schroedinger-1.0.11/0000775000175000017500000000000011707140273011253 500000000000000schroedinger-1.0.11/missing0000755000175000017500000002623311707122104012567 00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2009-04-28.21; # UTC # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, # 2008, 2009 Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case $1 in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' autom4te touch the output file, or create a stub one automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and \`g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # normalize program name to check for. program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). This is about non-GNU programs, so use $1 not # $program. case $1 in lex*|yacc*) # Not GNU programs, they don't have --version. ;; tar*) if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then exit 1 fi ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case $program in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te*) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison*|yacc*) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi if test ! -f y.tab.h; then echo >y.tab.h fi if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; lex*|flex*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit $? fi ;; makeinfo*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n ' /^@setfilename/{ s/.* \([^ ]*\) *$/\1/ p q }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; tar*) shift # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case $firstarg in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case $firstarg in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: schroedinger-1.0.11/compile0000755000175000017500000000727111707122104012547 00000000000000#! /bin/sh # Wrapper for compilers which do not understand `-c -o'. scriptversion=2009-10-06.20; # UTC # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009 Free Software # Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand `-c -o'. Remove `-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file `INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; esac ofile= cfile= eat= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as `compile cc -o foo foo.c'. # So we strip `-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no `-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # `.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use `[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: schroedinger-1.0.11/configure0000775000175000017500000224245511707140263013117 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.68 for schroedinger 1.0.11. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software # Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # 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 fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. 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 # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # 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 fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV export CONFIG_SHELL case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org 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." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in #( -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" SHELL=${CONFIG_SHELL-/bin/sh} test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='schroedinger' PACKAGE_TARNAME='schroedinger' PACKAGE_VERSION='1.0.11' PACKAGE_STRING='schroedinger 1.0.11' PACKAGE_BUGREPORT='' PACKAGE_URL='' # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_unique_file="schroedinger/schro.h" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS pkgconfigdir HAVE_ARM_FALSE HAVE_ARM_TRUE HAVE_POWERPC_FALSE HAVE_POWERPC_TRUE HAVE_AMD64_FALSE HAVE_AMD64_TRUE HAVE_I386_FALSE HAVE_I386_TRUE SCHRO_PKG_DEPS SCHRO_LIBS BUILD_BROKEN_TESTS_FALSE BUILD_BROKEN_TESTS_TRUE HAVE_OPENGL_FALSE HAVE_OPENGL_TRUE OPENGL_LIBS OPENGL_CFLAGS HAVE_CUDA_FALSE HAVE_CUDA_TRUE NVCCFLAGS CUDA_LIBS CUDA_CFLAGS NVCC SCHRO_CFLAGS GTK_DOC_USE_LIBTOOL_FALSE GTK_DOC_USE_LIBTOOL_TRUE ENABLE_GTK_DOC_FALSE ENABLE_GTK_DOC_TRUE GTKDOC_CHECK HTML_DIR ENABLE_MOTION_REF_FALSE ENABLE_MOTION_REF_TRUE ENABLE_ENCODER_FALSE ENABLE_ENCODER_TRUE GTHREAD_LIBS GTHREAD_CFLAGS PTHREAD_LIBS PTHREAD_CFLAGS THREAD_IMPL HAVE_ORCC_FALSE HAVE_ORCC_TRUE ORCC ORC_LIBS ORC_CFLAGS PKG_CONFIG LIBM ACLOCAL_AMFLAGS GST_GCOV_ENABLED_FALSE GST_GCOV_ENABLED_TRUE FFLAGS GCOV GCOV_LIBS GCOV_CFLAGS am__fastdepCCAS_FALSE am__fastdepCCAS_TRUE CCASDEPMODE CCASFLAGS CCAS CXXCPP am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE ac_ct_CXX CXXFLAGS CXX CPP OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP EGREP GREP SED am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC LIBTOOL OBJDUMP DLLTOOL AS SCHRO_LIBVERSION SCHRO_MAJORMINOR am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM host_os host_vendor host_cpu host build_os build_vendor build_cpu build PACKAGE_VERSION_RELEASE PACKAGE_VERSION_NANO PACKAGE_VERSION_MICRO PACKAGE_VERSION_MINOR PACKAGE_VERSION_MAJOR target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_shared enable_static with_pic enable_fast_install enable_dependency_tracking with_gnu_ld with_sysroot enable_libtool_lock enable_largefile enable_gcov with_autoconf with_autoheader with_automake with_aclocal with_thread with_opengl enable_encoder enable_motion_ref with_html_dir enable_gtk_doc with_cuda ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP CXX CXXFLAGS CCC CXXCPP CCAS CCASFLAGS PKG_CONFIG ORC_CFLAGS ORC_LIBS GTHREAD_CFLAGS GTHREAD_LIBS' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. 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 do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used" >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # 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 schroedinger 1.0.11 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --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] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/schroedinger] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of schroedinger 1.0.11:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --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-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --disable-libtool-lock avoid locking (might break parallel builds) --disable-largefile omit support for large files --enable-gcov compile with coverage profiling instrumentation (gcc only) --disable-encoder disable encoder (default=enabled) --disable-motion-ref disable motion reference code (default=enabled) --enable-gtk-doc use gtk-doc to build documentation [[default=no]] Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic try to use only PIC/non-PIC objects [default=use both] --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-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-thread=IMPL use threading library {auto,pthread,gthread,win32,none} [[default=auto]] --with-opengl=PATH prefix where OpenGL is installed [[default=no]] --with-html-dir=PATH path to installed docs --with-cuda=PATH prefix where cuda is installed [[default=no]] Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory 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 CPP C preprocessor CXX C++ compiler command CXXFLAGS C++ compiler flags CXXCPP C++ preprocessor CCAS assembler compiler command (defaults to CC) CCASFLAGS assembler compiler flags (defaults to CFLAGS) PKG_CONFIG path to pkg-config utility ORC_CFLAGS C compiler flags for ORC, overriding pkg-config ORC_LIBS linker flags for ORC, overriding pkg-config GTHREAD_CFLAGS C compiler flags for GTHREAD, overriding pkg-config GTHREAD_LIBS linker flags for GTHREAD, overriding pkg-config 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 the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF schroedinger configure 1.0.11 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" 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_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" 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_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _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_header_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" 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_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" 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_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { 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_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* 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 $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext 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_func # ac_fn_cxx_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" 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_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile # ac_fn_cxx_try_cpp LINENO # ------------------------ # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" 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_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_cpp # ac_fn_cxx_try_link LINENO # ------------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" 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_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_link cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by schroedinger $as_me 1.0.11, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## 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 PACKAGE_VERSION_MAJOR=$(echo 1.0.11 | cut -d'.' -f1) PACKAGE_VERSION_MINOR=$(echo 1.0.11 | cut -d'.' -f2) PACKAGE_VERSION_MICRO=$(echo 1.0.11 | cut -d'.' -f3) { $as_echo "$as_me:${as_lineno-$LINENO}: checking nano version" >&5 $as_echo_n "checking nano version... " >&6; } NANO=$(echo 1.0.11 | 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 SCHRO_CVS=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` SCHRO_CVS=yes fi PACKAGE_VERSION_NANO=$NANO ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac am__api_version='1.11' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; 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_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $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 STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; 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_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" $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_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" 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 STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac for ac_prog in gawk mawk nawk awk 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_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$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 AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='schroedinger' VERSION='1.0.11' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. AMTAR=${AMTAR-"${am_missing_run}tar"} am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' SCHRO_MAJORMINOR=1.0 ac_config_headers="$ac_config_headers config.h" SCHRO_LIBVERSION="11:0:11" 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 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 { $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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_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 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi 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 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_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 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 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' macro_revision='1.3293' 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='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= 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 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 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 /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" 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_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" 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_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" 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_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { 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_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" 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_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $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 #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); 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 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'. 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 8's {/usr,}/bin/sh. touch 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 ;; 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 { $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" { test -f "$ac_path_SED" && $as_test_x "$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 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 test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_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 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "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_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_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_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # 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 else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; 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 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` 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" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do 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" # 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; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else 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 for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do 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 # Check to see if the nm accepts a BSD-compat flag. # 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'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done 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" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" 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_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DUMPBIN="$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 DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" 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_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_DUMPBIN="$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_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" 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 DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # 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` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone 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` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$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 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"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${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 lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test "$GCC" != yes; then reload_cmds=false fi ;; darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_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 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 test -z "$OBJDUMP" && OBJDUMP=objdump { $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 : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # 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. # '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. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # 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 lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) 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 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)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_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 test -z "$DLLTOOL" && DLLTOOL=dlltool { $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 : $as_echo_n "(cached) " >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' 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 case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 $as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar 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_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AR="$ac_tool_prefix$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 AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar 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_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_AR="$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_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="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 AR=$ac_ct_AR fi fi : ${AR=ar} : ${AR_FLAGS=cru} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; 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 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $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 archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; 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_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $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 STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; 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_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" $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_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" 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 STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; 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_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; 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_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" 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 RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # 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'" # 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'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # 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. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 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))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF 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 # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then 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 relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #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 #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS 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 pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { $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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test "x$enable_libtool_lock" != xno && 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. echo 'int i;' > 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 case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. 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 case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > 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 case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. 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; } if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else 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 cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext 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 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 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; sparc*-*solaris*) # Find out which ABI we are using. echo 'int i;' > 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 case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac 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. set dummy ${ac_tool_prefix}mt; 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_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $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 MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 $as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; 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_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $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_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" 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 MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* 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 MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; 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_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $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 DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; 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_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $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_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" 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 DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; 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_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $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 NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; 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_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $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_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" 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 NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; 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_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $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 LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; 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_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_LIPO="lipo" $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_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" 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 LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; 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_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $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 OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; 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_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OTOOL="otool" $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_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" 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 OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; 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_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $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 OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; 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_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OTOOL64="otool64" $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_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" 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 OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no 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 # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _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' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; 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' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac 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 how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no 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_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.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" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done # Set options enable_dlopen=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 # 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=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; pic_mode="$withval" else pic_mode=default 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 else enable_fast_install=yes fi # 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 "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 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 [\\/*] | ?:[\\/]*) 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 ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do 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 -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" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi 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; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for 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_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" test -z "$ac_dir" && ac_dir=. 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" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi 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; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC="$CC" 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 # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else 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" # 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 # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $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 lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test "$GCC" = yes; 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 # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; 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'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; 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). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' lt_prog_compiler_pic='-Xcompiler -fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; 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' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ F* | *Sun*Fortran*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else 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" # 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 # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $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 case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no 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 # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* 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 : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # 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 # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # 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 # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; 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; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no 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;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_flag_spec_ld= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # 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'. 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 # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # 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 with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) link_all_deplibs=no ;; esac ld_shlibs=yes # 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 case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty 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' # 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' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v 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 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) 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_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then 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' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _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' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' 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' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' link_all_deplibs=yes ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no 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' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; 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 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' 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' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--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' 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' 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' if test "x$supports_anon_versioning" = xyes; 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' fi case $cc_basename in 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= hardcode_libdir_flag_spec_ld='-rpath $libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; 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' fi ;; esac else ld_shlibs=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then 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' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _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' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** 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 *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # 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' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) 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' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # 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 # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; 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="" 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". 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' 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' 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. 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 aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='${wl}-f,' if test "$GCC" = yes; 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` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi link_all_deplibs=no else # not using gcc if test "$host_cpu" = ia64; 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' else shared_flag='${wl}-bM:SRE' fi fi fi 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 # 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 aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi 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" fi fi 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" else if test "$host_cpu" = ia64; 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" else # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi 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" fi fi aix_libpath=$lt_cv_aix_libpath_ fi 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 # We only use this code for GNU lds that support --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' fi fi ;; amigaos*) 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_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. 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=' # 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 export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # 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' ;; *) # Assume MSVC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. 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. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no 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\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; 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}" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; freebsd1*) ld_shlibs=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; 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' 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' fi 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' ;; 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' 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' hardcode_libdir_flag_spec_ld='+b $libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes 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 fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) 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}+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' ;; ia64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no 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 # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* 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' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes 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 ;; esac fi ;; 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' # 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. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } 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" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_irix_exported_symbol=yes else lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext 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' fi 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' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; 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 else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; 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_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd*) 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 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' 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 fi else ld_shlibs=no fi ;; os2*) 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' ;; 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' 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' fi archive_cmds_need_lc='no' 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' 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_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' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; 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' 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' 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_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' ;; *) 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' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in 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 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' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; 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' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) 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' 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' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT 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' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes 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' 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' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='${wl}-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > 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; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $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 case $host_os in 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" ;; 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 *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # 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` 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 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; 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; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # 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'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux 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' ;; aix[4-9]*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 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 # 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 : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not 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 # 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 # 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 shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in 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}' ;; 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' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux 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' 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" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # 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'\''`~ 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' shlibpath_overrides_runpath=yes 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}' 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}' ;; 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}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` 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" 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'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; 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'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" 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' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux 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' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi 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}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux 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' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; haiku*) version_type=linux 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' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes 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 sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes 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' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' 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' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux 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' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; 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}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; 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}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux 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' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # 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 # Append ld.so.conf contents 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" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux 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' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos 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' 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' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux 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 ;; *nto* | *qnx*) 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' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos 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 else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; 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}' 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" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux 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' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos 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 need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux 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) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux 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 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' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; 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' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux need_lib_prefix=no need_version=no 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 ;; uts4*) version_type=linux 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 ;; *) dynamic_linker=no ;; 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 variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; 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" 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" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct" != no && # 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 # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $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 # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) 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_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # 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 : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $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 dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=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_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" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) 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" 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; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $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 shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=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_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" 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" else { $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 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $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 dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=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_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" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $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 dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=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_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" 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; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $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 dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=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_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" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF 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} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $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 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 : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF 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} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report which 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 $as_echo "$can_build_shared" >&6; } { $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 # 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 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 fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } 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 CC="$lt_save_CC" ac_config_commands="$ac_config_commands libtool" # Only expand once: ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC 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_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CXX="$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 CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC 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_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CXX="$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_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" 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 CXX=$ac_ct_CXX fi fi fi fi # 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_cxx_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_cxx_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_cxx_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } if ${ac_cv_prog_cxx_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes else CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_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_cxx_werror_flag=$ac_save_cxx_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 $as_echo "$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi 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="$CXX" 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_CXX_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'. 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_CXX_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 8's {/usr,}/bin/sh. touch 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 ;; 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_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 $as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi 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}\$%%"`;; esac } # func_stripname_cnf if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 $as_echo_n "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then if ${ac_cv_prog_CXXCPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 $as_echo "$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } 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 else _lt_caught_CXX_error=yes fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu archive_cmds_need_lc_CXX=no allow_undefined_flag_CXX= always_export_symbols_CXX=no archive_expsym_cmds_CXX= compiler_needs_object_CXX=no export_dynamic_flag_spec_CXX= hardcode_direct_CXX=no hardcode_direct_absolute_CXX=no hardcode_libdir_flag_spec_CXX= hardcode_libdir_flag_spec_ld_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no hardcode_shlibpath_var_CXX=unsupported hardcode_automatic_CXX=no inherit_rpath_CXX=no module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds reload_flag_CXX=$reload_flag reload_cmds_CXX=$reload_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o objext_CXX=$objext # No sense in running all these tests if we already determined that # 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 # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC compiler_CXX=$CC 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-%%"` 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 lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' else lt_prog_compiler_no_builtin_flag_CXX= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration # 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 else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; 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 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` 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" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do 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" # 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; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_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 archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$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' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${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}' # 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 whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_CXX= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # 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 GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } ld_shlibs_CXX=yes case $host_os in aix3*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aix[4-9]*) if test "$host_cpu" = ia64; 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="" 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. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_CXX='' hardcode_direct_CXX=yes hardcode_direct_absolute_CXX=yes hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes file_list_spec_CXX='${wl}-f,' if test "$GXX" = yes; 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` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct_CXX=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_CXX=yes hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_libdir_separator_CXX= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; 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' else shared_flag='${wl}-bM:SRE' fi fi fi export_dynamic_flag_spec_CXX='${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_CXX=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_CXX='-berok' # Determine the default libpath from the value encoded in an empty # executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath__CXX+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath__CXX fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_CXX='$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" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_CXX="-z nodefs" archive_expsym_cmds_CXX="\$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 aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath__CXX+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath__CXX fi hardcode_libdir_flag_spec_CXX='${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_CXX=' ${wl}-bernotok' allow_undefined_flag_CXX=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_CXX='$convenience' fi archive_cmds_need_lc_CXX=yes # This is similar to how AIX traditionally builds its shared # libraries. archive_expsym_cmds_CXX="\$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' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_CXX=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_CXX=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_CXX=' ' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=yes file_list_spec_CXX='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' archive_expsym_cmds_CXX='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=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' enable_shared_with_static_runtimes_CXX=yes # Don't use ranlib old_postinstall_cmds_CXX='chmod 644 $oldlib' postlink_cmds_CXX='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' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_CXX='-L$libdir' export_dynamic_flag_spec_CXX='${wl}--export-all-symbols' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=no enable_shared_with_static_runtimes_CXX=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds_CXX='$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... archive_expsym_cmds_CXX='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' else ld_shlibs_CXX=no fi ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc_CXX=no hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported if test "$lt_cv_ld_force_load" = "yes"; then whole_archive_flag_spec_CXX='`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_CXX='' fi link_all_deplibs_CXX=yes allow_undefined_flag_CXX="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds_CXX="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_CXX="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}" if test "$lt_cv_apple_cc_single_mod" != "yes"; then archive_cmds_CXX="\$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}" archive_expsym_cmds_CXX="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 ld_shlibs_CXX=no fi ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; freebsd[12]*) # C++ shared libraries reported to be fairly broken before # switch to ELF ld_shlibs_CXX=no ;; freebsd-elf*) archive_cmds_need_lc_CXX=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes ;; gnu*) ;; haiku*) archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' link_all_deplibs_CXX=yes ;; hpux9*) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='${wl}-E' hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) archive_cmds_CXX='$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' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # 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"' ;; *) if test "$GXX" = yes; then archive_cmds_CXX='$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' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: case $host_cpu in hppa*64*|ia64*) ;; *) export_dynamic_flag_spec_CXX='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no ;; *) hardcode_direct_CXX=yes hardcode_direct_absolute_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$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 # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # 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"' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$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 else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; interix[3-9]*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${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_CXX='$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_CXX='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++ archive_cmds_CXX='$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 # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then archive_cmds_CXX='$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 archive_cmds_CXX='$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 link_all_deplibs_CXX=yes ;; esac hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: inherit_rpath_CXX=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # 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. archive_cmds_CXX='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' archive_expsym_cmds_CXX='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. # # There doesn't appear to be a way to prevent this compiler from # 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"' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$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 archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac archive_cmds_need_lc_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [1-5].* | *pgcpp\ [1-5].*) prelink_cmds_CXX='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`"' old_archive_cmds_CXX='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' archive_cmds_CXX='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' archive_expsym_cmds_CXX='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' ;; *) # Version 6 and above use weak symbols archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='$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 hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${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++ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$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 hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # 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' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds_CXX='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' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' hardcode_libdir_flag_spec_CXX='-R$libdir' whole_archive_flag_spec_CXX='${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_CXX=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; m88k*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) ld_shlibs_CXX=yes ;; openbsd2*) # C++ shared libraries are fairly broken ld_shlibs_CXX=no ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no hardcode_direct_absolute_CXX=yes archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' export_dynamic_flag_spec_CXX='${wl}-E' whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else ld_shlibs_CXX=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # 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. archive_cmds_CXX='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' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) case $host in osf3*) allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$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' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' ;; *) allow_undefined_flag_CXX=' -expect_unresolved \*' archive_cmds_CXX='$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' archive_expsym_cmds_CXX='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' hardcode_libdir_flag_spec_CXX='-rpath $libdir' ;; esac hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # 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"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) archive_cmds_CXX='$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' ;; *) archive_cmds_CXX='$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 hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # 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 # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ archive_cmds_need_lc_CXX=yes no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='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' hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_shlibpath_var_CXX=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs_CXX=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler archive_cmds_CXX='$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. old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then no_undefined_flag_CXX=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='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' # 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 # platform. archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='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' # 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 -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_CXX='${wl}-z,text' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$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 # 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_CXX='${wl}-z,text' allow_undefined_flag_CXX='${wl}-z,nodefs' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-R,$libdir' hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes export_dynamic_flag_spec_CXX='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ '"$old_archive_cmds_CXX" reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ '"$reload_cmds_CXX" ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } test "$ld_shlibs_CXX" = no && can_build_shared=no GCC_CXX="$GXX" LD_CXX="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... # Dependencies to place before and after the object being linked: predep_objects_CXX= postdep_objects_CXX= predeps_CXX= postdeps_CXX= compiler_lib_search_path_CXX= cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; esac 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 # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do 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 prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi 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 -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 "$compiler_lib_search_path_CXX"; then compiler_lib_search_path_CXX="${prev}${p}" else compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$postdeps_CXX"; then postdeps_CXX="${prev}${p}" else postdeps_CXX="${postdeps_CXX} ${prev}${p}" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$predep_objects_CXX"; then predep_objects_CXX="$p" else predep_objects_CXX="$predep_objects_CXX $p" fi else if test -z "$postdep_objects_CXX"; then postdep_objects_CXX="$p" else postdep_objects_CXX="$postdep_objects_CXX $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling CXX test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken case $host_os in interix[3-9]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. predep_objects_CXX= postdep_objects_CXX= postdeps_CXX= ;; 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 postdeps_CXX='-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 postdeps_CXX='-library=Cstd -library=Crun' fi ;; esac ;; esac case " $postdeps_CXX " in *" -lc "*) archive_cmds_need_lc_CXX=no ;; esac compiler_lib_search_dirs_CXX= if test -n "${compiler_lib_search_path_CXX}"; then compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic_CXX='-fPIC' ;; 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'. lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | 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). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_CXX='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static_CXX= ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_CXX=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac else case $host_os in aix[4-9]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' else lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | 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_CXX='-DDLL_EXPORT' ;; dgux*) case $cc_basename in ec++*) lt_prog_compiler_pic_CXX='-KPIC' ;; ghcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then lt_prog_compiler_pic_CXX='+Z' fi ;; aCC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_CXX='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler lt_prog_compiler_wl_CXX='--backend -Wl,' lt_prog_compiler_pic_CXX='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fPIC' lt_prog_compiler_static_CXX='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fpic' lt_prog_compiler_static_CXX='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) # IBM XL 8.0, 9.0 on PPC and BlueGene lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-qpic' lt_prog_compiler_static_CXX='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) lt_prog_compiler_pic_CXX='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) lt_prog_compiler_wl_CXX='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 lt_prog_compiler_pic_CXX='-pic' ;; cxx*) # Digital/Compaq C++ lt_prog_compiler_wl_CXX='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x lt_prog_compiler_pic_CXX='-pic' lt_prog_compiler_static_CXX='-Bstatic' ;; lcc*) # Lucid lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 lt_prog_compiler_pic_CXX='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) lt_prog_compiler_can_build_shared_CXX=no ;; esac fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_CXX= ;; *) lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 $as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; } lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" # 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 # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works_CXX=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 $as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; } if test x"$lt_cv_prog_compiler_pic_works_CXX" = xyes; then case $lt_prog_compiler_pic_CXX in "" | " "*) ;; *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; esac else lt_prog_compiler_pic_CXX= lt_prog_compiler_can_build_shared_CXX=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works_CXX=no 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 # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works_CXX=yes fi else lt_cv_prog_compiler_static_works_CXX=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 $as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; } if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then : else lt_prog_compiler_static_CXX= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # 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 # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # 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 # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; 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; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no 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;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' 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". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' ;; esac ;; linux* | k*bsd*-gnu | gnu*) link_all_deplibs_CXX=no ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } test "$ld_shlibs_CXX" = no && can_build_shared=no with_gnu_ld_CXX=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_CXX" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_CXX=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_CXX in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > 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; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_CXX pic_flag=$lt_prog_compiler_pic_CXX compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_CXX allow_undefined_flag_CXX= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc_CXX=no else lt_cv_archive_cmds_need_lc_CXX=yes fi allow_undefined_flag_CXX=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 $as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; } archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux 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' ;; aix[4-9]*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 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 # 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 : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not 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 # 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 # 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 shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in 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}' ;; 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' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux 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' 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" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # 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'\''`~ 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' shlibpath_overrides_runpath=yes 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}' ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix 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}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` 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" 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'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; 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'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" 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' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux 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' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi 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}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux 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' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; haiku*) version_type=linux 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' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes 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 sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes 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' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' 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' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux 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' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; 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}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; 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}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux 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' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # 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 # Append ld.so.conf contents 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" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux 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' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos 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' 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' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux 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 ;; *nto* | *qnx*) 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' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos 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 else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; 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}' 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" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux 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' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos 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 need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux 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) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux 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 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' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; 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' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux need_lib_prefix=no need_version=no 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 ;; uts4*) version_type=linux 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 ;; *) dynamic_linker=no ;; 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 variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; 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" 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" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || test -n "$runpath_var_CXX" || test "X$hardcode_automatic_CXX" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct_CXX" != no && # 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, CXX)" != no && test "$hardcode_minus_L_CXX" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_CXX=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_CXX=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_CXX=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 $as_echo "$hardcode_action_CXX" >&6; } if test "$hardcode_action_CXX" = relink || test "$inherit_rpath_CXX" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD 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 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 # By default we simply use the C compiler to build assembly code. test "${CCAS+set}" = set || CCAS=$CC test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS depcc="$CCAS" 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_CCAS_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'. 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_CCAS_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 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 8's {/usr,}/bin/sh. touch 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 ;; 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_CCAS_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CCAS_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CCAS_dependencies_compiler_type" >&5 $as_echo "$am_cv_CCAS_dependencies_compiler_type" >&6; } CCASDEPMODE=depmode=$am_cv_CCAS_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CCAS_dependencies_compiler_type" = gcc3; then am__fastdepCCAS_TRUE= am__fastdepCCAS_FALSE='#' else am__fastdepCCAS_TRUE='#' am__fastdepCCAS_FALSE= fi if test "x$CC" != xcc; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5 $as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; } else { $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; } fi set dummy $CC; ac_cc=`$as_echo "$2" | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` if eval \${ac_cv_prog_cc_${ac_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. # We do the test twice because some compilers refuse to overwrite an # existing .o file with -o, though they will create one. ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' rm -f conftest2.* if { { 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_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -f conftest2.$ac_objext && { { 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_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then eval ac_cv_prog_cc_${ac_cc}_c_o=yes if test "x$CC" != xcc; then # Test first that cc exists at all. if { ac_try='cc -c conftest.$ac_ext >&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_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5' rm -f conftest2.* if { { 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_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -f conftest2.$ac_objext && { { 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_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # cc works too. : else # cc exists but doesn't like -o. eval ac_cv_prog_cc_${ac_cc}_c_o=no fi fi fi else eval ac_cv_prog_cc_${ac_cc}_c_o=no fi rm -f core conftest* fi if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h fi # FIXME: we rely on the cache variable name because # there is no other way. set dummy $CC am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o if test "$am_t" != 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 # Check whether --enable-largefile was given. if test "${enable_largefile+set}" = set; then : enableval=$enable_largefile; fi if test "$enable_largefile" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 $as_echo_n "checking for special C compiler options needed for large files... " >&6; } if ${ac_cv_sys_largefile_CC+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_sys_largefile_CC=no if test "$GCC" != yes; then ac_save_CC=$CC while :; do # IRIX 6.2 and later do not support large files by default, # so use the C compiler's -n32 option if that helps. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : break fi rm -f core conftest.err conftest.$ac_objext CC="$CC -n32" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_largefile_CC=' -n32'; break fi rm -f core conftest.err conftest.$ac_objext break done CC=$ac_save_CC rm -f conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 $as_echo "$ac_cv_sys_largefile_CC" >&6; } if test "$ac_cv_sys_largefile_CC" != no; then CC=$CC$ac_cv_sys_largefile_CC fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 $as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } if ${ac_cv_sys_file_offset_bits+:} false; then : $as_echo_n "(cached) " >&6 else while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_file_offset_bits=no; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _FILE_OFFSET_BITS 64 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_file_offset_bits=64; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_sys_file_offset_bits=unknown break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 $as_echo "$ac_cv_sys_file_offset_bits" >&6; } case $ac_cv_sys_file_offset_bits in #( no | unknown) ;; *) cat >>confdefs.h <<_ACEOF #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits _ACEOF ;; esac rm -rf conftest* if test $ac_cv_sys_file_offset_bits = unknown; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 $as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } if ${ac_cv_sys_large_files+:} false; then : $as_echo_n "(cached) " >&6 else while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_large_files=no; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _LARGE_FILES 1 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_large_files=1; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_sys_large_files=unknown break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 $as_echo "$ac_cv_sys_large_files" >&6; } case $ac_cv_sys_large_files in #( no | unknown) ;; *) cat >>confdefs.h <<_ACEOF #define _LARGE_FILES $ac_cv_sys_large_files _ACEOF ;; esac rm -rf conftest* fi fi { $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 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 # Check whether --enable-gcov was given. if test "${enable_gcov+set}" = set; then : enableval=$enable_gcov; enable_gcov=$enableval else enable_gcov=no fi if test x$enable_gcov = xyes ; then if test "x$GCC" != "xyes" then as_fn_error $? "gcov only works if gcc is used" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if compiler understands \"-fprofile-arcs\"" >&5 $as_echo_n "checking to see if compiler understands \"-fprofile-arcs\"... " >&6; } save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS "-fprofile-arcs"" 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 GCOV_CFLAGS="$GCOV_CFLAGS -fprofile-arcs" true else true 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 \"-ftest-coverage\"" >&5 $as_echo_n "checking to see if compiler understands \"-ftest-coverage\"... " >&6; } save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS "-ftest-coverage"" 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 GCOV_CFLAGS="$GCOV_CFLAGS -ftest-coverage" true else true true fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag_ok" >&5 $as_echo "$flag_ok" >&6; } GCOV_CFLAGS=`echo "$GCOV_CFLAGS" | sed -e 's/-O[0-9]*//g'` GCOV_LIBS=-lgcov GCOV=`echo $CC | sed s/gcc/gcov/g` GST_GCOV_ENABLED=yes cat >>confdefs.h <<_ACEOF #define GST_GCOV_ENABLED 1 _ACEOF if test "x$GST_GCOV_ENABLED" = "xyes" then CFLAGS="-O0" CXXFLAGS="-O0" FFLAGS="-O0" CCASFLAGS="-O0" { $as_echo "$as_me:${as_lineno-$LINENO}: gcov enabled, setting CFLAGS and friends to $CFLAGS" >&5 $as_echo "$as_me: gcov enabled, setting CFLAGS and friends to $CFLAGS" >&6;} fi fi if test x$enable_gcov = xyes; then GST_GCOV_ENABLED_TRUE= GST_GCOV_ENABLED_FALSE='#' else GST_GCOV_ENABLED_TRUE='#' GST_GCOV_ENABLED_FALSE= fi # 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 $ACLOCAL_AMFLAGS" #AM_GNU_GETTEXT_VERSION([0.11.5]) #AM_GNU_GETTEXT([external]) LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _mwvalidcheckl in -lmw" >&5 $as_echo_n "checking for _mwvalidcheckl in -lmw... " >&6; } if ${ac_cv_lib_mw__mwvalidcheckl+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmw $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 _mwvalidcheckl (); int main () { return _mwvalidcheckl (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_mw__mwvalidcheckl=yes else ac_cv_lib_mw__mwvalidcheckl=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_mw__mwvalidcheckl" >&5 $as_echo "$ac_cv_lib_mw__mwvalidcheckl" >&6; } if test "x$ac_cv_lib_mw__mwvalidcheckl" = xyes; then : LIBM="-lmw" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cos in -lm" >&5 $as_echo_n "checking for cos in -lm... " >&6; } if ${ac_cv_lib_m_cos+:} 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 cos (); int main () { return cos (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_m_cos=yes else ac_cv_lib_m_cos=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_cos" >&5 $as_echo "$ac_cv_lib_m_cos" >&6; } if test "x$ac_cv_lib_m_cos" = xyes; then : LIBM="$LIBM -lm" fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cos in -lm" >&5 $as_echo_n "checking for cos in -lm... " >&6; } if ${ac_cv_lib_m_cos+:} 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 cos (); int main () { return cos (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_m_cos=yes else ac_cv_lib_m_cos=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_cos" >&5 $as_echo "$ac_cv_lib_m_cos" >&6; } if test "x$ac_cv_lib_m_cos" = xyes; then : LIBM="-lm" fi ;; esac ORC_VER="0.4.16" if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; 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_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$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 PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; 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_ac_pt_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_pt_PKG_CONFIG="$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 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 $as_echo "$ac_pt_PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" 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 PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } PKG_CONFIG="" fi fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ORC" >&5 $as_echo_n "checking for ORC... " >&6; } if test -n "$PKG_CONFIG"; then if test -n "$ORC_CFLAGS"; then pkg_cv_ORC_CFLAGS="$ORC_CFLAGS" else if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"orc-0.4 >= \$ORC_VER\""; } >&5 ($PKG_CONFIG --exists --print-errors "orc-0.4 >= $ORC_VER") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_ORC_CFLAGS=`$PKG_CONFIG --cflags "orc-0.4 >= $ORC_VER" 2>/dev/null` else pkg_failed=yes fi fi else pkg_failed=untried fi if test -n "$PKG_CONFIG"; then if test -n "$ORC_LIBS"; then pkg_cv_ORC_LIBS="$ORC_LIBS" else if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"orc-0.4 >= \$ORC_VER\""; } >&5 ($PKG_CONFIG --exists --print-errors "orc-0.4 >= $ORC_VER") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_ORC_LIBS=`$PKG_CONFIG --libs "orc-0.4 >= $ORC_VER" 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 ORC_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "orc-0.4 >= $ORC_VER"` else ORC_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "orc-0.4 >= $ORC_VER"` fi # Put the nasty error message in config.log where it belongs echo "$ORC_PKG_ERRORS" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } HAVE_ORC=no elif test $pkg_failed = untried; then HAVE_ORC=no else ORC_CFLAGS=$pkg_cv_ORC_CFLAGS ORC_LIBS=$pkg_cv_ORC_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } HAVE_ORC=yes fi if test "x${HAVE_ORC}" != xyes ; then as_fn_error $? "orc-0.4 >= $ORC_VER is required" "$LINENO" 5 fi SCHRO_PKG_DEPS="$SCHRO_PKG_DEPS orc-0.4 >= $ORC_VER" ORCC=`$PKG_CONFIG --variable=orcc orc-0.4` if test "x$cross_compiling" != xyes; then HAVE_ORCC_TRUE= HAVE_ORCC_FALSE='#' else HAVE_ORCC_TRUE='#' HAVE_ORCC_FALSE= fi # Check whether --with-thread was given. if test "${with_thread+set}" = set; then : withval=$with_thread; else with_thread=auto fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking threading implementation to use" >&5 $as_echo_n "checking threading implementation to use... " >&6; } if test "x${with_thread}" = "xauto" ; then case $host_os in mingw* | pw32*) with_thread=win32 ;; *) with_thread=pthread ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_thread" >&5 $as_echo "$with_thread" >&6; } THREAD_IMPL=${with_thread} if test "x${with_thread}" = "xpthread" ; then case "$host_os" in openbsd*) PTHREAD_CFLAGS= PTHREAD_LIBS=-pthread ;; *) PTHREAD_CFLAGS= PTHREAD_LIBS=-lpthread ;; esac fi if test "x${with_thread}" = "xgthread" ; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTHREAD" >&5 $as_echo_n "checking for GTHREAD... " >&6; } if test -n "$PKG_CONFIG"; then if test -n "$GTHREAD_CFLAGS"; then pkg_cv_GTHREAD_CFLAGS="$GTHREAD_CFLAGS" else if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gthread-2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "gthread-2.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GTHREAD_CFLAGS=`$PKG_CONFIG --cflags "gthread-2.0" 2>/dev/null` else pkg_failed=yes fi fi else pkg_failed=untried fi if test -n "$PKG_CONFIG"; then if test -n "$GTHREAD_LIBS"; then pkg_cv_GTHREAD_LIBS="$GTHREAD_LIBS" else if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gthread-2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "gthread-2.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GTHREAD_LIBS=`$PKG_CONFIG --libs "gthread-2.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 GTHREAD_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "gthread-2.0"` else GTHREAD_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "gthread-2.0"` fi # Put the nasty error message in config.log where it belongs echo "$GTHREAD_PKG_ERRORS" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } HAVE_GTHREAD=no elif test $pkg_failed = untried; then HAVE_GTHREAD=no else GTHREAD_CFLAGS=$pkg_cv_GTHREAD_CFLAGS GTHREAD_LIBS=$pkg_cv_GTHREAD_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } HAVE_GTHREAD=yes fi SCHRO_PKG_DEPS="$SCHRO_PKG_DEPS gthread-2.0" fi # Check whether --with-opengl was given. if test "${with_opengl+set}" = set; then : withval=$with_opengl; else with_opengl=no fi # Check whether --enable-encoder was given. if test "${enable_encoder+set}" = set; then : enableval=$enable_encoder; fi if test "x$enable_encoder" != "xno"; then ENABLE_ENCODER_TRUE= ENABLE_ENCODER_FALSE='#' else ENABLE_ENCODER_TRUE='#' ENABLE_ENCODER_FALSE= fi if test "x$enable_encoder" != "xno" ; then $as_echo "#define ENABLE_ENCODER 1" >>confdefs.h fi # Check whether --enable-motion-ref was given. if test "${enable_motion_ref+set}" = set; then : enableval=$enable_motion_ref; fi if test "x$enable_motion_ref" != "xno"; then ENABLE_MOTION_REF_TRUE= ENABLE_MOTION_REF_FALSE='#' else ENABLE_MOTION_REF_TRUE='#' ENABLE_MOTION_REF_FALSE= fi if test "x$enable_motion_ref" != "xno" ; then $as_echo "#define ENABLE_MOTION_REF 1" >>confdefs.h fi ################################################## # Check for gtk-doc. ################################################## if test "x$cross_compiling" = "xyes" ; then enable_gtk_doc=no fi # Check whether --with-html-dir was given. if test "${with_html_dir+set}" = set; then : withval=$with_html_dir; else 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 >= 1.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "gtk-doc >= 1.0") 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 >= 1.0 installed to build gtk-doc" "$LINENO" 5 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; } for ac_prog in gtkdoc-check 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_GTKDOC_CHECK+:} false; then : $as_echo_n "(cached) " >&6 else case $GTKDOC_CHECK in [\\/]* | ?:[\\/]*) ac_cv_path_GTKDOC_CHECK="$GTKDOC_CHECK" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then 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 done done IFS=$as_save_IFS ;; esac fi 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; } fi test -n "$GTKDOC_CHECK" && break done if test x$enable_gtk_doc = xyes; then ENABLE_GTK_DOC_TRUE= ENABLE_GTK_DOC_FALSE='#' else ENABLE_GTK_DOC_TRUE='#' ENABLE_GTK_DOC_FALSE= fi if test -n "$LIBTOOL"; then GTK_DOC_USE_LIBTOOL_TRUE= GTK_DOC_USE_LIBTOOL_FALSE='#' else GTK_DOC_USE_LIBTOOL_TRUE='#' GTK_DOC_USE_LIBTOOL_FALSE= fi { $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 SCHRO_CFLAGS="$SCHRO_CFLAGS -Wall" true else true fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag_ok" >&5 $as_echo "$flag_ok" >&6; } if test "x$SCHRO_CVS" = "xyes" then { $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; } save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Werror" 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 SCHRO_CFLAGS="$SCHRO_CFLAGS -Werror" 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 -Wno-strict-overflow" >&5 $as_echo_n "checking to see if compiler understands -Wno-strict-overflow... " >&6; } save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wno-strict-overflow" 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 SCHRO_CFLAGS="$SCHRO_CFLAGS -Wno-strict-overflow" true else true fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag_ok" >&5 $as_echo "$flag_ok" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if compiler understands -O3" >&5 $as_echo_n "checking to see if compiler understands -O3... " >&6; } save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -O3" 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 CFLAGS=`echo $CFLAGS | sed s/O2/O3/` true else true fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag_ok" >&5 $as_echo "$flag_ok" >&6; } # Enable severe pain #AS_COMPILER_FLAGS(COMPANY_CFLAGS,"-Wextra -Wno-missing-field-initializers -Wno-unused-parameter -Wold-style-definition -Wdeclaration-after-statement -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Winline -Wformat-nonliteral -Wformat-security -Wswitch-enum -Wswitch-default") #COMPANY_CFLAGS="-Wextra -Wno-missing-field-initializers -Wno-unused-parameter -Wold-style-definition -Wdeclaration-after-statement -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Winline -Wformat-nonliteral -Wformat-security -Wswitch-enum -Wswitch-default" #SCHRO_CFLAGS="$SCHRO_CFLAGS $COMPANY_CFLAGS" SCHRO_CFLAGS="$SCHRO_CFLAGS -I\$(top_srcdir)" ######################## # Check for CUDA ######################## # Check whether --with-cuda was given. if test "${with_cuda+set}" = set; then : withval=$with_cuda; else with_cuda=no fi if test "x$with_cuda" = xyes; then # Extract the first word of "nvcc", so it can be a program name with args. set dummy nvcc; 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_NVCC+:} false; then : $as_echo_n "(cached) " >&6 else case $NVCC in [\\/]* | ?:[\\/]*) ac_cv_path_NVCC="$NVCC" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/usr/local/cuda/bin" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_NVCC="$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 test -z "$ac_cv_path_NVCC" && ac_cv_path_NVCC="no" ;; esac fi NVCC=$ac_cv_path_NVCC if test -n "$NVCC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NVCC" >&5 $as_echo "$NVCC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$NVCC" = xno ; 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 $? "\"--with-cuda was give, but nvcc was not found\" See \`config.log' for more details" "$LINENO" 5; } fi with_cuda=`echo $NVCC|sed 's,bin/nvcc,,'` fi if test "x$with_cuda" != xno; then CUDA_CFLAGS="-I$with_cuda/include" CUDA_LIBS="-L$with_cuda/lib -lcudart" NVCC="$with_cuda/bin/nvcc" NVCCFLAGS="-O2 -use_fast_math" HAVE_CUDA=yes $as_echo "#define HAVE_CUDA 1" >>confdefs.h else CUDA_CFLAGS= CUDA_LIBS= NVCC= NVCCFLAGS= HAVE_CUDA=no fi if test "x$HAVE_CUDA" = "xyes"; then HAVE_CUDA_TRUE= HAVE_CUDA_FALSE='#' else HAVE_CUDA_TRUE='#' HAVE_CUDA_FALSE= fi ######################## # Check for OpenGL/GLEW ######################## if test "x$with_opengl" = xyes; then save_CPPFLAGS="$CPPFLAGS" save_LIBS="$LIBS" CPPFLAGS="$CPPFLAGS $X_CFLAGS" LIBS="$LIBS $X_LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for glTexImage2D in -lGL" >&5 $as_echo_n "checking for glTexImage2D in -lGL... " >&6; } if ${ac_cv_lib_GL_glTexImage2D+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lGL $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 glTexImage2D (); int main () { return glTexImage2D (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_GL_glTexImage2D=yes else ac_cv_lib_GL_glTexImage2D=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_GL_glTexImage2D" >&5 $as_echo "$ac_cv_lib_GL_glTexImage2D" >&6; } if test "x$ac_cv_lib_GL_glTexImage2D" = xyes; then : OPENGL_CFLAGS= OPENGL_LIBS=-lGL HAVE_OPENGL=yes $as_echo "#define HAVE_OPENGL 1" >>confdefs.h else HAVE_OPENGL=no fi if test "x${HAVE_OPENGL}" = xyes ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for glewInit in -lGLEW" >&5 $as_echo_n "checking for glewInit in -lGLEW... " >&6; } if ${ac_cv_lib_GLEW_glewInit+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lGLEW $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 glewInit (); int main () { return glewInit (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_GLEW_glewInit=yes else ac_cv_lib_GLEW_glewInit=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_GLEW_glewInit" >&5 $as_echo "$ac_cv_lib_GLEW_glewInit" >&6; } if test "x$ac_cv_lib_GLEW_glewInit" = xyes; then : OPENGL_CFLAGS= OPENGL_LIBS="-lGL -lGLEW" HAVE_LIBGLEW=yes else HAVE_LIBGLEW=no fi if test "x${HAVE_LIBGLEW}" != xyes ; then as_fn_error $? "libglew1.5 is required" "$LINENO" 5 fi fi CPPFLAGS="$save_CPPFLAGS" LIBS="$save_LIBS" fi if test "x$HAVE_OPENGL" = "xyes"; then HAVE_OPENGL_TRUE= HAVE_OPENGL_FALSE='#' else HAVE_OPENGL_TRUE='#' HAVE_OPENGL_FALSE= fi if false; then BUILD_BROKEN_TESTS_TRUE= BUILD_BROKEN_TESTS_FALSE='#' else BUILD_BROKEN_TESTS_TRUE='#' BUILD_BROKEN_TESTS_FALSE= fi SCHRO_LIBS="\$(top_builddir)/schroedinger/libschroedinger-$SCHRO_MAJORMINOR.la" # hack around ld bug SCHRO_LIBS="$SCHRO_LIBS $ORC_LIBS $CUDA_LIBS $OPENGL_LIBS $PTHREAD_LIBS $GTHREAD_LIBS $LIBM" #SCHRO_LIBS="$SCHRO_LIBS -lprofiler" case "x${host_cpu}" in xi?86 | k?) HAVE_I386=yes $as_echo "#define HAVE_I386 1" >>confdefs.h ;; xx86_64|xamd64) HAVE_AMD64=yes $as_echo "#define HAVE_AMD64 1" >>confdefs.h ;; xpowerpc|xppc|xpowerpc64|xppc64) HAVE_POWERPC=yes $as_echo "#define HAVE_POWERPC 1" >>confdefs.h ;; xarm) HAVE_ARM=yes $as_echo "#define HAVE_ARM 1" >>confdefs.h ;; esac if test "x$HAVE_I386" = "xyes"; then HAVE_I386_TRUE= HAVE_I386_FALSE='#' else HAVE_I386_TRUE='#' HAVE_I386_FALSE= fi if test "x$HAVE_AMD64" = "xyes"; then HAVE_AMD64_TRUE= HAVE_AMD64_FALSE='#' else HAVE_AMD64_TRUE='#' HAVE_AMD64_FALSE= fi if test "x$HAVE_POWERPC" = "xyes"; then HAVE_POWERPC_TRUE= HAVE_POWERPC_FALSE='#' else HAVE_POWERPC_TRUE='#' HAVE_POWERPC_FALSE= fi if test "x$HAVE_ARM" = "xyes"; then HAVE_ARM_TRUE= HAVE_ARM_FALSE='#' else HAVE_ARM_TRUE='#' HAVE_ARM_FALSE= fi pkgconfigdir="\$(libdir)/pkgconfig" ac_config_files="$ac_config_files Makefile doc/Makefile schroedinger/Makefile schroedinger/cuda/Makefile schroedinger/opengl/Makefile testsuite/Makefile testsuite/cache/Makefile testsuite/cuda/Makefile testsuite/perf/Makefile testsuite/coder/Makefile testsuite/dirac/Makefile testsuite/installation/Makefile testsuite/manual/Makefile testsuite/opengl/Makefile testsuite/prototype/Makefile testsuite/streams/Makefile testsuite/tables2/Makefile tools/Makefile schroedinger/schroversion.h schroedinger-uninstalled.pc schroedinger.pc schroedinger.spec" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= 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 fi 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 "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCCAS_TRUE}" && test -z "${am__fastdepCCAS_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCCAS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GST_GCOV_ENABLED_TRUE}" && test -z "${GST_GCOV_ENABLED_FALSE}"; then as_fn_error $? "conditional \"GST_GCOV_ENABLED\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_ORCC_TRUE}" && test -z "${HAVE_ORCC_FALSE}"; then as_fn_error $? "conditional \"HAVE_ORCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_ENCODER_TRUE}" && test -z "${ENABLE_ENCODER_FALSE}"; then as_fn_error $? "conditional \"ENABLE_ENCODER\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_MOTION_REF_TRUE}" && test -z "${ENABLE_MOTION_REF_FALSE}"; then as_fn_error $? "conditional \"ENABLE_MOTION_REF\" 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_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 "${HAVE_CUDA_TRUE}" && test -z "${HAVE_CUDA_FALSE}"; then as_fn_error $? "conditional \"HAVE_CUDA\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_OPENGL_TRUE}" && test -z "${HAVE_OPENGL_FALSE}"; then as_fn_error $? "conditional \"HAVE_OPENGL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BUILD_BROKEN_TESTS_TRUE}" && test -z "${BUILD_BROKEN_TESTS_FALSE}"; then as_fn_error $? "conditional \"BUILD_BROKEN_TESTS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_I386_TRUE}" && test -z "${HAVE_I386_FALSE}"; then as_fn_error $? "conditional \"HAVE_I386\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_AMD64_TRUE}" && test -z "${HAVE_AMD64_FALSE}"; then as_fn_error $? "conditional \"HAVE_AMD64\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_POWERPC_TRUE}" && test -z "${HAVE_POWERPC_FALSE}"; then as_fn_error $? "conditional \"HAVE_POWERPC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_ARM_TRUE}" && test -z "${HAVE_ARM_FALSE}"; then as_fn_error $? "conditional \"HAVE_ARM\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # 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 fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. 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 # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in #( -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by schroedinger $as_me 1.0.11, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ schroedinger config.status 1.0.11 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" Copyright (C) 2010 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_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"`' 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"`' enable_static='`$ECHO "$enable_static" | $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"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' 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"`' 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"`' 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"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' 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_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"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $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"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_ld='`$ECHO "$hardcode_libdir_flag_spec_ld" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' 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"`' 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"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_ld_CXX='`$ECHO "$hardcode_libdir_flag_spec_ld_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in AS \ DLLTOOL \ OBJDUMP \ SHELL \ ECHO \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ nm_file_list_spec \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_flag_spec_ld \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib \ compiler_lib_search_dirs \ predep_objects \ postdep_objects \ predeps \ postdeps \ compiler_lib_search_path \ LD_CXX \ reload_flag_CXX \ compiler_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ lt_prog_compiler_pic_CXX \ lt_prog_compiler_wl_CXX \ lt_prog_compiler_static_CXX \ lt_cv_prog_compiler_c_o_CXX \ export_dynamic_flag_spec_CXX \ whole_archive_flag_spec_CXX \ compiler_needs_object_CXX \ with_gnu_ld_CXX \ allow_undefined_flag_CXX \ no_undefined_flag_CXX \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_flag_spec_ld_CXX \ hardcode_libdir_separator_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX \ file_list_spec_CXX \ compiler_lib_search_dirs_CXX \ predep_objects_CXX \ postdep_objects_CXX \ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec \ reload_cmds_CXX \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ archive_cmds_CXX \ archive_expsym_cmds_CXX \ module_cmds_CXX \ module_expsym_cmds_CXX \ export_symbols_cmds_CXX \ prelink_cmds_CXX \ postlink_cmds_CXX; 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=\\\\\\"\\\$\$var\\\\\\"" ;; esac 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 # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "schroedinger/Makefile") CONFIG_FILES="$CONFIG_FILES schroedinger/Makefile" ;; "schroedinger/cuda/Makefile") CONFIG_FILES="$CONFIG_FILES schroedinger/cuda/Makefile" ;; "schroedinger/opengl/Makefile") CONFIG_FILES="$CONFIG_FILES schroedinger/opengl/Makefile" ;; "testsuite/Makefile") CONFIG_FILES="$CONFIG_FILES testsuite/Makefile" ;; "testsuite/cache/Makefile") CONFIG_FILES="$CONFIG_FILES testsuite/cache/Makefile" ;; "testsuite/cuda/Makefile") CONFIG_FILES="$CONFIG_FILES testsuite/cuda/Makefile" ;; "testsuite/perf/Makefile") CONFIG_FILES="$CONFIG_FILES testsuite/perf/Makefile" ;; "testsuite/coder/Makefile") CONFIG_FILES="$CONFIG_FILES testsuite/coder/Makefile" ;; "testsuite/dirac/Makefile") CONFIG_FILES="$CONFIG_FILES testsuite/dirac/Makefile" ;; "testsuite/installation/Makefile") CONFIG_FILES="$CONFIG_FILES testsuite/installation/Makefile" ;; "testsuite/manual/Makefile") CONFIG_FILES="$CONFIG_FILES testsuite/manual/Makefile" ;; "testsuite/opengl/Makefile") CONFIG_FILES="$CONFIG_FILES testsuite/opengl/Makefile" ;; "testsuite/prototype/Makefile") CONFIG_FILES="$CONFIG_FILES testsuite/prototype/Makefile" ;; "testsuite/streams/Makefile") CONFIG_FILES="$CONFIG_FILES testsuite/streams/Makefile" ;; "testsuite/tables2/Makefile") CONFIG_FILES="$CONFIG_FILES testsuite/tables2/Makefile" ;; "tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;; "schroedinger/schroversion.h") CONFIG_FILES="$CONFIG_FILES schroedinger/schroversion.h" ;; "schroedinger-uninstalled.pc") CONFIG_FILES="$CONFIG_FILES schroedinger-uninstalled.pc" ;; "schroedinger.pc") CONFIG_FILES="$CONFIG_FILES schroedinger.pc" ;; "schroedinger.spec") CONFIG_FILES="$CONFIG_FILES schroedinger.spec" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "libtool":C) # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi 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 # 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. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010 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. # # 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. # The names of the tagged configurations supported by this script. available_tags="CXX " # ### BEGIN LIBTOOL CONFIG # Assembler program. AS=$lt_AS # DLL creation program. DLLTOOL=$lt_DLLTOOL # Object dumper program. OBJDUMP=$lt_OBJDUMP # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # 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 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 # 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. lt_sysroot=$lt_sysroot # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # 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 # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # If ld is used when linking, flag to hardcode \$libdir into a binary # during linking. This must work even if \$libdir does not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld # 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 # DIR into the resulting binary. hardcode_direct=$hardcode_direct # 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 # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects postdep_objects=$lt_postdep_objects predeps=$lt_predeps postdeps=$lt_postdeps # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path # ### END LIBTOOL CONFIG _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 COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain="$ac_aux_dir/ltmain.sh" # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? 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" cat <<_LT_EOF >> "$ofile" # ### BEGIN LIBTOOL TAG CONFIG: CXX # The linker used to build libraries. LD=$lt_LD_CXX # How to create reloadable object files. reload_flag=$lt_reload_flag_CXX reload_cmds=$lt_reload_cmds_CXX # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds_CXX # A language specific compiler. CC=$lt_compiler_CXX # Is the compiler the GNU compiler? with_gcc=$GCC_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_CXX # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_CXX # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object_CXX # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds_CXX archive_expsym_cmds=$lt_archive_expsym_cmds_CXX # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds_CXX module_expsym_cmds=$lt_module_expsym_cmds_CXX # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld_CXX # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_CXX # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_CXX # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX # If ld is used when linking, flag to hardcode \$libdir into a binary # during linking. This must work even if \$libdir does not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct_CXX # 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 # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute_CXX # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L_CXX # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic_CXX # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath_CXX # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_CXX # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols_CXX # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_CXX # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_CXX # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_CXX # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds_CXX # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds_CXX # Specify filename containing input files. file_list_spec=$lt_file_list_spec_CXX # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_CXX # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects_CXX postdep_objects=$lt_postdep_objects_CXX predeps=$lt_predeps_CXX postdeps=$lt_postdeps_CXX # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_CXX # ### END LIBTOOL TAG CONFIG: CXX _LT_EOF ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi schroedinger-1.0.11/COPYING.MPL0000644000175000017500000006222310735025462012662 00000000000000 MOZILLA PUBLIC LICENSE Version 1.1 --------------- 1. Definitions. 1.0.1. "Commercial Use" means distribution or otherwise making the Covered Code available to a third party. 1.1. "Contributor" means each entity that creates or contributes to the creation of Modifications. 1.2. "Contributor Version" means the combination of the Original Code, prior Modifications used by a Contributor, and the Modifications made by that particular Contributor. 1.3. "Covered Code" means the Original Code or Modifications or the combination of the Original Code and Modifications, in each case including portions thereof. 1.4. "Electronic Distribution Mechanism" means a mechanism generally accepted in the software development community for the electronic transfer of data. 1.5. "Executable" means Covered Code in any form other than Source Code. 1.6. "Initial Developer" means the individual or entity identified as the Initial Developer in the Source Code notice required by Exhibit A. 1.7. "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License. 1.8. "License" means this document. 1.8.1. "Licensable" means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein. 1.9. "Modifications" means any addition to or deletion from the substance or structure of either the Original Code or any previous Modifications. When Covered Code is released as a series of files, a Modification is: A. Any addition to or deletion from the contents of a file containing Original Code or previous Modifications. B. Any new file that contains any part of the Original Code or previous Modifications. 1.10. "Original Code" means Source Code of computer software code which is described in the Source Code notice required by Exhibit A as Original Code, and which, at the time of its release under this License is not already Covered Code governed by this License. 1.10.1. "Patent Claims" means any patent claim(s), now owned or hereafter acquired, including without limitation, method, process, and apparatus claims, in any patent Licensable by grantor. 1.11. "Source Code" means the preferred form of the Covered Code for making modifications to it, including all modules it contains, plus any associated interface definition files, scripts used to control compilation and installation of an Executable, or source code differential comparisons against either the Original Code or another well known, available Covered Code of the Contributor's choice. The Source Code can be in a compressed or archival form, provided the appropriate decompression or de-archiving software is widely available for no charge. 1.12. "You" (or "Your") means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License or a future version of this License issued under Section 6.1. For legal entities, "You" includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, "control" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. 2. Source Code License. 2.1. The Initial Developer Grant. The Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license, subject to third party intellectual property claims: (a) under intellectual property rights (other than patent or trademark) Licensable by Initial Developer to use, reproduce, modify, display, perform, sublicense and distribute the Original Code (or portions thereof) with or without Modifications, and/or as part of a Larger Work; and (b) under Patents Claims infringed by the making, using or selling of Original Code, to make, have made, use, practice, sell, and offer for sale, and/or otherwise dispose of the Original Code (or portions thereof). (c) the licenses granted in this Section 2.1(a) and (b) are effective on the date Initial Developer first distributes Original Code under the terms of this License. (d) Notwithstanding Section 2.1(b) above, no patent license is granted: 1) for code that You delete from the Original Code; 2) separate from the Original Code; or 3) for infringements caused by: i) the modification of the Original Code or ii) the combination of the Original Code with other software or devices. 2.2. Contributor Grant. Subject to third party intellectual property claims, each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license (a) under intellectual property rights (other than patent or trademark) Licensable by Contributor, to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof) either on an unmodified basis, with other Modifications, as Covered Code and/or as part of a Larger Work; and (b) under Patent Claims infringed by the making, using, or selling of Modifications made by that Contributor either alone and/or in combination with its Contributor Version (or portions of such combination), to make, use, sell, offer for sale, have made, and/or otherwise dispose of: 1) Modifications made by that Contributor (or portions thereof); and 2) the combination of Modifications made by that Contributor with its Contributor Version (or portions of such combination). (c) the licenses granted in Sections 2.2(a) and 2.2(b) are effective on the date Contributor first makes Commercial Use of the Covered Code. (d) Notwithstanding Section 2.2(b) above, no patent license is granted: 1) for any code that Contributor has deleted from the Contributor Version; 2) separate from the Contributor Version; 3) for infringements caused by: i) third party modifications of Contributor Version or ii) the combination of Modifications made by that Contributor with other software (except as part of the Contributor Version) or other devices; or 4) under Patent Claims infringed by Covered Code in the absence of Modifications made by that Contributor. 3. Distribution Obligations. 3.1. Application of License. The Modifications which You create or to which You contribute are governed by the terms of this License, including without limitation Section 2.2. The Source Code version of Covered Code may be distributed only under the terms of this License or a future version of this License released under Section 6.1, and You must include a copy of this License with every copy of the Source Code You distribute. You may not offer or impose any terms on any Source Code version that alters or restricts the applicable version of this License or the recipients' rights hereunder. However, You may include an additional document offering the additional rights described in Section 3.5. 3.2. Availability of Source Code. Any Modification which You create or to which You contribute must be made available in Source Code form under the terms of this License either on the same media as an Executable version or via an accepted Electronic Distribution Mechanism to anyone to whom you made an Executable version available; and if made available via Electronic Distribution Mechanism, must remain available for at least twelve (12) months after the date it initially became available, or at least six (6) months after a subsequent version of that particular Modification has been made available to such recipients. You are responsible for ensuring that the Source Code version remains available even if the Electronic Distribution Mechanism is maintained by a third party. 3.3. Description of Modifications. You must cause all Covered Code to which You contribute to contain a file documenting the changes You made to create that Covered Code and the date of any change. You must include a prominent statement that the Modification is derived, directly or indirectly, from Original Code provided by the Initial Developer and including the name of the Initial Developer in (a) the Source Code, and (b) in any notice in an Executable version or related documentation in which You describe the origin or ownership of the Covered Code. 3.4. Intellectual Property Matters (a) Third Party Claims. If Contributor has knowledge that a license under a third party's intellectual property rights is required to exercise the rights granted by such Contributor under Sections 2.1 or 2.2, Contributor must include a text file with the Source Code distribution titled "LEGAL" which describes the claim and the party making the claim in sufficient detail that a recipient will know whom to contact. If Contributor obtains such knowledge after the Modification is made available as described in Section 3.2, Contributor shall promptly modify the LEGAL file in all copies Contributor makes available thereafter and shall take other steps (such as notifying appropriate mailing lists or newsgroups) reasonably calculated to inform those who received the Covered Code that new knowledge has been obtained. (b) Contributor APIs. If Contributor's Modifications include an application programming interface and Contributor has knowledge of patent licenses which are reasonably necessary to implement that API, Contributor must also include this information in the LEGAL file. (c) Representations. Contributor represents that, except as disclosed pursuant to Section 3.4(a) above, Contributor believes that Contributor's Modifications are Contributor's original creation(s) and/or Contributor has sufficient rights to grant the rights conveyed by this License. 3.5. Required Notices. You must duplicate the notice in Exhibit A in each file of the Source Code. If it is not possible to put such notice in a particular Source Code file due to its structure, then You must include such notice in a location (such as a relevant directory) where a user would be likely to look for such a notice. If You created one or more Modification(s) You may add your name as a Contributor to the notice described in Exhibit A. You must also duplicate this License in any documentation for the Source Code where You describe recipients' rights or ownership rights relating to Covered Code. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Code. However, You may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear than any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer. 3.6. Distribution of Executable Versions. You may distribute Covered Code in Executable form only if the requirements of Section 3.1-3.5 have been met for that Covered Code, and if You include a notice stating that the Source Code version of the Covered Code is available under the terms of this License, including a description of how and where You have fulfilled the obligations of Section 3.2. The notice must be conspicuously included in any notice in an Executable version, related documentation or collateral in which You describe recipients' rights relating to the Covered Code. You may distribute the Executable version of Covered Code or ownership rights under a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable version does not attempt to limit or alter the recipient's rights in the Source Code version from the rights set forth in this License. If You distribute the Executable version under a different license You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer or any Contributor. You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of any such terms You offer. 3.7. Larger Works. You may create a Larger Work by combining Covered Code with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Code. 4. Inability to Comply Due to Statute or Regulation. If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Code due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be included in the LEGAL file described in Section 3.4 and must be included with all distributions of the Source Code. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it. 5. Application of this License. This License applies to code to which the Initial Developer has attached the notice in Exhibit A and to related Covered Code. 6. Versions of the License. 6.1. New Versions. BBC Communications Corporation ("Netscape") may publish revised and/or new versions of the License from time to time. Each version will be given a distinguishing version number. 6.2. Effect of New Versions. Once Covered Code has been published under a particular version of the License, You may always continue to use it under the terms of that version. You may also choose to use such Covered Code under the terms of any subsequent version of the License published by BBC. No one other than BBC has the right to modify the terms applicable to Covered Code created under this License. 6.3. Derivative Works. If You create or use a modified version of this License (which you may only do in order to apply it to code which is not already Covered Code governed by this License), You must (a) rename Your license so that the phrases "Mozilla", "MOZILLAPL", "MOZPL", "BBC", "MPL", "NPL" or any confusingly similar phrase do not appear in your license (except to note that your license differs from this License) and (b) otherwise make it clear that Your version of the license contains terms which differ from the Mozilla Public License and BBC Public License. (Filling in the name of the Initial Developer, Original Code or Contributor in the notice described in Exhibit A shall not of themselves be deemed to be modifications of this License.) 7. DISCLAIMER OF WARRANTY. COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER. 8. TERMINATION. 8.1. This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. All sublicenses to the Covered Code which are properly granted shall survive any termination of this License. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive. 8.2. If You initiate litigation by asserting a patent infringement claim (excluding declatory judgment actions) against Initial Developer or a Contributor (the Initial Developer or Contributor against whom You file such action is referred to as "Participant") alleging that: (a) such Participant's Contributor Version directly or indirectly infringes any patent, then any and all rights granted by such Participant to You under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice from Participant terminate prospectively, unless if within 60 days after receipt of notice You either: (i) agree in writing to pay Participant a mutually agreeable reasonable royalty for Your past and future use of Modifications made by such Participant, or (ii) withdraw Your litigation claim with respect to the Contributor Version against such Participant. If within 60 days of notice, a reasonable royalty and payment arrangement are not mutually agreed upon in writing by the parties or the litigation claim is not withdrawn, the rights granted by Participant to You under Sections 2.1 and/or 2.2 automatically terminate at the expiration of the 60 day notice period specified above. (b) any software, hardware, or device, other than such Participant's Contributor Version, directly or indirectly infringes any patent, then any rights granted to You by such Participant under Sections 2.1(b) and 2.2(b) are revoked effective as of the date You first made, used, sold, distributed, or had made, Modifications made by that Participant. 8.3. If You assert a patent infringement claim against Participant alleging that such Participant's Contributor Version directly or indirectly infringes any patent where such claim is resolved (such as by license or settlement) prior to the initiation of patent infringement litigation, then the reasonable value of the licenses granted by such Participant under Sections 2.1 or 2.2 shall be taken into account in determining the amount or value of any payment or license. 8.4. In the event of termination under Sections 8.1 or 8.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or any distributor hereunder prior to termination shall survive termination. 9. LIMITATION OF LIABILITY. UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. 10. U.S. GOVERNMENT END USERS. The Covered Code is a "commercial item," as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer software" and "commercial computer software documentation," as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Code with only those rights set forth herein. 11. MISCELLANEOUS. This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by California law provisions (except to the extent applicable law, if any, provides otherwise), excluding its conflict-of-law provisions. With respect to disputes in which at least one party is a citizen of, or an entity chartered or registered to do business in the United States of America, any litigation relating to this License shall be subject to the jurisdiction of the Federal Courts of the Northern District of California, with venue lying in Santa Clara County, California, with the losing party responsible for costs, including without limitation, court costs and reasonable attorneys' fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License. 12. RESPONSIBILITY FOR CLAIMS. As between Initial Developer and the Contributors, each party is responsible for claims and damages arising, directly or indirectly, out of its utilization of rights under this License and You agree to work with Initial Developer and Contributors to distribute such responsibility on an equitable basis. Nothing herein is intended or shall be deemed to constitute any admission of liability. 13. MULTIPLE-LICENSED CODE. Initial Developer may designate portions of the Covered Code as "Multiple-Licensed". "Multiple-Licensed" means that the Initial Developer permits you to utilize portions of the Covered Code under Your choice of the GPL, LGPL, MIT or the alternative licenses, if any, specified by the Initial Developer in the file described in Exhibit A. EXHIBIT A -Mozilla Public License. ``The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/ Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. The Original Code is ______________________________________. The Initial Developer of the Original Code is ________________________. Portions created by ______________________ are Copyright (C) ______ _______________________. All Rights Reserved. Contributor(s): ______________________________________. Alternatively, the contents of this file may be used under the terms of the _____ license (the "[___] License"), in which case the provisions of [______] License are applicable instead of those above. If you wish to allow use of your version of this file only under the terms of the [____] License and not to allow others to use your version of this file under the MPL, indicate your decision by deleting the provisions above and replace them with the notice and other provisions required by the [___] License. If you do not delete the provisions above, a recipient may use your version of this file under either the MPL or the [___] License." [NOTE: The text of this Exhibit A may differ slightly from the text of the notices in the Source Code files of the Original Code. You should use the text of this Exhibit A rather than the text found in the Original Code Source Code for Your Modifications.] schroedinger-1.0.11/TODO0000644000175000017500000000304611320237456011665 00000000000000 - modify scheduler to run multiple tasks on the same picture simultaneously - "rate distortion" for time vs. ME searching - BUGS: general: add copyright blocks add profile support add bit peeling schropack.c: figure out how to push disjoint buffers if possible schrodecoder.c: trick modes (decode_prediction_only) should be made into parameters sanitize code layout schroencoder.c: sanitize code layout don't use metric in SchroMotionVector schrohistogram.c: rename ilogx/iexpx to something sane schroparams.c: write function for determining optimal index for various parameters move data to schrobitstream.c schropredict.c: implement "how did we get this" bitfield schrowavelet.c: implement 32-bit code schrooil.c: move stuff to liboil add arrays of arrays to liboil simplify complex functions: 42 44 181 263 292 schrodecoder.c(264): schro_decoder_iterate 37 37 124 43 152 schromotion.c(44): schro_obmc_init 36 36 129 1748 206 schroencoder.c(1749): schro_encoder_encode_subband 26 26 100 647 176 schrodecoder.c(648): schro_decoder_decode_access_unit 25 25 77 1316 136 schroencoder.c(1317): schro_encoder_encode_access_unit_header 25 25 57 907 99 schroencoder.c(908): schro_encoder_encode_picture_prediction 21 21 109 830 149 schropredict.c(831): schro_encoder_hierarchical_prediction_2 21 21 105 121 130 schroquantiser.c(122): schro_encoder_calculate_subband_weights 20 20 51 1030 80 schrowavelet.c(1030): schro_iiwt_daub_9_7 20 20 128 341 141 schropredict.c(342): schro_motion_field_global_prediction schroedinger-1.0.11/gtk-doc.make0000644000175000017500000001212311161526031013351 00000000000000# -*- mode: makefile -*- #################################### # Everything below here is generic # #################################### if GTK_DOC_USE_LIBTOOL GTKDOC_CC = $(LIBTOOL) --mode=compile $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) GTKDOC_LD = $(LIBTOOL) --mode=link $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) else GTKDOC_CC = $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) GTKDOC_LD = $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) 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) EXTRA_DIST = \ $(content_files) \ $(HTML_IMAGES) \ $(DOC_MAIN_SGML_FILE) \ $(DOC_MODULE)-sections.txt \ $(DOC_MODULE)-overrides.txt DOC_STAMPS=scan-build.stamp tmpl-build.stamp sgml-build.stamp html-build.stamp \ $(srcdir)/tmpl.stamp $(srcdir)/sgml.stamp $(srcdir)/html.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) if ENABLE_GTK_DOC all-local: html-build.stamp else all-local: endif docs: html-build.stamp #### scan #### scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB) @echo 'gtk-doc: Scanning header files' @-chmod -R u+w $(srcdir) cd $(srcdir) && \ gtkdoc-scan --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="$(IGNORE_HFILES)" $(SCAN_OPTIONS) $(EXTRA_HFILES) if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null 2>&1 ; then \ CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" CFLAGS="$(GTKDOC_CFLAGS)" LDFLAGS="$(GTKDOC_LIBS)" gtkdoc-scangobj $(SCANGOBJ_OPTIONS) --module=$(DOC_MODULE) --output-dir=$(srcdir) ; \ else \ cd $(srcdir) ; \ for i in $(SCANOBJ_FILES) ; do \ 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 #### templates #### tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt @echo 'gtk-doc: Rebuilding template files' @-chmod -R u+w $(srcdir) cd $(srcdir) && gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS) touch tmpl-build.stamp tmpl.stamp: tmpl-build.stamp @true tmpl/*.sgml: @true #### xml #### sgml-build.stamp: tmpl.stamp $(HFILE_GLOB) $(CFILE_GLOB) $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files) @echo 'gtk-doc: Building XML' @-chmod -R u+w $(srcdir) cd $(srcdir) && \ gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $(MKDB_OPTIONS) touch sgml-build.stamp sgml.stamp: sgml-build.stamp @true #### html #### html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) @echo 'gtk-doc: Building HTML' @-chmod -R u+w $(srcdir) rm -rf $(srcdir)/html mkdir $(srcdir)/html cd $(srcdir)/html && gtkdoc-mkhtml $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) html ) @echo 'gtk-doc: Fixing cross-references' cd $(srcdir) && gtkdoc-fixxref --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) touch html-build.stamp ############## clean-local: rm -f *~ *.bak rm -rf .libs distclean-local: cd $(srcdir) && \ rm -rf xml $(REPORT_FILES) \ $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt maintainer-clean-local: clean cd $(srcdir) && rm -rf xml html install-data-local: -installfiles=`echo $(srcdir)/html/*`; \ if test "$$installfiles" = '$(srcdir)/html/*'; \ 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 $(srcdir)/html/index.sgml' ; \ $(INSTALL_DATA) $(srcdir)/html/index.sgml $(DESTDIR)$(TARGET_DIR) || :; \ which gtkdoc-rebase >/dev/null && \ gtkdoc-rebase --relative --dest-dir=$(DESTDIR) --html-dir=$(DESTDIR)$(TARGET_DIR) ; \ fi uninstall-local: rm -f $(DESTDIR)$(TARGET_DIR)/* # # 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)/tmpl mkdir $(distdir)/xml mkdir $(distdir)/html -cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl -cp $(srcdir)/xml/*.xml $(distdir)/xml cp $(srcdir)/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 schroedinger-1.0.11/configure.ac0000664000175000017500000001605211707134275013472 00000000000000AC_PREREQ([2.58]) dnl PLEASE remove the nano when doing a release AC_INIT(schroedinger,1.0.11) AS_VERSION AS_NANO(SCHRO_CVS=no,SCHRO_CVS=yes) AC_CANONICAL_HOST([]) AM_INIT_AUTOMAKE(1.6) SCHRO_MAJORMINOR=1.0 AC_SUBST(SCHRO_MAJORMINOR) AM_CONFIG_HEADER(config.h) dnl CURRENT, REVISION, AGE 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 SCHRO_LIBVERSION="11:0:11" AC_SUBST(SCHRO_LIBVERSION) AC_LIBTOOL_WIN32_DLL AC_PROG_LIBTOOL AC_PROG_CXX AM_PROG_AS AM_PROG_CC_C_O AC_SYS_LARGEFILE AC_C_BIGENDIAN AG_GST_ARG_GCOV dnl allow for different autotools AS_AUTOTOOLS_ALTERNATE AC_CONFIG_SRCDIR([schroedinger/schro.h]) AC_CONFIG_MACRO_DIR([m4]) ACLOCAL_AMFLAGS="-I m4 $ACLOCAL_AMFLAGS" AC_SUBST(ACLOCAL_AMFLAGS) dnl set up gettext dnl the version check needs to stay here because autopoint greps for it #AM_GNU_GETTEXT_VERSION([0.11.5]) #AM_GNU_GETTEXT([external]) AC_CHECK_LIBM AC_SUBST(LIBM) dnl Orc is required ORC_VER="0.4.16" PKG_CHECK_MODULES(ORC, orc-0.4 >= $ORC_VER, HAVE_ORC=yes, HAVE_ORC=no) if test "x${HAVE_ORC}" != xyes ; then AC_ERROR([orc-0.4 >= $ORC_VER is required]) fi SCHRO_PKG_DEPS="$SCHRO_PKG_DEPS orc-0.4 >= $ORC_VER" ORCC=`$PKG_CONFIG --variable=orcc orc-0.4` AC_SUBST(ORCC) AM_CONDITIONAL(HAVE_ORCC, test "x$cross_compiling" != xyes) AC_ARG_WITH([thread], AS_HELP_STRING([--with-thread=IMPL],[use threading library {auto,pthread,gthread,win32,none} [[default=auto]]]), [], [with_thread=auto]) AC_MSG_CHECKING([threading implementation to use]) if test "x${with_thread}" = "xauto" ; then case $host_os in mingw* | pw32*) with_thread=win32 ;; *) with_thread=pthread ;; esac fi AC_MSG_RESULT([$with_thread]) THREAD_IMPL=${with_thread} AC_SUBST(THREAD_IMPL) if test "x${with_thread}" = "xpthread" ; then case "$host_os" in openbsd*) PTHREAD_CFLAGS= PTHREAD_LIBS=-pthread ;; *) PTHREAD_CFLAGS= PTHREAD_LIBS=-lpthread ;; esac AC_SUBST(PTHREAD_CFLAGS) AC_SUBST(PTHREAD_LIBS) fi if test "x${with_thread}" = "xgthread" ; then PKG_CHECK_MODULES(GTHREAD, gthread-2.0, HAVE_GTHREAD=yes, HAVE_GTHREAD=no) AC_SUBST(GTHREAD_LIBS) AC_SUBST(GTHREAD_CFLAGS) SCHRO_PKG_DEPS="$SCHRO_PKG_DEPS gthread-2.0" fi AC_ARG_WITH([opengl], AS_HELP_STRING([--with-opengl=PATH],[prefix where OpenGL is installed [[default=no]]]), [], [with_opengl=no]) AC_ARG_ENABLE(encoder, AC_HELP_STRING([--disable-encoder], [disable encoder (default=enabled)])) AM_CONDITIONAL(ENABLE_ENCODER, test "x$enable_encoder" != "xno") if [ test "x$enable_encoder" != "xno" ] ; then AC_DEFINE(ENABLE_ENCODER, 1, [Enable encoder]) fi AC_ARG_ENABLE(motion-ref, AC_HELP_STRING([--disable-motion-ref], [disable motion reference code (default=enabled)])) AM_CONDITIONAL(ENABLE_MOTION_REF, test "x$enable_motion_ref" != "xno") if [ test "x$enable_motion_ref" != "xno" ] ; then AC_DEFINE(ENABLE_MOTION_REF, 1, [Enable motion reference code]) fi ################################################## # Check for gtk-doc. ################################################## if test "x$cross_compiling" = "xyes" ; then enable_gtk_doc=no fi GTK_DOC_CHECK([1.0]) AS_COMPILER_FLAG(-Wall, SCHRO_CFLAGS="$SCHRO_CFLAGS -Wall") if test "x$SCHRO_CVS" = "xyes" then AS_COMPILER_FLAG(-Werror, SCHRO_CFLAGS="$SCHRO_CFLAGS -Werror") AS_COMPILER_FLAG(-Wno-strict-overflow, SCHRO_CFLAGS="$SCHRO_CFLAGS -Wno-strict-overflow") fi AS_COMPILER_FLAG(-O3, CFLAGS=`echo $CFLAGS | sed s/O2/O3/`) # Enable severe pain #AS_COMPILER_FLAGS(COMPANY_CFLAGS,"-Wextra -Wno-missing-field-initializers -Wno-unused-parameter -Wold-style-definition -Wdeclaration-after-statement -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Winline -Wformat-nonliteral -Wformat-security -Wswitch-enum -Wswitch-default") #COMPANY_CFLAGS="-Wextra -Wno-missing-field-initializers -Wno-unused-parameter -Wold-style-definition -Wdeclaration-after-statement -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Winline -Wformat-nonliteral -Wformat-security -Wswitch-enum -Wswitch-default" #SCHRO_CFLAGS="$SCHRO_CFLAGS $COMPANY_CFLAGS" SCHRO_CFLAGS="$SCHRO_CFLAGS -I\$(top_srcdir)" AC_SUBST(SCHRO_CFLAGS) ######################## # Check for CUDA ######################## AC_ARG_WITH([cuda], AS_HELP_STRING([--with-cuda=PATH],[prefix where cuda is installed [[default=no]]]), [], [with_cuda=no]) if test "x$with_cuda" = xyes; then AC_PATH_PROG([NVCC], [nvcc], no, [$PATH:/usr/local/cuda/bin]) if test "x$NVCC" = xno ; then AC_MSG_FAILURE(["--with-cuda was give, but nvcc was not found"]) fi with_cuda=`echo $NVCC|sed 's,bin/nvcc,,'` fi if test "x$with_cuda" != xno; then CUDA_CFLAGS="-I$with_cuda/include" CUDA_LIBS="-L$with_cuda/lib -lcudart" NVCC="$with_cuda/bin/nvcc" NVCCFLAGS="-O2 -use_fast_math" HAVE_CUDA=yes AC_DEFINE(HAVE_CUDA, 1, [Compile in CUDA rendering backend]) else CUDA_CFLAGS= CUDA_LIBS= NVCC= NVCCFLAGS= HAVE_CUDA=no fi AC_SUBST(CUDA_CFLAGS) AC_SUBST(CUDA_LIBS) AC_SUBST(NVCC) AC_SUBST(NVCCFLAGS) AM_CONDITIONAL(HAVE_CUDA, test "x$HAVE_CUDA" = "xyes") ######################## # Check for OpenGL/GLEW ######################## if test "x$with_opengl" = xyes; then save_CPPFLAGS="$CPPFLAGS" save_LIBS="$LIBS" CPPFLAGS="$CPPFLAGS $X_CFLAGS" LIBS="$LIBS $X_LIBS" AC_CHECK_LIB(GL, glTexImage2D, [ OPENGL_CFLAGS= OPENGL_LIBS=-lGL HAVE_OPENGL=yes AC_DEFINE(HAVE_OPENGL, 1, [Compile in OpenGL rendering backend]) ], [HAVE_OPENGL=no]) if test "x${HAVE_OPENGL}" = xyes ; then AC_CHECK_LIB(GLEW, glewInit, [ OPENGL_CFLAGS= OPENGL_LIBS="-lGL -lGLEW" HAVE_LIBGLEW=yes ], [HAVE_LIBGLEW=no]) if test "x${HAVE_LIBGLEW}" != xyes ; then AC_ERROR([libglew1.5 is required]) fi fi CPPFLAGS="$save_CPPFLAGS" LIBS="$save_LIBS" fi AC_SUBST(OPENGL_CFLAGS) AC_SUBST(OPENGL_LIBS) AM_CONDITIONAL(HAVE_OPENGL, test "x$HAVE_OPENGL" = "xyes") AM_CONDITIONAL(BUILD_BROKEN_TESTS, false) SCHRO_LIBS="\$(top_builddir)/schroedinger/libschroedinger-$SCHRO_MAJORMINOR.la" # hack around ld bug SCHRO_LIBS="$SCHRO_LIBS $ORC_LIBS $CUDA_LIBS $OPENGL_LIBS $PTHREAD_LIBS $GTHREAD_LIBS $LIBM" #SCHRO_LIBS="$SCHRO_LIBS -lprofiler" AC_SUBST(SCHRO_LIBS) AC_SUBST(SCHRO_PKG_DEPS) AS_HOST_DEFINES() pkgconfigdir="\$(libdir)/pkgconfig" AC_SUBST(pkgconfigdir) AC_CONFIG_FILES([ Makefile doc/Makefile schroedinger/Makefile schroedinger/cuda/Makefile schroedinger/opengl/Makefile testsuite/Makefile testsuite/cache/Makefile testsuite/cuda/Makefile testsuite/perf/Makefile testsuite/coder/Makefile testsuite/dirac/Makefile testsuite/installation/Makefile testsuite/manual/Makefile testsuite/opengl/Makefile testsuite/prototype/Makefile testsuite/streams/Makefile testsuite/tables2/Makefile tools/Makefile schroedinger/schroversion.h schroedinger-uninstalled.pc schroedinger.pc schroedinger.spec ]) AC_OUTPUT schroedinger-1.0.11/ltmain.sh0000755000175000017500000105052711707122077013030 00000000000000 # libtool (GNU libtool) 2.4 # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, # 2007, 2008, 2009, 2010 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # 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. # # 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. # 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) # --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 Debian-2.4-2ubuntu1 # 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 Debian-2.4-2ubuntu1" TIMESTAMP="" package_revision=1.3293 # Be Bourne compatible 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 # 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 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 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\" fi" done LC_ALL=C LANGUAGE=C export LANGUAGE LC_ALL $lt_unset CDPATH # 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" : ${CP="cp -f"} test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} : ${EGREP="/bin/grep -E"} : ${FGREP="/bin/grep -F"} : ${GREP="/bin/grep"} : ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SED="/bin/sed"} : ${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 # func_basename file func_basename () { func_basename_result=`$ECHO "${1}" | $SED "$basename"` } # func_basename may be replaced by extended shell implementation # 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 # 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 # 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,/*$,/,' # 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 } # 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 # 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 # 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 } # The name of this program: func_dirname_and_basename "$progpath" progname=$func_basename_result # Make sure we have an absolute path for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=$func_dirname_result progdir=`cd "$progdir" && pwd` progpath="$progdir/$progname" ;; *) save_IFS="$IFS" IFS=: for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break done IFS="$save_IFS" test -n "$progdir" || progdir=`pwd` 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: 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+"$@"} # 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_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 } # 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 # 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_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 # func_grep expression filename # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $GREP "$1" "$2" >/dev/null 2>&1 } # 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= if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then # Protect directory names starting with `-' case $my_directory_path in -*) my_directory_path="./$my_directory_path" ;; esac # While some portion of DIR does not yet exist... while test ! -d "$my_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" # If the last portion added has no slash in it, the list is done case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` done my_dir_list=`$ECHO "$my_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 # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$my_dir" 2>/dev/null || : done IFS="$save_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'" fi } # func_mktempdir [string] # 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. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$opt_dry_run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $MKDIR "$my_tmpdir" umask $save_mktempdir_umask fi # 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 $ECHO "$my_tmpdir" } # 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 () { case $1 in *[\\\`\"\$]*) func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac 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 } # 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 () { case $1 in *[\\\`\"]*) my_arg=`$ECHO "$1" | $SED \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; esac 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_quote_for_expand_result="$my_arg" } # 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-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } 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 } # 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 () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } 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_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 } # 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 $? } # func_usage # Echo short help message to standard output and exit. func_usage () { $opt_debug $SED -n '/^# Usage:/,/^# *.*--help/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" echo $ECHO "run \`$progname --help | more' for full usage" exit $? } # func_help [NOEXIT] # Echo long help message to standard output and exit, # unless 'noexit' is passed as argument. func_help () { $opt_debug $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 --version) 2>/dev/null |$SED 1q`"'/ s/\$autoconf_version/'"`(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_missing_arg argname # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $opt_debug func_error "missing argument for $1." exit_cmd=exit } # 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 () { my_sed_short_opt='1s/^\(..\).*$/\1/;q' my_sed_short_rest='1s/^..\(.*\)$/\1/;q' 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_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 () { my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' my_sed_long_arg='1s/^--[^=]*=//' 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 exit_cmd=: magic="%%%MAGIC variable%%%" magic_exe="%%%MAGIC EXE variable%%%" # Global variables. nonopt= preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" 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= # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "${1}=\$${1}\${2}" } # func_append may be replaced by extended shell implementation # 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 # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "${@}"` } # func_arith may be replaced by extended shell implementation # 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 # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` } # func_lo2o may be replaced by extended shell implementation # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` } # func_xform may be replaced by extended shell implementation # 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_config # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # Display the features supported by this script. func_features () { echo "host: $host" if test "$build_libtool_libs" = yes; then echo "enable shared libraries" else echo "disable shared libraries" fi if test "$build_old_libs" = yes; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # 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" 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) ;; *) 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 } # 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 $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 $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 $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 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 # 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_verbose=: opt_silent=false opt_verbose=false # 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-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: # save first non-option argument if test "$#" -gt 0; then nonopt="$opt" shift fi # preserve --debug test "$opt_debug" = : || func_append preserve_args " --debug" 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 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 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 } ## ----------- ## ## Main. ## ## ----------- ## # func_lalib_p 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 } # func_lalib_unsafe_p 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. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case "$lalib_p_line" in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test "$lalib_p" = yes } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { func_lalib_p "$1" } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { 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_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $opt_debug save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$save_ifs eval cmd=\"$cmd\" func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # 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. func_source () { $opt_debug case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case "$lt_sysroot:$1" in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result="=$func_stripname_result" ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $opt_debug if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) 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`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # 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'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # 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}\' else write_lobj=none fi if test "$build_old_libs" = yes; then write_oldobj=\'${3}\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` 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"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $opt_debug # unfortunately, winepath doesn't convert paths, only file names 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 -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" else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $opt_debug if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $opt_debug # 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"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $opt_debug if test -z "$2" && test -n "$1" ; then func_error "Could not determine host file name corresponding to" func_error " \`$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result="$1" fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $opt_debug if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" 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. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result="$3" fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $opt_debug case $4 in $1 ) func_to_host_path_result="$3$func_to_host_path_result" ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # 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. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $opt_debug $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $opt_debug case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result="$1" } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $opt_debug 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" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $opt_debug 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. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # 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" 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" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $opt_debug 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" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $opt_debug 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" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # 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. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $opt_debug 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}" fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $opt_debug func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result="$1" } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $opt_debug 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 ';.'; # and winepath ignores them completely. 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_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $opt_debug 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_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # 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" 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_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $opt_debug 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_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $opt_debug 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 ';.', and winepath ignores them completely. func_stripname : : "$1" 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_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_mode_compile arg... func_mode_compile () { $opt_debug # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify \`-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" func_append_quoted lastarg "$arg" done IFS="$save_ifs" func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) 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" } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from \`$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done 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_dirname_and_basename "$obj" "/" "" 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 removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; 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" else output_obj= need_locks=no lockfile= fi # 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 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 if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` 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 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." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile 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 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." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test "$suppress_opt" = yes; 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 # 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 func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile 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 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." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test "$need_locks" != no; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test "$opt_mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... 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 to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -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 -Wc,FLAG pass FLAG directly to the compiler 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'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path 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 into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. 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." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -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 -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 try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -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 -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wl,FLAG -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. 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 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 \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... 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 to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode \`$opt_mode'" ;; esac echo $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 func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | sed -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | sed '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $opt_debug # The first argument is the command name. 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" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # 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" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. 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'" continue fi func_dirname "$file" "" "." 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'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir="$func_dirname_result" ;; *) 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" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. 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" fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if test "X$opt_dry_run" = Xfalse; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" 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 fi } test "$opt_mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $opt_debug libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "\`$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument \`$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do 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 \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done 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 "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 " during execution" fi if test -n "$runpath_var"; then 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" 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'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test "$opt_mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $opt_debug # 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 || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" func_append install_prog "$func_quote_for_eval_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # 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 arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the \`$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" func_append install_shared_prog " -m $func_quote_for_eval_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" 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" destname= else func_dirname_and_basename "$dest" "" "." 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" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "\`$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # 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" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # 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" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking \`$file'" func_show_eval "$relink_command" \ '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" shift 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" case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme="" ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # 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 do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. 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 func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest="$destfile" destfile= ;; *) func_fatal_help "cannot copy a libtool object to \`$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" 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="" case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script \`$wrapper'" finalize=yes 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 if test -n "$libdir" && test ! -f "$libfile"; then func_warning "\`$lib' has not been installed in \`$libdir'" finalize=no fi done relink_command= func_source "$wrapper" outputname= if test "$fast_install" = no && test -n "$relink_command"; then $opt_dry_run || { if test "$finalize" = yes; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file="$func_basename_result" outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_silent || { 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" $opt_dry_run || ${RM}r "$tmpdir" continue fi file="$outputname" else func_warning "cannot relink \`$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name="$func_basename_result" # Set up the ranlib parameters. oldlib="$destdir/$name" func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$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' else exit $EXIT_SUCCESS fi } test "$opt_mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # 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'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms="${my_outputname}S.c" else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${my_outputname}.nm" func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. 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 */ #ifdef __cplusplus extern \"C\" { #endif #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 relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #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 /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then func_verbose "generating symbol list for \`$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. 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'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then 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"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { 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 *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" 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="" 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 func_basename "$dlprefile_dlname" dlprefile_dlbasename="$func_basename_result" else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename" ; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) if test "X$my_pic_p" != Xno; then pic_flag_for_symtable=" $pic_flag" fi ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. 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"' # Transform the symbol file into the correct name. symfileobj="$output_objdir/${my_outputname}S.$objext" case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for \`$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $opt_debug win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # 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 ' 1,100{ / I /{ s,.*,import, p q } }'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $opt_debug sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $opt_debug match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./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 # 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 # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $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 # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $opt_debug 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 # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result="" fi } # 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 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" sleep 2 done 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 $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $opt_debug my_gentop="$1"; shift my_oldlibs=${1+"$@"} 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" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib="$func_basename_result" my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir="$my_gentop/$my_xlib_u" func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`basename "$darwin_archive"` 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}" cd "$darwin_curdir" $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_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # 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 # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible 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 # 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 fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=\"$qECHO\" fi # 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 # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options which match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; 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\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$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 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include /* declarations of non-ANSI functions */ #if defined(__MINGW32__) # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #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) ... */ #endif /* portability defines, excluding path handling macros */ #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__) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined(__CYGWIN__) # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined (other platforms) ... */ #endif #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) #if defined(LT_DEBUGWRAPPER) static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (strcmp (str, pat) == 0) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else int len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { int orig_value_len = strlen (orig_value); int add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ int len = strlen (new_value); while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[len-1] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -e 's/\([\\"]\)/\\\1/g' \ -e 's/^/ fputs ("/' -e 's/$/\\n", f);/' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $opt_debug case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_mode_link arg... func_mode_link () { $opt_debug 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 # 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 # 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. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module="${wl}-single_module" func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not 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 func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir="$arg" prev= continue ;; dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" test -f "$arg" \ || func_fatal_error "symbol file \`$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" 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'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. 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" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file \`$arg' does not exist" fi arg=$save_arg prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds="$arg" prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "\`-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) 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 prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) 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'" else func_fatal_error "need path for \`-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of \`$dir'" dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module="${wl}-multi_module" continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-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" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do 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" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do 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" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -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 # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization -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) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" 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'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. 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" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test "$prev" = dlfiles; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" fi continue ;; # Some other compiler argument. *) # 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" ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the \`$prevarg' option requires an argument" if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" 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\'\` 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\" func_dirname "$output" "/" "" output_objdir="$func_dirname_result$objdir" func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # 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 case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac 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 ## 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" fi if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in 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 # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs="$dlprefiles" fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then func_warning "\`-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test "$linkmode" = lib; 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" fi 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}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no 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 $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 case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no func_dirname "$lib" "" "." ladir="$func_dirname_result" lib=$ladir/$old_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 fi fi ;; *) ;; esac fi fi ;; # -l *.ltframework) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && 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 deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "\`-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=no 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 fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." 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" 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 deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes 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 # 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_dirname "$lib" "" "." ladir="$func_dirname_result" dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac 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 test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test "$pass" = conv; 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'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" 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" fi continue fi # $pass = conv # 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 linklib=$old_library else for l in $old_library $library_names; do linklib="$l" done fi if test -z "$linklib"; then 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 -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; 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 # bomb out in the load deplibs phase. func_append dlprefiles " $lib $dependency_libs" else func_append newdlfiles " $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [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 "passing it literally to the linker, although it might fail" abs_ladir="$ladir" fi ;; esac func_basename "$lib" laname="$func_basename_result" # Find the relevant object directory and library name. if test "X$installed" = Xyes; 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" else dir="$lt_sysroot$libdir" absdir="$lt_sysroot$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later func_append notinst_path " $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" 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'" fi case "$host" in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; 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 fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; 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 case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { { test "$prefer_static_libs" = no || test "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath:" in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi 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 use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test "$installed" = no; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule="" for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule="$dlpremoduletest" break fi done if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then echo if test "$linkmode" = prog; 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 # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift 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" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc*) func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" func_basename "$soroot" 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_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_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$opt_mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we can not # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $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 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" fi elif test -n "$old_library"; then add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-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" 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$dir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; 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 case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$opt_mode" = relink; 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 case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. 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 [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; 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" 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 # Not a shared library if test "$deplibs_check_method" != pass_all; 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 "*** 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 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 "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done 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" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path="$deplib" ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [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" fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then 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 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 -z "$darwin_install_name"; then 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}" path= fi fi ;; *) path="-L$absdir/$objdir" ;; esac else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "\`$deplib' seems to be moved" path="-L$absdir" fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test "$pass" = link; then if test "$linkmode" = "prog"; 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 # 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 # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac 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" fi if test "$linkmode" = prog || test "$linkmode" = lib; then dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "\`-R' is ignored for archives" test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "\`-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "\`-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test "$module" = no && \ func_fatal_help "libtool library \`$output' must begin with \`lib'" if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; 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" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test "$dlself" != no && \ 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" install_libdir="$1" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # 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" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "\`-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 shift IFS="$save_ifs" test -n "$7" && \ func_fatal_help "too many parameters to \`-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) 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 # case $version_type in darwin|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|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" lt_irix_increment=no ;; *) func_fatal_configuration "$modename: unknown library version type \`$version_type'" ;; esac ;; no) current="$1" revision="$2" age="$3" ;; esac # Check that each of the things are valid numbers. 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" ;; 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" ;; 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" ;; 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" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result 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" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current" ;; irix | nonstopux) if test "X$lt_irix_increment" = "Xno"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" ;; osf) func_arith $current - $age major=.$func_arith_result 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 func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring:${iface}.0" done # Make executables depend on our current version. func_append verstring ":${current}.0" ;; qnx) major=".$current" versuffix=".$current" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; *) func_fatal_configuration "unknown library version type \`$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else 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 major= versuffix= 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 fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi func_generate_dlsyms "$libname" "$libname" "yes" func_append libobjs " $symfileobj" test "X$libobjs" = "X " && libobjs= if test "$opt_mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) func_append dlfiles " $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # 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="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [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="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." 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" echo "*** because I did check the linker path looking for a file starting" 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" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib="" ;; esac fi 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 if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." 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" echo "*** because I did check the linker path looking for a file starting" 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" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) 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 # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test "X$deplibs_check_method" = "Xnone"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." 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 "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; 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" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$opt_mode" != relink && 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" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_apped perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" if test -n "$hardcode_libdir_flag_spec_ld"; then eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" else eval dep_rpath=\"$hardcode_libdir_flag_spec\" fi fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname="$1" shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= 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" func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in 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 # 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" 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" $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd1 in $cmds; do 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 *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test "$try_normal_branch" = yes \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output 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" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi 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" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test "X$skipped_export" != "X:" && 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" # FIXME: $output_objdir/$libname.filter potentially contains lots of # '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. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test "$compiler_needs_object" = yes && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test "$thread_safe" = yes && 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 $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 -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= 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 func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output 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 func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test "$compiler_needs_object" = yes; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-${k}.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test "X$objlist" = X || 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 # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-${k}.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # 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\" if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi if ${skipped_export-false}; then 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. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" 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='~' for cmd in $concat_cmds; do IFS="$save_ifs" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done 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"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi if ${skipped_export-false}; then 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" $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" # FIXME: $output_objdir/$libname.filter potentially contains lots of # '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. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" 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. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$opt_mode" = relink; 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 if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "\`-R' is ignored for objects" test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for objects" test -n "$release" && \ 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" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # 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 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'` else gentop="$output_objdir/${obj}x" func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test "$build_libtool_libs" != yes && 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 output="$obj" func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $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 # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for programs" test -n "$release" && \ 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." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-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 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" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs="$new_libs" func_append compile_command " $compile_deplibs" func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append finalize_perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; 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" # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=yes case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=no ;; *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; esac if test "$wrappers_required" = no; then # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. 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" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. 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. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi 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 # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) 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" $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result 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 $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # 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" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" if test "$preload" = yes && test -f "$symfileobj"; then func_append oldobjs " $symfileobj" fi fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; 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" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase="$func_basename_result" case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist 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\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" 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=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; 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 -z "$install_libdir"; then break fi 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" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done 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` test -z "$libdir" && \ 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" newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # 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` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname 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 func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that can not go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } { test "$opt_mode" = link || test "$opt_mode" = relink; } && func_mode_link ${1+"$@"} # func_mode_uninstall arg... func_mode_uninstall () { $opt_debug RM="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) func_append RM " $arg"; rmforce=yes ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then odir="$objdir" else odir="$dir/$objdir" fi func_basename "$file" name="$func_basename_result" test "$opt_mode" = uninstall && odir="$dir" # Remember odir for removal later, being careful to avoid duplicates if test "$opt_mode" = clean; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case "$opt_mode" in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; 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' 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' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; 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 func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test "$opt_mode" = clean ; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # 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/lt-$name" fi if test "X$noexename" != "X$name" ; then func_append rmfiles " $odir/lt-${noexename}.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # 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" fi done exit $exit_status } { test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && func_mode_uninstall ${1+"$@"} test -z "$opt_mode" && { help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode \`$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # in which 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 # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: # vi:sw=2 schroedinger-1.0.11/config.h.in0000664000175000017500000000540511707140272013221 00000000000000/* config.h.in. Generated from configure.ac by autoheader. */ /* Define if building universal (internal helper macro) */ #undef AC_APPLE_UNIVERSAL_BUILD /* Enable encoder */ #undef ENABLE_ENCODER /* Enable motion reference code */ #undef ENABLE_MOTION_REF /* Defined if gcov is enabled to force a rebuild due to config.h changing */ #undef GST_GCOV_ENABLED /* Defined if host is amd64 */ #undef HAVE_AMD64 /* Defined if host is arm */ #undef HAVE_ARM /* Compile in CUDA rendering backend */ #undef HAVE_CUDA /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Defined if host is i386 */ #undef HAVE_I386 /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Compile in OpenGL rendering backend */ #undef HAVE_OPENGL /* Defined if host is powerpc */ #undef HAVE_POWERPC /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Define to 1 if your C compiler doesn't accept -c and -o together. */ #undef NO_MINUS_C_MINUS_O /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* 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 /* Number of bits in a file offset, on hosts where this is settable. */ #undef _FILE_OFFSET_BITS /* Define for large files, on AIX-style hosts. */ #undef _LARGE_FILES schroedinger-1.0.11/testsuite/0000775000175000017500000000000011707140273013304 500000000000000schroedinger-1.0.11/testsuite/wavelet_max_gain.c0000644000175000017500000001511411704734626016712 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include "common.h" int filtershift[] = { 1, 1, 1, 0, 1, 0, 1 }; int fail = 0; int verbose = 1; void iwt_ref(SchroFrameData *p, int filter); void iiwt_ref(SchroFrameData *p, int filter); void iwt_test(SchroFrameData *p, int filter); void iiwt_test(SchroFrameData *p, int filter); void schro_frame_data_get_wavelet_fd (SchroFrameData *dest, SchroFrameData *src, int level, int pos) { dest->format = src->format; dest->data = src->data; dest->width = src->width >> level; dest->height = src->height >> level; dest->stride = src->stride << level; if (pos & 1) { dest->data = SCHRO_OFFSET(dest->data, sizeof(int32_t) * dest->width); } if (pos & 2) { dest->data = SCHRO_OFFSET(dest->data, dest->stride>>1); } } void schro_frame_data_clear (SchroFrameData *fd) { int j; for(j=0;jheight;j++){ int32_t *line = SCHRO_FRAME_DATA_GET_LINE (fd, j); memset (line, 0, sizeof(int32_t) * fd->width); } } void schro_frame_data_set_center (SchroFrameData *fd) { int32_t *line = SCHRO_FRAME_DATA_GET_LINE (fd, fd->height/2-1); line[fd->width/2-1] = 256; } int schro_frame_data_get_center (SchroFrameData *fd) { int32_t *line = SCHRO_FRAME_DATA_GET_LINE (fd, fd->height/2-1); return line[fd->width/2-1]; } void schro_frame_data_saturate (SchroFrameData *fd) { int j; int i; for(j=0;jheight;j++){ int32_t *line = SCHRO_FRAME_DATA_GET_LINE (fd, j); for(i=0;iwidth;i++){ if (line[i]<0) line[i]=-16; else if (line[i]>0) line[i]=16; } } } int get_shift (int n) { int i = 0; n--; while (n > 0) { i++; n >>= 1; } return i; } void gain_test_s32 (int filter) { SchroFrame *test; SchroFrame *orig; SchroFrame *ref; SchroFrameData *fd_orig; //SchroFrameData *fd_test; SchroFrameData *fd_ref; SchroFrameData fd_trans; int max; int level; int pos; int i; int width = 256; int height = 256; int level_max; printf(" Gain table filter=%d\n", filter); for(level=1;level<=6;level++){ level_max = 0; for(pos=0;pos<4;pos++){ orig = schro_frame_new_and_alloc (NULL, SCHRO_FRAME_FORMAT_S32_444, width, height); fd_orig = orig->components + 0; test = schro_frame_new_and_alloc (NULL, SCHRO_FRAME_FORMAT_S32_444, width, height); //fd_test = test->components + 0; ref = schro_frame_new_and_alloc (NULL, SCHRO_FRAME_FORMAT_S32_444, width, height); fd_ref = ref->components + 0; schro_frame_data_clear (fd_orig); schro_frame_data_get_wavelet_fd (&fd_trans, fd_orig, level, pos); schro_frame_data_set_center (&fd_trans); schro_frame_convert (ref, orig); fflush(stdout); for(i=0;iheight;j++){ data = OFFSET(p->data,j*p->stride); for(i=0;iwidth;i++){ data[i] >>= n; } } } void lshift (SchroFrameData *p, int n) { int i; int j; int16_t *data; if (n==0) return; for(j=0;jheight;j++){ data = OFFSET(p->data,j*p->stride); for(i=0;iwidth;i++){ data[i] <<= n; } } } void copy (int16_t *d, int ds, int16_t *s, int ss, int n) { int i; int16_t *xd, *xs; for(i=0;iheight;i++){ data = OFFSET(p->data,i*p->stride); copy(tmpbuf, sizeof(int16_t), data, sizeof(int16_t), p->width); split (tmpbuf, p->width, filter); orc_deinterleave2_s16 (lo, hi, tmpbuf, p->width/2); copy(data, sizeof(int16_t), lo, sizeof(int16_t), p->width/2); copy(data + p->width/2, sizeof(int16_t), hi, sizeof(int16_t), p->width/2); } for(i=0;iwidth;i++){ data = OFFSET(p->data,i*sizeof(int16_t)); copy(tmpbuf, sizeof(int16_t), data, p->stride, p->height); split (tmpbuf, p->height, filter); copy(data, p->stride, tmpbuf, sizeof(int16_t), p->height); } } void iiwt_ref(SchroFrameData *p, int filter) { int16_t tmp1[256+16], *hi; int16_t tmp2[256+16], *lo; int16_t tmp3[256+16], *tmpbuf; int16_t *data; int i; hi = tmp1 + 4; lo = tmp2 + 4; tmpbuf = tmp3 + 8; for(i=0;iwidth;i++){ data = OFFSET(p->data,i*sizeof(int16_t)); copy(tmpbuf, sizeof(int16_t), data, p->stride, p->height); synth (tmpbuf, p->height, filter); copy(data, p->stride, tmpbuf, sizeof(int16_t), p->height); } for(i=0;iheight;i++){ data = OFFSET(p->data,i*p->stride); copy(hi, sizeof(int16_t), data, sizeof(int16_t), p->width/2); copy(lo, sizeof(int16_t), data + p->width/2, sizeof(int16_t), p->width/2); orc_interleave2_s16 (tmpbuf, hi, lo, p->width/2); synth (tmpbuf, p->width, filter); copy(data, sizeof(int16_t), tmpbuf, sizeof(int16_t), p->width); } rshift(p, filtershift[filter]); } void iwt_test(SchroFrameData *p, int filter) { int16_t *tmp; tmp = malloc(((p->width+8)*2)*sizeof(int32_t)); schro_wavelet_transform_2d (p, filter, tmp); free(tmp); } void iiwt_test(SchroFrameData *p, int filter) { int16_t *tmp; tmp = malloc(((p->width+8)*2)*sizeof(int32_t)); schro_wavelet_inverse_transform_2d (p, p, filter, tmp); free(tmp); } schroedinger-1.0.11/testsuite/phasecorrelation.c0000644000175000017500000000446411541755167016752 00000000000000 #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include "common.h" void discrete_fourier_transform (double *d1, double *d2, double *s1, double *s2, double *s3, int n) { int mask = n-1; double x; double y; int i; int j; for(i=0;i 0) x = 1/x; i1[i] *= x; i2[i] *= x; } } #define N 256 int main (int argc, char *argv[]) { double s[N], c[N]; double image1[N]; double image2[N]; double ft1r[N]; double ft1i[N]; double ft2r[N]; double ft2i[N]; double conv_r[N], conv_i[N]; double resr[N], resi[N]; int i; sincos_array (c, s, 2*M_PI/N, N); for(i=0;i #include #include //#define MAX(a,b) (((a)>(b))?(a):(b)) #define ABS(a) (((a)>0)?(a):(-a)) double sinc (double x) { if (x==0) return 1; return sin(x)/x; } double envelope (double x, double zp) { #if 0 x /= zp; if (x > 1) return 0; return 1-x*x; #endif x /= zp; if (x < -1 || x > 1) return 0; return sinc(M_PI*x); } #if 0 int main (int argc, char *argv[]) { int i; double x; double cutoff; double t[100]; double sum = 0; double offset = 0.25; double w; double center; int n_taps; int j; cutoff = 1.0; offset = 0.25; w = 4; for(i = 0; i < 50; i++) { offset = i/50.0; //w = 1 + i*0.1; n_taps = floor(w*2 + 1); n_taps = (n_taps + 1)&(~1); center = offset; sum = 0; for(j=0;jd_taps[(x) + (y)*(filter)->n_taps]) #define FILTER2D_I_TAP(filter,x,y) ((filter)->i_taps[(x) + (y)*(filter)->n_taps]) Filter2D * filter2d_new (int n_taps, int shift) { Filter2D *f; f = schro_malloc0 (sizeof(Filter2D)); f->n_taps = n_taps; f->shift = shift; f->d_taps = schro_malloc0 (n_taps * n_taps * sizeof(double)); f->i_taps = schro_malloc0 (n_taps * n_taps * sizeof(int)); return f; } double filter2d_calc_sum (Filter2D *f) { int i,j; double sum = 0; for(i=0;in_taps;i++){ for(j=0;jn_taps;j++){ sum += FILTER2D_D_TAP (f,i,j); } } return sum; } int filter2d_calc_int_sum (Filter2D *f) { int i,j; int sum = 0; for(i=0;in_taps;i++){ for(j=0;jn_taps;j++){ sum += FILTER2D_I_TAP (f,i,j); } } return sum; } int filter2d_calc_int_abs_sum (Filter2D *f) { int i,j; int sum = 0; for(i=0;in_taps;i++){ for(j=0;jn_taps;j++){ sum += ABS(FILTER2D_I_TAP (f,i,j)); } } return sum; } void filter2d_generate_sinc (Filter2D *filter, double cutoff, double w) { int j,k; double x; double center_x = (filter->n_taps - 1.0) * 0.5; double center_y = (filter->n_taps - 1.0) * 0.5; for(j=0;jn_taps;j++){ for(k=0;kn_taps;k++){ x = sqrt((j-center_x)*(j-center_x)+(k-center_y)*(k-center_y)); FILTER2D_D_TAP(filter,j,k) = sinc(cutoff*x*M_PI)*envelope(x,w); } } } void filter2d_quantise (Filter2D *filter, double adjust) { int j,k; double sum; int target = 1<shift; sum = filter2d_calc_sum (filter); for(j=0;jn_taps;j++){ for(k=0;kn_taps;k++){ FILTER2D_I_TAP (filter,j,k) = floor(0.5 + target*FILTER2D_D_TAP(filter,j,k)/sum + adjust); } } } void filter2d_dump (Filter2D *filter) { int j,k; for(j=0;jn_taps;j++){ for(k=0;kn_taps;k++){ if (FILTER2D_I_TAP(filter,j,k) == 0) { printf(" . "); } else { printf("%5d ", FILTER2D_I_TAP(filter,j,k)); } } printf("\n"); } } double filter2d_adjust (Filter2D *filter) { int isum; double lo_adj, hi_adj, mid_adj; int lo_isum, hi_isum, mid_isum; int i; int target = 1<shift; filter2d_quantise (filter, 0.0); isum = filter2d_calc_int_sum (filter); if (isum == target) return 0; if (isum > target) { hi_adj = 0.0; hi_isum = isum; lo_adj = -0.5; filter2d_quantise (filter, lo_adj); lo_isum = filter2d_calc_int_sum (filter); if (lo_isum == target) { return lo_adj; } } else { lo_adj = 0.0; lo_isum = isum; hi_adj = 0.5; filter2d_quantise (filter, hi_adj); hi_isum = filter2d_calc_int_sum (filter); if (hi_isum == target) { return hi_adj; } } for(i=0;i<10;i++){ //printf("[%g,%g] -> [%d,%d]\n", lo_adj, hi_adj, lo_isum, hi_isum); mid_adj = 0.5*(hi_adj + lo_adj); filter2d_quantise (filter, mid_adj); mid_isum = filter2d_calc_int_sum (filter); if (mid_isum == target) return mid_adj; if (mid_isum < target) { lo_adj = mid_adj; lo_isum = mid_isum; } else { hi_adj = mid_adj; hi_isum = mid_isum; } } printf("unresolved sum=%d\n", mid_isum); return mid_adj; } int main (int argc, char *argv[]) { Filter2D *filter; int i; double cutoff; double offset = 0.25; double w; int isum; int asum; schro_init (); filter = filter2d_new (9, 12); cutoff = 0.5; offset = 0.25; w = 4; for(i = 0; i <= 50; i++) { offset = i/50.0; w = 1 + i*0.1; filter2d_generate_sinc (filter, cutoff, w); filter2d_calc_sum (filter); printf("w %g offset %g:\n", w, offset); filter2d_quantise (filter, 0.0); filter2d_adjust (filter); isum = filter2d_calc_int_sum (filter); asum = filter2d_calc_int_abs_sum (filter); filter2d_dump (filter); printf("sum = %d abs sum = %d\n",isum, asum); } return 0; } schroedinger-1.0.11/testsuite/wavelet_gain_curve.c0000644000175000017500000001114511541755167017253 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #include #include "common.h" int16_t tmp[2000]; int16_t tmp2[2000]; int filtershift[] = { 1, 1, 1, 0, 1, 0, 1 }; void dump (int16_t *a, int n); void dump_cmp (int16_t *a, int16_t *b, int n); void solve (double *matrix, double *col, int n); #define SHIFT 8 #define N (1<>4);i++){ a[i]=floor(0.5 + amplitude*random_std()*weights[0]); } for(i=(N>>4);i<(N>>3);i++){ a[i]=floor(0.5 + amplitude*random_std()*weights[1]); } for(i=(N>>3);i<(N>>2);i++){ a[i]=floor(0.5 + amplitude*random_std()*weights[2]); } for(i=(N>>2);i<(N>>1);i++){ a[i]=floor(0.5 + amplitude*random_std()*weights[3]); } for(i=(N>>1);i<(N>>0);i++){ a[i]=floor(0.5 + amplitude*random_std()*weights[4]); } synth(a,N>>3,filter); synth(a,N>>2,filter); synth(a,N>>1,filter); synth(a,N,filter); for(i=0;i>1);i++){ double x; x = power[i]/n_cycles; x /= (amplitude*amplitude); /* divide by FFT normalization */ x /= (1< 1) { filter = strtol(argv[1], NULL, 0); } for(j=0;j<5;j++){ double weights[5]; memset(weights,0,sizeof(weights)); weights[j] = 1; random_test(curves[j], filter, weights); } for(i=0;i0;i--) { for(j=i-1;j>=0;j--) { column[j] -= matrix[j*n+i] * column[i]; matrix[j*n+i] = 0; } } } schroedinger-1.0.11/testsuite/decode_loop.c0000644000175000017500000000526211541755167015661 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include "common.h" void decode (FILE *file); void parse (FILE *file); int main (int argc, char *argv[]) { FILE *file; int i = 0; schro_init(); if (argc < 2) { printf("decode_loop stream.drc\n"); exit(1); } while (1) { printf("%d\n", i); file = fopen (argv[1], "r"); if (file == NULL) { printf("cannot open %s\n", argv[1]); return 1; } decode (file); fclose (file); i++; } return 0; } static void buffer_free (SchroBuffer *buf, void *priv) { free (priv); } void decode (FILE *file) { SchroDecoder *decoder; SchroBuffer *buffer; SchroVideoFormat *format = NULL; SchroFrame *frame; int go; int it; int eos = FALSE; void *packet; int size; int ret; decoder = schro_decoder_new(); while(!eos) { ret = parse_packet (file, &packet, &size); if (!ret) { exit(1); } if (size == 0) { schro_decoder_push_end_of_stream (decoder); } else { buffer = schro_buffer_new_with_data (packet, size); buffer->free = buffer_free; buffer->priv = packet; it = schro_decoder_push (decoder, buffer); if (it == SCHRO_DECODER_FIRST_ACCESS_UNIT) { format = schro_decoder_get_video_format (decoder); } } go = 1; while (go) { it = schro_decoder_wait (decoder); switch (it) { case SCHRO_DECODER_NEED_BITS: go = 0; break; case SCHRO_DECODER_NEED_FRAME: frame = schro_frame_new_and_alloc (NULL, schro_params_get_frame_format(8, format->chroma_format), format->width, format->height); schro_decoder_add_output_picture (decoder, frame); break; case SCHRO_DECODER_OK: frame = schro_decoder_pull (decoder); //printf("got frame %p\n", frame); if (frame) { //printf("picture number %d\n", // schro_decoder_get_picture_number (decoder) - 1); schro_frame_unref (frame); } break; case SCHRO_DECODER_EOS: printf("got eos\n"); eos = TRUE; go = 0; break; case SCHRO_DECODER_ERROR: exit(0); break; } } } printf("freeing decoder\n"); schro_decoder_free (decoder); free(format); } void parse (FILE *file) { void *packet; int size; int ret; while(1) { ret = parse_packet (file, &packet, &size); if (!ret) { exit(1); } if (packet) free (packet); if (size == 0) return; } } schroedinger-1.0.11/testsuite/installation/0000775000175000017500000000000011707140273016005 500000000000000schroedinger-1.0.11/testsuite/installation/header_test0000755000175000017500000000111011161525516020132 00000000000000#!/bin/sh verbose=true if $verbose then REDIRECT= else REDIRECT=">/dev/null 2>/dev/null" fi CC=gcc pkg=schroedinger-1.0 includedir=$(pkg-config --variable=includedir ${pkg}) CFLAGS="-Wall -Werror $(pkg-config --cflags ${pkg}) -DSCHRO_ENABLE_UNSTABLE_API" headers="$(cd ${includedir} && find . -type f -name '*.h')" fail=false for each in $headers do echo -n "$each... " echo "#include <$each>" >test.c if ${CC} ${CFLAGS} test.c -c -o test.o ${REDIRECT} then echo OK else echo failed fail=true fi done if [ "$fail" = "true" ] then exit 1 fi exit 0 schroedinger-1.0.11/testsuite/installation/Makefile.am0000644000175000017500000000003310735025462017755 00000000000000 EXTRA_DIST = header_test schroedinger-1.0.11/testsuite/installation/Makefile.in0000664000175000017500000002534311707140262017777 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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@ subdir = testsuite/installation DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-auto-alt.m4 \ $(top_srcdir)/m4/as-compiler-flag.m4 \ $(top_srcdir)/m4/as-host-defines.m4 \ $(top_srcdir)/m4/as-version.m4 $(top_srcdir)/m4/gst-args.m4 \ $(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)/m4/pkg.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUDA_CFLAGS = @CUDA_CFLAGS@ CUDA_LIBS = @CUDA_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ GCOV = @GCOV@ GCOV_CFLAGS = @GCOV_CFLAGS@ GCOV_LIBS = @GCOV_LIBS@ GREP = @GREP@ GTHREAD_CFLAGS = @GTHREAD_CFLAGS@ GTHREAD_LIBS = @GTHREAD_LIBS@ GTKDOC_CHECK = @GTKDOC_CHECK@ 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@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ NVCC = @NVCC@ NVCCFLAGS = @NVCCFLAGS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENGL_CFLAGS = @OPENGL_CFLAGS@ OPENGL_LIBS = @OPENGL_LIBS@ ORCC = @ORCC@ ORC_CFLAGS = @ORC_CFLAGS@ ORC_LIBS = @ORC_LIBS@ 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@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SCHRO_CFLAGS = @SCHRO_CFLAGS@ SCHRO_LIBS = @SCHRO_LIBS@ SCHRO_LIBVERSION = @SCHRO_LIBVERSION@ SCHRO_MAJORMINOR = @SCHRO_MAJORMINOR@ SCHRO_PKG_DEPS = @SCHRO_PKG_DEPS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ THREAD_IMPL = @THREAD_IMPL@ VERSION = @VERSION@ 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_CXX = @ac_ct_CXX@ 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@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = header_test 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) --foreign testsuite/installation/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign testsuite/installation/Makefile .PRECIOUS: 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 tags: TAGS TAGS: ctags: CTAGS CTAGS: 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 \ 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 uninstall uninstall-am # 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: schroedinger-1.0.11/testsuite/cache/0000775000175000017500000000000011707140274014350 500000000000000schroedinger-1.0.11/testsuite/cache/upsample_speed.c0000644000175000017500000000217311541755167017454 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include int16_t tmp[2048+100]; int orc_profile_get_min (OrcProfile *prof) { int i; int min; min = prof->hist_time[0]; for(i=0;i<10;i++){ if (prof->hist_count[i] > 0) { if (prof->hist_time[i] < min) { min = prof->hist_time[i]; } } } return min; } void upsample_speed (int filter, int width, int height) { SchroFrame *frame1; SchroUpsampledFrame *upframe; SchroMemoryDomain *mem; int i; mem = schro_memory_domain_new_local (); frame1 = schro_frame_new_and_alloc (mem, SCHRO_FRAME_FORMAT_U8_444, width, height); for(i=0;i<100;i++){ upframe = schro_upsampled_frame_new (schro_frame_ref(frame1)); schro_upsampled_frame_upsample (upframe); schro_upsampled_frame_free (upframe); } schro_frame_unref (frame1); schro_memory_domain_free (mem); } int main (int argc, char *argv[]) { orc_init(); upsample_speed (1, 1920, 1080); return 0; } schroedinger-1.0.11/testsuite/cache/Makefile.am0000644000175000017500000000040711541755167016334 00000000000000 noinst_PROGRAMS = wavelet_speed upsample_speed AM_CFLAGS = $(SCHRO_CFLAGS) $(ERROR_CFLAGS) $(ORC_CFLAGS) \ -DSCHRO_ENABLE_UNSTABLE_API LDADD = ../libschrotest.la $(SCHRO_LIBS) -lorc-test-0.4 $(ORC_LIBS) $(LIBM) wavelet_speed_SOURCES = wavelet_speed.c schroedinger-1.0.11/testsuite/cache/Makefile.in0000664000175000017500000004007211707140262016335 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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@ noinst_PROGRAMS = wavelet_speed$(EXEEXT) upsample_speed$(EXEEXT) subdir = testsuite/cache DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-auto-alt.m4 \ $(top_srcdir)/m4/as-compiler-flag.m4 \ $(top_srcdir)/m4/as-host-defines.m4 \ $(top_srcdir)/m4/as-version.m4 $(top_srcdir)/m4/gst-args.m4 \ $(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)/m4/pkg.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) upsample_speed_SOURCES = upsample_speed.c upsample_speed_OBJECTS = upsample_speed.$(OBJEXT) upsample_speed_LDADD = $(LDADD) am__DEPENDENCIES_1 = upsample_speed_DEPENDENCIES = ../libschrotest.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_wavelet_speed_OBJECTS = wavelet_speed.$(OBJEXT) wavelet_speed_OBJECTS = $(am_wavelet_speed_OBJECTS) wavelet_speed_LDADD = $(LDADD) wavelet_speed_DEPENDENCIES = ../libschrotest.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = upsample_speed.c $(wavelet_speed_SOURCES) DIST_SOURCES = upsample_speed.c $(wavelet_speed_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUDA_CFLAGS = @CUDA_CFLAGS@ CUDA_LIBS = @CUDA_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ GCOV = @GCOV@ GCOV_CFLAGS = @GCOV_CFLAGS@ GCOV_LIBS = @GCOV_LIBS@ GREP = @GREP@ GTHREAD_CFLAGS = @GTHREAD_CFLAGS@ GTHREAD_LIBS = @GTHREAD_LIBS@ GTKDOC_CHECK = @GTKDOC_CHECK@ 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@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ NVCC = @NVCC@ NVCCFLAGS = @NVCCFLAGS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENGL_CFLAGS = @OPENGL_CFLAGS@ OPENGL_LIBS = @OPENGL_LIBS@ ORCC = @ORCC@ ORC_CFLAGS = @ORC_CFLAGS@ ORC_LIBS = @ORC_LIBS@ 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@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SCHRO_CFLAGS = @SCHRO_CFLAGS@ SCHRO_LIBS = @SCHRO_LIBS@ SCHRO_LIBVERSION = @SCHRO_LIBVERSION@ SCHRO_MAJORMINOR = @SCHRO_MAJORMINOR@ SCHRO_PKG_DEPS = @SCHRO_PKG_DEPS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ THREAD_IMPL = @THREAD_IMPL@ VERSION = @VERSION@ 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_CXX = @ac_ct_CXX@ 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@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CFLAGS = $(SCHRO_CFLAGS) $(ERROR_CFLAGS) $(ORC_CFLAGS) \ -DSCHRO_ENABLE_UNSTABLE_API LDADD = ../libschrotest.la $(SCHRO_LIBS) -lorc-test-0.4 $(ORC_LIBS) $(LIBM) wavelet_speed_SOURCES = wavelet_speed.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(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) --foreign testsuite/cache/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign testsuite/cache/Makefile .PRECIOUS: 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-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list upsample_speed$(EXEEXT): $(upsample_speed_OBJECTS) $(upsample_speed_DEPENDENCIES) @rm -f upsample_speed$(EXEEXT) $(LINK) $(upsample_speed_OBJECTS) $(upsample_speed_LDADD) $(LIBS) wavelet_speed$(EXEEXT): $(wavelet_speed_OBJECTS) $(wavelet_speed_DEPENDENCIES) @rm -f wavelet_speed$(EXEEXT) $(LINK) $(wavelet_speed_OBJECTS) $(wavelet_speed_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/upsample_speed.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wavelet_speed.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 $(PROGRAMS) 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-noinstPROGRAMS \ 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 all all-am check check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS ctags 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 uninstall uninstall-am # 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: schroedinger-1.0.11/testsuite/cache/wavelet_speed.c0000644000175000017500000000343611556115124017265 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include int16_t tmp[2048+100]; int16_t *data; int orc_profile_get_min (OrcProfile *prof) { int i; int min; min = prof->hist_time[0]; for(i=0;i<10;i++){ if (prof->hist_count[i] > 0) { if (prof->hist_time[i] < min) { min = prof->hist_time[i]; } } } return min; } void wavelet_speed (int filter, int width, int height) { OrcProfile prof1; OrcProfile prof2; double ave_fwd, ave_rev; int i; SchroFrameData fd; fd.format = SCHRO_FRAME_FORMAT_S16_444; fd.data = data; fd.stride = width*2; fd.width = width; fd.height = height; orc_profile_init (&prof1); orc_profile_init (&prof2); for(i=0;i<10;i++){ orc_profile_start (&prof1); schro_wavelet_transform_2d (&fd, filter, tmp); orc_profile_stop (&prof1); orc_profile_start (&prof2); schro_wavelet_inverse_transform_2d (&fd, &fd, filter, tmp); orc_profile_stop (&prof2); } //orc_profile_get_ave_std (&prof1, &ave_fwd, &std); //printf("fwd %g (%g)\n", ave, std); //orc_profile_get_ave_std (&prof2, &ave_rev, &std); //printf("rev %g (%g)\n", ave, std); ave_fwd = orc_profile_get_min (&prof1); ave_rev = orc_profile_get_min (&prof2); printf("%d %d %g %g %g %g\n", width, height, ave_fwd, ave_rev, ave_fwd/(width*height), ave_rev/(width*height)); } int main (int argc, char *argv[]) { int i; orc_init(); data = malloc(2048*512*2); #if 0 for(i=0;i<8;i++){ printf("wavelet %d\n", i); wavelet_speed (i, 256, 256); } #endif for(i=16;i<=2048;i+=16){ wavelet_speed (1, i, 256); } free(data); return 0; } schroedinger-1.0.11/testsuite/common.c0000664000175000017500000004746011707126525014677 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #include #include "common.h" double sgn(double x) { if (x<0) return -1; if (x>0) return 1; return 0; } double random_std (void) { double x; double y; while (1) { x = -5.0 + rand () * (1.0/RAND_MAX) * 10; y = rand () * (1.0/RAND_MAX); if (y < exp(-x*x*0.5)) return x; } } double random_triangle (void) { return rand () * (1.0/RAND_MAX) - rand () * (1.0/RAND_MAX); } int gain_to_quant_index (double x) { int i = 0; x *= x; x *= x; while (x*x > 2) { x *= 0.5; i++; } return i; } double sum_f64 (double *a, int n) { double sum = 0; int i; for(i=0;iformat) == SCHRO_FRAME_FORMAT_DEPTH_U8) { uint8_t *data; for(j=0;jheight;j++){ data = SCHRO_FRAME_DATA_GET_LINE(fd, j); orc_random_bits (&context, data, fd->width); } } else if (SCHRO_FRAME_FORMAT_DEPTH(fd->format) == SCHRO_FRAME_FORMAT_DEPTH_S16) { int16_t *data; for(j=0;jheight;j++){ data = SCHRO_FRAME_DATA_GET_LINE(fd, j); for(i=0;iwidth;i++) { data[i] = orc_random(&context)&0xff; } } } else { int32_t *data; for(j=0;jheight;j++){ data = SCHRO_FRAME_DATA_GET_LINE(fd, j); for(i=0;iwidth;i++) { data[i] = orc_random(&context)&0xffff; } } } } static int gen_const_array[] = { 0, 1, 127, 128, 129, 254, 255 }; #define CONST 255 static void gen_const (SchroFrameData *fd, int type) { int i,j; int value = gen_const_array[type]; if (SCHRO_FRAME_FORMAT_DEPTH(fd->format) == SCHRO_FRAME_FORMAT_DEPTH_U8) { for(j=0;jheight;j++){ uint8_t *data; data = SCHRO_FRAME_DATA_GET_LINE(fd, j); for(i=0;iwidth;i++) { data[i] = value; } } } else { for(j=0;jheight;j++){ int16_t *data; data = SCHRO_FRAME_DATA_GET_LINE(fd, j); for(i=0;iwidth;i++) { data[i] = value; } } } } static void gen_vert_lines (SchroFrameData *fd, int type) { int i,j; int pitch; pitch = type + 2; if (SCHRO_FRAME_FORMAT_DEPTH(fd->format) == SCHRO_FRAME_FORMAT_DEPTH_U8) { uint8_t *data; for(j=0;jheight;j++){ data = SCHRO_FRAME_DATA_GET_LINE(fd, j); for(i=0;iwidth;i++) { data[i] = CONST*((i%pitch)==0); } } } else { int16_t *data; for(j=0;jheight;j++){ data = SCHRO_FRAME_DATA_GET_LINE(fd, j); for(i=0;iwidth;i++) { data[i] = CONST*((i%pitch)==0); } } } } static void gen_horiz_lines (SchroFrameData *fd, int type) { int i,j; int pitch; pitch = type + 2; if (SCHRO_FRAME_FORMAT_DEPTH(fd->format) == SCHRO_FRAME_FORMAT_DEPTH_U8) { uint8_t *data; for(j=0;jheight;j++){ data = SCHRO_FRAME_DATA_GET_LINE(fd, j); for(i=0;iwidth;i++) { data[i] = CONST*(((j+1)%pitch)==0); } } } else { int16_t *data; for(j=0;jheight;j++){ data = SCHRO_FRAME_DATA_GET_LINE(fd, j); for(i=0;iwidth;i++) { data[i] = CONST*(((j+1)%pitch)==0); } } } } static void gen_vert_bands (SchroFrameData *fd, int type) { int i,j; int pitch; pitch = type + 1; if (SCHRO_FRAME_FORMAT_DEPTH(fd->format) == SCHRO_FRAME_FORMAT_DEPTH_U8) { uint8_t *data; for(j=0;jheight;j++){ data = SCHRO_FRAME_DATA_GET_LINE(fd, j); for(i=0;iwidth;i++) { data[i] = CONST*((i/pitch)&1); } } } else { int16_t *data; for(j=0;jheight;j++){ data = SCHRO_FRAME_DATA_GET_LINE(fd, j); for(i=0;iwidth;i++) { data[i] = CONST*((i/pitch)&1); } } } } static void gen_horiz_bands (SchroFrameData *fd, int type) { int i,j; int pitch; pitch = type + 1; if (SCHRO_FRAME_FORMAT_DEPTH(fd->format) == SCHRO_FRAME_FORMAT_DEPTH_U8) { uint8_t *data; for(j=0;jheight;j++){ data = SCHRO_FRAME_DATA_GET_LINE(fd, j); for(i=0;iwidth;i++) { data[i] = CONST*((j/pitch)&1); } } } else { int16_t *data; for(j=0;jheight;j++){ data = SCHRO_FRAME_DATA_GET_LINE(fd, j); for(i=0;iwidth;i++) { data[i] = CONST*((j/pitch)&1); } } } } static void gen_vert_edge (SchroFrameData *fd, int type) { int i,j; if (SCHRO_FRAME_FORMAT_DEPTH(fd->format) == SCHRO_FRAME_FORMAT_DEPTH_U8) { uint8_t *data; for(j=0;jheight;j++){ data = SCHRO_FRAME_DATA_GET_LINE(fd, j); for(i=0;iwidth;i++) { data[i] = CONST*(i*2 < fd->width); } } } else { int16_t *data; for(j=0;jheight;j++){ data = SCHRO_FRAME_DATA_GET_LINE(fd, j); for(i=0;iwidth;i++) { data[i] = CONST*(i*2 < fd->width); } } } } static void gen_horiz_edge (SchroFrameData *fd, int type) { int i,j; if (SCHRO_FRAME_FORMAT_DEPTH(fd->format) == SCHRO_FRAME_FORMAT_DEPTH_U8) { uint8_t *data; for(j=0;jheight;j++){ data = SCHRO_FRAME_DATA_GET_LINE(fd, j); for(i=0;iwidth;i++) { data[i] = CONST*(j*2 < fd->height); } } } else { int16_t *data; for(j=0;jheight;j++){ data = SCHRO_FRAME_DATA_GET_LINE(fd, j); for(i=0;iwidth;i++) { data[i] = CONST*(j*2 < fd->height); } } } } static void gen_vert_ramp (SchroFrameData *fd, int type) { int i,j; if (SCHRO_FRAME_FORMAT_DEPTH(fd->format) == SCHRO_FRAME_FORMAT_DEPTH_U8) { uint8_t *data; for(j=0;jheight;j++){ data = SCHRO_FRAME_DATA_GET_LINE(fd, j); for(i=0;iwidth;i++) { data[i] = ((i<<4)>>type)&0xff; } } } else { int16_t *data; for(j=0;jheight;j++){ data = SCHRO_FRAME_DATA_GET_LINE(fd, j); for(i=0;iwidth;i++) { data[i] = ((i<<4)>>type)&0xff; } } } } static void gen_horiz_ramp (SchroFrameData *fd, int type) { int i,j; if (SCHRO_FRAME_FORMAT_DEPTH(fd->format) == SCHRO_FRAME_FORMAT_DEPTH_U8) { uint8_t *data; for(j=0;jheight;j++){ data = SCHRO_FRAME_DATA_GET_LINE(fd, j); for(i=0;iwidth;i++) { data[i] = ((j<<4)>>type)&0xff; } } } else { int16_t *data; for(j=0;jheight;j++){ data = SCHRO_FRAME_DATA_GET_LINE(fd, j); for(i=0;iwidth;i++) { data[i] = ((j<<4)>>type)&0xff; } } } } typedef struct _Generator Generator; struct _Generator { char *name; void (*generate)(SchroFrameData *fd, int i); int n; }; Generator generators_u8[] = { { "random", gen_random, 1 }, { "const", gen_const, ARRAY_SIZE(gen_const_array) }, { "vert_lines", gen_vert_lines, 8 }, { "horiz_lines", gen_horiz_lines, 16 }, { "vert_bands", gen_vert_bands, 8 }, { "horiz_bands", gen_horiz_bands, 8 }, { "vert_edge", gen_vert_edge, 1 }, { "horiz_edge", gen_horiz_edge, 1 }, { "vert_ramp", gen_vert_ramp, 8 }, { "horiz_ramp", gen_horiz_ramp, 8 }, }; int test_pattern_get_n_generators (void) { int i; int n; n = 0; for(i=0;iformat); int dest_depth = SCHRO_FRAME_FORMAT_DEPTH(dest->format); if (src_depth == SCHRO_FRAME_FORMAT_DEPTH_U8 && dest_depth == SCHRO_FRAME_FORMAT_DEPTH_U8) { uint8_t *d; uint8_t *s; for(j=0;jheight;j++){ d = SCHRO_FRAME_DATA_GET_LINE(dest, j); s = SCHRO_FRAME_DATA_GET_LINE(src, j); for(i=0;iwidth;i++){ if (d[i] != s[i]) return FALSE; } } } else if (dest_depth == SCHRO_FRAME_FORMAT_DEPTH_S16 && src_depth == SCHRO_FRAME_FORMAT_DEPTH_S16) { int16_t *d; int16_t *s; for(j=0;jheight;j++){ d = SCHRO_FRAME_DATA_GET_LINE(dest, j); s = SCHRO_FRAME_DATA_GET_LINE(src, j); for(i=0;iwidth;i++){ if (d[i] != s[i]) return FALSE; } } } else if (dest_depth == SCHRO_FRAME_FORMAT_DEPTH_S32 && src_depth == SCHRO_FRAME_FORMAT_DEPTH_S16) { int32_t *d; int16_t *s; for(j=0;jheight;j++){ d = SCHRO_FRAME_DATA_GET_LINE(dest, j); s = SCHRO_FRAME_DATA_GET_LINE(src, j); for(i=0;iwidth;i++){ if (d[i] != s[i]) return FALSE; } } } return TRUE; } void frame_data_dump_u8 (SchroFrameData *test, SchroFrameData *ref) { int i; int j; printf("=====\n"); for(j=0;jheight;j++){ uint8_t *tline; uint8_t *rline; tline = SCHRO_FRAME_DATA_GET_LINE(test, j); rline = SCHRO_FRAME_DATA_GET_LINE(ref, j); for(i=0;iwidth;i++){ if (tline[i] == rline[i]) { printf("%4d ", tline[i]); } else { printf("\033[00;01;37;41m%4d\033[00m ", tline[i]); } } printf("\n"); } printf("=====\n"); } void frame_data_dump_s16 (SchroFrameData *test, SchroFrameData *ref) { int i; int j; printf("=====\n"); for(j=0;jheight;j++){ int16_t *tline; int16_t *rline; tline = SCHRO_FRAME_DATA_GET_LINE(test, j); rline = SCHRO_FRAME_DATA_GET_LINE(ref, j); for(i=0;iwidth;i++){ if (tline[i] == rline[i]) { printf("%4d ", tline[i]); } else { printf("\033[00;01;37;41m%4d\033[00m ", tline[i]); } } printf("\n"); } printf("=====\n"); } void frame_data_dump_s32_s16 (SchroFrameData *test, SchroFrameData *ref) { int i; int j; printf("=====\n"); for(j=0;jheight;j++){ int32_t *tline; int16_t *rline; tline = SCHRO_FRAME_DATA_GET_LINE(test, j); rline = SCHRO_FRAME_DATA_GET_LINE(ref, j); for(i=0;iwidth;i++){ if (tline[i] == rline[i]) { printf("%4d ", tline[i]); } else { printf("\033[00;01;37;41m%4d\033[00m ", tline[i]); } } printf("\n"); } printf("=====\n"); } void frame_data_dump_full (SchroFrameData *test, SchroFrameData *ref, SchroFrameData *orig) { int i; int j; int test_depth = SCHRO_FRAME_FORMAT_DEPTH(test->format); int ref_depth = SCHRO_FRAME_FORMAT_DEPTH(ref->format); printf("=====\n"); if (test_depth == SCHRO_FRAME_FORMAT_DEPTH_U8 && ref_depth == SCHRO_FRAME_FORMAT_DEPTH_U8) { for(j=0;jheight;j++){ uint8_t *tline; uint8_t *rline; uint8_t *oline; tline = SCHRO_FRAME_DATA_GET_LINE(test, j); rline = SCHRO_FRAME_DATA_GET_LINE(ref, j); oline = SCHRO_FRAME_DATA_GET_LINE(orig, j); for(i=0;iwidth;i++){ printf("\033[00;35m%4d\033[00m ", oline[i]); } printf("\n"); for(i=0;iwidth;i++){ printf("\033[00;32m%4d\033[00m ", rline[i]); } printf("\n"); for(i=0;iwidth;i++){ if (tline[i] == rline[i]) { printf("%4d ", tline[i]); } else { printf("\033[00;01;37;41m%4d\033[00m ", tline[i]); } } printf("\n"); } } else if (ref_depth == SCHRO_FRAME_FORMAT_DEPTH_S16 && test_depth == SCHRO_FRAME_FORMAT_DEPTH_S16) { for(j=0;jheight;j++){ int16_t *tline; int16_t *rline; int16_t *oline; tline = SCHRO_FRAME_DATA_GET_LINE(test, j); rline = SCHRO_FRAME_DATA_GET_LINE(ref, j); oline = SCHRO_FRAME_DATA_GET_LINE(orig, j); for(i=0;iwidth;i++){ printf("\033[00;35m%4d\033[00m ", oline[i]); } printf("\n"); for(i=0;iwidth;i++){ printf("\033[00;32m%4d\033[00m ", rline[i]); } printf("\n"); for(i=0;iwidth;i++){ if (tline[i] == rline[i]) { printf("%4d ", tline[i]); } else { printf("\033[00;01;37;41m%4d\033[00m ", tline[i]); } } printf("\n"); } } else if (test_depth == SCHRO_FRAME_FORMAT_DEPTH_S32 && ref_depth == SCHRO_FRAME_FORMAT_DEPTH_S16) { for(j=0;jheight;j++){ int32_t *tline; int16_t *rline; int16_t *oline; tline = SCHRO_FRAME_DATA_GET_LINE(test, j); rline = SCHRO_FRAME_DATA_GET_LINE(ref, j); oline = SCHRO_FRAME_DATA_GET_LINE(orig, j); for(i=0;iwidth;i++){ printf("\033[00;35m%4d\033[00m ", oline[i]); } printf("\n"); for(i=0;iwidth;i++){ printf("\033[00;32m%4d\033[00m ", rline[i]); } printf("\n"); for(i=0;iwidth;i++){ if (tline[i] == rline[i]) { printf("%4d ", tline[i]); } else { printf("\033[00;01;37;41m%4d\033[00m ", tline[i]); } } printf("\n"); } } printf("=====\n"); } int frame_compare (SchroFrame *dest, SchroFrame *src) { int ret; ret = frame_data_compare (dest->components + 0, src->components + 0); ret &= frame_data_compare (dest->components + 1, src->components + 1); ret &= frame_data_compare (dest->components + 2, src->components + 2); return ret; } void frame_data_dump (SchroFrameData *test, SchroFrameData *ref) { if (SCHRO_FRAME_FORMAT_DEPTH(test->format) == SCHRO_FRAME_FORMAT_DEPTH_U8) { frame_data_dump_u8 (test, ref); } else { frame_data_dump_s16 (test, ref); } } void frame_dump (SchroFrame *test, SchroFrame *ref) { if (SCHRO_FRAME_FORMAT_DEPTH(test->format) == SCHRO_FRAME_FORMAT_DEPTH_U8) { frame_data_dump_u8 (test->components + 0, ref->components + 0); frame_data_dump_u8 (test->components + 1, ref->components + 1); frame_data_dump_u8 (test->components + 2, ref->components + 2); } else { frame_data_dump_s16 (test->components + 0, ref->components + 0); frame_data_dump_s16 (test->components + 1, ref->components + 1); frame_data_dump_s16 (test->components + 2, ref->components + 2); } } /* simple parse dirac stream */ int parse_packet (FILE *file, void **p_data, int *p_size) { unsigned char *packet; unsigned char header[13]; int n; int size; n = fread (header, 1, 13, file); if (n == 0) { *p_data = NULL; *p_size = 0; return 1; } if (n < 13) { printf("truncated header\n"); return 0; } if (header[0] != 'B' || header[1] != 'B' || header[2] != 'C' || header[3] != 'D') { return 0; } size = (header[5]<<24) | (header[6]<<16) | (header[7]<<8) | (header[8]); if (size == 0) { size = 13; } if (size < 13) { return 0; } if (size > 16*1024*1024) { printf("packet too large? (%d > 16777216)\n", size); return 0; } packet = malloc (size); memcpy (packet, header, 13); n = fread (packet + 13, 1, size - 13, file); if (n < size - 13) { free (packet); return 0; } *p_data = packet; *p_size = size; return 1; } void interleave (int16_t *a, int n) { int i; int16_t tmp[300]; for(i=0;i>2; } extend(a,n); for(i=0;i>4; } break; case SCHRO_WAVELET_LE_GALL_5_3: extend(a,n); for(i=0;i>2; } extend(a,n); for(i=0;i>1; } break; case SCHRO_WAVELET_DESLAURIERS_DUBUC_13_7: extend(a,n); for(i=0;i>5; } extend(a,n); for(i=0;i>4; } break; case SCHRO_WAVELET_HAAR_0: case SCHRO_WAVELET_HAAR_1: for(i=0;i>1; } for(i=0;i> 8; } extend(a,n); for(i=0;i> 8; } break; case SCHRO_WAVELET_DAUBECHIES_9_7: extend(a,n); for(i=0;i>12; } extend(a,n); for(i=0;i>12; } extend(a,n); for(i=0;i>12; } extend(a,n); for(i=0;i>12; } break; } } void split (int16_t *a, int n, int filter) { int i; switch (filter) { case SCHRO_WAVELET_DESLAURIERS_DUBUC_9_7: extend(a,n); for(i=0;i>4; } extend(a,n); for(i=0;i>2; } break; case SCHRO_WAVELET_LE_GALL_5_3: extend(a,n); for(i=0;i>1; } extend(a,n); for(i=0;i>2; } break; case SCHRO_WAVELET_DESLAURIERS_DUBUC_13_7: extend(a,n); for(i=0;i>4; } extend(a,n); for(i=0;i>5; } break; case SCHRO_WAVELET_HAAR_0: case SCHRO_WAVELET_HAAR_1: for(i=0;i>1; } break; case SCHRO_WAVELET_FIDELITY: extend(a,n); for(i=0;i> 8; } extend(a,n); for(i=0;i> 8; } break; case SCHRO_WAVELET_DAUBECHIES_9_7: extend(a,n); for(i=0;i>12; } extend(a,n); for(i=0;i>12; } extend(a,n); for(i=0;i>12; } extend(a,n); for(i=0;i>12; } break; } } schroedinger-1.0.11/testsuite/fft.c0000644000175000017500000001627511556115124014157 00000000000000 #include #include #include #include #ifndef M_PI #define M_PI 3.14159265358979323846 #endif #define COMPLEX_MULT_R(a,b,c,d) ((a)*(c) - (b)*(d)) #define COMPLEX_MULT_I(a,b,c,d) ((a)*(d) + (b)*(c)) /* reference */ void DFT_ref (double *d1, double *d2, double *s1, double *costable, double *sintable, int shift) { int n = 1<>1; int i; double x,y; for(i=0;i #include #include #include #include #include #include #include #include #include "common.h" void ref_frame_downsample (SchroFrame *dest, SchroFrame *src); void frame_create_test_pattern(SchroFrame *frame, int type); int failed = FALSE; void test (int width, int height) { SchroFrame *frame; SchroFrame *frame_ref; SchroFrame *frame_test; char name[TEST_PATTERN_NAME_SIZE]; int i; printf("size %dx%d\n", width, height); frame = schro_frame_new_and_alloc (NULL, SCHRO_FRAME_FORMAT_U8_420, width, height); frame_ref = schro_frame_new_and_alloc (NULL, SCHRO_FRAME_FORMAT_U8_420, ROUND_UP_SHIFT(width, 1), ROUND_UP_SHIFT(height, 1)); frame_test = schro_frame_new_and_alloc (NULL, SCHRO_FRAME_FORMAT_U8_420, ROUND_UP_SHIFT(width, 1), ROUND_UP_SHIFT(height, 1)); for(i=0;icomponents + 0, name, i); test_pattern_generate (frame->components + 1, name, i); test_pattern_generate (frame->components + 2, name, i); ref_frame_downsample (frame_ref, frame); schro_frame_downsample (frame_test, frame); if (frame_compare (frame_ref, frame_test)) { printf(" pattern %s: OK\n", name); } else { printf(" pattern %s: broken\n", name); frame_data_dump_full (frame_test->components + 0, frame_ref->components + 0, frame->components + 0); failed = TRUE; } } schro_frame_unref (frame_ref); schro_frame_unref (frame_test); schro_frame_unref (frame); } int main (int argc, char *argv[]) { int width; int height; schro_init(); for(width=10;width<40;width++){ for(height=10;height<40;height++){ test (width, height); } } if (failed) { printf("FAILED\n"); } else { printf("SUCCESS\n"); } return failed; } int component_get (SchroFrameData *src, int i, int j) { uint8_t *data; i = CLAMP(i,0,src->width-1); j = CLAMP(j,0,src->height-1); data = OFFSET(src->data, j*src->stride); return data[i]; } void ref_frame_component_downsample (SchroFrameData *dest, SchroFrameData *src) { static const int taps[4] = { 6, 26, 26, 6 }; int i,j; int k,l; uint8_t *ddata; for(j=0;jheight;j++){ ddata = OFFSET(dest->data, dest->stride * j); for(i=0;iwidth;i++){ int x = 0; for(l=0;l<4;l++){ int y = 0; for(k=0;k<4;k++){ y += component_get (src, (i*2-1) + l, (j*2-1) + k) * taps[k]; } x += CLAMP((y + 32) >> 6,0,255) * taps[l]; } ddata[i] = CLAMP((x + 32) >> 6,0,255); } } } void ref_frame_downsample (SchroFrame *dest, SchroFrame *src) { ref_frame_component_downsample (dest->components+0, src->components+0); ref_frame_component_downsample (dest->components+1, src->components+1); ref_frame_component_downsample (dest->components+2, src->components+2); } void frame_create_test_pattern(SchroFrame *frame, int type) { int j,k; uint8_t *data; for(k=0;k<3;k++){ for(j=0;jcomponents[k].height;j++){ data = OFFSET(frame->components[k].data,j*frame->components[k].stride); orc_random_bits (&context, data, frame->components[k].width); } } } schroedinger-1.0.11/testsuite/dirac/0000775000175000017500000000000011707140273014366 500000000000000schroedinger-1.0.11/testsuite/dirac/dirac_test_intra0000755000175000017500000000240111320234754017544 00000000000000#!/bin/sh dirac_srcdir=~/dirac/compress/encoder if [ ! -x $dirac_srcdir/dirac_encoder ] then echo Dirac encoder missing exit 1 fi if [ ! -x $dirac_srcdir/dirac_encoder ] then echo gst-launch missing exit 1 fi gst-inspect schrodec &>/dev/null || \ (echo GStreamer element schrodec missing;exit 1) gst-inspect pngenc &>/dev/null || \ (echo GStreamer element pngenc missing;exit 1) file=pr0n encode() { ${dirac_srcdir}/dirac_encoder -SD576 -qf 7 -num_L1 0 \ -cformat 2 \ -wlt_depth $2 -iwlt_filter $1 \ -verbose \ $file.yuv ${file}.drc || exit 1 test -f ${file}.drc || exit 1 gst-launch-0.10 \ filesrc location=${file}.drc ! \ schrodec ! \ ffmpegcolorspace ! \ pngenc ! \ filesink location=${file}-$1-$2.png || exit 1 } encode DD9_5 1 encode DD9_5 2 encode DD9_5 3 encode DD9_5 4 encode LEGALL5_3 1 encode LEGALL5_3 2 encode LEGALL5_3 3 encode LEGALL5_3 4 encode DD13_5 1 encode DD13_5 2 encode DD13_5 3 encode DD13_5 4 encode HAAR0 1 encode HAAR0 2 encode HAAR0 3 encode HAAR0 4 encode HAAR1 1 encode HAAR1 2 encode HAAR1 3 encode HAAR1 4 # not handled by Dirac yet #encode FIDELITY 1 #encode FIDELITY 2 #encode FIDELITY 3 #encode FIDELITY 4 encode DAUB9_7 1 encode DAUB9_7 2 encode DAUB9_7 3 #encode DAUB9_7 4 schroedinger-1.0.11/testsuite/dirac/Makefile.am0000644000175000017500000000006210735025462016340 00000000000000 EXTRA_DIST = dirac_test_intra dirac_vts_streams schroedinger-1.0.11/testsuite/dirac/Makefile.in0000664000175000017500000002534511707140262016362 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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@ subdir = testsuite/dirac DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-auto-alt.m4 \ $(top_srcdir)/m4/as-compiler-flag.m4 \ $(top_srcdir)/m4/as-host-defines.m4 \ $(top_srcdir)/m4/as-version.m4 $(top_srcdir)/m4/gst-args.m4 \ $(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)/m4/pkg.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUDA_CFLAGS = @CUDA_CFLAGS@ CUDA_LIBS = @CUDA_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ GCOV = @GCOV@ GCOV_CFLAGS = @GCOV_CFLAGS@ GCOV_LIBS = @GCOV_LIBS@ GREP = @GREP@ GTHREAD_CFLAGS = @GTHREAD_CFLAGS@ GTHREAD_LIBS = @GTHREAD_LIBS@ GTKDOC_CHECK = @GTKDOC_CHECK@ 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@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ NVCC = @NVCC@ NVCCFLAGS = @NVCCFLAGS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENGL_CFLAGS = @OPENGL_CFLAGS@ OPENGL_LIBS = @OPENGL_LIBS@ ORCC = @ORCC@ ORC_CFLAGS = @ORC_CFLAGS@ ORC_LIBS = @ORC_LIBS@ 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@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SCHRO_CFLAGS = @SCHRO_CFLAGS@ SCHRO_LIBS = @SCHRO_LIBS@ SCHRO_LIBVERSION = @SCHRO_LIBVERSION@ SCHRO_MAJORMINOR = @SCHRO_MAJORMINOR@ SCHRO_PKG_DEPS = @SCHRO_PKG_DEPS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ THREAD_IMPL = @THREAD_IMPL@ VERSION = @VERSION@ 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_CXX = @ac_ct_CXX@ 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@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = dirac_test_intra dirac_vts_streams 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) --foreign testsuite/dirac/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign testsuite/dirac/Makefile .PRECIOUS: 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 tags: TAGS TAGS: ctags: CTAGS CTAGS: 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 \ 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 uninstall uninstall-am # 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: schroedinger-1.0.11/testsuite/dirac/dirac_vts_streams0000755000175000017500000000143110735025462017747 00000000000000#!/bin/sh dirac_srcdir=~/dirac/compress/encoder if [ ! -x $dirac_srcdir/dirac_encoder ] then echo Dirac encoder missing exit 1 fi width=352 height=240 format=I420 filter=DD9_5 depth=3 file=output testname=1 gst-launch-0.10 \ videotestsrc num-buffers=300 ! \ video/x-raw-yuv,format=\(fourcc\)"$format",width=$width,height=$height,framerate=30/1 ! \ timeoverlay ! \ cairotextoverlay text=$testname halign=left deltay=-100 ! \ filesink location=vts.yuv ${dirac_srcdir}/dirac_encoder -SD576 -qf 7 -num_L1 0 \ -fr 30/1 \ -width $width -height $height \ -cformat 2 \ -verbose \ vts.yuv vts.intra.drc || exit 1 ${dirac_srcdir}/dirac_encoder -SD576 -qf 7 \ -fr 30/1 \ -width $width -height $height \ -cformat 2 \ -verbose \ vts.yuv vts.default.drc || exit 1 schroedinger-1.0.11/testsuite/perf/0000775000175000017500000000000011707140273014240 500000000000000schroedinger-1.0.11/testsuite/perf/schroorc.orc0000644000175000017500000005156011541755167016526 00000000000000 .init schro_orc_init .function orc_add2_rshift_add_s16_22_op .dest 2 d1 int16_t .source 2 s1 int16_t .source 2 s2 int16_t .source 2 s3 int16_t .temp 2 t1 addw t1, s2, s3 addw t1, t1, 2 shrsw t1, t1, 2 addw d1, s1, t1 .function orc_add2_rshift_add_s16_22 .dest 2 d1 int16_t .source 2 s1 int16_t .source 2 s2 int16_t .temp 2 t1 addw t1, s1, s2 addw t1, t1, 2 shrsw t1, t1, 2 addw d1, d1, t1 .function orc_add2_rshift_sub_s16_22_op .dest 2 d1 int16_t .source 2 s1 int16_t .source 2 s2 int16_t .source 2 s3 int16_t .temp 2 t1 addw t1, s2, s3 addw t1, t1, 2 shrsw t1, t1, 2 subw d1, s1, t1 .function orc_add2_rshift_sub_s16_22 .dest 2 d1 int16_t .source 2 s1 int16_t .source 2 s2 int16_t .temp 2 t1 addw t1, s1, s2 addw t1, t1, 2 shrsw t1, t1, 2 subw d1, d1, t1 .function orc_add2_rshift_add_s16_11_op .dest 2 d1 int16_t .source 2 s1 int16_t .source 2 s2 int16_t .source 2 s3 int16_t .temp 2 t1 avgsw t1, s2, s3 addw d1, s1, t1 .function orc_add2_rshift_add_s16_11 .dest 2 d1 int16_t .source 2 s1 int16_t .source 2 s2 int16_t .temp 2 t1 avgsw t1, s1, s2 addw d1, d1, t1 .function orc_add2_rshift_sub_s16_11_op .dest 2 d1 int16_t .source 2 s1 int16_t .source 2 s2 int16_t .source 2 s3 int16_t .temp 2 t1 avgsw t1, s2, s3 subw d1, s1, t1 .function orc_add2_rshift_sub_s16_11 .dest 2 d1 int16_t .source 2 s1 int16_t .source 2 s2 int16_t .temp 2 t1 avgsw t1, s1, s2 subw d1, d1, t1 .function orc_add_const_rshift_s16_11 .dest 2 d1 int16_t .source 2 s1 int16_t .temp 2 t1 addw t1, s1, 1 shrsw d1, t1, 1 .function orc_add_const_rshift_s16 .dest 2 d1 int16_t .param 2 p1 .param 2 p2 .temp 2 t1 addw t1, d1, p1 shrsw d1, t1, p2 .function orc_add_s16 .dest 2 d1 int16_t .source 2 s1 int16_t .source 2 s2 int16_t addw d1, s1, s2 .function orc_add_s16_2d .flags 2d .dest 2 d1 int16_t .source 2 s1 int16_t addw d1, d1, s1 .function orc_addc_rshift_s16 .dest 2 d1 int16_t .source 2 s1 int16_t .source 2 s2 int16_t .temp 2 t1 .param 2 p1 addw t1, s1, s2 shrsw d1, t1, p1 .function orc_lshift1_s16 .dest 2 d1 int16_t .source 2 s1 int16_t shlw d1, s1, 1 .function orc_lshift2_s16 .dest 2 d1 int16_t .source 2 s1 int16_t shlw d1, s1, 2 .function orc_lshift_s16_ip .dest 2 d1 int16_t .param 2 p1 shlw d1, d1, p1 .function orc_mas2_add_s16_op .dest 2 d1 int16_t .source 2 s0 int16_t .source 2 s1 int16_t .source 2 s2 int16_t .temp 2 t1 .temp 4 t2 .param 2 p1 .param 4 p2 .param 4 p3 addw t1, s1, s2 mulswl t2, t1, p1 addl t2, t2, p2 shrsl t2, t2, p3 convlw t1, t2 addw d1, s0, t1 .function orc_mas2_add_s16_ip .dest 2 d1 int16_t .source 2 s1 int16_t .source 2 s2 int16_t .temp 2 t1 .temp 4 t2 .param 2 p1 .param 4 p2 .param 4 p3 addw t1, s1, s2 mulswl t2, t1, p1 addl t2, t2, p2 shrsl t2, t2, p3 convlw t1, t2 addw d1, d1, t1 .function orc_mas2_sub_s16_op .dest 2 d1 int16_t .source 2 s0 int16_t .source 2 s1 int16_t .source 2 s2 int16_t .temp 2 t1 .temp 4 t2 .param 2 p1 .param 4 p2 .param 4 p3 addw t1, s1, s2 mulswl t2, t1, p1 addl t2, t2, p2 shrsl t2, t2, p3 convlw t1, t2 subw d1, s0, t1 .function orc_mas2_sub_s16_ip .dest 2 d1 int16_t .source 2 s1 int16_t .source 2 s2 int16_t .temp 2 t1 .temp 4 t2 .param 2 p1 .param 4 p2 .param 4 p3 addw t1, s1, s2 mulswl t2, t1, p1 addl t2, t2, p2 shrsl t2, t2, p3 convlw t1, t2 subw d1, d1, t1 .function orc_mas4_across_add_s16_1991_op .dest 2 d1 int16_t .source 2 s0 int16_t .source 2 s1 int16_t .source 2 s2 int16_t .source 2 s3 int16_t .source 2 s4 int16_t .param 4 p1 .param 4 p2 .temp 2 t1 .temp 2 t2 .temp 4 t3 .temp 4 t4 addw t1, s2, s3 mulswl t3, t1, 9 addw t2, s1, s4 convswl t4, t2 subl t3, t3, t4 addl t3, t3, p1 shrsl t3, t3, p2 convlw t1, t3 addw d1, s0, t1 .function orc_mas4_across_add_s16_1991_ip .dest 2 d1 int16_t .source 2 s1 int16_t .param 4 p1 .param 4 p2 .temp 2 t1 .temp 2 t2 .temp 4 t3 .temp 4 t4 loadoffw t1, s1, 1 loadoffw t2, s1, 2 addw t1, t1, t2 mulswl t3, t1, 9 loadw t1, s1 loadoffw t2, s1, 3 addw t2, t1, t2 convswl t4, t2 subl t3, t3, t4 addl t3, t3, p1 shrsl t3, t3, p2 convlw t1, t3 addw d1, d1, t1 .function orc_mas4_across_sub_s16_1991_op .dest 2 d1 int16_t .source 2 s0 int16_t .source 2 s1 int16_t .source 2 s2 int16_t .source 2 s3 int16_t .source 2 s4 int16_t .param 4 p1 .param 4 p2 .temp 2 t1 .temp 2 t2 .temp 4 t3 .temp 4 t4 addw t1, s2, s3 mulswl t3, t1, 9 addw t2, s1, s4 convswl t4, t2 subl t3, t3, t4 addl t3, t3, p1 shrsl t3, t3, p2 convlw t1, t3 subw d1, s0, t1 .function orc_mas4_across_sub_s16_1991_ip .dest 2 d1 int16_t .source 2 s1 int16_t .param 4 p1 .param 4 p2 .temp 2 t1 .temp 2 t2 .temp 4 t3 .temp 4 t4 loadoffw t1, s1, 1 loadoffw t2, s1, 2 addw t1, t1, t2 mulswl t3, t1, 9 loadw t1, s1 loadoffw t2, s1, 3 addw t2, t1, t2 convswl t4, t2 subl t3, t3, t4 addl t3, t3, p1 shrsl t3, t3, p2 convlw t1, t3 subw d1, d1, t1 .function orc_subtract_s16 .dest 2 d1 int16_t .source 2 s1 int16_t .source 2 s2 int16_t subw d1, s1, s2 .function orc_add_s16_u8 .dest 2 d1 int16_t .source 2 s1 int16_t .source 1 s2 .temp 2 t1 convubw t1, s2 addw d1, t1, s1 .function orc_add_s16_u8_2d .flags 2d .dest 2 d1 int16_t .source 1 s1 .temp 2 t1 convubw t1, s1 addw d1, d1, t1 .function orc_convert_s16_u8 .dest 2 d1 .source 1 s1 convubw d1, s1 .function orc_convert_u8_s16 .dest 1 d1 .source 2 s1 int16_t convsuswb d1, s1 .function orc_offsetconvert_u8_s16 .dest 1 d1 .source 2 s1 int16_t .temp 2 t1 addw t1, s1, 128 convsuswb d1, t1 .function orc_offsetconvert_s16_u8 .dest 2 d1 int16_t .source 1 s1 .temp 2 t1 convubw t1, s1 subw d1, t1, 128 .function orc_subtract_s16_u8 .dest 2 d1 int16_t .source 2 s1 int16_t .source 1 s2 .temp 2 t1 convubw t1, s2 subw d1, s1, t1 .function orc_multiply_and_add_s16_u8 .dest 2 d1 int16_t .source 2 s1 int16_t .source 1 s2 .temp 2 t1 convubw t1, s2 mullw t1, t1, s1 addw d1, d1, t1 .function orc_splat_s16_ns .dest 2 d1 int16_t .param 2 p1 copyw d1, p1 .function orc_splat_s16_2d_4xn .n 4 .flags 2d .dest 2 d1 int16_t .param 2 p1 copyw d1, p1 .function orc_splat_s16_2d_8xn .n 8 .flags 2d .dest 2 d1 int16_t .param 2 p1 copyw d1, p1 .function orc_splat_s16_2d .flags 2d .dest 2 d1 int16_t .param 2 p1 copyw d1, p1 .function orc_splat_u8_ns .dest 1 d1 .param 1 p1 copyb d1, p1 .function orc_splat_u8_2d .flags 2d .dest 1 d1 .param 1 p1 copyb d1, p1 .function orc_average_u8 .dest 1 d1 .source 1 s1 .source 1 s2 avgub d1, s1, s2 .function orc_rrshift6_add_s16_2d .flags 2d .dest 1 d1 uint8_t .source 2 s1 int16_t .source 2 s2 int16_t .temp 2 t1 addw t1, s2, 32 shrsw t1, t1, 6 addw t1, s1, t1 convsuswb d1, t1 .function orc_rrshift6_sub_s16_2d .flags 2d .dest 2 d1 int16_t .dest 2 d2 int16_t .temp 2 t1 subw t1, d2, 8160 shrsw t1, t1, 6 copyw d2, t1 subw d1, d1, t1 .function orc_rrshift6_s16_ip_2d .flags 2d .dest 2 d1 int16_t .temp 2 t1 subw t1, d1, 8160 shrsw d1, t1, 6 .function orc_rrshift6_s16_ip .dest 2 d1 int16_t .temp 2 t1 subw t1, d1, 8160 shrsw d1, t1, 6 .function orc_unpack_yuyv_y .dest 1 d1 .source 2 s1 select0wb d1, s1 .function orc_unpack_yuyv_u .dest 1 d1 .source 4 s1 .temp 2 t1 select0lw t1, s1 select1wb d1, t1 .function orc_unpack_yuyv_v .dest 1 d1 .source 4 s1 .temp 2 t1 select1lw t1, s1 select1wb d1, t1 .function orc_packyuyv .dest 4 d1 .source 2 s1 uint8_t .source 1 s2 .source 1 s3 .temp 1 t1 .temp 1 t2 .temp 2 t3 .temp 2 t4 .temp 2 t5 copyw t5, s1 select0wb t1, t5 select1wb t2, t5 mergebw t3, t1, s2 mergebw t4, t2, s3 mergewl d1, t3, t4 .function orc_unpack_uyvy_y .dest 1 d1 .source 2 s1 select1wb d1, s1 .function orc_unpack_uyvy_u .dest 1 d1 .source 4 s1 .temp 2 t1 select0lw t1, s1 select0wb d1, t1 .function orc_unpack_uyvy_v .dest 1 d1 .source 4 s1 .temp 2 t1 select1lw t1, s1 select0wb d1, t1 .function orc_interleave2_s16 .dest 4 d1 int16_t .source 2 s1 int16_t .source 2 s2 int16_t mergewl d1, s1, s2 .function orc_interleave2_rrshift1_s16 .dest 4 d1 int16_t .source 2 s1 int16_t .source 2 s2 int16_t .temp 2 t1 .temp 2 t2 addw t1, s1, 1 shrsw t1, t1, 1 addw t2, s2, 1 shrsw t2, t2, 1 mergewl d1, t1, t2 .function orc_deinterleave2_s16 .dest 2 d1 int16_t .dest 2 d2 int16_t .source 4 s1 int16_t .temp 4 t1 copyl t1, s1 select0lw d1, t1 select1lw d2, t1 .function orc_deinterleave2_lshift1_s16 .dest 2 d1 int16_t .dest 2 d2 int16_t .source 4 s1 int16_t .temp 4 t1 .temp 2 t2 .temp 2 t3 copyl t1, s1 select0lw t2, t1 shlw d1, t2, 1 select1lw t3, t1 shlw d2, t3, 1 .function orc_haar_deint_lshift1_split_s16 .dest 2 d1 int16_t .dest 2 d2 int16_t .source 4 s1 int16_t .temp 2 t1 .temp 2 t2 .temp 4 t3 copyl t3, s1 select0lw t1, t3 select1lw t2, t3 shlw t1, t1, 1 shlw t2, t2, 1 subw t2, t2, t1 copyw d2, t2 avgsw t2, t2, 0 addw d1, t1, t2 .function orc_haar_deint_split_s16 .dest 2 d1 int16_t .dest 2 d2 int16_t .source 4 s1 int16_t .temp 2 t1 .temp 2 t2 .temp 4 t3 copyl t3, s1 select0lw t1, t3 select1lw t2, t3 subw t2, t2, t1 copyw d2, t2 avgsw t2, t2, 0 addw d1, t1, t2 .function orc_haar_split_s16_lo .dest 2 d1 int16_t .source 2 s1 int16_t .source 2 s2 int16_t .temp 2 t1 .temp 2 t2 copyw t1, s1 subw t2, s2, t1 avgsw t2, t2, 0 addw d1, t1, t2 .function orc_haar_split_s16_hi .dest 2 d1 int16_t .source 2 s1 int16_t .source 2 s2 int16_t subw d1, s2, s1 .function orc_haar_split_s16_op .dest 2 d1 int16_t .dest 2 d2 int16_t .source 2 s1 int16_t .source 2 s2 int16_t .temp 2 t1 .temp 2 t2 copyw t1, s1 subw t2, s2, t1 copyw d2, t2 avgsw t2, t2, 0 addw d1, t1, t2 .function orc_haar_split_s16 .dest 2 d1 int16_t .dest 2 d2 int16_t .temp 2 t1 .temp 2 t2 copyw t1, d1 copyw t2, d2 subw t2, t2, t1 copyw d2, t2 avgsw t2, t2, 0 addw d1, t1, t2 .function orc_haar_synth_s16_lo .dest 2 d1 int16_t .source 2 s1 int16_t .source 2 s2 int16_t .temp 2 t1 avgsw t1, s2, 0 subw d1, s1, t1 .function orc_haar_synth_s16_hi .dest 2 d1 int16_t .source 2 s1 int16_t .source 2 s2 int16_t .temp 2 t1 .temp 2 t2 .temp 2 t3 copyw t2, s2 avgsw t3, t2, 0 subw t1, s1, t3 addw d1, t2, t1 .function orc_haar_synth_s16_op .dest 2 d1 int16_t .dest 2 d2 int16_t .source 2 s1 int16_t .source 2 s2 int16_t .temp 2 t1 .temp 2 t2 .temp 2 t3 copyw t2, s2 avgsw t3, t2, 0 subw t1, s1, t3 copyw d1, t1 addw d2, t2, t1 .function orc_haar_synth_s16 .dest 2 d1 int16_t .dest 2 d2 int16_t .temp 2 t1 .temp 2 t2 .temp 2 t3 copyw t1, d1 copyw t2, d2 avgsw t3, t2, 0 subw t1, t1, t3 copyw d1, t1 addw d2, t2, t1 .function orc_haar_synth_rrshift1_int_s16 .dest 4 d1 int16_t .source 2 s1 int16_t .source 2 s2 int16_t .temp 2 t1 .temp 2 t2 copyw t2, s2 avgsw t1, t2, 0 subw t1, s1, t1 addw t2, t2, t1 avgsw t1, t1, 0 avgsw t2, t2, 0 mergewl d1, t1, t2 .function orc_haar_synth_int_s16 .dest 4 d1 int16_t .source 2 s1 int16_t .source 2 s2 int16_t .temp 2 t1 .temp 2 t2 copyw t2, s2 avgsw t1, t2, 0 subw t1, s1, t1 addw t2, t2, t1 mergewl d1, t1, t2 .function orc_haar_sub_s16 .dest 2 d1 int16_t .source 2 s1 int16_t subw d1, d1, s1 .function orc_haar_add_half_s16 .dest 2 d1 int16_t .source 2 s1 int16_t .temp 2 t1 avgsw t1, s1, 0 addw d1, d1, t1 .function orc_haar_add_s16 .dest 2 d1 int16_t .source 2 s1 int16_t addw d1, d1, s1 .function orc_haar_sub_half_s16 .dest 2 d1 int16_t .source 2 s1 int16_t .temp 2 t1 avgsw t1, s1, 0 subw d1, d1, t1 .function orc_sum_u8 .accumulator 4 a1 int32_t .source 1 s1 .temp 2 t1 .temp 4 t2 convubw t1, s1 convuwl t2, t1 accl a1, t2 .function orc_sum_s16 .accumulator 4 a1 int32_t .source 2 s1 int16_t .temp 4 t1 convswl t1, s1 accl a1, t1 .function orc_sum_square_diff_u8 .accumulator 4 a1 int32_t .source 1 s1 .source 1 s2 .temp 2 t1 .temp 2 t2 .temp 4 t3 convubw t1, s1 convubw t2, s2 subw t1, t1, t2 mullw t1, t1, t1 convuwl t3, t1 accl a1, t3 .function orc_dequantise_s16_2d_4xn .n 4 .flags 2d .dest 2 d1 int16_t .source 2 s1 int16_t .param 2 p1 .param 2 p2 .temp 2 t1 .temp 2 t2 copyw t1, s1 signw t2, t1 absw t1, t1 mullw t1, t1, p1 addw t1, t1, p2 shrsw t1, t1, 2 mullw d1, t1, t2 .function orc_dequantise_s16_2d_8xn .n 8 .flags 2d .dest 2 d1 int16_t .source 2 s1 int16_t .param 2 p1 .param 2 p2 .temp 2 t1 .temp 2 t2 copyw t1, s1 signw t2, t1 absw t1, t1 mullw t1, t1, p1 addw t1, t1, p2 shrsw t1, t1, 2 mullw d1, t1, t2 .function orc_dequantise_s16_ip_2d_8xn .n 8 .flags 2d .dest 2 d1 int16_t .param 2 p1 .param 2 p2 .temp 2 t1 .temp 2 t2 copyw t1, d1 signw t2, t1 absw t1, t1 mullw t1, t1, p1 addw t1, t1, p2 shrsw t1, t1, 2 mullw d1, t1, t2 .function orc_dequantise_s16_ip_2d .flags 2d .dest 2 d1 int16_t .param 2 p1 .param 2 p2 .temp 2 t1 .temp 2 t2 copyw t1, d1 signw t2, t1 absw t1, t1 mullw t1, t1, p1 addw t1, t1, p2 shrsw t1, t1, 2 mullw d1, t1, t2 .function orc_dequantise_s16_ip .dest 2 d1 int16_t .param 2 p1 .param 2 p2 .temp 2 t1 .temp 2 t2 copyw t1, d1 signw t2, t1 absw t1, t1 mullw t1, t1, p1 addw t1, t1, p2 shrsw t1, t1, 2 mullw d1, t1, t2 .function orc_dequantise_s16 .dest 2 d1 int16_t .source 2 s1 int16_t .param 2 p1 .param 2 p2 .temp 2 t1 .temp 2 t2 copyw t1, s1 signw t2, t1 absw t1, t1 mullw t1, t1, p1 addw t1, t1, p2 shrsw t1, t1, 2 mullw d1, t1, t2 .function orc_dequantise_var_s16_ip .dest 2 d1 int16_t .source 2 s1 int16_t .source 2 s2 int16_t .temp 2 t1 .temp 2 t2 copyw t1, d1 signw t2, t1 absw t1, t1 mullw t1, t1, s1 addw t1, t1, s2 shrsw t1, t1, 2 mullw d1, t1, t2 # only works for values between -16384 and 16384 .function orc_quantise1_s16 .dest 2 d1 int16_t .source 2 s1 int16_t .param 2 p1 .param 2 p2 .param 2 p3 .temp 2 t1 .temp 2 t2 copyw t1, s1 signw t2, t1 absw t1, t1 shlw t1, t1, 2 subw t1, t1, p2 mulhuw t1, t1, p1 shruw t1, t1, p3 mullw d1, t1, t2 # only works for values between -16384 and 16384 .function orc_quantise2_s16 .dest 2 d1 int16_t .source 2 s1 int16_t .param 2 p1 .param 2 p2 .temp 2 t1 .temp 2 t2 copyw t1, s1 signw t2, t1 absw t1, t1 shlw t1, t1, 2 subw t1, t1, p2 shruw t1, t1, p1 mullw d1, t1, t2 # only works for values between -16384 and 16384 .function orc_quantdequant1_s16 .dest 2 d1 int16_t .dest 2 d2 int16_t .param 2 p1 .param 2 p2 .param 2 p3 .param 2 p4 .param 2 p5 .temp 2 t1 .temp 2 t2 copyw t1, d2 signw t2, t1 absw t1, t1 shlw t1, t1, 2 subw t1, t1, p2 mulhuw t1, t1, p1 shruw t1, t1, p3 mullw t2, t1, t2 copyw d1, t2 signw t2, t2 mullw t1, t1, p4 addw t1, t1, p5 shrsw t1, t1, 2 mullw d2, t1, t2 # only works for values between -16384 and 16384 .function orc_quantdequant3_s16 .dest 2 d1 int16_t .dest 2 d2 int16_t .param 2 p1 .param 2 p2 .param 2 p3 .param 2 p4 .param 2 p5 .param 4 p6 .temp 2 t1 .temp 2 t2 .temp 4 t3 copyw t1, d2 signw t2, t1 absw t1, t1 shlw t1, t1, 2 subw t1, t1, p2 muluwl t3, t1, p1 addl t3, t3, p6 shrul t3, t3, p3 convlw t1, t3 mullw t2, t1, t2 copyw d1, t2 signw t2, t2 mullw t1, t1, p4 addw t1, t1, p5 shrsw t1, t1, 2 mullw d2, t1, t2 # only works for values between -16384 and 16384 .function orc_quantdequant2_s16 .dest 2 d1 int16_t .dest 2 d2 int16_t .param 2 p1 .param 2 p2 .param 2 p4 .param 2 p5 .temp 2 t1 .temp 2 t2 copyw t1, d2 signw t2, t1 absw t1, t1 shlw t1, t1, 2 subw t1, t1, p2 shruw t1, t1, p1 mullw t2, t1, t2 copyw d1, t2 signw t2, t2 mullw t1, t1, p4 addw t1, t1, p5 shrsw t1, t1, 2 mullw d2, t1, t2 .function orc_downsample_vert_u8 .dest 1 d1 .source 1 s1 .source 1 s2 .source 1 s3 .source 1 s4 .temp 2 t1 .temp 2 t2 .temp 2 t3 convubw t1, s1 convubw t2, s4 addw t1, t1, t2 mullw t1, t1, 6 convubw t2, s2 convubw t3, s3 addw t2, t2, t3 mullw t2, t2, 26 addw t2, t2, t1 addw t2, t2, 32 shruw t2, t2, 6 convwb d1, t2 .function orc_downsample_horiz_u8 .dest 1 d1 .source 2 s1 uint8_t .source 2 s2 uint8_t .temp 2 t1 .temp 2 t2 .temp 1 t3 .temp 2 t4 .temp 2 t5 .temp 2 t6 copyw t1, s1 copyw t2, s2 select0wb t3, t1 convubw t4, t3 select1wb t3, t2 convubw t5, t3 addw t4, t4, t5 mullw t4, t4, 6 select1wb t3, t1 convubw t5, t3 select0wb t3, t2 convubw t6, t3 addw t5, t5, t6 mullw t5, t5, 26 addw t4, t4, t5 addw t4, t4, 32 shruw t4, t4, 6 convwb d1, t4 .function orc_stats_moment_s16 .source 2 s1 int16_t .accumulator 4 a1 int32_t .temp 2 t1 .temp 4 t2 absw t1, s1 subw t1, t1, 2 maxsw t1, t1, 0 convuwl t2, t1 accl a1, t2 .function orc_stats_above_s16 .source 2 s1 int16_t .accumulator 4 a1 int32_t .temp 2 t1 .temp 4 t2 absw t1, s1 subw t1, t1, 1 maxsw t1, t1, 0 minsw t1, t1, 1 convuwl t2, t1 accl a1, t2 .function orc_accw .accumulator 2 a1 int .source 2 s1 int16_t .temp 2 t1 absw t1, s1 accw a1, t1 .function orc_avg2_8xn_u8 .flags 2d .n 8 .dest 1 d1 uint8_t .source 1 s1 uint8_t .source 1 s2 uint8_t avgub d1, s1, s2 .function orc_avg2_12xn_u8 .flags 2d .n 12 .dest 1 d1 uint8_t .source 1 s1 uint8_t .source 1 s2 uint8_t avgub d1, s1, s2 .function orc_avg2_16xn_u8 .flags 2d .n 16 .dest 1 d1 uint8_t .source 1 s1 uint8_t .source 1 s2 uint8_t avgub d1, s1, s2 .function orc_avg2_32xn_u8 .flags 2d .n 32 .dest 1 d1 uint8_t .source 1 s1 uint8_t .source 1 s2 uint8_t avgub d1, s1, s2 .function orc_avg2_nxm_u8 .flags 2d .dest 1 d1 uint8_t .source 1 s1 uint8_t .source 1 s2 uint8_t avgub d1, s1, s2 .function orc_combine4_8xn_u8 .flags 2d .n 8 .dest 1 d1 uint8_t .source 1 s1 uint8_t .source 1 s2 uint8_t .source 1 s3 uint8_t .source 1 s4 uint8_t .param 2 p1 .param 2 p2 .param 2 p3 .param 2 p4 .temp 2 t1 .temp 2 t2 convubw t1, s1 mullw t2, t1, p1 convubw t1, s2 mullw t1, t1, p2 addw t2, t2, t1 convubw t1, s3 mullw t1, t1, p3 addw t2, t2, t1 convubw t1, s4 mullw t1, t1, p4 addw t2, t2, t1 addw t2, t2, 8 convsuswb d1, t2 .function orc_combine4_12xn_u8 .flags 2d .n 12 .dest 1 d1 uint8_t .source 1 s1 uint8_t .source 1 s2 uint8_t .source 1 s3 uint8_t .source 1 s4 uint8_t .param 2 p1 .param 2 p2 .param 2 p3 .param 2 p4 .temp 2 t1 .temp 2 t2 convubw t1, s1 mullw t2, t1, p1 convubw t1, s2 mullw t1, t1, p2 addw t2, t2, t1 convubw t1, s3 mullw t1, t1, p3 addw t2, t2, t1 convubw t1, s4 mullw t1, t1, p4 addw t2, t2, t1 addw t2, t2, 8 convsuswb d1, t2 .function orc_combine4_16xn_u8 .flags 2d .n 16 .dest 1 d1 uint8_t .source 1 s1 uint8_t .source 1 s2 uint8_t .source 1 s3 uint8_t .source 1 s4 uint8_t .param 2 p1 .param 2 p2 .param 2 p3 .param 2 p4 .temp 2 t1 .temp 2 t2 convubw t1, s1 mullw t2, t1, p1 convubw t1, s2 mullw t1, t1, p2 addw t2, t2, t1 convubw t1, s3 mullw t1, t1, p3 addw t2, t2, t1 convubw t1, s4 mullw t1, t1, p4 addw t2, t2, t1 addw t2, t2, 8 convsuswb d1, t2 .function orc_combine4_24xn_u8 .flags 2d .n 24 .dest 1 d1 uint8_t .source 1 s1 uint8_t .source 1 s2 uint8_t .source 1 s3 uint8_t .source 1 s4 uint8_t .param 2 p1 .param 2 p2 .param 2 p3 .param 2 p4 .temp 2 t1 .temp 2 t2 convubw t1, s1 mullw t2, t1, p1 convubw t1, s2 mullw t1, t1, p2 addw t2, t2, t1 convubw t1, s3 mullw t1, t1, p3 addw t2, t2, t1 convubw t1, s4 mullw t1, t1, p4 addw t2, t2, t1 addw t2, t2, 8 convsuswb d1, t2 .function orc_combine4_32xn_u8 .flags 2d .n 32 .dest 1 d1 uint8_t .source 1 s1 uint8_t .source 1 s2 uint8_t .source 1 s3 uint8_t .source 1 s4 uint8_t .param 2 p1 .param 2 p2 .param 2 p3 .param 2 p4 .temp 2 t1 .temp 2 t2 convubw t1, s1 mullw t2, t1, p1 convubw t1, s2 mullw t1, t1, p2 addw t2, t2, t1 convubw t1, s3 mullw t1, t1, p3 addw t2, t2, t1 convubw t1, s4 mullw t1, t1, p4 addw t2, t2, t1 addw t2, t2, 8 convsuswb d1, t2 .function orc_combine4_nxm_u8 .flags 2d .dest 1 d1 uint8_t .source 1 s1 uint8_t .source 1 s2 uint8_t .source 1 s3 uint8_t .source 1 s4 uint8_t .param 2 p1 .param 2 p2 .param 2 p3 .param 2 p4 .temp 2 t1 .temp 2 t2 convubw t1, s1 mullw t2, t1, p1 convubw t1, s2 mullw t1, t1, p2 addw t2, t2, t1 convubw t1, s3 mullw t1, t1, p3 addw t2, t2, t1 convubw t1, s4 mullw t1, t1, p4 addw t2, t2, t1 addw t2, t2, 8 shrsw t2, t2, 4 convsuswb d1, t2 .function orc_combine2_8xn_u8 .flags 2d .n 8 .dest 1 d1 uint8_t .source 1 s1 uint8_t .source 1 s2 uint8_t .param 2 p1 .param 2 p2 .param 2 p3 .param 2 p4 .temp 2 t1 .temp 2 t2 convubw t1, s1 convubw t2, s2 mullw t1, t1, p1 mullw t2, t2, p2 addw t1, t1, t2 addw t1, t1, p3 shrsw t1, t1, p4 convsuswb d1, t1 .function orc_combine2_12xn_u8 .flags 2d .n 12 .dest 1 d1 uint8_t .source 1 s1 uint8_t .source 1 s2 uint8_t .param 2 p1 .param 2 p2 .param 2 p3 .param 2 p4 .temp 2 t1 .temp 2 t2 convubw t1, s1 convubw t2, s2 mullw t1, t1, p1 mullw t2, t2, p2 addw t1, t1, t2 addw t1, t1, p3 shrsw t1, t1, p4 convsuswb d1, t1 .function orc_combine2_16xn_u8 .flags 2d .n 16 .dest 1 d1 uint8_t .source 1 s1 uint8_t .source 1 s2 uint8_t .param 2 p1 .param 2 p2 .param 2 p3 .param 2 p4 .temp 2 t1 .temp 2 t2 convubw t1, s1 convubw t2, s2 mullw t1, t1, p1 mullw t2, t2, p2 addw t1, t1, t2 addw t1, t1, p3 shrsw t1, t1, p4 convsuswb d1, t1 .function orc_combine2_nxm_u8 .flags 2d .dest 1 d1 uint8_t .source 1 s1 uint8_t .source 1 s2 uint8_t .param 2 p1 .param 2 p2 .param 2 p3 .param 2 p4 .temp 2 t1 .temp 2 t2 convubw t1, s1 convubw t2, s2 mullw t1, t1, p1 mullw t2, t2, p2 addw t1, t1, t2 addw t1, t1, p3 shrsw t1, t1, p4 convsuswb d1, t1 .function orc_sad_nxm_u8 .flags 2d .accumulator 4 a1 uint32_t .source 1 s1 uint8_t .source 1 s2 uint8_t accsadubl a1, s1, s2 .function orc_sad_8x8_u8 .flags 2d .n 8 .m 8 .accumulator 4 a1 uint32_t .source 1 s1 uint8_t .source 1 s2 uint8_t accsadubl a1, s1, s2 .function orc_sad_12x12_u8 .flags 2d .n 12 .m 12 .accumulator 4 a1 uint32_t .source 1 s1 uint8_t .source 1 s2 uint8_t accsadubl a1, s1, s2 .function orc_sad_16xn_u8 .flags 2d .n 16 .accumulator 4 a1 uint32_t .source 1 s1 uint8_t .source 1 s2 uint8_t accsadubl a1, s1, s2 .function orc_sad_32xn_u8 .flags 2d .n 32 .accumulator 4 a1 uint32_t .source 1 s1 uint8_t .source 1 s2 uint8_t accsadubl a1, s1, s2 schroedinger-1.0.11/testsuite/perf/schroorc-dist.h0000644000175000017500000017571211562334775017142 00000000000000 /* autogenerated from schroorc.orc */ #ifndef _SCHROORC_H_ #define _SCHROORC_H_ #ifdef __cplusplus extern "C" { #endif void schro_orc_init (void); #include extern OrcCode *_orc_code_orc_add2_rshift_add_s16_22_op; static inline void orc_add2_rshift_add_s16_22_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add2_rshift_add_s16_22_op; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_add2_rshift_add_s16_22; static inline void orc_add2_rshift_add_s16_22 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add2_rshift_add_s16_22; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_add2_rshift_sub_s16_22_op; static inline void orc_add2_rshift_sub_s16_22_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add2_rshift_sub_s16_22_op; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_add2_rshift_sub_s16_22; static inline void orc_add2_rshift_sub_s16_22 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add2_rshift_sub_s16_22; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_add2_rshift_add_s16_11_op; static inline void orc_add2_rshift_add_s16_11_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add2_rshift_add_s16_11_op; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_add2_rshift_add_s16_11; static inline void orc_add2_rshift_add_s16_11 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add2_rshift_add_s16_11; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_add2_rshift_sub_s16_11_op; static inline void orc_add2_rshift_sub_s16_11_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add2_rshift_sub_s16_11_op; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_add2_rshift_sub_s16_11; static inline void orc_add2_rshift_sub_s16_11 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add2_rshift_sub_s16_11; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_add_const_rshift_s16_11; static inline void orc_add_const_rshift_s16_11 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add_const_rshift_s16_11; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_add_const_rshift_s16; static inline void orc_add_const_rshift_s16 (orc_int16 * ORC_RESTRICT d1, int p1, int p2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add_const_rshift_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_add_s16; static inline void orc_add_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_add_s16_2d; static inline void orc_add_s16_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, const orc_int16 * ORC_RESTRICT s1, int s1_stride, int n, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add_s16_2d; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_addc_rshift_s16; static inline void orc_addc_rshift_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int p1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_addc_rshift_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_P1] = p1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_lshift1_s16; static inline void orc_lshift1_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_lshift1_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_lshift2_s16; static inline void orc_lshift2_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_lshift2_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_lshift_s16_ip; static inline void orc_lshift_s16_ip (orc_int16 * ORC_RESTRICT d1, int p1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_lshift_s16_ip; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_P1] = p1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_mas2_add_s16_op; static inline void orc_mas2_add_s16_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, int p1, int p2, int p3, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_mas2_add_s16_op; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_mas2_add_s16_ip; static inline void orc_mas2_add_s16_ip (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int p1, int p2, int p3, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_mas2_add_s16_ip; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_mas2_sub_s16_op; static inline void orc_mas2_sub_s16_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, int p1, int p2, int p3, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_mas2_sub_s16_op; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_mas2_sub_s16_ip; static inline void orc_mas2_sub_s16_ip (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int p1, int p2, int p3, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_mas2_sub_s16_ip; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_mas4_across_add_s16_1991_op; static inline void orc_mas4_across_add_s16_1991_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, const orc_int16 * ORC_RESTRICT s4, const orc_int16 * ORC_RESTRICT s5, int p1, int p2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_mas4_across_add_s16_1991_op; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->arrays[ORC_VAR_S4] = (void *)s4; ex->arrays[ORC_VAR_S5] = (void *)s5; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_mas4_across_add_s16_1991_ip; static inline void orc_mas4_across_add_s16_1991_ip (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int p1, int p2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_mas4_across_add_s16_1991_ip; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_mas4_across_sub_s16_1991_op; static inline void orc_mas4_across_sub_s16_1991_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, const orc_int16 * ORC_RESTRICT s4, const orc_int16 * ORC_RESTRICT s5, int p1, int p2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_mas4_across_sub_s16_1991_op; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->arrays[ORC_VAR_S4] = (void *)s4; ex->arrays[ORC_VAR_S5] = (void *)s5; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_mas4_across_sub_s16_1991_ip; static inline void orc_mas4_across_sub_s16_1991_ip (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int p1, int p2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_mas4_across_sub_s16_1991_ip; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_subtract_s16; static inline void orc_subtract_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_subtract_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_add_s16_u8; static inline void orc_add_s16_u8 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add_s16_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_add_s16_u8_2d; static inline void orc_add_s16_u8_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, int n, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add_s16_u8_2d; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_convert_s16_u8; static inline void orc_convert_s16_u8 (orc_uint16 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_convert_s16_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_convert_u8_s16; static inline void orc_convert_u8_s16 (orc_uint8 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_convert_u8_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_offsetconvert_u8_s16; static inline void orc_offsetconvert_u8_s16 (orc_uint8 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_offsetconvert_u8_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_offsetconvert_s16_u8; static inline void orc_offsetconvert_s16_u8 (orc_int16 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_offsetconvert_s16_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_subtract_s16_u8; static inline void orc_subtract_s16_u8 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_subtract_s16_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_multiply_and_add_s16_u8; static inline void orc_multiply_and_add_s16_u8 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_multiply_and_add_s16_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_splat_s16_ns; static inline void orc_splat_s16_ns (orc_int16 * ORC_RESTRICT d1, int p1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_splat_s16_ns; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_P1] = p1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_splat_s16_2d_4xn; static inline void orc_splat_s16_2d_4xn (orc_int16 * ORC_RESTRICT d1, int d1_stride, int p1, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_splat_s16_2d_4xn; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 4; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->params[ORC_VAR_P1] = p1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_splat_s16_2d_8xn; static inline void orc_splat_s16_2d_8xn (orc_int16 * ORC_RESTRICT d1, int d1_stride, int p1, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_splat_s16_2d_8xn; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 8; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->params[ORC_VAR_P1] = p1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_splat_s16_2d; static inline void orc_splat_s16_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, int p1, int n, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_splat_s16_2d; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->params[ORC_VAR_P1] = p1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_splat_u8_ns; static inline void orc_splat_u8_ns (orc_uint8 * ORC_RESTRICT d1, int p1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_splat_u8_ns; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_P1] = p1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_splat_u8_2d; static inline void orc_splat_u8_2d (orc_uint8 * ORC_RESTRICT d1, int d1_stride, int p1, int n, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_splat_u8_2d; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->params[ORC_VAR_P1] = p1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_average_u8; static inline void orc_average_u8 (orc_uint8 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_average_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_rrshift6_add_s16_2d; static inline void orc_rrshift6_add_s16_2d (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_int16 * ORC_RESTRICT s1, int s1_stride, const orc_int16 * ORC_RESTRICT s2, int s2_stride, int n, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_rrshift6_add_s16_2d; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_rrshift6_sub_s16_2d; static inline void orc_rrshift6_sub_s16_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, orc_int16 * ORC_RESTRICT d2, int d2_stride, int n, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_rrshift6_sub_s16_2d; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_D2] = d2; ex->params[ORC_VAR_D2] = d2_stride; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_rrshift6_s16_ip_2d; static inline void orc_rrshift6_s16_ip_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, int n, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_rrshift6_s16_ip_2d; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_rrshift6_s16_ip; static inline void orc_rrshift6_s16_ip (orc_int16 * ORC_RESTRICT d1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_rrshift6_s16_ip; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_unpack_yuyv_y; static inline void orc_unpack_yuyv_y (orc_uint8 * ORC_RESTRICT d1, const orc_uint16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_unpack_yuyv_y; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_unpack_yuyv_u; static inline void orc_unpack_yuyv_u (orc_uint8 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_unpack_yuyv_u; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_unpack_yuyv_v; static inline void orc_unpack_yuyv_v (orc_uint8 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_unpack_yuyv_v; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_packyuyv; static inline void orc_packyuyv (orc_uint32 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, const orc_uint8 * ORC_RESTRICT s3, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_packyuyv; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_unpack_uyvy_y; static inline void orc_unpack_uyvy_y (orc_uint8 * ORC_RESTRICT d1, const orc_uint16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_unpack_uyvy_y; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_unpack_uyvy_u; static inline void orc_unpack_uyvy_u (orc_uint8 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_unpack_uyvy_u; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_unpack_uyvy_v; static inline void orc_unpack_uyvy_v (orc_uint8 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_unpack_uyvy_v; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_interleave2_s16; static inline void orc_interleave2_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_interleave2_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_interleave2_rrshift1_s16; static inline void orc_interleave2_rrshift1_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_interleave2_rrshift1_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_deinterleave2_s16; static inline void orc_deinterleave2_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_deinterleave2_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_deinterleave2_lshift1_s16; static inline void orc_deinterleave2_lshift1_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_deinterleave2_lshift1_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_haar_deint_lshift1_split_s16; static inline void orc_haar_deint_lshift1_split_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_deint_lshift1_split_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_haar_deint_split_s16; static inline void orc_haar_deint_split_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_deint_split_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_haar_split_s16_lo; static inline void orc_haar_split_s16_lo (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_split_s16_lo; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_haar_split_s16_hi; static inline void orc_haar_split_s16_hi (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_split_s16_hi; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_haar_split_s16_op; static inline void orc_haar_split_s16_op (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_split_s16_op; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_haar_split_s16; static inline void orc_haar_split_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_split_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_haar_synth_s16_lo; static inline void orc_haar_synth_s16_lo (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_synth_s16_lo; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_haar_synth_s16_hi; static inline void orc_haar_synth_s16_hi (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_synth_s16_hi; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_haar_synth_s16_op; static inline void orc_haar_synth_s16_op (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_synth_s16_op; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_haar_synth_s16; static inline void orc_haar_synth_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_synth_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_haar_synth_rrshift1_int_s16; static inline void orc_haar_synth_rrshift1_int_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_synth_rrshift1_int_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_haar_synth_int_s16; static inline void orc_haar_synth_int_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_synth_int_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_haar_sub_s16; static inline void orc_haar_sub_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_sub_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_haar_add_half_s16; static inline void orc_haar_add_half_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_add_half_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_haar_add_s16; static inline void orc_haar_add_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_add_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_haar_sub_half_s16; static inline void orc_haar_sub_half_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_sub_half_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_sum_u8; static inline void orc_sum_u8 (orc_int32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_sum_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); *a1 = orc_executor_get_accumulator (ex, ORC_VAR_A1); } extern OrcCode *_orc_code_orc_sum_s16; static inline void orc_sum_s16 (orc_int32 * ORC_RESTRICT a1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_sum_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); *a1 = orc_executor_get_accumulator (ex, ORC_VAR_A1); } extern OrcCode *_orc_code_orc_sum_square_diff_u8; static inline void orc_sum_square_diff_u8 (orc_int32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_sum_square_diff_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); *a1 = orc_executor_get_accumulator (ex, ORC_VAR_A1); } extern OrcCode *_orc_code_orc_dequantise_s16_2d_4xn; static inline void orc_dequantise_s16_2d_4xn (orc_int16 * ORC_RESTRICT d1, int d1_stride, const orc_int16 * ORC_RESTRICT s1, int s1_stride, int p1, int p2, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_dequantise_s16_2d_4xn; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 4; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_dequantise_s16_2d_8xn; static inline void orc_dequantise_s16_2d_8xn (orc_int16 * ORC_RESTRICT d1, int d1_stride, const orc_int16 * ORC_RESTRICT s1, int s1_stride, int p1, int p2, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_dequantise_s16_2d_8xn; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 8; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_dequantise_s16_ip_2d_8xn; static inline void orc_dequantise_s16_ip_2d_8xn (orc_int16 * ORC_RESTRICT d1, int d1_stride, int p1, int p2, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_dequantise_s16_ip_2d_8xn; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 8; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_dequantise_s16_ip_2d; static inline void orc_dequantise_s16_ip_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, int p1, int p2, int n, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_dequantise_s16_ip_2d; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_dequantise_s16_ip; static inline void orc_dequantise_s16_ip (orc_int16 * ORC_RESTRICT d1, int p1, int p2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_dequantise_s16_ip; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_dequantise_s16; static inline void orc_dequantise_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int p1, int p2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_dequantise_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_dequantise_var_s16_ip; static inline void orc_dequantise_var_s16_ip (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_dequantise_var_s16_ip; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_quantise1_s16; static inline void orc_quantise1_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int p1, int p2, int p3, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_quantise1_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_quantise2_s16; static inline void orc_quantise2_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int p1, int p2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_quantise2_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_quantdequant1_s16; static inline void orc_quantdequant1_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, int p1, int p2, int p3, int p4, int p5, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_quantdequant1_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; ex->params[ORC_VAR_P5] = p5; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_quantdequant3_s16; static inline void orc_quantdequant3_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, int p1, int p2, int p3, int p4, int p5, int p6, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_quantdequant3_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; ex->params[ORC_VAR_P5] = p5; ex->params[ORC_VAR_P6] = p6; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_quantdequant2_s16; static inline void orc_quantdequant2_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, int p1, int p2, int p3, int p4, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_quantdequant2_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_downsample_vert_u8; static inline void orc_downsample_vert_u8 (orc_uint8 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, const orc_uint8 * ORC_RESTRICT s3, const orc_uint8 * ORC_RESTRICT s4, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_downsample_vert_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->arrays[ORC_VAR_S4] = (void *)s4; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_downsample_horiz_u8; static inline void orc_downsample_horiz_u8 (orc_uint8 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_downsample_horiz_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_stats_moment_s16; static inline void orc_stats_moment_s16 (orc_int32 * ORC_RESTRICT a1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_stats_moment_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); *a1 = orc_executor_get_accumulator (ex, ORC_VAR_A1); } extern OrcCode *_orc_code_orc_stats_above_s16; static inline void orc_stats_above_s16 (orc_int32 * ORC_RESTRICT a1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_stats_above_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); *a1 = orc_executor_get_accumulator (ex, ORC_VAR_A1); } extern OrcCode *_orc_code_orc_accw; static inline void orc_accw (int * ORC_RESTRICT a1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_accw; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); *a1 = orc_executor_get_accumulator (ex, ORC_VAR_A1); } extern OrcCode *_orc_code_orc_avg2_8xn_u8; static inline void orc_avg2_8xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_avg2_8xn_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 8; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_avg2_12xn_u8; static inline void orc_avg2_12xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_avg2_12xn_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 12; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_avg2_16xn_u8; static inline void orc_avg2_16xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_avg2_16xn_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 16; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_avg2_32xn_u8; static inline void orc_avg2_32xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_avg2_32xn_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 32; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_avg2_nxm_u8; static inline void orc_avg2_nxm_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int n, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_avg2_nxm_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_combine4_8xn_u8; static inline void orc_combine4_8xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_combine4_8xn_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 8; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->params[ORC_VAR_S3] = s3_stride; ex->arrays[ORC_VAR_S4] = (void *)s4; ex->params[ORC_VAR_S4] = s4_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_combine4_12xn_u8; static inline void orc_combine4_12xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_combine4_12xn_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 12; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->params[ORC_VAR_S3] = s3_stride; ex->arrays[ORC_VAR_S4] = (void *)s4; ex->params[ORC_VAR_S4] = s4_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_combine4_16xn_u8; static inline void orc_combine4_16xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_combine4_16xn_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 16; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->params[ORC_VAR_S3] = s3_stride; ex->arrays[ORC_VAR_S4] = (void *)s4; ex->params[ORC_VAR_S4] = s4_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_combine4_24xn_u8; static inline void orc_combine4_24xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_combine4_24xn_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 24; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->params[ORC_VAR_S3] = s3_stride; ex->arrays[ORC_VAR_S4] = (void *)s4; ex->params[ORC_VAR_S4] = s4_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_combine4_32xn_u8; static inline void orc_combine4_32xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_combine4_32xn_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 32; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->params[ORC_VAR_S3] = s3_stride; ex->arrays[ORC_VAR_S4] = (void *)s4; ex->params[ORC_VAR_S4] = s4_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_combine4_nxm_u8; static inline void orc_combine4_nxm_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int n, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_combine4_nxm_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->params[ORC_VAR_S3] = s3_stride; ex->arrays[ORC_VAR_S4] = (void *)s4; ex->params[ORC_VAR_S4] = s4_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_combine2_8xn_u8; static inline void orc_combine2_8xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int p1, int p2, int p3, int p4, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_combine2_8xn_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 8; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_combine2_12xn_u8; static inline void orc_combine2_12xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int p1, int p2, int p3, int p4, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_combine2_12xn_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 12; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_combine2_16xn_u8; static inline void orc_combine2_16xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int p1, int p2, int p3, int p4, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_combine2_16xn_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 16; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_combine2_nxm_u8; static inline void orc_combine2_nxm_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int p1, int p2, int p3, int p4, int n, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_combine2_nxm_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_sad_nxm_u8; static inline void orc_sad_nxm_u8 (orc_uint32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int n, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_sad_nxm_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; func = c->exec; func (ex); *a1 = orc_executor_get_accumulator (ex, ORC_VAR_A1); } extern OrcCode *_orc_code_orc_sad_8x8_u8; static inline void orc_sad_8x8_u8 (orc_uint32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_sad_8x8_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 8; ORC_EXECUTOR_M(ex) = 8; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; func = c->exec; func (ex); *a1 = orc_executor_get_accumulator (ex, ORC_VAR_A1); } extern OrcCode *_orc_code_orc_sad_12x12_u8; static inline void orc_sad_12x12_u8 (orc_uint32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_sad_12x12_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 12; ORC_EXECUTOR_M(ex) = 12; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; func = c->exec; func (ex); *a1 = orc_executor_get_accumulator (ex, ORC_VAR_A1); } extern OrcCode *_orc_code_orc_sad_16xn_u8; static inline void orc_sad_16xn_u8 (orc_uint32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_sad_16xn_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 16; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; func = c->exec; func (ex); *a1 = orc_executor_get_accumulator (ex, ORC_VAR_A1); } extern OrcCode *_orc_code_orc_sad_32xn_u8; static inline void orc_sad_32xn_u8 (orc_uint32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_sad_32xn_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 32; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; func = c->exec; func (ex); *a1 = orc_executor_get_accumulator (ex, ORC_VAR_A1); } #ifdef __cplusplus } #endif #endif schroedinger-1.0.11/testsuite/perf/upsample_speed.c0000644000175000017500000000325711541755167017351 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include int16_t tmp[2048+100]; int orc_profile_get_min (OrcProfile *prof) { int i; int min; min = prof->hist_time[0]; for(i=0;i<10;i++){ if (prof->hist_count[i] > 0) { if (prof->hist_time[i] < min) { min = prof->hist_time[i]; } } } return min; } void upsample_speed (int filter, int width, int height) { OrcProfile prof1; double ave; int i; SchroFrame *frame1; SchroFrame *frame2; SchroUpsampledFrame *upframe; SchroMemoryDomain *mem; mem = schro_memory_domain_new_local (); frame1 = schro_frame_new_and_alloc (mem, SCHRO_FRAME_FORMAT_U8_444, width, height); frame2 = schro_frame_new_and_alloc (mem, SCHRO_FRAME_FORMAT_U8_444, width, height); orc_profile_init (&prof1); upframe = schro_upsampled_frame_new (schro_frame_ref(frame1)); schro_upsampled_frame_upsample (upframe); schro_upsampled_frame_free (upframe); for(i=0;i<10;i++) { upframe = schro_upsampled_frame_new (schro_frame_ref(frame1)); orc_profile_start (&prof1); schro_upsampled_frame_upsample (upframe); orc_profile_stop (&prof1); schro_upsampled_frame_free (upframe); } ave = orc_profile_get_min (&prof1); printf("%d %d %g %g\n", width, height, ave, ave/(width*height)); schro_frame_unref (frame1); schro_frame_unref (frame2); schro_memory_domain_free (mem); } int main (int argc, char *argv[]) { int i; orc_init(); for(i=16;i<=2048;i+=16){ upsample_speed (1, i, (i*9)/16); } return 0; } schroedinger-1.0.11/testsuite/perf/quantise_speed.c0000644000175000017500000001127511556115124017340 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #include #define N 10000 int16_t a[N]; int16_t b[N]; int16_t c[N]; int16_t table[65536]; int orc_profile_get_min (OrcProfile *prof) { int i; int min; min = prof->hist_time[0]; for(i=0;i<10;i++){ if (prof->hist_count[i] > 0) { if (prof->hist_time[i] < min) { min = prof->hist_time[i]; } } } return min; } #if 0 static int __schro_dequantise (int q, int quant_factor, int quant_offset) { if (q == 0) return 0; if (q < 0) { return -((-q * quant_factor + quant_offset + 2)>>2); } else { return (q * quant_factor + quant_offset + 2)>>2; } } #endif static int __schro_quantise_shift (int value, int quant_shift) { unsigned int x; if (value == 0) return 0; if (value < 0) { x = (-value)>>quant_shift; value = -x; } else { x = value>>quant_shift; value = x; } return value; } #if 0 static int __schro_quantise_table (int value, int16_t *table) { return table[value]; } #endif void schro_quantise_s16_ref (int16_t *dest, int16_t *src, int quant_index, schro_bool is_intra, int n) { int i; int quant_factor = schro_table_quant[quant_index]; #if 0 int quant_offset = is_intra ? schro_table_offset_1_2[quant_index] : schro_table_offset_3_8[quant_index]; #endif for(i=0;i> 2); } } else { schro_quantise_s16_ref (dest, src, quant_index, is_intra, n); } } void schro_quantise_s16_test (int16_t *dest, int16_t *src, int quant_index, schro_bool is_intra, int n) { int quant_factor = schro_table_quant[quant_index]; #if 0 int quant_offset = is_intra ? schro_table_offset_1_2[quant_index] : schro_table_offset_3_8[quant_index]; #endif int inv_quant_factor; int i; //inv_quant_factor = ((1LL<<32) + quant_factor/2) / quant_factor; inv_quant_factor = ((1LL<<16) + quant_factor/2) / quant_factor; for(i=0;i> 16; value = -x; } else { x = value<<2; x = (x * inv_quant_factor) >> 16; value = x; } dest[i] = value; } } void generate_table (int16_t *table, int quant_index, schro_bool is_intra) { int i; for(i=0;i<65536;i++){ table[i] = i-32768; } schro_quantise_s16_ref (table, table, quant_index, is_intra, 65536); } void quantise_speed (int quant_index) { OrcProfile prof1; OrcProfile prof2; OrcProfile prof3; double ave1; double ave2; double ave3; int i; int j; schro_bool is_intra = TRUE; orc_profile_init (&prof1); orc_profile_init (&prof2); orc_profile_init (&prof3); for(i=0;i<10;i++) { for(j=0;j= 199901L #include typedef int8_t orc_int8; typedef int16_t orc_int16; typedef int32_t orc_int32; typedef int64_t orc_int64; typedef uint8_t orc_uint8; typedef uint16_t orc_uint16; typedef uint32_t orc_uint32; typedef uint64_t orc_uint64; #define ORC_UINT64_C(x) UINT64_C(x) #elif defined(_MSC_VER) typedef signed __int8 orc_int8; typedef signed __int16 orc_int16; typedef signed __int32 orc_int32; typedef signed __int64 orc_int64; typedef unsigned __int8 orc_uint8; typedef unsigned __int16 orc_uint16; typedef unsigned __int32 orc_uint32; typedef unsigned __int64 orc_uint64; #define ORC_UINT64_C(x) (x##Ui64) #define inline __inline #else #include typedef signed char orc_int8; typedef short orc_int16; typedef int orc_int32; typedef unsigned char orc_uint8; typedef unsigned short orc_uint16; typedef unsigned int orc_uint32; #if INT_MAX == LONG_MAX typedef long long orc_int64; typedef unsigned long long orc_uint64; #define ORC_UINT64_C(x) (x##ULL) #else typedef long orc_int64; typedef unsigned long orc_uint64; #define ORC_UINT64_C(x) (x##UL) #endif #endif typedef union { orc_int16 i; orc_int8 x2[2]; } orc_union16; typedef union { orc_int32 i; float f; orc_int16 x2[2]; orc_int8 x4[4]; } orc_union32; typedef union { orc_int64 i; double f; orc_int32 x2[2]; float x2f[2]; orc_int16 x4[4]; } orc_union64; #endif #ifndef ORC_RESTRICT #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define ORC_RESTRICT restrict #elif defined(__GNUC__) && __GNUC__ >= 4 #define ORC_RESTRICT __restrict__ #else #define ORC_RESTRICT #endif #endif #ifndef DISABLE_ORC #include #endif void orc_add2_rshift_add_s16_22_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, int n); void orc_add2_rshift_add_s16_22 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n); void orc_add2_rshift_sub_s16_22_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, int n); void orc_add2_rshift_sub_s16_22 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n); void orc_add2_rshift_add_s16_11_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, int n); void orc_add2_rshift_add_s16_11 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n); void orc_add2_rshift_sub_s16_11_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, int n); void orc_add2_rshift_sub_s16_11 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n); void orc_add_const_rshift_s16_11 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n); void orc_add_const_rshift_s16 (orc_int16 * ORC_RESTRICT d1, int p1, int p2, int n); void orc_add_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n); void orc_add_s16_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, const orc_int16 * ORC_RESTRICT s1, int s1_stride, int n, int m); void orc_addc_rshift_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int p1, int n); void orc_lshift1_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n); void orc_lshift2_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n); void orc_lshift_s16_ip (orc_int16 * ORC_RESTRICT d1, int p1, int n); void orc_mas2_add_s16_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, int p1, int p2, int p3, int n); void orc_mas2_add_s16_ip (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int p1, int p2, int p3, int n); void orc_mas2_sub_s16_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, int p1, int p2, int p3, int n); void orc_mas2_sub_s16_ip (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int p1, int p2, int p3, int n); void orc_mas4_across_add_s16_1991_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, const orc_int16 * ORC_RESTRICT s4, const orc_int16 * ORC_RESTRICT s5, int p1, int p2, int n); void orc_mas4_across_add_s16_1991_ip (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int p1, int p2, int n); void orc_mas4_across_sub_s16_1991_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, const orc_int16 * ORC_RESTRICT s4, const orc_int16 * ORC_RESTRICT s5, int p1, int p2, int n); void orc_mas4_across_sub_s16_1991_ip (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int p1, int p2, int n); void orc_subtract_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n); void orc_add_s16_u8 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n); void orc_add_s16_u8_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, int n, int m); void orc_convert_s16_u8 (orc_uint16 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, int n); void orc_convert_u8_s16 (orc_uint8 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n); void orc_offsetconvert_u8_s16 (orc_uint8 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n); void orc_offsetconvert_s16_u8 (orc_int16 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, int n); void orc_subtract_s16_u8 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n); void orc_multiply_and_add_s16_u8 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n); void orc_splat_s16_ns (orc_int16 * ORC_RESTRICT d1, int p1, int n); void orc_splat_s16_2d_4xn (orc_int16 * ORC_RESTRICT d1, int d1_stride, int p1, int m); void orc_splat_s16_2d_8xn (orc_int16 * ORC_RESTRICT d1, int d1_stride, int p1, int m); void orc_splat_s16_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, int p1, int n, int m); void orc_splat_u8_ns (orc_uint8 * ORC_RESTRICT d1, int p1, int n); void orc_splat_u8_2d (orc_uint8 * ORC_RESTRICT d1, int d1_stride, int p1, int n, int m); void orc_average_u8 (orc_uint8 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n); void orc_rrshift6_add_s16_2d (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_int16 * ORC_RESTRICT s1, int s1_stride, const orc_int16 * ORC_RESTRICT s2, int s2_stride, int n, int m); void orc_rrshift6_sub_s16_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, orc_int16 * ORC_RESTRICT d2, int d2_stride, int n, int m); void orc_rrshift6_s16_ip_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, int n, int m); void orc_rrshift6_s16_ip (orc_int16 * ORC_RESTRICT d1, int n); void orc_unpack_yuyv_y (orc_uint8 * ORC_RESTRICT d1, const orc_uint16 * ORC_RESTRICT s1, int n); void orc_unpack_yuyv_u (orc_uint8 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n); void orc_unpack_yuyv_v (orc_uint8 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n); void orc_packyuyv (orc_uint32 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, const orc_uint8 * ORC_RESTRICT s3, int n); void orc_unpack_uyvy_y (orc_uint8 * ORC_RESTRICT d1, const orc_uint16 * ORC_RESTRICT s1, int n); void orc_unpack_uyvy_u (orc_uint8 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n); void orc_unpack_uyvy_v (orc_uint8 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n); void orc_interleave2_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n); void orc_interleave2_rrshift1_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n); void orc_deinterleave2_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, int n); void orc_deinterleave2_lshift1_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, int n); void orc_haar_deint_lshift1_split_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, int n); void orc_haar_deint_split_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, int n); void orc_haar_split_s16_lo (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n); void orc_haar_split_s16_hi (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n); void orc_haar_split_s16_op (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n); void orc_haar_split_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, int n); void orc_haar_synth_s16_lo (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n); void orc_haar_synth_s16_hi (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n); void orc_haar_synth_s16_op (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n); void orc_haar_synth_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, int n); void orc_haar_synth_rrshift1_int_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n); void orc_haar_synth_int_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n); void orc_haar_sub_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n); void orc_haar_add_half_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n); void orc_haar_add_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n); void orc_haar_sub_half_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n); void orc_sum_u8 (orc_int32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int n); void orc_sum_s16 (orc_int32 * ORC_RESTRICT a1, const orc_int16 * ORC_RESTRICT s1, int n); void orc_sum_square_diff_u8 (orc_int32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n); void orc_dequantise_s16_2d_4xn (orc_int16 * ORC_RESTRICT d1, int d1_stride, const orc_int16 * ORC_RESTRICT s1, int s1_stride, int p1, int p2, int m); void orc_dequantise_s16_2d_8xn (orc_int16 * ORC_RESTRICT d1, int d1_stride, const orc_int16 * ORC_RESTRICT s1, int s1_stride, int p1, int p2, int m); void orc_dequantise_s16_ip_2d_8xn (orc_int16 * ORC_RESTRICT d1, int d1_stride, int p1, int p2, int m); void orc_dequantise_s16_ip_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, int p1, int p2, int n, int m); void orc_dequantise_s16_ip (orc_int16 * ORC_RESTRICT d1, int p1, int p2, int n); void orc_dequantise_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int p1, int p2, int n); void orc_dequantise_var_s16_ip (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n); void orc_quantise1_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int p1, int p2, int p3, int n); void orc_quantise2_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int p1, int p2, int n); void orc_quantdequant1_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, int p1, int p2, int p3, int p4, int p5, int n); void orc_quantdequant3_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, int p1, int p2, int p3, int p4, int p5, int p6, int n); void orc_quantdequant2_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, int p1, int p2, int p3, int p4, int n); void orc_downsample_vert_u8 (orc_uint8 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, const orc_uint8 * ORC_RESTRICT s3, const orc_uint8 * ORC_RESTRICT s4, int n); void orc_downsample_horiz_u8 (orc_uint8 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n); void orc_stats_moment_s16 (orc_int32 * ORC_RESTRICT a1, const orc_int16 * ORC_RESTRICT s1, int n); void orc_stats_above_s16 (orc_int32 * ORC_RESTRICT a1, const orc_int16 * ORC_RESTRICT s1, int n); void orc_accw (int * ORC_RESTRICT a1, const orc_int16 * ORC_RESTRICT s1, int n); void orc_avg2_8xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m); void orc_avg2_12xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m); void orc_avg2_16xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m); void orc_avg2_32xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m); void orc_avg2_nxm_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int n, int m); void orc_combine4_8xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int m); void orc_combine4_12xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int m); void orc_combine4_16xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int m); void orc_combine4_24xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int m); void orc_combine4_32xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int m); void orc_combine4_nxm_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int n, int m); void orc_combine2_8xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int p1, int p2, int p3, int p4, int m); void orc_combine2_12xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int p1, int p2, int p3, int p4, int m); void orc_combine2_16xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int p1, int p2, int p3, int p4, int m); void orc_combine2_nxm_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int p1, int p2, int p3, int p4, int n, int m); void orc_sad_nxm_u8 (orc_uint32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int n, int m); void orc_sad_8x8_u8 (orc_uint32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride); void orc_sad_12x12_u8 (orc_uint32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride); void orc_sad_16xn_u8 (orc_uint32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m); void orc_sad_32xn_u8 (orc_uint32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m); void schro_orc_init (void); /* begin Orc C target preamble */ #define ORC_CLAMP(x,a,b) ((x)<(a) ? (a) : ((x)>(b) ? (b) : (x))) #define ORC_ABS(a) ((a)<0 ? -(a) : (a)) #define ORC_MIN(a,b) ((a)<(b) ? (a) : (b)) #define ORC_MAX(a,b) ((a)>(b) ? (a) : (b)) #define ORC_SB_MAX 127 #define ORC_SB_MIN (-1-ORC_SB_MAX) #define ORC_UB_MAX 255 #define ORC_UB_MIN 0 #define ORC_SW_MAX 32767 #define ORC_SW_MIN (-1-ORC_SW_MAX) #define ORC_UW_MAX 65535 #define ORC_UW_MIN 0 #define ORC_SL_MAX 2147483647 #define ORC_SL_MIN (-1-ORC_SL_MAX) #define ORC_UL_MAX 4294967295U #define ORC_UL_MIN 0 #define ORC_CLAMP_SB(x) ORC_CLAMP(x,ORC_SB_MIN,ORC_SB_MAX) #define ORC_CLAMP_UB(x) ORC_CLAMP(x,ORC_UB_MIN,ORC_UB_MAX) #define ORC_CLAMP_SW(x) ORC_CLAMP(x,ORC_SW_MIN,ORC_SW_MAX) #define ORC_CLAMP_UW(x) ORC_CLAMP(x,ORC_UW_MIN,ORC_UW_MAX) #define ORC_CLAMP_SL(x) ORC_CLAMP(x,ORC_SL_MIN,ORC_SL_MAX) #define ORC_CLAMP_UL(x) ORC_CLAMP(x,ORC_UL_MIN,ORC_UL_MAX) #define ORC_SWAP_W(x) ((((x)&0xff)<<8) | (((x)&0xff00)>>8)) #define ORC_SWAP_L(x) ((((x)&0xff)<<24) | (((x)&0xff00)<<8) | (((x)&0xff0000)>>8) | (((x)&0xff000000)>>24)) #define ORC_SWAP_Q(x) ((((x)&ORC_UINT64_C(0xff))<<56) | (((x)&ORC_UINT64_C(0xff00))<<40) | (((x)&ORC_UINT64_C(0xff0000))<<24) | (((x)&ORC_UINT64_C(0xff000000))<<8) | (((x)&ORC_UINT64_C(0xff00000000))>>8) | (((x)&ORC_UINT64_C(0xff0000000000))>>24) | (((x)&ORC_UINT64_C(0xff000000000000))>>40) | (((x)&ORC_UINT64_C(0xff00000000000000))>>56)) #define ORC_PTR_OFFSET(ptr,offset) ((void *)(((unsigned char *)(ptr)) + (offset))) #define ORC_DENORMAL(x) ((x) & ((((x)&0x7f800000) == 0) ? 0xff800000 : 0xffffffff)) #define ORC_ISNAN(x) ((((x)&0x7f800000) == 0x7f800000) && (((x)&0x007fffff) != 0)) #define ORC_DENORMAL_DOUBLE(x) ((x) & ((((x)&ORC_UINT64_C(0x7ff0000000000000)) == 0) ? ORC_UINT64_C(0xfff0000000000000) : ORC_UINT64_C(0xffffffffffffffff))) #define ORC_ISNAN_DOUBLE(x) ((((x)&ORC_UINT64_C(0x7ff0000000000000)) == ORC_UINT64_C(0x7ff0000000000000)) && (((x)&ORC_UINT64_C(0x000fffffffffffff)) != 0)) #ifndef ORC_RESTRICT #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define ORC_RESTRICT restrict #elif defined(__GNUC__) && __GNUC__ >= 4 #define ORC_RESTRICT __restrict__ #else #define ORC_RESTRICT #endif #endif /* end Orc C target preamble */ /* orc_add2_rshift_add_s16_22_op */ #ifdef DISABLE_ORC void orc_add2_rshift_add_s16_22_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; ptr6 = (orc_union16 *)s3; /* 3: loadpw */ var35.i = (int)0x00000002; /* 2 or 9.88131e-324f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr5[i]; /* 1: loadw */ var34 = ptr6[i]; /* 2: addw */ var38.i = var33.i + var34.i; /* 4: addw */ var39.i = var38.i + var35.i; /* 5: shrsw */ var40.i = var39.i >> 2; /* 6: loadw */ var36 = ptr4[i]; /* 7: addw */ var37.i = var36.i + var40.i; /* 8: storew */ ptr0[i] = var37; } } #else static void _backup_orc_add2_rshift_add_s16_22_op (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; ptr6 = (orc_union16 *)ex->arrays[6]; /* 3: loadpw */ var35.i = (int)0x00000002; /* 2 or 9.88131e-324f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr5[i]; /* 1: loadw */ var34 = ptr6[i]; /* 2: addw */ var38.i = var33.i + var34.i; /* 4: addw */ var39.i = var38.i + var35.i; /* 5: shrsw */ var40.i = var39.i >> 2; /* 6: loadw */ var36 = ptr4[i]; /* 7: addw */ var37.i = var36.i + var40.i; /* 8: storew */ ptr0[i] = var37; } } OrcCode *_orc_code_orc_add2_rshift_add_s16_22_op; void orc_add2_rshift_add_s16_22_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add2_rshift_add_s16_22_op; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; func = c->exec; func (ex); } #endif /* orc_add2_rshift_add_s16_22 */ #ifdef DISABLE_ORC void orc_add2_rshift_add_s16_22 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; /* 3: loadpw */ var35.i = (int)0x00000002; /* 2 or 9.88131e-324f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 1: loadw */ var34 = ptr5[i]; /* 2: addw */ var38.i = var33.i + var34.i; /* 4: addw */ var39.i = var38.i + var35.i; /* 5: shrsw */ var40.i = var39.i >> 2; /* 6: loadw */ var36 = ptr0[i]; /* 7: addw */ var37.i = var36.i + var40.i; /* 8: storew */ ptr0[i] = var37; } } #else static void _backup_orc_add2_rshift_add_s16_22 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; /* 3: loadpw */ var35.i = (int)0x00000002; /* 2 or 9.88131e-324f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 1: loadw */ var34 = ptr5[i]; /* 2: addw */ var38.i = var33.i + var34.i; /* 4: addw */ var39.i = var38.i + var35.i; /* 5: shrsw */ var40.i = var39.i >> 2; /* 6: loadw */ var36 = ptr0[i]; /* 7: addw */ var37.i = var36.i + var40.i; /* 8: storew */ ptr0[i] = var37; } } OrcCode *_orc_code_orc_add2_rshift_add_s16_22; void orc_add2_rshift_add_s16_22 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add2_rshift_add_s16_22; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_add2_rshift_sub_s16_22_op */ #ifdef DISABLE_ORC void orc_add2_rshift_sub_s16_22_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; ptr6 = (orc_union16 *)s3; /* 3: loadpw */ var35.i = (int)0x00000002; /* 2 or 9.88131e-324f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr5[i]; /* 1: loadw */ var34 = ptr6[i]; /* 2: addw */ var38.i = var33.i + var34.i; /* 4: addw */ var39.i = var38.i + var35.i; /* 5: shrsw */ var40.i = var39.i >> 2; /* 6: loadw */ var36 = ptr4[i]; /* 7: subw */ var37.i = var36.i - var40.i; /* 8: storew */ ptr0[i] = var37; } } #else static void _backup_orc_add2_rshift_sub_s16_22_op (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; ptr6 = (orc_union16 *)ex->arrays[6]; /* 3: loadpw */ var35.i = (int)0x00000002; /* 2 or 9.88131e-324f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr5[i]; /* 1: loadw */ var34 = ptr6[i]; /* 2: addw */ var38.i = var33.i + var34.i; /* 4: addw */ var39.i = var38.i + var35.i; /* 5: shrsw */ var40.i = var39.i >> 2; /* 6: loadw */ var36 = ptr4[i]; /* 7: subw */ var37.i = var36.i - var40.i; /* 8: storew */ ptr0[i] = var37; } } OrcCode *_orc_code_orc_add2_rshift_sub_s16_22_op; void orc_add2_rshift_sub_s16_22_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add2_rshift_sub_s16_22_op; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; func = c->exec; func (ex); } #endif /* orc_add2_rshift_sub_s16_22 */ #ifdef DISABLE_ORC void orc_add2_rshift_sub_s16_22 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; /* 3: loadpw */ var35.i = (int)0x00000002; /* 2 or 9.88131e-324f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 1: loadw */ var34 = ptr5[i]; /* 2: addw */ var38.i = var33.i + var34.i; /* 4: addw */ var39.i = var38.i + var35.i; /* 5: shrsw */ var40.i = var39.i >> 2; /* 6: loadw */ var36 = ptr0[i]; /* 7: subw */ var37.i = var36.i - var40.i; /* 8: storew */ ptr0[i] = var37; } } #else static void _backup_orc_add2_rshift_sub_s16_22 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; /* 3: loadpw */ var35.i = (int)0x00000002; /* 2 or 9.88131e-324f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 1: loadw */ var34 = ptr5[i]; /* 2: addw */ var38.i = var33.i + var34.i; /* 4: addw */ var39.i = var38.i + var35.i; /* 5: shrsw */ var40.i = var39.i >> 2; /* 6: loadw */ var36 = ptr0[i]; /* 7: subw */ var37.i = var36.i - var40.i; /* 8: storew */ ptr0[i] = var37; } } OrcCode *_orc_code_orc_add2_rshift_sub_s16_22; void orc_add2_rshift_sub_s16_22 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add2_rshift_sub_s16_22; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_add2_rshift_add_s16_11_op */ #ifdef DISABLE_ORC void orc_add2_rshift_add_s16_11_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; ptr6 = (orc_union16 *)s3; for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr5[i]; /* 1: loadw */ var34 = ptr6[i]; /* 2: avgsw */ var37.i = (var33.i + var34.i + 1)>>1; /* 3: loadw */ var35 = ptr4[i]; /* 4: addw */ var36.i = var35.i + var37.i; /* 5: storew */ ptr0[i] = var36; } } #else static void _backup_orc_add2_rshift_add_s16_11_op (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; ptr6 = (orc_union16 *)ex->arrays[6]; for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr5[i]; /* 1: loadw */ var34 = ptr6[i]; /* 2: avgsw */ var37.i = (var33.i + var34.i + 1)>>1; /* 3: loadw */ var35 = ptr4[i]; /* 4: addw */ var36.i = var35.i + var37.i; /* 5: storew */ ptr0[i] = var36; } } OrcCode *_orc_code_orc_add2_rshift_add_s16_11_op; void orc_add2_rshift_add_s16_11_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add2_rshift_add_s16_11_op; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; func = c->exec; func (ex); } #endif /* orc_add2_rshift_add_s16_11 */ #ifdef DISABLE_ORC void orc_add2_rshift_add_s16_11 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 1: loadw */ var34 = ptr5[i]; /* 2: avgsw */ var37.i = (var33.i + var34.i + 1)>>1; /* 3: loadw */ var35 = ptr0[i]; /* 4: addw */ var36.i = var35.i + var37.i; /* 5: storew */ ptr0[i] = var36; } } #else static void _backup_orc_add2_rshift_add_s16_11 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 1: loadw */ var34 = ptr5[i]; /* 2: avgsw */ var37.i = (var33.i + var34.i + 1)>>1; /* 3: loadw */ var35 = ptr0[i]; /* 4: addw */ var36.i = var35.i + var37.i; /* 5: storew */ ptr0[i] = var36; } } OrcCode *_orc_code_orc_add2_rshift_add_s16_11; void orc_add2_rshift_add_s16_11 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add2_rshift_add_s16_11; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_add2_rshift_sub_s16_11_op */ #ifdef DISABLE_ORC void orc_add2_rshift_sub_s16_11_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; ptr6 = (orc_union16 *)s3; for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr5[i]; /* 1: loadw */ var34 = ptr6[i]; /* 2: avgsw */ var37.i = (var33.i + var34.i + 1)>>1; /* 3: loadw */ var35 = ptr4[i]; /* 4: subw */ var36.i = var35.i - var37.i; /* 5: storew */ ptr0[i] = var36; } } #else static void _backup_orc_add2_rshift_sub_s16_11_op (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; ptr6 = (orc_union16 *)ex->arrays[6]; for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr5[i]; /* 1: loadw */ var34 = ptr6[i]; /* 2: avgsw */ var37.i = (var33.i + var34.i + 1)>>1; /* 3: loadw */ var35 = ptr4[i]; /* 4: subw */ var36.i = var35.i - var37.i; /* 5: storew */ ptr0[i] = var36; } } OrcCode *_orc_code_orc_add2_rshift_sub_s16_11_op; void orc_add2_rshift_sub_s16_11_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add2_rshift_sub_s16_11_op; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; func = c->exec; func (ex); } #endif /* orc_add2_rshift_sub_s16_11 */ #ifdef DISABLE_ORC void orc_add2_rshift_sub_s16_11 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 1: loadw */ var34 = ptr5[i]; /* 2: avgsw */ var37.i = (var33.i + var34.i + 1)>>1; /* 3: loadw */ var35 = ptr0[i]; /* 4: subw */ var36.i = var35.i - var37.i; /* 5: storew */ ptr0[i] = var36; } } #else static void _backup_orc_add2_rshift_sub_s16_11 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 1: loadw */ var34 = ptr5[i]; /* 2: avgsw */ var37.i = (var33.i + var34.i + 1)>>1; /* 3: loadw */ var35 = ptr0[i]; /* 4: subw */ var36.i = var35.i - var37.i; /* 5: storew */ ptr0[i] = var36; } } OrcCode *_orc_code_orc_add2_rshift_sub_s16_11; void orc_add2_rshift_sub_s16_11 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add2_rshift_sub_s16_11; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_add_const_rshift_s16_11 */ #ifdef DISABLE_ORC void orc_add_const_rshift_s16_11 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; /* 1: loadpw */ var34.i = (int)0x00000001; /* 1 or 4.94066e-324f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 2: addw */ var36.i = var33.i + var34.i; /* 3: shrsw */ var35.i = var36.i >> 1; /* 4: storew */ ptr0[i] = var35; } } #else static void _backup_orc_add_const_rshift_s16_11 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; /* 1: loadpw */ var34.i = (int)0x00000001; /* 1 or 4.94066e-324f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 2: addw */ var36.i = var33.i + var34.i; /* 3: shrsw */ var35.i = var36.i >> 1; /* 4: storew */ ptr0[i] = var35; } } OrcCode *_orc_code_orc_add_const_rshift_s16_11; void orc_add_const_rshift_s16_11 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add_const_rshift_s16_11; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_add_const_rshift_s16 */ #ifdef DISABLE_ORC void orc_add_const_rshift_s16 (orc_int16 * ORC_RESTRICT d1, int p1, int p2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; ptr0 = (orc_union16 *)d1; /* 1: loadpw */ var34.i = p1; for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr0[i]; /* 2: addw */ var36.i = var33.i + var34.i; /* 3: shrsw */ var35.i = var36.i >> p2; /* 4: storew */ ptr0[i] = var35; } } #else static void _backup_orc_add_const_rshift_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; ptr0 = (orc_union16 *)ex->arrays[0]; /* 1: loadpw */ var34.i = ex->params[24]; for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr0[i]; /* 2: addw */ var36.i = var33.i + var34.i; /* 3: shrsw */ var35.i = var36.i >> ex->params[25]; /* 4: storew */ ptr0[i] = var35; } } OrcCode *_orc_code_orc_add_const_rshift_s16; void orc_add_const_rshift_s16 (orc_int16 * ORC_RESTRICT d1, int p1, int p2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add_const_rshift_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } #endif /* orc_add_s16 */ #ifdef DISABLE_ORC void orc_add_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: loadw */ var33 = ptr5[i]; /* 2: addw */ var34.i = var32.i + var33.i; /* 3: storew */ ptr0[i] = var34; } } #else static void _backup_orc_add_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: loadw */ var33 = ptr5[i]; /* 2: addw */ var34.i = var32.i + var33.i; /* 3: storew */ ptr0[i] = var34; } } OrcCode *_orc_code_orc_add_s16; void orc_add_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_add_s16_2d */ #ifdef DISABLE_ORC void orc_add_s16_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, const orc_int16 * ORC_RESTRICT s1, int s1_stride, int n, int m){ int i; int j; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_union16 var33; orc_union16 var34; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr0[i]; /* 1: loadw */ var33 = ptr4[i]; /* 2: addw */ var34.i = var32.i + var33.i; /* 3: storew */ ptr0[i] = var34; } } } #else static void _backup_orc_add_s16_2d (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_union16 var33; orc_union16 var34; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr0[i]; /* 1: loadw */ var33 = ptr4[i]; /* 2: addw */ var34.i = var32.i + var33.i; /* 3: storew */ ptr0[i] = var34; } } } OrcCode *_orc_code_orc_add_s16_2d; void orc_add_s16_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, const orc_int16 * ORC_RESTRICT s1, int s1_stride, int n, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add_s16_2d; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; func = c->exec; func (ex); } #endif /* orc_addc_rshift_s16 */ #ifdef DISABLE_ORC void orc_addc_rshift_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int p1, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 1: loadw */ var34 = ptr5[i]; /* 2: addw */ var36.i = var33.i + var34.i; /* 3: shrsw */ var35.i = var36.i >> p1; /* 4: storew */ ptr0[i] = var35; } } #else static void _backup_orc_addc_rshift_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 1: loadw */ var34 = ptr5[i]; /* 2: addw */ var36.i = var33.i + var34.i; /* 3: shrsw */ var35.i = var36.i >> ex->params[24]; /* 4: storew */ ptr0[i] = var35; } } OrcCode *_orc_code_orc_addc_rshift_s16; void orc_addc_rshift_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int p1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_addc_rshift_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_P1] = p1; func = c->exec; func (ex); } #endif /* orc_lshift1_s16 */ #ifdef DISABLE_ORC void orc_lshift1_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_union16 var33; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: shlw */ var33.i = var32.i << 1; /* 2: storew */ ptr0[i] = var33; } } #else static void _backup_orc_lshift1_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_union16 var33; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: shlw */ var33.i = var32.i << 1; /* 2: storew */ ptr0[i] = var33; } } OrcCode *_orc_code_orc_lshift1_s16; void orc_lshift1_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_lshift1_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_lshift2_s16 */ #ifdef DISABLE_ORC void orc_lshift2_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_union16 var33; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: shlw */ var33.i = var32.i << 2; /* 2: storew */ ptr0[i] = var33; } } #else static void _backup_orc_lshift2_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_union16 var33; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: shlw */ var33.i = var32.i << 2; /* 2: storew */ ptr0[i] = var33; } } OrcCode *_orc_code_orc_lshift2_s16; void orc_lshift2_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_lshift2_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_lshift_s16_ip */ #ifdef DISABLE_ORC void orc_lshift_s16_ip (orc_int16 * ORC_RESTRICT d1, int p1, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var32; orc_union16 var33; ptr0 = (orc_union16 *)d1; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr0[i]; /* 1: shlw */ var33.i = var32.i << p1; /* 2: storew */ ptr0[i] = var33; } } #else static void _backup_orc_lshift_s16_ip (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var32; orc_union16 var33; ptr0 = (orc_union16 *)ex->arrays[0]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr0[i]; /* 1: shlw */ var33.i = var32.i << ex->params[24]; /* 2: storew */ ptr0[i] = var33; } } OrcCode *_orc_code_orc_lshift_s16_ip; void orc_lshift_s16_ip (orc_int16 * ORC_RESTRICT d1, int p1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_lshift_s16_ip; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_P1] = p1; func = c->exec; func (ex); } #endif /* orc_mas2_add_s16_op */ #ifdef DISABLE_ORC void orc_mas2_add_s16_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, int p1, int p2, int p3, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union32 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; orc_union16 var44; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; ptr6 = (orc_union16 *)s3; /* 3: loadpw */ var36.i = p1; /* 5: loadpl */ var37.i = p2; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr5[i]; /* 1: loadw */ var35 = ptr6[i]; /* 2: addw */ var40.i = var34.i + var35.i; /* 4: mulswl */ var41.i = var40.i * var36.i; /* 6: addl */ var42.i = var41.i + var37.i; /* 7: shrsl */ var43.i = var42.i >> p3; /* 8: convlw */ var44.i = var43.i; /* 9: loadw */ var38 = ptr4[i]; /* 10: addw */ var39.i = var38.i + var44.i; /* 11: storew */ ptr0[i] = var39; } } #else static void _backup_orc_mas2_add_s16_op (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union32 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; orc_union16 var44; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; ptr6 = (orc_union16 *)ex->arrays[6]; /* 3: loadpw */ var36.i = ex->params[24]; /* 5: loadpl */ var37.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr5[i]; /* 1: loadw */ var35 = ptr6[i]; /* 2: addw */ var40.i = var34.i + var35.i; /* 4: mulswl */ var41.i = var40.i * var36.i; /* 6: addl */ var42.i = var41.i + var37.i; /* 7: shrsl */ var43.i = var42.i >> ex->params[26]; /* 8: convlw */ var44.i = var43.i; /* 9: loadw */ var38 = ptr4[i]; /* 10: addw */ var39.i = var38.i + var44.i; /* 11: storew */ ptr0[i] = var39; } } OrcCode *_orc_code_orc_mas2_add_s16_op; void orc_mas2_add_s16_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, int p1, int p2, int p3, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_mas2_add_s16_op; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; func = c->exec; func (ex); } #endif /* orc_mas2_add_s16_ip */ #ifdef DISABLE_ORC void orc_mas2_add_s16_ip (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int p1, int p2, int p3, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union32 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; orc_union16 var44; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; /* 3: loadpw */ var36.i = p1; /* 5: loadpl */ var37.i = p2; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: loadw */ var35 = ptr5[i]; /* 2: addw */ var40.i = var34.i + var35.i; /* 4: mulswl */ var41.i = var40.i * var36.i; /* 6: addl */ var42.i = var41.i + var37.i; /* 7: shrsl */ var43.i = var42.i >> p3; /* 8: convlw */ var44.i = var43.i; /* 9: loadw */ var38 = ptr0[i]; /* 10: addw */ var39.i = var38.i + var44.i; /* 11: storew */ ptr0[i] = var39; } } #else static void _backup_orc_mas2_add_s16_ip (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union32 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; orc_union16 var44; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; /* 3: loadpw */ var36.i = ex->params[24]; /* 5: loadpl */ var37.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: loadw */ var35 = ptr5[i]; /* 2: addw */ var40.i = var34.i + var35.i; /* 4: mulswl */ var41.i = var40.i * var36.i; /* 6: addl */ var42.i = var41.i + var37.i; /* 7: shrsl */ var43.i = var42.i >> ex->params[26]; /* 8: convlw */ var44.i = var43.i; /* 9: loadw */ var38 = ptr0[i]; /* 10: addw */ var39.i = var38.i + var44.i; /* 11: storew */ ptr0[i] = var39; } } OrcCode *_orc_code_orc_mas2_add_s16_ip; void orc_mas2_add_s16_ip (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int p1, int p2, int p3, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_mas2_add_s16_ip; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; func = c->exec; func (ex); } #endif /* orc_mas2_sub_s16_op */ #ifdef DISABLE_ORC void orc_mas2_sub_s16_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, int p1, int p2, int p3, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union32 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; orc_union16 var44; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; ptr6 = (orc_union16 *)s3; /* 3: loadpw */ var36.i = p1; /* 5: loadpl */ var37.i = p2; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr5[i]; /* 1: loadw */ var35 = ptr6[i]; /* 2: addw */ var40.i = var34.i + var35.i; /* 4: mulswl */ var41.i = var40.i * var36.i; /* 6: addl */ var42.i = var41.i + var37.i; /* 7: shrsl */ var43.i = var42.i >> p3; /* 8: convlw */ var44.i = var43.i; /* 9: loadw */ var38 = ptr4[i]; /* 10: subw */ var39.i = var38.i - var44.i; /* 11: storew */ ptr0[i] = var39; } } #else static void _backup_orc_mas2_sub_s16_op (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union32 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; orc_union16 var44; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; ptr6 = (orc_union16 *)ex->arrays[6]; /* 3: loadpw */ var36.i = ex->params[24]; /* 5: loadpl */ var37.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr5[i]; /* 1: loadw */ var35 = ptr6[i]; /* 2: addw */ var40.i = var34.i + var35.i; /* 4: mulswl */ var41.i = var40.i * var36.i; /* 6: addl */ var42.i = var41.i + var37.i; /* 7: shrsl */ var43.i = var42.i >> ex->params[26]; /* 8: convlw */ var44.i = var43.i; /* 9: loadw */ var38 = ptr4[i]; /* 10: subw */ var39.i = var38.i - var44.i; /* 11: storew */ ptr0[i] = var39; } } OrcCode *_orc_code_orc_mas2_sub_s16_op; void orc_mas2_sub_s16_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, int p1, int p2, int p3, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_mas2_sub_s16_op; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; func = c->exec; func (ex); } #endif /* orc_mas2_sub_s16_ip */ #ifdef DISABLE_ORC void orc_mas2_sub_s16_ip (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int p1, int p2, int p3, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union32 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; orc_union16 var44; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; /* 3: loadpw */ var36.i = p1; /* 5: loadpl */ var37.i = p2; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: loadw */ var35 = ptr5[i]; /* 2: addw */ var40.i = var34.i + var35.i; /* 4: mulswl */ var41.i = var40.i * var36.i; /* 6: addl */ var42.i = var41.i + var37.i; /* 7: shrsl */ var43.i = var42.i >> p3; /* 8: convlw */ var44.i = var43.i; /* 9: loadw */ var38 = ptr0[i]; /* 10: subw */ var39.i = var38.i - var44.i; /* 11: storew */ ptr0[i] = var39; } } #else static void _backup_orc_mas2_sub_s16_ip (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union32 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; orc_union16 var44; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; /* 3: loadpw */ var36.i = ex->params[24]; /* 5: loadpl */ var37.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: loadw */ var35 = ptr5[i]; /* 2: addw */ var40.i = var34.i + var35.i; /* 4: mulswl */ var41.i = var40.i * var36.i; /* 6: addl */ var42.i = var41.i + var37.i; /* 7: shrsl */ var43.i = var42.i >> ex->params[26]; /* 8: convlw */ var44.i = var43.i; /* 9: loadw */ var38 = ptr0[i]; /* 10: subw */ var39.i = var38.i - var44.i; /* 11: storew */ ptr0[i] = var39; } } OrcCode *_orc_code_orc_mas2_sub_s16_ip; void orc_mas2_sub_s16_ip (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int p1, int p2, int p3, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_mas2_sub_s16_ip; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; func = c->exec; func (ex); } #endif /* orc_mas4_across_add_s16_1991_op */ #ifdef DISABLE_ORC void orc_mas4_across_add_s16_1991_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, const orc_int16 * ORC_RESTRICT s4, const orc_int16 * ORC_RESTRICT s5, int p1, int p2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; const orc_union16 * ORC_RESTRICT ptr7; const orc_union16 * ORC_RESTRICT ptr8; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union32 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union32 var45; orc_union16 var46; orc_union32 var47; orc_union32 var48; orc_union32 var49; orc_union32 var50; orc_union16 var51; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; ptr6 = (orc_union16 *)s3; ptr7 = (orc_union16 *)s4; ptr8 = (orc_union16 *)s5; /* 3: loadpw */ var38.i = (int)0x00000009; /* 9 or 4.44659e-323f */ /* 10: loadpl */ var41.i = p1; for (i = 0; i < n; i++) { /* 0: loadw */ var36 = ptr6[i]; /* 1: loadw */ var37 = ptr7[i]; /* 2: addw */ var44.i = var36.i + var37.i; /* 4: mulswl */ var45.i = var44.i * var38.i; /* 5: loadw */ var39 = ptr5[i]; /* 6: loadw */ var40 = ptr8[i]; /* 7: addw */ var46.i = var39.i + var40.i; /* 8: convswl */ var47.i = var46.i; /* 9: subl */ var48.i = var45.i - var47.i; /* 11: addl */ var49.i = var48.i + var41.i; /* 12: shrsl */ var50.i = var49.i >> p2; /* 13: convlw */ var51.i = var50.i; /* 14: loadw */ var42 = ptr4[i]; /* 15: addw */ var43.i = var42.i + var51.i; /* 16: storew */ ptr0[i] = var43; } } #else static void _backup_orc_mas4_across_add_s16_1991_op (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; const orc_union16 * ORC_RESTRICT ptr7; const orc_union16 * ORC_RESTRICT ptr8; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union32 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union32 var45; orc_union16 var46; orc_union32 var47; orc_union32 var48; orc_union32 var49; orc_union32 var50; orc_union16 var51; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; ptr6 = (orc_union16 *)ex->arrays[6]; ptr7 = (orc_union16 *)ex->arrays[7]; ptr8 = (orc_union16 *)ex->arrays[8]; /* 3: loadpw */ var38.i = (int)0x00000009; /* 9 or 4.44659e-323f */ /* 10: loadpl */ var41.i = ex->params[24]; for (i = 0; i < n; i++) { /* 0: loadw */ var36 = ptr6[i]; /* 1: loadw */ var37 = ptr7[i]; /* 2: addw */ var44.i = var36.i + var37.i; /* 4: mulswl */ var45.i = var44.i * var38.i; /* 5: loadw */ var39 = ptr5[i]; /* 6: loadw */ var40 = ptr8[i]; /* 7: addw */ var46.i = var39.i + var40.i; /* 8: convswl */ var47.i = var46.i; /* 9: subl */ var48.i = var45.i - var47.i; /* 11: addl */ var49.i = var48.i + var41.i; /* 12: shrsl */ var50.i = var49.i >> ex->params[25]; /* 13: convlw */ var51.i = var50.i; /* 14: loadw */ var42 = ptr4[i]; /* 15: addw */ var43.i = var42.i + var51.i; /* 16: storew */ ptr0[i] = var43; } } OrcCode *_orc_code_orc_mas4_across_add_s16_1991_op; void orc_mas4_across_add_s16_1991_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, const orc_int16 * ORC_RESTRICT s4, const orc_int16 * ORC_RESTRICT s5, int p1, int p2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_mas4_across_add_s16_1991_op; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->arrays[ORC_VAR_S4] = (void *)s4; ex->arrays[ORC_VAR_S5] = (void *)s5; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } #endif /* orc_mas4_across_add_s16_1991_ip */ #ifdef DISABLE_ORC void orc_mas4_across_add_s16_1991_ip (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int p1, int p2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var36; orc_union32 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union32 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union32 var47; orc_union32 var48; orc_union32 var49; orc_union32 var50; orc_union16 var51; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; /* 3: loadpw */ var36.i = (int)0x00000009; /* 9 or 4.44659e-323f */ /* 10: loadpl */ var37.i = p1; for (i = 0; i < n; i++) { /* 0: loadoffw */ var40 = ptr4[i + 1]; /* 1: loadoffw */ var41 = ptr4[i + 2]; /* 2: addw */ var42.i = var40.i + var41.i; /* 4: mulswl */ var43.i = var42.i * var36.i; /* 5: loadw */ var44 = ptr4[i]; /* 6: loadoffw */ var45 = ptr4[i + 3]; /* 7: addw */ var46.i = var44.i + var45.i; /* 8: convswl */ var47.i = var46.i; /* 9: subl */ var48.i = var43.i - var47.i; /* 11: addl */ var49.i = var48.i + var37.i; /* 12: shrsl */ var50.i = var49.i >> p2; /* 13: convlw */ var51.i = var50.i; /* 14: loadw */ var38 = ptr0[i]; /* 15: addw */ var39.i = var38.i + var51.i; /* 16: storew */ ptr0[i] = var39; } } #else static void _backup_orc_mas4_across_add_s16_1991_ip (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var36; orc_union32 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union32 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union32 var47; orc_union32 var48; orc_union32 var49; orc_union32 var50; orc_union16 var51; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; /* 3: loadpw */ var36.i = (int)0x00000009; /* 9 or 4.44659e-323f */ /* 10: loadpl */ var37.i = ex->params[24]; for (i = 0; i < n; i++) { /* 0: loadoffw */ var40 = ptr4[i + 1]; /* 1: loadoffw */ var41 = ptr4[i + 2]; /* 2: addw */ var42.i = var40.i + var41.i; /* 4: mulswl */ var43.i = var42.i * var36.i; /* 5: loadw */ var44 = ptr4[i]; /* 6: loadoffw */ var45 = ptr4[i + 3]; /* 7: addw */ var46.i = var44.i + var45.i; /* 8: convswl */ var47.i = var46.i; /* 9: subl */ var48.i = var43.i - var47.i; /* 11: addl */ var49.i = var48.i + var37.i; /* 12: shrsl */ var50.i = var49.i >> ex->params[25]; /* 13: convlw */ var51.i = var50.i; /* 14: loadw */ var38 = ptr0[i]; /* 15: addw */ var39.i = var38.i + var51.i; /* 16: storew */ ptr0[i] = var39; } } OrcCode *_orc_code_orc_mas4_across_add_s16_1991_ip; void orc_mas4_across_add_s16_1991_ip (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int p1, int p2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_mas4_across_add_s16_1991_ip; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } #endif /* orc_mas4_across_sub_s16_1991_op */ #ifdef DISABLE_ORC void orc_mas4_across_sub_s16_1991_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, const orc_int16 * ORC_RESTRICT s4, const orc_int16 * ORC_RESTRICT s5, int p1, int p2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; const orc_union16 * ORC_RESTRICT ptr7; const orc_union16 * ORC_RESTRICT ptr8; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union32 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union32 var45; orc_union16 var46; orc_union32 var47; orc_union32 var48; orc_union32 var49; orc_union32 var50; orc_union16 var51; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; ptr6 = (orc_union16 *)s3; ptr7 = (orc_union16 *)s4; ptr8 = (orc_union16 *)s5; /* 3: loadpw */ var38.i = (int)0x00000009; /* 9 or 4.44659e-323f */ /* 10: loadpl */ var41.i = p1; for (i = 0; i < n; i++) { /* 0: loadw */ var36 = ptr6[i]; /* 1: loadw */ var37 = ptr7[i]; /* 2: addw */ var44.i = var36.i + var37.i; /* 4: mulswl */ var45.i = var44.i * var38.i; /* 5: loadw */ var39 = ptr5[i]; /* 6: loadw */ var40 = ptr8[i]; /* 7: addw */ var46.i = var39.i + var40.i; /* 8: convswl */ var47.i = var46.i; /* 9: subl */ var48.i = var45.i - var47.i; /* 11: addl */ var49.i = var48.i + var41.i; /* 12: shrsl */ var50.i = var49.i >> p2; /* 13: convlw */ var51.i = var50.i; /* 14: loadw */ var42 = ptr4[i]; /* 15: subw */ var43.i = var42.i - var51.i; /* 16: storew */ ptr0[i] = var43; } } #else static void _backup_orc_mas4_across_sub_s16_1991_op (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; const orc_union16 * ORC_RESTRICT ptr7; const orc_union16 * ORC_RESTRICT ptr8; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union32 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union32 var45; orc_union16 var46; orc_union32 var47; orc_union32 var48; orc_union32 var49; orc_union32 var50; orc_union16 var51; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; ptr6 = (orc_union16 *)ex->arrays[6]; ptr7 = (orc_union16 *)ex->arrays[7]; ptr8 = (orc_union16 *)ex->arrays[8]; /* 3: loadpw */ var38.i = (int)0x00000009; /* 9 or 4.44659e-323f */ /* 10: loadpl */ var41.i = ex->params[24]; for (i = 0; i < n; i++) { /* 0: loadw */ var36 = ptr6[i]; /* 1: loadw */ var37 = ptr7[i]; /* 2: addw */ var44.i = var36.i + var37.i; /* 4: mulswl */ var45.i = var44.i * var38.i; /* 5: loadw */ var39 = ptr5[i]; /* 6: loadw */ var40 = ptr8[i]; /* 7: addw */ var46.i = var39.i + var40.i; /* 8: convswl */ var47.i = var46.i; /* 9: subl */ var48.i = var45.i - var47.i; /* 11: addl */ var49.i = var48.i + var41.i; /* 12: shrsl */ var50.i = var49.i >> ex->params[25]; /* 13: convlw */ var51.i = var50.i; /* 14: loadw */ var42 = ptr4[i]; /* 15: subw */ var43.i = var42.i - var51.i; /* 16: storew */ ptr0[i] = var43; } } OrcCode *_orc_code_orc_mas4_across_sub_s16_1991_op; void orc_mas4_across_sub_s16_1991_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, const orc_int16 * ORC_RESTRICT s4, const orc_int16 * ORC_RESTRICT s5, int p1, int p2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_mas4_across_sub_s16_1991_op; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->arrays[ORC_VAR_S4] = (void *)s4; ex->arrays[ORC_VAR_S5] = (void *)s5; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } #endif /* orc_mas4_across_sub_s16_1991_ip */ #ifdef DISABLE_ORC void orc_mas4_across_sub_s16_1991_ip (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int p1, int p2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var36; orc_union32 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union32 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union32 var47; orc_union32 var48; orc_union32 var49; orc_union32 var50; orc_union16 var51; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; /* 3: loadpw */ var36.i = (int)0x00000009; /* 9 or 4.44659e-323f */ /* 10: loadpl */ var37.i = p1; for (i = 0; i < n; i++) { /* 0: loadoffw */ var40 = ptr4[i + 1]; /* 1: loadoffw */ var41 = ptr4[i + 2]; /* 2: addw */ var42.i = var40.i + var41.i; /* 4: mulswl */ var43.i = var42.i * var36.i; /* 5: loadw */ var44 = ptr4[i]; /* 6: loadoffw */ var45 = ptr4[i + 3]; /* 7: addw */ var46.i = var44.i + var45.i; /* 8: convswl */ var47.i = var46.i; /* 9: subl */ var48.i = var43.i - var47.i; /* 11: addl */ var49.i = var48.i + var37.i; /* 12: shrsl */ var50.i = var49.i >> p2; /* 13: convlw */ var51.i = var50.i; /* 14: loadw */ var38 = ptr0[i]; /* 15: subw */ var39.i = var38.i - var51.i; /* 16: storew */ ptr0[i] = var39; } } #else static void _backup_orc_mas4_across_sub_s16_1991_ip (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var36; orc_union32 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union32 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union32 var47; orc_union32 var48; orc_union32 var49; orc_union32 var50; orc_union16 var51; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; /* 3: loadpw */ var36.i = (int)0x00000009; /* 9 or 4.44659e-323f */ /* 10: loadpl */ var37.i = ex->params[24]; for (i = 0; i < n; i++) { /* 0: loadoffw */ var40 = ptr4[i + 1]; /* 1: loadoffw */ var41 = ptr4[i + 2]; /* 2: addw */ var42.i = var40.i + var41.i; /* 4: mulswl */ var43.i = var42.i * var36.i; /* 5: loadw */ var44 = ptr4[i]; /* 6: loadoffw */ var45 = ptr4[i + 3]; /* 7: addw */ var46.i = var44.i + var45.i; /* 8: convswl */ var47.i = var46.i; /* 9: subl */ var48.i = var43.i - var47.i; /* 11: addl */ var49.i = var48.i + var37.i; /* 12: shrsl */ var50.i = var49.i >> ex->params[25]; /* 13: convlw */ var51.i = var50.i; /* 14: loadw */ var38 = ptr0[i]; /* 15: subw */ var39.i = var38.i - var51.i; /* 16: storew */ ptr0[i] = var39; } } OrcCode *_orc_code_orc_mas4_across_sub_s16_1991_ip; void orc_mas4_across_sub_s16_1991_ip (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int p1, int p2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_mas4_across_sub_s16_1991_ip; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } #endif /* orc_subtract_s16 */ #ifdef DISABLE_ORC void orc_subtract_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: loadw */ var33 = ptr5[i]; /* 2: subw */ var34.i = var32.i - var33.i; /* 3: storew */ ptr0[i] = var34; } } #else static void _backup_orc_subtract_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: loadw */ var33 = ptr5[i]; /* 2: subw */ var34.i = var32.i - var33.i; /* 3: storew */ ptr0[i] = var34; } } OrcCode *_orc_code_orc_subtract_s16; void orc_subtract_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_subtract_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_add_s16_u8 */ #ifdef DISABLE_ORC void orc_add_s16_u8 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_int8 *)s2; for (i = 0; i < n; i++) { /* 0: loadb */ var33 = ptr5[i]; /* 1: convubw */ var36.i = (orc_uint8)var33; /* 2: loadw */ var34 = ptr4[i]; /* 3: addw */ var35.i = var36.i + var34.i; /* 4: storew */ ptr0[i] = var35; } } #else static void _backup_orc_add_s16_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_int8 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadb */ var33 = ptr5[i]; /* 1: convubw */ var36.i = (orc_uint8)var33; /* 2: loadw */ var34 = ptr4[i]; /* 3: addw */ var35.i = var36.i + var34.i; /* 4: storew */ ptr0[i] = var35; } } OrcCode *_orc_code_orc_add_s16_u8; void orc_add_s16_u8 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add_s16_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_add_s16_u8_2d */ #ifdef DISABLE_ORC void orc_add_s16_u8_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, int n, int m){ int i; int j; orc_union16 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); for (i = 0; i < n; i++) { /* 0: loadb */ var33 = ptr4[i]; /* 1: convubw */ var36.i = (orc_uint8)var33; /* 2: loadw */ var34 = ptr0[i]; /* 3: addw */ var35.i = var34.i + var36.i; /* 4: storew */ ptr0[i] = var35; } } } #else static void _backup_orc_add_s16_u8_2d (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); for (i = 0; i < n; i++) { /* 0: loadb */ var33 = ptr4[i]; /* 1: convubw */ var36.i = (orc_uint8)var33; /* 2: loadw */ var34 = ptr0[i]; /* 3: addw */ var35.i = var34.i + var36.i; /* 4: storew */ ptr0[i] = var35; } } } OrcCode *_orc_code_orc_add_s16_u8_2d; void orc_add_s16_u8_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, int n, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add_s16_u8_2d; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; func = c->exec; func (ex); } #endif /* orc_convert_s16_u8 */ #ifdef DISABLE_ORC void orc_convert_s16_u8 (orc_uint16 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var32; orc_union16 var33; ptr0 = (orc_union16 *)d1; ptr4 = (orc_int8 *)s1; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: convubw */ var33.i = (orc_uint8)var32; /* 2: storew */ ptr0[i] = var33; } } #else static void _backup_orc_convert_s16_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var32; orc_union16 var33; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_int8 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: convubw */ var33.i = (orc_uint8)var32; /* 2: storew */ ptr0[i] = var33; } } OrcCode *_orc_code_orc_convert_s16_u8; void orc_convert_s16_u8 (orc_uint16 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_convert_s16_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_convert_u8_s16 */ #ifdef DISABLE_ORC void orc_convert_u8_s16 (orc_uint8 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n){ int i; orc_int8 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_int8 var33; ptr0 = (orc_int8 *)d1; ptr4 = (orc_union16 *)s1; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: convsuswb */ var33 = ORC_CLAMP_UB(var32.i); /* 2: storeb */ ptr0[i] = var33; } } #else static void _backup_orc_convert_u8_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_int8 var33; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: convsuswb */ var33 = ORC_CLAMP_UB(var32.i); /* 2: storeb */ ptr0[i] = var33; } } OrcCode *_orc_code_orc_convert_u8_s16; void orc_convert_u8_s16 (orc_uint8 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_convert_u8_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_offsetconvert_u8_s16 */ #ifdef DISABLE_ORC void orc_offsetconvert_u8_s16 (orc_uint8 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n){ int i; orc_int8 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var33; orc_union16 var34; orc_int8 var35; orc_union16 var36; ptr0 = (orc_int8 *)d1; ptr4 = (orc_union16 *)s1; /* 1: loadpw */ var34.i = (int)0x00000080; /* 128 or 6.32404e-322f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 2: addw */ var36.i = var33.i + var34.i; /* 3: convsuswb */ var35 = ORC_CLAMP_UB(var36.i); /* 4: storeb */ ptr0[i] = var35; } } #else static void _backup_orc_offsetconvert_u8_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var33; orc_union16 var34; orc_int8 var35; orc_union16 var36; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; /* 1: loadpw */ var34.i = (int)0x00000080; /* 128 or 6.32404e-322f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 2: addw */ var36.i = var33.i + var34.i; /* 3: convsuswb */ var35 = ORC_CLAMP_UB(var36.i); /* 4: storeb */ ptr0[i] = var35; } } OrcCode *_orc_code_orc_offsetconvert_u8_s16; void orc_offsetconvert_u8_s16 (orc_uint8 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_offsetconvert_u8_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_offsetconvert_s16_u8 */ #ifdef DISABLE_ORC void orc_offsetconvert_s16_u8 (orc_int16 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; ptr0 = (orc_union16 *)d1; ptr4 = (orc_int8 *)s1; /* 2: loadpw */ var34.i = (int)0x00000080; /* 128 or 6.32404e-322f */ for (i = 0; i < n; i++) { /* 0: loadb */ var33 = ptr4[i]; /* 1: convubw */ var36.i = (orc_uint8)var33; /* 3: subw */ var35.i = var36.i - var34.i; /* 4: storew */ ptr0[i] = var35; } } #else static void _backup_orc_offsetconvert_s16_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_int8 *)ex->arrays[4]; /* 2: loadpw */ var34.i = (int)0x00000080; /* 128 or 6.32404e-322f */ for (i = 0; i < n; i++) { /* 0: loadb */ var33 = ptr4[i]; /* 1: convubw */ var36.i = (orc_uint8)var33; /* 3: subw */ var35.i = var36.i - var34.i; /* 4: storew */ ptr0[i] = var35; } } OrcCode *_orc_code_orc_offsetconvert_s16_u8; void orc_offsetconvert_s16_u8 (orc_int16 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_offsetconvert_s16_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_subtract_s16_u8 */ #ifdef DISABLE_ORC void orc_subtract_s16_u8 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_int8 *)s2; for (i = 0; i < n; i++) { /* 0: loadb */ var33 = ptr5[i]; /* 1: convubw */ var36.i = (orc_uint8)var33; /* 2: loadw */ var34 = ptr4[i]; /* 3: subw */ var35.i = var34.i - var36.i; /* 4: storew */ ptr0[i] = var35; } } #else static void _backup_orc_subtract_s16_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_int8 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadb */ var33 = ptr5[i]; /* 1: convubw */ var36.i = (orc_uint8)var33; /* 2: loadw */ var34 = ptr4[i]; /* 3: subw */ var35.i = var34.i - var36.i; /* 4: storew */ ptr0[i] = var35; } } OrcCode *_orc_code_orc_subtract_s16_u8; void orc_subtract_s16_u8 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_subtract_s16_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_multiply_and_add_s16_u8 */ #ifdef DISABLE_ORC void orc_multiply_and_add_s16_u8 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_int8 *)s2; for (i = 0; i < n; i++) { /* 0: loadb */ var33 = ptr5[i]; /* 1: convubw */ var37.i = (orc_uint8)var33; /* 2: loadw */ var34 = ptr4[i]; /* 3: mullw */ var38.i = (var37.i * var34.i) & 0xffff; /* 4: loadw */ var35 = ptr0[i]; /* 5: addw */ var36.i = var35.i + var38.i; /* 6: storew */ ptr0[i] = var36; } } #else static void _backup_orc_multiply_and_add_s16_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_int8 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadb */ var33 = ptr5[i]; /* 1: convubw */ var37.i = (orc_uint8)var33; /* 2: loadw */ var34 = ptr4[i]; /* 3: mullw */ var38.i = (var37.i * var34.i) & 0xffff; /* 4: loadw */ var35 = ptr0[i]; /* 5: addw */ var36.i = var35.i + var38.i; /* 6: storew */ ptr0[i] = var36; } } OrcCode *_orc_code_orc_multiply_and_add_s16_u8; void orc_multiply_and_add_s16_u8 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_multiply_and_add_s16_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_splat_s16_ns */ #ifdef DISABLE_ORC void orc_splat_s16_ns (orc_int16 * ORC_RESTRICT d1, int p1, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var32; orc_union16 var33; ptr0 = (orc_union16 *)d1; /* 0: loadpw */ var32.i = p1; for (i = 0; i < n; i++) { /* 1: copyw */ var33.i = var32.i; /* 2: storew */ ptr0[i] = var33; } } #else static void _backup_orc_splat_s16_ns (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var32; orc_union16 var33; ptr0 = (orc_union16 *)ex->arrays[0]; /* 0: loadpw */ var32.i = ex->params[24]; for (i = 0; i < n; i++) { /* 1: copyw */ var33.i = var32.i; /* 2: storew */ ptr0[i] = var33; } } OrcCode *_orc_code_orc_splat_s16_ns; void orc_splat_s16_ns (orc_int16 * ORC_RESTRICT d1, int p1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_splat_s16_ns; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_P1] = p1; func = c->exec; func (ex); } #endif /* orc_splat_s16_2d_4xn */ #ifdef DISABLE_ORC void orc_splat_s16_2d_4xn (orc_int16 * ORC_RESTRICT d1, int d1_stride, int p1, int m){ int i; int j; int n = 4; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var32; orc_union16 var33; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); /* 0: loadpw */ var32.i = p1; for (i = 0; i < n; i++) { /* 1: copyw */ var33.i = var32.i; /* 2: storew */ ptr0[i] = var33; } } } #else static void _backup_orc_splat_s16_2d_4xn (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 4; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var32; orc_union16 var33; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); /* 0: loadpw */ var32.i = ex->params[24]; for (i = 0; i < n; i++) { /* 1: copyw */ var33.i = var32.i; /* 2: storew */ ptr0[i] = var33; } } } OrcCode *_orc_code_orc_splat_s16_2d_4xn; void orc_splat_s16_2d_4xn (orc_int16 * ORC_RESTRICT d1, int d1_stride, int p1, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_splat_s16_2d_4xn; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 4; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->params[ORC_VAR_P1] = p1; func = c->exec; func (ex); } #endif /* orc_splat_s16_2d_8xn */ #ifdef DISABLE_ORC void orc_splat_s16_2d_8xn (orc_int16 * ORC_RESTRICT d1, int d1_stride, int p1, int m){ int i; int j; int n = 8; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var32; orc_union16 var33; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); /* 0: loadpw */ var32.i = p1; for (i = 0; i < n; i++) { /* 1: copyw */ var33.i = var32.i; /* 2: storew */ ptr0[i] = var33; } } } #else static void _backup_orc_splat_s16_2d_8xn (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 8; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var32; orc_union16 var33; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); /* 0: loadpw */ var32.i = ex->params[24]; for (i = 0; i < n; i++) { /* 1: copyw */ var33.i = var32.i; /* 2: storew */ ptr0[i] = var33; } } } OrcCode *_orc_code_orc_splat_s16_2d_8xn; void orc_splat_s16_2d_8xn (orc_int16 * ORC_RESTRICT d1, int d1_stride, int p1, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_splat_s16_2d_8xn; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 8; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->params[ORC_VAR_P1] = p1; func = c->exec; func (ex); } #endif /* orc_splat_s16_2d */ #ifdef DISABLE_ORC void orc_splat_s16_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, int p1, int n, int m){ int i; int j; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var32; orc_union16 var33; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); /* 0: loadpw */ var32.i = p1; for (i = 0; i < n; i++) { /* 1: copyw */ var33.i = var32.i; /* 2: storew */ ptr0[i] = var33; } } } #else static void _backup_orc_splat_s16_2d (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var32; orc_union16 var33; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); /* 0: loadpw */ var32.i = ex->params[24]; for (i = 0; i < n; i++) { /* 1: copyw */ var33.i = var32.i; /* 2: storew */ ptr0[i] = var33; } } } OrcCode *_orc_code_orc_splat_s16_2d; void orc_splat_s16_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, int p1, int n, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_splat_s16_2d; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->params[ORC_VAR_P1] = p1; func = c->exec; func (ex); } #endif /* orc_splat_u8_ns */ #ifdef DISABLE_ORC void orc_splat_u8_ns (orc_uint8 * ORC_RESTRICT d1, int p1, int n){ int i; orc_int8 * ORC_RESTRICT ptr0; orc_int8 var32; orc_int8 var33; ptr0 = (orc_int8 *)d1; /* 0: loadpb */ var32 = p1; for (i = 0; i < n; i++) { /* 1: copyb */ var33 = var32; /* 2: storeb */ ptr0[i] = var33; } } #else static void _backup_orc_splat_u8_ns (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; orc_int8 var32; orc_int8 var33; ptr0 = (orc_int8 *)ex->arrays[0]; /* 0: loadpb */ var32 = ex->params[24]; for (i = 0; i < n; i++) { /* 1: copyb */ var33 = var32; /* 2: storeb */ ptr0[i] = var33; } } OrcCode *_orc_code_orc_splat_u8_ns; void orc_splat_u8_ns (orc_uint8 * ORC_RESTRICT d1, int p1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_splat_u8_ns; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_P1] = p1; func = c->exec; func (ex); } #endif /* orc_splat_u8_2d */ #ifdef DISABLE_ORC void orc_splat_u8_2d (orc_uint8 * ORC_RESTRICT d1, int d1_stride, int p1, int n, int m){ int i; int j; orc_int8 * ORC_RESTRICT ptr0; orc_int8 var32; orc_int8 var33; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); /* 0: loadpb */ var32 = p1; for (i = 0; i < n; i++) { /* 1: copyb */ var33 = var32; /* 2: storeb */ ptr0[i] = var33; } } } #else static void _backup_orc_splat_u8_2d (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; orc_int8 var32; orc_int8 var33; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); /* 0: loadpb */ var32 = ex->params[24]; for (i = 0; i < n; i++) { /* 1: copyb */ var33 = var32; /* 2: storeb */ ptr0[i] = var33; } } } OrcCode *_orc_code_orc_splat_u8_2d; void orc_splat_u8_2d (orc_uint8 * ORC_RESTRICT d1, int d1_stride, int p1, int n, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_splat_u8_2d; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->params[ORC_VAR_P1] = p1; func = c->exec; func (ex); } #endif /* orc_average_u8 */ #ifdef DISABLE_ORC void orc_average_u8 (orc_uint8 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n){ int i; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; ptr0 = (orc_int8 *)d1; ptr4 = (orc_int8 *)s1; ptr5 = (orc_int8 *)s2; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: avgub */ var34 = ((orc_uint8)var32 + (orc_uint8)var33 + 1)>>1; /* 3: storeb */ ptr0[i] = var34; } } #else static void _backup_orc_average_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_int8 *)ex->arrays[4]; ptr5 = (orc_int8 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: avgub */ var34 = ((orc_uint8)var32 + (orc_uint8)var33 + 1)>>1; /* 3: storeb */ ptr0[i] = var34; } } OrcCode *_orc_code_orc_average_u8; void orc_average_u8 (orc_uint8 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_average_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_rrshift6_add_s16_2d */ #ifdef DISABLE_ORC void orc_rrshift6_add_s16_2d (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_int16 * ORC_RESTRICT s1, int s1_stride, const orc_int16 * ORC_RESTRICT s2, int s2_stride, int n, int m){ int i; int j; orc_int8 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_int8 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); /* 1: loadpw */ var34.i = (int)0x00000020; /* 32 or 1.58101e-322f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr5[i]; /* 2: addw */ var37.i = var33.i + var34.i; /* 3: shrsw */ var38.i = var37.i >> 6; /* 4: loadw */ var35 = ptr4[i]; /* 5: addw */ var39.i = var35.i + var38.i; /* 6: convsuswb */ var36 = ORC_CLAMP_UB(var39.i); /* 7: storeb */ ptr0[i] = var36; } } } #else static void _backup_orc_rrshift6_add_s16_2d (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_int8 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); /* 1: loadpw */ var34.i = (int)0x00000020; /* 32 or 1.58101e-322f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr5[i]; /* 2: addw */ var37.i = var33.i + var34.i; /* 3: shrsw */ var38.i = var37.i >> 6; /* 4: loadw */ var35 = ptr4[i]; /* 5: addw */ var39.i = var35.i + var38.i; /* 6: convsuswb */ var36 = ORC_CLAMP_UB(var39.i); /* 7: storeb */ ptr0[i] = var36; } } } OrcCode *_orc_code_orc_rrshift6_add_s16_2d; void orc_rrshift6_add_s16_2d (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_int16 * ORC_RESTRICT s1, int s1_stride, const orc_int16 * ORC_RESTRICT s2, int s2_stride, int n, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_rrshift6_add_s16_2d; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; func = c->exec; func (ex); } #endif /* orc_rrshift6_sub_s16_2d */ #ifdef DISABLE_ORC void orc_rrshift6_sub_s16_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, orc_int16 * ORC_RESTRICT d2, int d2_stride, int n, int m){ int i; int j; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr1 = ORC_PTR_OFFSET(d2, d2_stride * j); /* 1: loadpw */ var34.i = (int)0x00001fe0; /* 8160 or 4.03158e-320f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr1[i]; /* 2: subw */ var38.i = var33.i - var34.i; /* 3: shrsw */ var39.i = var38.i >> 6; /* 4: copyw */ var35.i = var39.i; /* 5: storew */ ptr1[i] = var35; /* 6: loadw */ var36 = ptr0[i]; /* 7: subw */ var37.i = var36.i - var39.i; /* 8: storew */ ptr0[i] = var37; } } } #else static void _backup_orc_rrshift6_sub_s16_2d (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr1 = ORC_PTR_OFFSET(ex->arrays[1], ex->params[1] * j); /* 1: loadpw */ var34.i = (int)0x00001fe0; /* 8160 or 4.03158e-320f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr1[i]; /* 2: subw */ var38.i = var33.i - var34.i; /* 3: shrsw */ var39.i = var38.i >> 6; /* 4: copyw */ var35.i = var39.i; /* 5: storew */ ptr1[i] = var35; /* 6: loadw */ var36 = ptr0[i]; /* 7: subw */ var37.i = var36.i - var39.i; /* 8: storew */ ptr0[i] = var37; } } } OrcCode *_orc_code_orc_rrshift6_sub_s16_2d; void orc_rrshift6_sub_s16_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, orc_int16 * ORC_RESTRICT d2, int d2_stride, int n, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_rrshift6_sub_s16_2d; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_D2] = d2; ex->params[ORC_VAR_D2] = d2_stride; func = c->exec; func (ex); } #endif /* orc_rrshift6_s16_ip_2d */ #ifdef DISABLE_ORC void orc_rrshift6_s16_ip_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, int n, int m){ int i; int j; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); /* 1: loadpw */ var34.i = (int)0x00001fe0; /* 8160 or 4.03158e-320f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr0[i]; /* 2: subw */ var36.i = var33.i - var34.i; /* 3: shrsw */ var35.i = var36.i >> 6; /* 4: storew */ ptr0[i] = var35; } } } #else static void _backup_orc_rrshift6_s16_ip_2d (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); /* 1: loadpw */ var34.i = (int)0x00001fe0; /* 8160 or 4.03158e-320f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr0[i]; /* 2: subw */ var36.i = var33.i - var34.i; /* 3: shrsw */ var35.i = var36.i >> 6; /* 4: storew */ ptr0[i] = var35; } } } OrcCode *_orc_code_orc_rrshift6_s16_ip_2d; void orc_rrshift6_s16_ip_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, int n, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_rrshift6_s16_ip_2d; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; func = c->exec; func (ex); } #endif /* orc_rrshift6_s16_ip */ #ifdef DISABLE_ORC void orc_rrshift6_s16_ip (orc_int16 * ORC_RESTRICT d1, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; ptr0 = (orc_union16 *)d1; /* 1: loadpw */ var34.i = (int)0x00001fe0; /* 8160 or 4.03158e-320f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr0[i]; /* 2: subw */ var36.i = var33.i - var34.i; /* 3: shrsw */ var35.i = var36.i >> 6; /* 4: storew */ ptr0[i] = var35; } } #else static void _backup_orc_rrshift6_s16_ip (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; ptr0 = (orc_union16 *)ex->arrays[0]; /* 1: loadpw */ var34.i = (int)0x00001fe0; /* 8160 or 4.03158e-320f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr0[i]; /* 2: subw */ var36.i = var33.i - var34.i; /* 3: shrsw */ var35.i = var36.i >> 6; /* 4: storew */ ptr0[i] = var35; } } OrcCode *_orc_code_orc_rrshift6_s16_ip; void orc_rrshift6_s16_ip (orc_int16 * ORC_RESTRICT d1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_rrshift6_s16_ip; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; func = c->exec; func (ex); } #endif /* orc_unpack_yuyv_y */ #ifdef DISABLE_ORC void orc_unpack_yuyv_y (orc_uint8 * ORC_RESTRICT d1, const orc_uint16 * ORC_RESTRICT s1, int n){ int i; orc_int8 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_int8 var33; ptr0 = (orc_int8 *)d1; ptr4 = (orc_union16 *)s1; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: select0wb */ { orc_union16 _src; _src.i = var32.i; var33 = _src.x2[0]; } /* 2: storeb */ ptr0[i] = var33; } } #else static void _backup_orc_unpack_yuyv_y (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_int8 var33; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: select0wb */ { orc_union16 _src; _src.i = var32.i; var33 = _src.x2[0]; } /* 2: storeb */ ptr0[i] = var33; } } OrcCode *_orc_code_orc_unpack_yuyv_y; void orc_unpack_yuyv_y (orc_uint8 * ORC_RESTRICT d1, const orc_uint16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_unpack_yuyv_y; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_unpack_yuyv_u */ #ifdef DISABLE_ORC void orc_unpack_yuyv_u (orc_uint8 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n){ int i; orc_int8 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var33; orc_int8 var34; orc_union16 var35; ptr0 = (orc_int8 *)d1; ptr4 = (orc_union32 *)s1; for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr4[i]; /* 1: select0lw */ { orc_union32 _src; _src.i = var33.i; var35.i = _src.x2[0]; } /* 2: select1wb */ { orc_union16 _src; _src.i = var35.i; var34 = _src.x2[1]; } /* 3: storeb */ ptr0[i] = var34; } } #else static void _backup_orc_unpack_yuyv_u (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var33; orc_int8 var34; orc_union16 var35; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr4[i]; /* 1: select0lw */ { orc_union32 _src; _src.i = var33.i; var35.i = _src.x2[0]; } /* 2: select1wb */ { orc_union16 _src; _src.i = var35.i; var34 = _src.x2[1]; } /* 3: storeb */ ptr0[i] = var34; } } OrcCode *_orc_code_orc_unpack_yuyv_u; void orc_unpack_yuyv_u (orc_uint8 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_unpack_yuyv_u; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_unpack_yuyv_v */ #ifdef DISABLE_ORC void orc_unpack_yuyv_v (orc_uint8 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n){ int i; orc_int8 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var33; orc_int8 var34; orc_union16 var35; ptr0 = (orc_int8 *)d1; ptr4 = (orc_union32 *)s1; for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr4[i]; /* 1: select1lw */ { orc_union32 _src; _src.i = var33.i; var35.i = _src.x2[1]; } /* 2: select1wb */ { orc_union16 _src; _src.i = var35.i; var34 = _src.x2[1]; } /* 3: storeb */ ptr0[i] = var34; } } #else static void _backup_orc_unpack_yuyv_v (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var33; orc_int8 var34; orc_union16 var35; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr4[i]; /* 1: select1lw */ { orc_union32 _src; _src.i = var33.i; var35.i = _src.x2[1]; } /* 2: select1wb */ { orc_union16 _src; _src.i = var35.i; var34 = _src.x2[1]; } /* 3: storeb */ ptr0[i] = var34; } } OrcCode *_orc_code_orc_unpack_yuyv_v; void orc_unpack_yuyv_v (orc_uint8 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_unpack_yuyv_v; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_packyuyv */ #ifdef DISABLE_ORC void orc_packyuyv (orc_uint32 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, const orc_uint8 * ORC_RESTRICT s3, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; orc_union16 var37; orc_int8 var38; orc_int8 var39; orc_union32 var40; orc_union16 var41; orc_int8 var42; orc_int8 var43; orc_union16 var44; orc_union16 var45; ptr0 = (orc_union32 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_int8 *)s2; ptr6 = (orc_int8 *)s3; for (i = 0; i < n; i++) { /* 0: loadw */ var37 = ptr4[i]; /* 1: copyw */ var41.i = var37.i; /* 2: select0wb */ { orc_union16 _src; _src.i = var41.i; var42 = _src.x2[0]; } /* 3: select1wb */ { orc_union16 _src; _src.i = var41.i; var43 = _src.x2[1]; } /* 4: loadb */ var38 = ptr5[i]; /* 5: mergebw */ { orc_union16 _dest; _dest.x2[0] = var42; _dest.x2[1] = var38; var44.i = _dest.i; } /* 6: loadb */ var39 = ptr6[i]; /* 7: mergebw */ { orc_union16 _dest; _dest.x2[0] = var43; _dest.x2[1] = var39; var45.i = _dest.i; } /* 8: mergewl */ { orc_union32 _dest; _dest.x2[0] = var44.i; _dest.x2[1] = var45.i; var40.i = _dest.i; } /* 9: storel */ ptr0[i] = var40; } } #else static void _backup_orc_packyuyv (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; orc_union16 var37; orc_int8 var38; orc_int8 var39; orc_union32 var40; orc_union16 var41; orc_int8 var42; orc_int8 var43; orc_union16 var44; orc_union16 var45; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_int8 *)ex->arrays[5]; ptr6 = (orc_int8 *)ex->arrays[6]; for (i = 0; i < n; i++) { /* 0: loadw */ var37 = ptr4[i]; /* 1: copyw */ var41.i = var37.i; /* 2: select0wb */ { orc_union16 _src; _src.i = var41.i; var42 = _src.x2[0]; } /* 3: select1wb */ { orc_union16 _src; _src.i = var41.i; var43 = _src.x2[1]; } /* 4: loadb */ var38 = ptr5[i]; /* 5: mergebw */ { orc_union16 _dest; _dest.x2[0] = var42; _dest.x2[1] = var38; var44.i = _dest.i; } /* 6: loadb */ var39 = ptr6[i]; /* 7: mergebw */ { orc_union16 _dest; _dest.x2[0] = var43; _dest.x2[1] = var39; var45.i = _dest.i; } /* 8: mergewl */ { orc_union32 _dest; _dest.x2[0] = var44.i; _dest.x2[1] = var45.i; var40.i = _dest.i; } /* 9: storel */ ptr0[i] = var40; } } OrcCode *_orc_code_orc_packyuyv; void orc_packyuyv (orc_uint32 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, const orc_uint8 * ORC_RESTRICT s3, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_packyuyv; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; func = c->exec; func (ex); } #endif /* orc_unpack_uyvy_y */ #ifdef DISABLE_ORC void orc_unpack_uyvy_y (orc_uint8 * ORC_RESTRICT d1, const orc_uint16 * ORC_RESTRICT s1, int n){ int i; orc_int8 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_int8 var33; ptr0 = (orc_int8 *)d1; ptr4 = (orc_union16 *)s1; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: select1wb */ { orc_union16 _src; _src.i = var32.i; var33 = _src.x2[1]; } /* 2: storeb */ ptr0[i] = var33; } } #else static void _backup_orc_unpack_uyvy_y (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_int8 var33; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: select1wb */ { orc_union16 _src; _src.i = var32.i; var33 = _src.x2[1]; } /* 2: storeb */ ptr0[i] = var33; } } OrcCode *_orc_code_orc_unpack_uyvy_y; void orc_unpack_uyvy_y (orc_uint8 * ORC_RESTRICT d1, const orc_uint16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_unpack_uyvy_y; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_unpack_uyvy_u */ #ifdef DISABLE_ORC void orc_unpack_uyvy_u (orc_uint8 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n){ int i; orc_int8 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var33; orc_int8 var34; orc_union16 var35; ptr0 = (orc_int8 *)d1; ptr4 = (orc_union32 *)s1; for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr4[i]; /* 1: select0lw */ { orc_union32 _src; _src.i = var33.i; var35.i = _src.x2[0]; } /* 2: select0wb */ { orc_union16 _src; _src.i = var35.i; var34 = _src.x2[0]; } /* 3: storeb */ ptr0[i] = var34; } } #else static void _backup_orc_unpack_uyvy_u (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var33; orc_int8 var34; orc_union16 var35; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr4[i]; /* 1: select0lw */ { orc_union32 _src; _src.i = var33.i; var35.i = _src.x2[0]; } /* 2: select0wb */ { orc_union16 _src; _src.i = var35.i; var34 = _src.x2[0]; } /* 3: storeb */ ptr0[i] = var34; } } OrcCode *_orc_code_orc_unpack_uyvy_u; void orc_unpack_uyvy_u (orc_uint8 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_unpack_uyvy_u; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_unpack_uyvy_v */ #ifdef DISABLE_ORC void orc_unpack_uyvy_v (orc_uint8 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n){ int i; orc_int8 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var33; orc_int8 var34; orc_union16 var35; ptr0 = (orc_int8 *)d1; ptr4 = (orc_union32 *)s1; for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr4[i]; /* 1: select1lw */ { orc_union32 _src; _src.i = var33.i; var35.i = _src.x2[1]; } /* 2: select0wb */ { orc_union16 _src; _src.i = var35.i; var34 = _src.x2[0]; } /* 3: storeb */ ptr0[i] = var34; } } #else static void _backup_orc_unpack_uyvy_v (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var33; orc_int8 var34; orc_union16 var35; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr4[i]; /* 1: select1lw */ { orc_union32 _src; _src.i = var33.i; var35.i = _src.x2[1]; } /* 2: select0wb */ { orc_union16 _src; _src.i = var35.i; var34 = _src.x2[0]; } /* 3: storeb */ ptr0[i] = var34; } } OrcCode *_orc_code_orc_unpack_uyvy_v; void orc_unpack_uyvy_v (orc_uint8 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_unpack_uyvy_v; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_interleave2_s16 */ #ifdef DISABLE_ORC void orc_interleave2_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var32; orc_union16 var33; orc_union32 var34; ptr0 = (orc_union32 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: loadw */ var33 = ptr5[i]; /* 2: mergewl */ { orc_union32 _dest; _dest.x2[0] = var32.i; _dest.x2[1] = var33.i; var34.i = _dest.i; } /* 3: storel */ ptr0[i] = var34; } } #else static void _backup_orc_interleave2_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var32; orc_union16 var33; orc_union32 var34; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: loadw */ var33 = ptr5[i]; /* 2: mergewl */ { orc_union32 _dest; _dest.x2[0] = var32.i; _dest.x2[1] = var33.i; var34.i = _dest.i; } /* 3: storel */ ptr0[i] = var34; } } OrcCode *_orc_code_orc_interleave2_s16; void orc_interleave2_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_interleave2_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_interleave2_rrshift1_s16 */ #ifdef DISABLE_ORC void orc_interleave2_rrshift1_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union32 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; ptr0 = (orc_union32 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; /* 1: loadpw */ var35.i = (int)0x00000001; /* 1 or 4.94066e-324f */ /* 5: loadpw */ var37.i = (int)0x00000001; /* 1 or 4.94066e-324f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 2: addw */ var39.i = var34.i + var35.i; /* 3: shrsw */ var40.i = var39.i >> 1; /* 4: loadw */ var36 = ptr5[i]; /* 6: addw */ var41.i = var36.i + var37.i; /* 7: shrsw */ var42.i = var41.i >> 1; /* 8: mergewl */ { orc_union32 _dest; _dest.x2[0] = var40.i; _dest.x2[1] = var42.i; var38.i = _dest.i; } /* 9: storel */ ptr0[i] = var38; } } #else static void _backup_orc_interleave2_rrshift1_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union32 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; /* 1: loadpw */ var35.i = (int)0x00000001; /* 1 or 4.94066e-324f */ /* 5: loadpw */ var37.i = (int)0x00000001; /* 1 or 4.94066e-324f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 2: addw */ var39.i = var34.i + var35.i; /* 3: shrsw */ var40.i = var39.i >> 1; /* 4: loadw */ var36 = ptr5[i]; /* 6: addw */ var41.i = var36.i + var37.i; /* 7: shrsw */ var42.i = var41.i >> 1; /* 8: mergewl */ { orc_union32 _dest; _dest.x2[0] = var40.i; _dest.x2[1] = var42.i; var38.i = _dest.i; } /* 9: storel */ ptr0[i] = var38; } } OrcCode *_orc_code_orc_interleave2_rrshift1_s16; void orc_interleave2_rrshift1_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_interleave2_rrshift1_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_deinterleave2_s16 */ #ifdef DISABLE_ORC void orc_deinterleave2_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var33; orc_union16 var34; orc_union16 var35; orc_union32 var36; ptr0 = (orc_union16 *)d1; ptr1 = (orc_union16 *)d2; ptr4 = (orc_union32 *)s1; for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr4[i]; /* 1: copyl */ var36.i = var33.i; /* 2: select0lw */ { orc_union32 _src; _src.i = var36.i; var34.i = _src.x2[0]; } /* 3: storew */ ptr0[i] = var34; /* 4: select1lw */ { orc_union32 _src; _src.i = var36.i; var35.i = _src.x2[1]; } /* 5: storew */ ptr1[i] = var35; } } #else static void _backup_orc_deinterleave2_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var33; orc_union16 var34; orc_union16 var35; orc_union32 var36; ptr0 = (orc_union16 *)ex->arrays[0]; ptr1 = (orc_union16 *)ex->arrays[1]; ptr4 = (orc_union32 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr4[i]; /* 1: copyl */ var36.i = var33.i; /* 2: select0lw */ { orc_union32 _src; _src.i = var36.i; var34.i = _src.x2[0]; } /* 3: storew */ ptr0[i] = var34; /* 4: select1lw */ { orc_union32 _src; _src.i = var36.i; var35.i = _src.x2[1]; } /* 5: storew */ ptr1[i] = var35; } } OrcCode *_orc_code_orc_deinterleave2_s16; void orc_deinterleave2_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_deinterleave2_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_deinterleave2_lshift1_s16 */ #ifdef DISABLE_ORC void orc_deinterleave2_lshift1_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var35; orc_union16 var36; orc_union16 var37; orc_union32 var38; orc_union16 var39; orc_union16 var40; ptr0 = (orc_union16 *)d1; ptr1 = (orc_union16 *)d2; ptr4 = (orc_union32 *)s1; for (i = 0; i < n; i++) { /* 0: loadl */ var35 = ptr4[i]; /* 1: copyl */ var38.i = var35.i; /* 2: select0lw */ { orc_union32 _src; _src.i = var38.i; var39.i = _src.x2[0]; } /* 3: shlw */ var36.i = var39.i << 1; /* 4: storew */ ptr0[i] = var36; /* 5: select1lw */ { orc_union32 _src; _src.i = var38.i; var40.i = _src.x2[1]; } /* 6: shlw */ var37.i = var40.i << 1; /* 7: storew */ ptr1[i] = var37; } } #else static void _backup_orc_deinterleave2_lshift1_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var35; orc_union16 var36; orc_union16 var37; orc_union32 var38; orc_union16 var39; orc_union16 var40; ptr0 = (orc_union16 *)ex->arrays[0]; ptr1 = (orc_union16 *)ex->arrays[1]; ptr4 = (orc_union32 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadl */ var35 = ptr4[i]; /* 1: copyl */ var38.i = var35.i; /* 2: select0lw */ { orc_union32 _src; _src.i = var38.i; var39.i = _src.x2[0]; } /* 3: shlw */ var36.i = var39.i << 1; /* 4: storew */ ptr0[i] = var36; /* 5: select1lw */ { orc_union32 _src; _src.i = var38.i; var40.i = _src.x2[1]; } /* 6: shlw */ var37.i = var40.i << 1; /* 7: storew */ ptr1[i] = var37; } } OrcCode *_orc_code_orc_deinterleave2_lshift1_s16; void orc_deinterleave2_lshift1_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_deinterleave2_lshift1_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_haar_deint_lshift1_split_s16 */ #ifdef DISABLE_ORC void orc_haar_deint_lshift1_split_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union32 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; ptr0 = (orc_union16 *)d1; ptr1 = (orc_union16 *)d2; ptr4 = (orc_union32 *)s1; /* 9: loadpw */ var37.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadl */ var35 = ptr4[i]; /* 1: copyl */ var39.i = var35.i; /* 2: select0lw */ { orc_union32 _src; _src.i = var39.i; var40.i = _src.x2[0]; } /* 3: select1lw */ { orc_union32 _src; _src.i = var39.i; var41.i = _src.x2[1]; } /* 4: shlw */ var42.i = var40.i << 1; /* 5: shlw */ var43.i = var41.i << 1; /* 6: subw */ var44.i = var43.i - var42.i; /* 7: copyw */ var36.i = var44.i; /* 8: storew */ ptr1[i] = var36; /* 10: avgsw */ var45.i = (var44.i + var37.i + 1)>>1; /* 11: addw */ var38.i = var42.i + var45.i; /* 12: storew */ ptr0[i] = var38; } } #else static void _backup_orc_haar_deint_lshift1_split_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union32 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; ptr0 = (orc_union16 *)ex->arrays[0]; ptr1 = (orc_union16 *)ex->arrays[1]; ptr4 = (orc_union32 *)ex->arrays[4]; /* 9: loadpw */ var37.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadl */ var35 = ptr4[i]; /* 1: copyl */ var39.i = var35.i; /* 2: select0lw */ { orc_union32 _src; _src.i = var39.i; var40.i = _src.x2[0]; } /* 3: select1lw */ { orc_union32 _src; _src.i = var39.i; var41.i = _src.x2[1]; } /* 4: shlw */ var42.i = var40.i << 1; /* 5: shlw */ var43.i = var41.i << 1; /* 6: subw */ var44.i = var43.i - var42.i; /* 7: copyw */ var36.i = var44.i; /* 8: storew */ ptr1[i] = var36; /* 10: avgsw */ var45.i = (var44.i + var37.i + 1)>>1; /* 11: addw */ var38.i = var42.i + var45.i; /* 12: storew */ ptr0[i] = var38; } } OrcCode *_orc_code_orc_haar_deint_lshift1_split_s16; void orc_haar_deint_lshift1_split_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_deint_lshift1_split_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_haar_deint_split_s16 */ #ifdef DISABLE_ORC void orc_haar_deint_split_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union32 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; ptr0 = (orc_union16 *)d1; ptr1 = (orc_union16 *)d2; ptr4 = (orc_union32 *)s1; /* 7: loadpw */ var37.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadl */ var35 = ptr4[i]; /* 1: copyl */ var39.i = var35.i; /* 2: select0lw */ { orc_union32 _src; _src.i = var39.i; var40.i = _src.x2[0]; } /* 3: select1lw */ { orc_union32 _src; _src.i = var39.i; var41.i = _src.x2[1]; } /* 4: subw */ var42.i = var41.i - var40.i; /* 5: copyw */ var36.i = var42.i; /* 6: storew */ ptr1[i] = var36; /* 8: avgsw */ var43.i = (var42.i + var37.i + 1)>>1; /* 9: addw */ var38.i = var40.i + var43.i; /* 10: storew */ ptr0[i] = var38; } } #else static void _backup_orc_haar_deint_split_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union32 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; ptr0 = (orc_union16 *)ex->arrays[0]; ptr1 = (orc_union16 *)ex->arrays[1]; ptr4 = (orc_union32 *)ex->arrays[4]; /* 7: loadpw */ var37.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadl */ var35 = ptr4[i]; /* 1: copyl */ var39.i = var35.i; /* 2: select0lw */ { orc_union32 _src; _src.i = var39.i; var40.i = _src.x2[0]; } /* 3: select1lw */ { orc_union32 _src; _src.i = var39.i; var41.i = _src.x2[1]; } /* 4: subw */ var42.i = var41.i - var40.i; /* 5: copyw */ var36.i = var42.i; /* 6: storew */ ptr1[i] = var36; /* 8: avgsw */ var43.i = (var42.i + var37.i + 1)>>1; /* 9: addw */ var38.i = var40.i + var43.i; /* 10: storew */ ptr0[i] = var38; } } OrcCode *_orc_code_orc_haar_deint_split_s16; void orc_haar_deint_split_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_deint_split_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_haar_split_s16_lo */ #ifdef DISABLE_ORC void orc_haar_split_s16_lo (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; /* 4: loadpw */ var36.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: copyw */ var38.i = var34.i; /* 2: loadw */ var35 = ptr5[i]; /* 3: subw */ var39.i = var35.i - var38.i; /* 5: avgsw */ var40.i = (var39.i + var36.i + 1)>>1; /* 6: addw */ var37.i = var38.i + var40.i; /* 7: storew */ ptr0[i] = var37; } } #else static void _backup_orc_haar_split_s16_lo (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; /* 4: loadpw */ var36.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: copyw */ var38.i = var34.i; /* 2: loadw */ var35 = ptr5[i]; /* 3: subw */ var39.i = var35.i - var38.i; /* 5: avgsw */ var40.i = (var39.i + var36.i + 1)>>1; /* 6: addw */ var37.i = var38.i + var40.i; /* 7: storew */ ptr0[i] = var37; } } OrcCode *_orc_code_orc_haar_split_s16_lo; void orc_haar_split_s16_lo (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_split_s16_lo; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_haar_split_s16_hi */ #ifdef DISABLE_ORC void orc_haar_split_s16_hi (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr5[i]; /* 1: loadw */ var33 = ptr4[i]; /* 2: subw */ var34.i = var32.i - var33.i; /* 3: storew */ ptr0[i] = var34; } } #else static void _backup_orc_haar_split_s16_hi (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr5[i]; /* 1: loadw */ var33 = ptr4[i]; /* 2: subw */ var34.i = var32.i - var33.i; /* 3: storew */ ptr0[i] = var34; } } OrcCode *_orc_code_orc_haar_split_s16_hi; void orc_haar_split_s16_hi (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_split_s16_hi; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_haar_split_s16_op */ #ifdef DISABLE_ORC void orc_haar_split_s16_op (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; ptr0 = (orc_union16 *)d1; ptr1 = (orc_union16 *)d2; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; /* 6: loadpw */ var37.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: copyw */ var39.i = var34.i; /* 2: loadw */ var35 = ptr5[i]; /* 3: subw */ var40.i = var35.i - var39.i; /* 4: copyw */ var36.i = var40.i; /* 5: storew */ ptr1[i] = var36; /* 7: avgsw */ var41.i = (var40.i + var37.i + 1)>>1; /* 8: addw */ var38.i = var39.i + var41.i; /* 9: storew */ ptr0[i] = var38; } } #else static void _backup_orc_haar_split_s16_op (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; ptr0 = (orc_union16 *)ex->arrays[0]; ptr1 = (orc_union16 *)ex->arrays[1]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; /* 6: loadpw */ var37.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: copyw */ var39.i = var34.i; /* 2: loadw */ var35 = ptr5[i]; /* 3: subw */ var40.i = var35.i - var39.i; /* 4: copyw */ var36.i = var40.i; /* 5: storew */ ptr1[i] = var36; /* 7: avgsw */ var41.i = (var40.i + var37.i + 1)>>1; /* 8: addw */ var38.i = var39.i + var41.i; /* 9: storew */ ptr0[i] = var38; } } OrcCode *_orc_code_orc_haar_split_s16_op; void orc_haar_split_s16_op (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_split_s16_op; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_haar_split_s16 */ #ifdef DISABLE_ORC void orc_haar_split_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; ptr0 = (orc_union16 *)d1; ptr1 = (orc_union16 *)d2; /* 7: loadpw */ var37.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr0[i]; /* 1: copyw */ var39.i = var34.i; /* 2: loadw */ var35 = ptr1[i]; /* 3: copyw */ var40.i = var35.i; /* 4: subw */ var41.i = var40.i - var39.i; /* 5: copyw */ var36.i = var41.i; /* 6: storew */ ptr1[i] = var36; /* 8: avgsw */ var42.i = (var41.i + var37.i + 1)>>1; /* 9: addw */ var38.i = var39.i + var42.i; /* 10: storew */ ptr0[i] = var38; } } #else static void _backup_orc_haar_split_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; ptr0 = (orc_union16 *)ex->arrays[0]; ptr1 = (orc_union16 *)ex->arrays[1]; /* 7: loadpw */ var37.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr0[i]; /* 1: copyw */ var39.i = var34.i; /* 2: loadw */ var35 = ptr1[i]; /* 3: copyw */ var40.i = var35.i; /* 4: subw */ var41.i = var40.i - var39.i; /* 5: copyw */ var36.i = var41.i; /* 6: storew */ ptr1[i] = var36; /* 8: avgsw */ var42.i = (var41.i + var37.i + 1)>>1; /* 9: addw */ var38.i = var39.i + var42.i; /* 10: storew */ ptr0[i] = var38; } } OrcCode *_orc_code_orc_haar_split_s16; void orc_haar_split_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_split_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; func = c->exec; func (ex); } #endif /* orc_haar_synth_s16_lo */ #ifdef DISABLE_ORC void orc_haar_synth_s16_lo (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; /* 1: loadpw */ var34.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr5[i]; /* 2: avgsw */ var37.i = (var33.i + var34.i + 1)>>1; /* 3: loadw */ var35 = ptr4[i]; /* 4: subw */ var36.i = var35.i - var37.i; /* 5: storew */ ptr0[i] = var36; } } #else static void _backup_orc_haar_synth_s16_lo (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; /* 1: loadpw */ var34.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr5[i]; /* 2: avgsw */ var37.i = (var33.i + var34.i + 1)>>1; /* 3: loadw */ var35 = ptr4[i]; /* 4: subw */ var36.i = var35.i - var37.i; /* 5: storew */ ptr0[i] = var36; } } OrcCode *_orc_code_orc_haar_synth_s16_lo; void orc_haar_synth_s16_lo (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_synth_s16_lo; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_haar_synth_s16_hi */ #ifdef DISABLE_ORC void orc_haar_synth_s16_hi (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; /* 2: loadpw */ var36.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var35 = ptr5[i]; /* 1: copyw */ var39.i = var35.i; /* 3: avgsw */ var40.i = (var39.i + var36.i + 1)>>1; /* 4: loadw */ var37 = ptr4[i]; /* 5: subw */ var41.i = var37.i - var40.i; /* 6: addw */ var38.i = var39.i + var41.i; /* 7: storew */ ptr0[i] = var38; } } #else static void _backup_orc_haar_synth_s16_hi (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; /* 2: loadpw */ var36.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var35 = ptr5[i]; /* 1: copyw */ var39.i = var35.i; /* 3: avgsw */ var40.i = (var39.i + var36.i + 1)>>1; /* 4: loadw */ var37 = ptr4[i]; /* 5: subw */ var41.i = var37.i - var40.i; /* 6: addw */ var38.i = var39.i + var41.i; /* 7: storew */ ptr0[i] = var38; } } OrcCode *_orc_code_orc_haar_synth_s16_hi; void orc_haar_synth_s16_hi (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_synth_s16_hi; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_haar_synth_s16_op */ #ifdef DISABLE_ORC void orc_haar_synth_s16_op (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; ptr0 = (orc_union16 *)d1; ptr1 = (orc_union16 *)d2; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; /* 2: loadpw */ var36.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var35 = ptr5[i]; /* 1: copyw */ var40.i = var35.i; /* 3: avgsw */ var41.i = (var40.i + var36.i + 1)>>1; /* 4: loadw */ var37 = ptr4[i]; /* 5: subw */ var42.i = var37.i - var41.i; /* 6: copyw */ var38.i = var42.i; /* 7: storew */ ptr0[i] = var38; /* 8: addw */ var39.i = var40.i + var42.i; /* 9: storew */ ptr1[i] = var39; } } #else static void _backup_orc_haar_synth_s16_op (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; ptr0 = (orc_union16 *)ex->arrays[0]; ptr1 = (orc_union16 *)ex->arrays[1]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; /* 2: loadpw */ var36.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var35 = ptr5[i]; /* 1: copyw */ var40.i = var35.i; /* 3: avgsw */ var41.i = (var40.i + var36.i + 1)>>1; /* 4: loadw */ var37 = ptr4[i]; /* 5: subw */ var42.i = var37.i - var41.i; /* 6: copyw */ var38.i = var42.i; /* 7: storew */ ptr0[i] = var38; /* 8: addw */ var39.i = var40.i + var42.i; /* 9: storew */ ptr1[i] = var39; } } OrcCode *_orc_code_orc_haar_synth_s16_op; void orc_haar_synth_s16_op (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_synth_s16_op; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_haar_synth_s16 */ #ifdef DISABLE_ORC void orc_haar_synth_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; ptr0 = (orc_union16 *)d1; ptr1 = (orc_union16 *)d2; /* 4: loadpw */ var37.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var35 = ptr0[i]; /* 1: copyw */ var40.i = var35.i; /* 2: loadw */ var36 = ptr1[i]; /* 3: copyw */ var41.i = var36.i; /* 5: avgsw */ var42.i = (var41.i + var37.i + 1)>>1; /* 6: subw */ var43.i = var40.i - var42.i; /* 7: copyw */ var38.i = var43.i; /* 8: storew */ ptr0[i] = var38; /* 9: addw */ var39.i = var41.i + var43.i; /* 10: storew */ ptr1[i] = var39; } } #else static void _backup_orc_haar_synth_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; ptr0 = (orc_union16 *)ex->arrays[0]; ptr1 = (orc_union16 *)ex->arrays[1]; /* 4: loadpw */ var37.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var35 = ptr0[i]; /* 1: copyw */ var40.i = var35.i; /* 2: loadw */ var36 = ptr1[i]; /* 3: copyw */ var41.i = var36.i; /* 5: avgsw */ var42.i = (var41.i + var37.i + 1)>>1; /* 6: subw */ var43.i = var40.i - var42.i; /* 7: copyw */ var38.i = var43.i; /* 8: storew */ ptr0[i] = var38; /* 9: addw */ var39.i = var41.i + var43.i; /* 10: storew */ ptr1[i] = var39; } } OrcCode *_orc_code_orc_haar_synth_s16; void orc_haar_synth_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_synth_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; func = c->exec; func (ex); } #endif /* orc_haar_synth_rrshift1_int_s16 */ #ifdef DISABLE_ORC void orc_haar_synth_rrshift1_int_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union32 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; ptr0 = (orc_union32 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; /* 2: loadpw */ var35.i = (int)0x00000000; /* 0 or 0f */ /* 7: loadpw */ var37.i = (int)0x00000000; /* 0 or 0f */ /* 9: loadpw */ var38.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr5[i]; /* 1: copyw */ var40.i = var34.i; /* 3: avgsw */ var41.i = (var40.i + var35.i + 1)>>1; /* 4: loadw */ var36 = ptr4[i]; /* 5: subw */ var42.i = var36.i - var41.i; /* 6: addw */ var43.i = var40.i + var42.i; /* 8: avgsw */ var44.i = (var42.i + var37.i + 1)>>1; /* 10: avgsw */ var45.i = (var43.i + var38.i + 1)>>1; /* 11: mergewl */ { orc_union32 _dest; _dest.x2[0] = var44.i; _dest.x2[1] = var45.i; var39.i = _dest.i; } /* 12: storel */ ptr0[i] = var39; } } #else static void _backup_orc_haar_synth_rrshift1_int_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union32 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; /* 2: loadpw */ var35.i = (int)0x00000000; /* 0 or 0f */ /* 7: loadpw */ var37.i = (int)0x00000000; /* 0 or 0f */ /* 9: loadpw */ var38.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr5[i]; /* 1: copyw */ var40.i = var34.i; /* 3: avgsw */ var41.i = (var40.i + var35.i + 1)>>1; /* 4: loadw */ var36 = ptr4[i]; /* 5: subw */ var42.i = var36.i - var41.i; /* 6: addw */ var43.i = var40.i + var42.i; /* 8: avgsw */ var44.i = (var42.i + var37.i + 1)>>1; /* 10: avgsw */ var45.i = (var43.i + var38.i + 1)>>1; /* 11: mergewl */ { orc_union32 _dest; _dest.x2[0] = var44.i; _dest.x2[1] = var45.i; var39.i = _dest.i; } /* 12: storel */ ptr0[i] = var39; } } OrcCode *_orc_code_orc_haar_synth_rrshift1_int_s16; void orc_haar_synth_rrshift1_int_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_synth_rrshift1_int_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_haar_synth_int_s16 */ #ifdef DISABLE_ORC void orc_haar_synth_int_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union32 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; ptr0 = (orc_union32 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; /* 2: loadpw */ var35.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr5[i]; /* 1: copyw */ var38.i = var34.i; /* 3: avgsw */ var39.i = (var38.i + var35.i + 1)>>1; /* 4: loadw */ var36 = ptr4[i]; /* 5: subw */ var40.i = var36.i - var39.i; /* 6: addw */ var41.i = var38.i + var40.i; /* 7: mergewl */ { orc_union32 _dest; _dest.x2[0] = var40.i; _dest.x2[1] = var41.i; var37.i = _dest.i; } /* 8: storel */ ptr0[i] = var37; } } #else static void _backup_orc_haar_synth_int_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union32 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; /* 2: loadpw */ var35.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr5[i]; /* 1: copyw */ var38.i = var34.i; /* 3: avgsw */ var39.i = (var38.i + var35.i + 1)>>1; /* 4: loadw */ var36 = ptr4[i]; /* 5: subw */ var40.i = var36.i - var39.i; /* 6: addw */ var41.i = var38.i + var40.i; /* 7: mergewl */ { orc_union32 _dest; _dest.x2[0] = var40.i; _dest.x2[1] = var41.i; var37.i = _dest.i; } /* 8: storel */ ptr0[i] = var37; } } OrcCode *_orc_code_orc_haar_synth_int_s16; void orc_haar_synth_int_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_synth_int_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_haar_sub_s16 */ #ifdef DISABLE_ORC void orc_haar_sub_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr0[i]; /* 1: loadw */ var33 = ptr4[i]; /* 2: subw */ var34.i = var32.i - var33.i; /* 3: storew */ ptr0[i] = var34; } } #else static void _backup_orc_haar_sub_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr0[i]; /* 1: loadw */ var33 = ptr4[i]; /* 2: subw */ var34.i = var32.i - var33.i; /* 3: storew */ ptr0[i] = var34; } } OrcCode *_orc_code_orc_haar_sub_s16; void orc_haar_sub_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_sub_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_haar_add_half_s16 */ #ifdef DISABLE_ORC void orc_haar_add_half_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; /* 1: loadpw */ var34.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 2: avgsw */ var37.i = (var33.i + var34.i + 1)>>1; /* 3: loadw */ var35 = ptr0[i]; /* 4: addw */ var36.i = var35.i + var37.i; /* 5: storew */ ptr0[i] = var36; } } #else static void _backup_orc_haar_add_half_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; /* 1: loadpw */ var34.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 2: avgsw */ var37.i = (var33.i + var34.i + 1)>>1; /* 3: loadw */ var35 = ptr0[i]; /* 4: addw */ var36.i = var35.i + var37.i; /* 5: storew */ ptr0[i] = var36; } } OrcCode *_orc_code_orc_haar_add_half_s16; void orc_haar_add_half_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_add_half_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_haar_add_s16 */ #ifdef DISABLE_ORC void orc_haar_add_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr0[i]; /* 1: loadw */ var33 = ptr4[i]; /* 2: addw */ var34.i = var32.i + var33.i; /* 3: storew */ ptr0[i] = var34; } } #else static void _backup_orc_haar_add_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr0[i]; /* 1: loadw */ var33 = ptr4[i]; /* 2: addw */ var34.i = var32.i + var33.i; /* 3: storew */ ptr0[i] = var34; } } OrcCode *_orc_code_orc_haar_add_s16; void orc_haar_add_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_add_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_haar_sub_half_s16 */ #ifdef DISABLE_ORC void orc_haar_sub_half_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; /* 1: loadpw */ var34.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 2: avgsw */ var37.i = (var33.i + var34.i + 1)>>1; /* 3: loadw */ var35 = ptr0[i]; /* 4: subw */ var36.i = var35.i - var37.i; /* 5: storew */ ptr0[i] = var36; } } #else static void _backup_orc_haar_sub_half_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; /* 1: loadpw */ var34.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 2: avgsw */ var37.i = (var33.i + var34.i + 1)>>1; /* 3: loadw */ var35 = ptr0[i]; /* 4: subw */ var36.i = var35.i - var37.i; /* 5: storew */ ptr0[i] = var36; } } OrcCode *_orc_code_orc_haar_sub_half_s16; void orc_haar_sub_half_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_sub_half_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_sum_u8 */ #ifdef DISABLE_ORC void orc_sum_u8 (orc_int32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int n){ int i; const orc_int8 * ORC_RESTRICT ptr4; orc_union32 var12 = { 0 }; orc_int8 var34; orc_union16 var35; orc_union32 var36; ptr4 = (orc_int8 *)s1; for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var35.i = (orc_uint8)var34; /* 2: convuwl */ var36.i = (orc_uint16)var35.i; /* 3: accl */ var12.i = var12.i + var36.i; } *a1 = var12.i; } #else static void _backup_orc_sum_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; const orc_int8 * ORC_RESTRICT ptr4; orc_union32 var12 = { 0 }; orc_int8 var34; orc_union16 var35; orc_union32 var36; ptr4 = (orc_int8 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var35.i = (orc_uint8)var34; /* 2: convuwl */ var36.i = (orc_uint16)var35.i; /* 3: accl */ var12.i = var12.i + var36.i; } ex->accumulators[0] = var12.i; } OrcCode *_orc_code_orc_sum_u8; void orc_sum_u8 (orc_int32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_sum_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); *a1 = orc_executor_get_accumulator (ex, ORC_VAR_A1); } #endif /* orc_sum_s16 */ #ifdef DISABLE_ORC void orc_sum_s16 (orc_int32 * ORC_RESTRICT a1, const orc_int16 * ORC_RESTRICT s1, int n){ int i; const orc_union16 * ORC_RESTRICT ptr4; orc_union32 var12 = { 0 }; orc_union16 var33; orc_union32 var34; ptr4 = (orc_union16 *)s1; for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 1: convswl */ var34.i = var33.i; /* 2: accl */ var12.i = var12.i + var34.i; } *a1 = var12.i; } #else static void _backup_orc_sum_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; const orc_union16 * ORC_RESTRICT ptr4; orc_union32 var12 = { 0 }; orc_union16 var33; orc_union32 var34; ptr4 = (orc_union16 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 1: convswl */ var34.i = var33.i; /* 2: accl */ var12.i = var12.i + var34.i; } ex->accumulators[0] = var12.i; } OrcCode *_orc_code_orc_sum_s16; void orc_sum_s16 (orc_int32 * ORC_RESTRICT a1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_sum_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); *a1 = orc_executor_get_accumulator (ex, ORC_VAR_A1); } #endif /* orc_sum_square_diff_u8 */ #ifdef DISABLE_ORC void orc_sum_square_diff_u8 (orc_int32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n){ int i; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_union32 var12 = { 0 }; orc_int8 var35; orc_int8 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union32 var41; ptr4 = (orc_int8 *)s1; ptr5 = (orc_int8 *)s2; for (i = 0; i < n; i++) { /* 0: loadb */ var35 = ptr4[i]; /* 1: convubw */ var37.i = (orc_uint8)var35; /* 2: loadb */ var36 = ptr5[i]; /* 3: convubw */ var38.i = (orc_uint8)var36; /* 4: subw */ var39.i = var37.i - var38.i; /* 5: mullw */ var40.i = (var39.i * var39.i) & 0xffff; /* 6: convuwl */ var41.i = (orc_uint16)var40.i; /* 7: accl */ var12.i = var12.i + var41.i; } *a1 = var12.i; } #else static void _backup_orc_sum_square_diff_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_union32 var12 = { 0 }; orc_int8 var35; orc_int8 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union32 var41; ptr4 = (orc_int8 *)ex->arrays[4]; ptr5 = (orc_int8 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadb */ var35 = ptr4[i]; /* 1: convubw */ var37.i = (orc_uint8)var35; /* 2: loadb */ var36 = ptr5[i]; /* 3: convubw */ var38.i = (orc_uint8)var36; /* 4: subw */ var39.i = var37.i - var38.i; /* 5: mullw */ var40.i = (var39.i * var39.i) & 0xffff; /* 6: convuwl */ var41.i = (orc_uint16)var40.i; /* 7: accl */ var12.i = var12.i + var41.i; } ex->accumulators[0] = var12.i; } OrcCode *_orc_code_orc_sum_square_diff_u8; void orc_sum_square_diff_u8 (orc_int32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_sum_square_diff_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); *a1 = orc_executor_get_accumulator (ex, ORC_VAR_A1); } #endif /* orc_dequantise_s16_2d_4xn */ #ifdef DISABLE_ORC void orc_dequantise_s16_2d_4xn (orc_int16 * ORC_RESTRICT d1, int d1_stride, const orc_int16 * ORC_RESTRICT s1, int s1_stride, int p1, int p2, int m){ int i; int j; int n = 4; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); /* 4: loadpw */ var35.i = p1; /* 6: loadpw */ var36.i = p2; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 5: mullw */ var41.i = (var40.i * var35.i) & 0xffff; /* 7: addw */ var42.i = var41.i + var36.i; /* 8: shrsw */ var43.i = var42.i >> 2; /* 9: mullw */ var37.i = (var43.i * var39.i) & 0xffff; /* 10: storew */ ptr0[i] = var37; } } } #else static void _backup_orc_dequantise_s16_2d_4xn (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 4; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); /* 4: loadpw */ var35.i = ex->params[24]; /* 6: loadpw */ var36.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 5: mullw */ var41.i = (var40.i * var35.i) & 0xffff; /* 7: addw */ var42.i = var41.i + var36.i; /* 8: shrsw */ var43.i = var42.i >> 2; /* 9: mullw */ var37.i = (var43.i * var39.i) & 0xffff; /* 10: storew */ ptr0[i] = var37; } } } OrcCode *_orc_code_orc_dequantise_s16_2d_4xn; void orc_dequantise_s16_2d_4xn (orc_int16 * ORC_RESTRICT d1, int d1_stride, const orc_int16 * ORC_RESTRICT s1, int s1_stride, int p1, int p2, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_dequantise_s16_2d_4xn; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 4; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } #endif /* orc_dequantise_s16_2d_8xn */ #ifdef DISABLE_ORC void orc_dequantise_s16_2d_8xn (orc_int16 * ORC_RESTRICT d1, int d1_stride, const orc_int16 * ORC_RESTRICT s1, int s1_stride, int p1, int p2, int m){ int i; int j; int n = 8; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); /* 4: loadpw */ var35.i = p1; /* 6: loadpw */ var36.i = p2; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 5: mullw */ var41.i = (var40.i * var35.i) & 0xffff; /* 7: addw */ var42.i = var41.i + var36.i; /* 8: shrsw */ var43.i = var42.i >> 2; /* 9: mullw */ var37.i = (var43.i * var39.i) & 0xffff; /* 10: storew */ ptr0[i] = var37; } } } #else static void _backup_orc_dequantise_s16_2d_8xn (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 8; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); /* 4: loadpw */ var35.i = ex->params[24]; /* 6: loadpw */ var36.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 5: mullw */ var41.i = (var40.i * var35.i) & 0xffff; /* 7: addw */ var42.i = var41.i + var36.i; /* 8: shrsw */ var43.i = var42.i >> 2; /* 9: mullw */ var37.i = (var43.i * var39.i) & 0xffff; /* 10: storew */ ptr0[i] = var37; } } } OrcCode *_orc_code_orc_dequantise_s16_2d_8xn; void orc_dequantise_s16_2d_8xn (orc_int16 * ORC_RESTRICT d1, int d1_stride, const orc_int16 * ORC_RESTRICT s1, int s1_stride, int p1, int p2, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_dequantise_s16_2d_8xn; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 8; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } #endif /* orc_dequantise_s16_ip_2d_8xn */ #ifdef DISABLE_ORC void orc_dequantise_s16_ip_2d_8xn (orc_int16 * ORC_RESTRICT d1, int d1_stride, int p1, int p2, int m){ int i; int j; int n = 8; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); /* 4: loadpw */ var35.i = p1; /* 6: loadpw */ var36.i = p2; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr0[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 5: mullw */ var41.i = (var40.i * var35.i) & 0xffff; /* 7: addw */ var42.i = var41.i + var36.i; /* 8: shrsw */ var43.i = var42.i >> 2; /* 9: mullw */ var37.i = (var43.i * var39.i) & 0xffff; /* 10: storew */ ptr0[i] = var37; } } } #else static void _backup_orc_dequantise_s16_ip_2d_8xn (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 8; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); /* 4: loadpw */ var35.i = ex->params[24]; /* 6: loadpw */ var36.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr0[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 5: mullw */ var41.i = (var40.i * var35.i) & 0xffff; /* 7: addw */ var42.i = var41.i + var36.i; /* 8: shrsw */ var43.i = var42.i >> 2; /* 9: mullw */ var37.i = (var43.i * var39.i) & 0xffff; /* 10: storew */ ptr0[i] = var37; } } } OrcCode *_orc_code_orc_dequantise_s16_ip_2d_8xn; void orc_dequantise_s16_ip_2d_8xn (orc_int16 * ORC_RESTRICT d1, int d1_stride, int p1, int p2, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_dequantise_s16_ip_2d_8xn; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 8; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } #endif /* orc_dequantise_s16_ip_2d */ #ifdef DISABLE_ORC void orc_dequantise_s16_ip_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, int p1, int p2, int n, int m){ int i; int j; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); /* 4: loadpw */ var35.i = p1; /* 6: loadpw */ var36.i = p2; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr0[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 5: mullw */ var41.i = (var40.i * var35.i) & 0xffff; /* 7: addw */ var42.i = var41.i + var36.i; /* 8: shrsw */ var43.i = var42.i >> 2; /* 9: mullw */ var37.i = (var43.i * var39.i) & 0xffff; /* 10: storew */ ptr0[i] = var37; } } } #else static void _backup_orc_dequantise_s16_ip_2d (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); /* 4: loadpw */ var35.i = ex->params[24]; /* 6: loadpw */ var36.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr0[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 5: mullw */ var41.i = (var40.i * var35.i) & 0xffff; /* 7: addw */ var42.i = var41.i + var36.i; /* 8: shrsw */ var43.i = var42.i >> 2; /* 9: mullw */ var37.i = (var43.i * var39.i) & 0xffff; /* 10: storew */ ptr0[i] = var37; } } } OrcCode *_orc_code_orc_dequantise_s16_ip_2d; void orc_dequantise_s16_ip_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, int p1, int p2, int n, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_dequantise_s16_ip_2d; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } #endif /* orc_dequantise_s16_ip */ #ifdef DISABLE_ORC void orc_dequantise_s16_ip (orc_int16 * ORC_RESTRICT d1, int p1, int p2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; ptr0 = (orc_union16 *)d1; /* 4: loadpw */ var35.i = p1; /* 6: loadpw */ var36.i = p2; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr0[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 5: mullw */ var41.i = (var40.i * var35.i) & 0xffff; /* 7: addw */ var42.i = var41.i + var36.i; /* 8: shrsw */ var43.i = var42.i >> 2; /* 9: mullw */ var37.i = (var43.i * var39.i) & 0xffff; /* 10: storew */ ptr0[i] = var37; } } #else static void _backup_orc_dequantise_s16_ip (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; ptr0 = (orc_union16 *)ex->arrays[0]; /* 4: loadpw */ var35.i = ex->params[24]; /* 6: loadpw */ var36.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr0[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 5: mullw */ var41.i = (var40.i * var35.i) & 0xffff; /* 7: addw */ var42.i = var41.i + var36.i; /* 8: shrsw */ var43.i = var42.i >> 2; /* 9: mullw */ var37.i = (var43.i * var39.i) & 0xffff; /* 10: storew */ ptr0[i] = var37; } } OrcCode *_orc_code_orc_dequantise_s16_ip; void orc_dequantise_s16_ip (orc_int16 * ORC_RESTRICT d1, int p1, int p2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_dequantise_s16_ip; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } #endif /* orc_dequantise_s16 */ #ifdef DISABLE_ORC void orc_dequantise_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int p1, int p2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; /* 4: loadpw */ var35.i = p1; /* 6: loadpw */ var36.i = p2; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 5: mullw */ var41.i = (var40.i * var35.i) & 0xffff; /* 7: addw */ var42.i = var41.i + var36.i; /* 8: shrsw */ var43.i = var42.i >> 2; /* 9: mullw */ var37.i = (var43.i * var39.i) & 0xffff; /* 10: storew */ ptr0[i] = var37; } } #else static void _backup_orc_dequantise_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; /* 4: loadpw */ var35.i = ex->params[24]; /* 6: loadpw */ var36.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 5: mullw */ var41.i = (var40.i * var35.i) & 0xffff; /* 7: addw */ var42.i = var41.i + var36.i; /* 8: shrsw */ var43.i = var42.i >> 2; /* 9: mullw */ var37.i = (var43.i * var39.i) & 0xffff; /* 10: storew */ ptr0[i] = var37; } } OrcCode *_orc_code_orc_dequantise_s16; void orc_dequantise_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int p1, int p2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_dequantise_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } #endif /* orc_dequantise_var_s16_ip */ #ifdef DISABLE_ORC void orc_dequantise_var_s16_ip (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr0[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 4: loadw */ var35 = ptr4[i]; /* 5: mullw */ var41.i = (var40.i * var35.i) & 0xffff; /* 6: loadw */ var36 = ptr5[i]; /* 7: addw */ var42.i = var41.i + var36.i; /* 8: shrsw */ var43.i = var42.i >> 2; /* 9: mullw */ var37.i = (var43.i * var39.i) & 0xffff; /* 10: storew */ ptr0[i] = var37; } } #else static void _backup_orc_dequantise_var_s16_ip (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr0[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 4: loadw */ var35 = ptr4[i]; /* 5: mullw */ var41.i = (var40.i * var35.i) & 0xffff; /* 6: loadw */ var36 = ptr5[i]; /* 7: addw */ var42.i = var41.i + var36.i; /* 8: shrsw */ var43.i = var42.i >> 2; /* 9: mullw */ var37.i = (var43.i * var39.i) & 0xffff; /* 10: storew */ ptr0[i] = var37; } } OrcCode *_orc_code_orc_dequantise_var_s16_ip; void orc_dequantise_var_s16_ip (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_dequantise_var_s16_ip; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_quantise1_s16 */ #ifdef DISABLE_ORC void orc_quantise1_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int p1, int p2, int p3, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; /* 5: loadpw */ var35.i = p2; /* 7: loadpw */ var36.i = p1; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 4: shlw */ var41.i = var40.i << 2; /* 6: subw */ var42.i = var41.i - var35.i; /* 8: mulhuw */ var43.i = ((orc_uint32)((orc_uint16)var42.i) * (orc_uint32)((orc_uint16)var36.i)) >> 16; /* 9: shruw */ var44.i = ((orc_uint16)var43.i) >> p3; /* 10: mullw */ var37.i = (var44.i * var39.i) & 0xffff; /* 11: storew */ ptr0[i] = var37; } } #else static void _backup_orc_quantise1_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; /* 5: loadpw */ var35.i = ex->params[25]; /* 7: loadpw */ var36.i = ex->params[24]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 4: shlw */ var41.i = var40.i << 2; /* 6: subw */ var42.i = var41.i - var35.i; /* 8: mulhuw */ var43.i = ((orc_uint32)((orc_uint16)var42.i) * (orc_uint32)((orc_uint16)var36.i)) >> 16; /* 9: shruw */ var44.i = ((orc_uint16)var43.i) >> ex->params[26]; /* 10: mullw */ var37.i = (var44.i * var39.i) & 0xffff; /* 11: storew */ ptr0[i] = var37; } } OrcCode *_orc_code_orc_quantise1_s16; void orc_quantise1_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int p1, int p2, int p3, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_quantise1_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; func = c->exec; func (ex); } #endif /* orc_quantise2_s16 */ #ifdef DISABLE_ORC void orc_quantise2_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int p1, int p2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; /* 5: loadpw */ var35.i = p2; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: copyw */ var37.i = var34.i; /* 2: signw */ var38.i = ORC_CLAMP(var37.i,-1,1); /* 3: absw */ var39.i = ORC_ABS(var37.i); /* 4: shlw */ var40.i = var39.i << 2; /* 6: subw */ var41.i = var40.i - var35.i; /* 7: shruw */ var42.i = ((orc_uint16)var41.i) >> p1; /* 8: mullw */ var36.i = (var42.i * var38.i) & 0xffff; /* 9: storew */ ptr0[i] = var36; } } #else static void _backup_orc_quantise2_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; /* 5: loadpw */ var35.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: copyw */ var37.i = var34.i; /* 2: signw */ var38.i = ORC_CLAMP(var37.i,-1,1); /* 3: absw */ var39.i = ORC_ABS(var37.i); /* 4: shlw */ var40.i = var39.i << 2; /* 6: subw */ var41.i = var40.i - var35.i; /* 7: shruw */ var42.i = ((orc_uint16)var41.i) >> ex->params[24]; /* 8: mullw */ var36.i = (var42.i * var38.i) & 0xffff; /* 9: storew */ ptr0[i] = var36; } } OrcCode *_orc_code_orc_quantise2_s16; void orc_quantise2_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int p1, int p2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_quantise2_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } #endif /* orc_quantdequant1_s16 */ #ifdef DISABLE_ORC void orc_quantdequant1_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, int p1, int p2, int p3, int p4, int p5, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; ptr0 = (orc_union16 *)d1; ptr1 = (orc_union16 *)d2; /* 5: loadpw */ var35.i = p2; /* 7: loadpw */ var36.i = p1; /* 14: loadpw */ var38.i = p4; /* 16: loadpw */ var39.i = p5; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr1[i]; /* 1: copyw */ var41.i = var34.i; /* 2: signw */ var42.i = ORC_CLAMP(var41.i,-1,1); /* 3: absw */ var43.i = ORC_ABS(var41.i); /* 4: shlw */ var44.i = var43.i << 2; /* 6: subw */ var45.i = var44.i - var35.i; /* 8: mulhuw */ var46.i = ((orc_uint32)((orc_uint16)var45.i) * (orc_uint32)((orc_uint16)var36.i)) >> 16; /* 9: shruw */ var47.i = ((orc_uint16)var46.i) >> p3; /* 10: mullw */ var48.i = (var47.i * var42.i) & 0xffff; /* 11: copyw */ var37.i = var48.i; /* 12: storew */ ptr0[i] = var37; /* 13: signw */ var49.i = ORC_CLAMP(var48.i,-1,1); /* 15: mullw */ var50.i = (var47.i * var38.i) & 0xffff; /* 17: addw */ var51.i = var50.i + var39.i; /* 18: shrsw */ var52.i = var51.i >> 2; /* 19: mullw */ var40.i = (var52.i * var49.i) & 0xffff; /* 20: storew */ ptr1[i] = var40; } } #else static void _backup_orc_quantdequant1_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; ptr0 = (orc_union16 *)ex->arrays[0]; ptr1 = (orc_union16 *)ex->arrays[1]; /* 5: loadpw */ var35.i = ex->params[25]; /* 7: loadpw */ var36.i = ex->params[24]; /* 14: loadpw */ var38.i = ex->params[27]; /* 16: loadpw */ var39.i = ex->params[28]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr1[i]; /* 1: copyw */ var41.i = var34.i; /* 2: signw */ var42.i = ORC_CLAMP(var41.i,-1,1); /* 3: absw */ var43.i = ORC_ABS(var41.i); /* 4: shlw */ var44.i = var43.i << 2; /* 6: subw */ var45.i = var44.i - var35.i; /* 8: mulhuw */ var46.i = ((orc_uint32)((orc_uint16)var45.i) * (orc_uint32)((orc_uint16)var36.i)) >> 16; /* 9: shruw */ var47.i = ((orc_uint16)var46.i) >> ex->params[26]; /* 10: mullw */ var48.i = (var47.i * var42.i) & 0xffff; /* 11: copyw */ var37.i = var48.i; /* 12: storew */ ptr0[i] = var37; /* 13: signw */ var49.i = ORC_CLAMP(var48.i,-1,1); /* 15: mullw */ var50.i = (var47.i * var38.i) & 0xffff; /* 17: addw */ var51.i = var50.i + var39.i; /* 18: shrsw */ var52.i = var51.i >> 2; /* 19: mullw */ var40.i = (var52.i * var49.i) & 0xffff; /* 20: storew */ ptr1[i] = var40; } } OrcCode *_orc_code_orc_quantdequant1_s16; void orc_quantdequant1_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, int p1, int p2, int p3, int p4, int p5, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_quantdequant1_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; ex->params[ORC_VAR_P5] = p5; func = c->exec; func (ex); } #endif /* orc_quantdequant3_s16 */ #ifdef DISABLE_ORC void orc_quantdequant3_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, int p1, int p2, int p3, int p4, int p5, int p6, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union32 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union32 var48; orc_union32 var49; orc_union32 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union16 var54; orc_union16 var55; orc_union16 var56; ptr0 = (orc_union16 *)d1; ptr1 = (orc_union16 *)d2; /* 5: loadpw */ var36.i = p2; /* 7: loadpw */ var37.i = p1; /* 9: loadpl */ var38.i = p6; /* 17: loadpw */ var40.i = p4; /* 19: loadpw */ var41.i = p5; for (i = 0; i < n; i++) { /* 0: loadw */ var35 = ptr1[i]; /* 1: copyw */ var43.i = var35.i; /* 2: signw */ var44.i = ORC_CLAMP(var43.i,-1,1); /* 3: absw */ var45.i = ORC_ABS(var43.i); /* 4: shlw */ var46.i = var45.i << 2; /* 6: subw */ var47.i = var46.i - var36.i; /* 8: muluwl */ var48.i = ((orc_uint16)var47.i) * ((orc_uint16)var37.i); /* 10: addl */ var49.i = var48.i + var38.i; /* 11: shrul */ var50.i = ((orc_uint32)var49.i) >> p3; /* 12: convlw */ var51.i = var50.i; /* 13: mullw */ var52.i = (var51.i * var44.i) & 0xffff; /* 14: copyw */ var39.i = var52.i; /* 15: storew */ ptr0[i] = var39; /* 16: signw */ var53.i = ORC_CLAMP(var52.i,-1,1); /* 18: mullw */ var54.i = (var51.i * var40.i) & 0xffff; /* 20: addw */ var55.i = var54.i + var41.i; /* 21: shrsw */ var56.i = var55.i >> 2; /* 22: mullw */ var42.i = (var56.i * var53.i) & 0xffff; /* 23: storew */ ptr1[i] = var42; } } #else static void _backup_orc_quantdequant3_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union32 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union32 var48; orc_union32 var49; orc_union32 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union16 var54; orc_union16 var55; orc_union16 var56; ptr0 = (orc_union16 *)ex->arrays[0]; ptr1 = (orc_union16 *)ex->arrays[1]; /* 5: loadpw */ var36.i = ex->params[25]; /* 7: loadpw */ var37.i = ex->params[24]; /* 9: loadpl */ var38.i = ex->params[29]; /* 17: loadpw */ var40.i = ex->params[27]; /* 19: loadpw */ var41.i = ex->params[28]; for (i = 0; i < n; i++) { /* 0: loadw */ var35 = ptr1[i]; /* 1: copyw */ var43.i = var35.i; /* 2: signw */ var44.i = ORC_CLAMP(var43.i,-1,1); /* 3: absw */ var45.i = ORC_ABS(var43.i); /* 4: shlw */ var46.i = var45.i << 2; /* 6: subw */ var47.i = var46.i - var36.i; /* 8: muluwl */ var48.i = ((orc_uint16)var47.i) * ((orc_uint16)var37.i); /* 10: addl */ var49.i = var48.i + var38.i; /* 11: shrul */ var50.i = ((orc_uint32)var49.i) >> ex->params[26]; /* 12: convlw */ var51.i = var50.i; /* 13: mullw */ var52.i = (var51.i * var44.i) & 0xffff; /* 14: copyw */ var39.i = var52.i; /* 15: storew */ ptr0[i] = var39; /* 16: signw */ var53.i = ORC_CLAMP(var52.i,-1,1); /* 18: mullw */ var54.i = (var51.i * var40.i) & 0xffff; /* 20: addw */ var55.i = var54.i + var41.i; /* 21: shrsw */ var56.i = var55.i >> 2; /* 22: mullw */ var42.i = (var56.i * var53.i) & 0xffff; /* 23: storew */ ptr1[i] = var42; } } OrcCode *_orc_code_orc_quantdequant3_s16; void orc_quantdequant3_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, int p1, int p2, int p3, int p4, int p5, int p6, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_quantdequant3_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; ex->params[ORC_VAR_P5] = p5; ex->params[ORC_VAR_P6] = p6; func = c->exec; func (ex); } #endif /* orc_quantdequant2_s16 */ #ifdef DISABLE_ORC void orc_quantdequant2_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, int p1, int p2, int p3, int p4, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; ptr0 = (orc_union16 *)d1; ptr1 = (orc_union16 *)d2; /* 5: loadpw */ var35.i = p2; /* 12: loadpw */ var37.i = p3; /* 14: loadpw */ var38.i = p4; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr1[i]; /* 1: copyw */ var40.i = var34.i; /* 2: signw */ var41.i = ORC_CLAMP(var40.i,-1,1); /* 3: absw */ var42.i = ORC_ABS(var40.i); /* 4: shlw */ var43.i = var42.i << 2; /* 6: subw */ var44.i = var43.i - var35.i; /* 7: shruw */ var45.i = ((orc_uint16)var44.i) >> p1; /* 8: mullw */ var46.i = (var45.i * var41.i) & 0xffff; /* 9: copyw */ var36.i = var46.i; /* 10: storew */ ptr0[i] = var36; /* 11: signw */ var47.i = ORC_CLAMP(var46.i,-1,1); /* 13: mullw */ var48.i = (var45.i * var37.i) & 0xffff; /* 15: addw */ var49.i = var48.i + var38.i; /* 16: shrsw */ var50.i = var49.i >> 2; /* 17: mullw */ var39.i = (var50.i * var47.i) & 0xffff; /* 18: storew */ ptr1[i] = var39; } } #else static void _backup_orc_quantdequant2_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; ptr0 = (orc_union16 *)ex->arrays[0]; ptr1 = (orc_union16 *)ex->arrays[1]; /* 5: loadpw */ var35.i = ex->params[25]; /* 12: loadpw */ var37.i = ex->params[26]; /* 14: loadpw */ var38.i = ex->params[27]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr1[i]; /* 1: copyw */ var40.i = var34.i; /* 2: signw */ var41.i = ORC_CLAMP(var40.i,-1,1); /* 3: absw */ var42.i = ORC_ABS(var40.i); /* 4: shlw */ var43.i = var42.i << 2; /* 6: subw */ var44.i = var43.i - var35.i; /* 7: shruw */ var45.i = ((orc_uint16)var44.i) >> ex->params[24]; /* 8: mullw */ var46.i = (var45.i * var41.i) & 0xffff; /* 9: copyw */ var36.i = var46.i; /* 10: storew */ ptr0[i] = var36; /* 11: signw */ var47.i = ORC_CLAMP(var46.i,-1,1); /* 13: mullw */ var48.i = (var45.i * var37.i) & 0xffff; /* 15: addw */ var49.i = var48.i + var38.i; /* 16: shrsw */ var50.i = var49.i >> 2; /* 17: mullw */ var39.i = (var50.i * var47.i) & 0xffff; /* 18: storew */ ptr1[i] = var39; } } OrcCode *_orc_code_orc_quantdequant2_s16; void orc_quantdequant2_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, int p1, int p2, int p3, int p4, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_quantdequant2_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; func = c->exec; func (ex); } #endif /* orc_downsample_vert_u8 */ #ifdef DISABLE_ORC void orc_downsample_vert_u8 (orc_uint8 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, const orc_uint8 * ORC_RESTRICT s3, const orc_uint8 * ORC_RESTRICT s4, int n){ int i; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; const orc_int8 * ORC_RESTRICT ptr7; orc_int8 var35; orc_int8 var36; orc_union16 var37; orc_int8 var38; orc_int8 var39; orc_union16 var40; orc_union16 var41; orc_int8 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; ptr0 = (orc_int8 *)d1; ptr4 = (orc_int8 *)s1; ptr5 = (orc_int8 *)s2; ptr6 = (orc_int8 *)s3; ptr7 = (orc_int8 *)s4; /* 5: loadpw */ var37.i = (int)0x00000006; /* 6 or 2.96439e-323f */ /* 12: loadpw */ var40.i = (int)0x0000001a; /* 26 or 1.28457e-322f */ /* 15: loadpw */ var41.i = (int)0x00000020; /* 32 or 1.58101e-322f */ for (i = 0; i < n; i++) { /* 0: loadb */ var35 = ptr4[i]; /* 1: convubw */ var43.i = (orc_uint8)var35; /* 2: loadb */ var36 = ptr7[i]; /* 3: convubw */ var44.i = (orc_uint8)var36; /* 4: addw */ var45.i = var43.i + var44.i; /* 6: mullw */ var46.i = (var45.i * var37.i) & 0xffff; /* 7: loadb */ var38 = ptr5[i]; /* 8: convubw */ var47.i = (orc_uint8)var38; /* 9: loadb */ var39 = ptr6[i]; /* 10: convubw */ var48.i = (orc_uint8)var39; /* 11: addw */ var49.i = var47.i + var48.i; /* 13: mullw */ var50.i = (var49.i * var40.i) & 0xffff; /* 14: addw */ var51.i = var50.i + var46.i; /* 16: addw */ var52.i = var51.i + var41.i; /* 17: shruw */ var53.i = ((orc_uint16)var52.i) >> 6; /* 18: convwb */ var42 = var53.i; /* 19: storeb */ ptr0[i] = var42; } } #else static void _backup_orc_downsample_vert_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; const orc_int8 * ORC_RESTRICT ptr7; orc_int8 var35; orc_int8 var36; orc_union16 var37; orc_int8 var38; orc_int8 var39; orc_union16 var40; orc_union16 var41; orc_int8 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_int8 *)ex->arrays[4]; ptr5 = (orc_int8 *)ex->arrays[5]; ptr6 = (orc_int8 *)ex->arrays[6]; ptr7 = (orc_int8 *)ex->arrays[7]; /* 5: loadpw */ var37.i = (int)0x00000006; /* 6 or 2.96439e-323f */ /* 12: loadpw */ var40.i = (int)0x0000001a; /* 26 or 1.28457e-322f */ /* 15: loadpw */ var41.i = (int)0x00000020; /* 32 or 1.58101e-322f */ for (i = 0; i < n; i++) { /* 0: loadb */ var35 = ptr4[i]; /* 1: convubw */ var43.i = (orc_uint8)var35; /* 2: loadb */ var36 = ptr7[i]; /* 3: convubw */ var44.i = (orc_uint8)var36; /* 4: addw */ var45.i = var43.i + var44.i; /* 6: mullw */ var46.i = (var45.i * var37.i) & 0xffff; /* 7: loadb */ var38 = ptr5[i]; /* 8: convubw */ var47.i = (orc_uint8)var38; /* 9: loadb */ var39 = ptr6[i]; /* 10: convubw */ var48.i = (orc_uint8)var39; /* 11: addw */ var49.i = var47.i + var48.i; /* 13: mullw */ var50.i = (var49.i * var40.i) & 0xffff; /* 14: addw */ var51.i = var50.i + var46.i; /* 16: addw */ var52.i = var51.i + var41.i; /* 17: shruw */ var53.i = ((orc_uint16)var52.i) >> 6; /* 18: convwb */ var42 = var53.i; /* 19: storeb */ ptr0[i] = var42; } } OrcCode *_orc_code_orc_downsample_vert_u8; void orc_downsample_vert_u8 (orc_uint8 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, const orc_uint8 * ORC_RESTRICT s3, const orc_uint8 * ORC_RESTRICT s4, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_downsample_vert_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->arrays[ORC_VAR_S4] = (void *)s4; func = c->exec; func (ex); } #endif /* orc_downsample_horiz_u8 */ #ifdef DISABLE_ORC void orc_downsample_horiz_u8 (orc_uint8 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n){ int i; orc_int8 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_int8 var43; orc_union16 var44; orc_union16 var45; orc_int8 var46; orc_union16 var47; orc_int8 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_int8 var52; orc_union16 var53; orc_int8 var54; orc_union16 var55; orc_union16 var56; orc_union16 var57; orc_union16 var58; orc_union16 var59; orc_union16 var60; ptr0 = (orc_int8 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; /* 9: loadpw */ var40.i = (int)0x00000006; /* 6 or 2.96439e-323f */ /* 16: loadpw */ var41.i = (int)0x0000001a; /* 26 or 1.28457e-322f */ /* 19: loadpw */ var42.i = (int)0x00000020; /* 32 or 1.58101e-322f */ for (i = 0; i < n; i++) { /* 0: loadw */ var38 = ptr4[i]; /* 1: copyw */ var44.i = var38.i; /* 2: loadw */ var39 = ptr5[i]; /* 3: copyw */ var45.i = var39.i; /* 4: select0wb */ { orc_union16 _src; _src.i = var44.i; var46 = _src.x2[0]; } /* 5: convubw */ var47.i = (orc_uint8)var46; /* 6: select1wb */ { orc_union16 _src; _src.i = var45.i; var48 = _src.x2[1]; } /* 7: convubw */ var49.i = (orc_uint8)var48; /* 8: addw */ var50.i = var47.i + var49.i; /* 10: mullw */ var51.i = (var50.i * var40.i) & 0xffff; /* 11: select1wb */ { orc_union16 _src; _src.i = var44.i; var52 = _src.x2[1]; } /* 12: convubw */ var53.i = (orc_uint8)var52; /* 13: select0wb */ { orc_union16 _src; _src.i = var45.i; var54 = _src.x2[0]; } /* 14: convubw */ var55.i = (orc_uint8)var54; /* 15: addw */ var56.i = var53.i + var55.i; /* 17: mullw */ var57.i = (var56.i * var41.i) & 0xffff; /* 18: addw */ var58.i = var51.i + var57.i; /* 20: addw */ var59.i = var58.i + var42.i; /* 21: shruw */ var60.i = ((orc_uint16)var59.i) >> 6; /* 22: convwb */ var43 = var60.i; /* 23: storeb */ ptr0[i] = var43; } } #else static void _backup_orc_downsample_horiz_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_int8 var43; orc_union16 var44; orc_union16 var45; orc_int8 var46; orc_union16 var47; orc_int8 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_int8 var52; orc_union16 var53; orc_int8 var54; orc_union16 var55; orc_union16 var56; orc_union16 var57; orc_union16 var58; orc_union16 var59; orc_union16 var60; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; /* 9: loadpw */ var40.i = (int)0x00000006; /* 6 or 2.96439e-323f */ /* 16: loadpw */ var41.i = (int)0x0000001a; /* 26 or 1.28457e-322f */ /* 19: loadpw */ var42.i = (int)0x00000020; /* 32 or 1.58101e-322f */ for (i = 0; i < n; i++) { /* 0: loadw */ var38 = ptr4[i]; /* 1: copyw */ var44.i = var38.i; /* 2: loadw */ var39 = ptr5[i]; /* 3: copyw */ var45.i = var39.i; /* 4: select0wb */ { orc_union16 _src; _src.i = var44.i; var46 = _src.x2[0]; } /* 5: convubw */ var47.i = (orc_uint8)var46; /* 6: select1wb */ { orc_union16 _src; _src.i = var45.i; var48 = _src.x2[1]; } /* 7: convubw */ var49.i = (orc_uint8)var48; /* 8: addw */ var50.i = var47.i + var49.i; /* 10: mullw */ var51.i = (var50.i * var40.i) & 0xffff; /* 11: select1wb */ { orc_union16 _src; _src.i = var44.i; var52 = _src.x2[1]; } /* 12: convubw */ var53.i = (orc_uint8)var52; /* 13: select0wb */ { orc_union16 _src; _src.i = var45.i; var54 = _src.x2[0]; } /* 14: convubw */ var55.i = (orc_uint8)var54; /* 15: addw */ var56.i = var53.i + var55.i; /* 17: mullw */ var57.i = (var56.i * var41.i) & 0xffff; /* 18: addw */ var58.i = var51.i + var57.i; /* 20: addw */ var59.i = var58.i + var42.i; /* 21: shruw */ var60.i = ((orc_uint16)var59.i) >> 6; /* 22: convwb */ var43 = var60.i; /* 23: storeb */ ptr0[i] = var43; } } OrcCode *_orc_code_orc_downsample_horiz_u8; void orc_downsample_horiz_u8 (orc_uint8 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_downsample_horiz_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_stats_moment_s16 */ #ifdef DISABLE_ORC void orc_stats_moment_s16 (orc_int32 * ORC_RESTRICT a1, const orc_int16 * ORC_RESTRICT s1, int n){ int i; const orc_union16 * ORC_RESTRICT ptr4; orc_union32 var12 = { 0 }; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union32 var40; ptr4 = (orc_union16 *)s1; /* 2: loadpw */ var35.i = (int)0x00000002; /* 2 or 9.88131e-324f */ /* 4: loadpw */ var36.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: absw */ var37.i = ORC_ABS(var34.i); /* 3: subw */ var38.i = var37.i - var35.i; /* 5: maxsw */ var39.i = ORC_MAX(var38.i, var36.i); /* 6: convuwl */ var40.i = (orc_uint16)var39.i; /* 7: accl */ var12.i = var12.i + var40.i; } *a1 = var12.i; } #else static void _backup_orc_stats_moment_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; const orc_union16 * ORC_RESTRICT ptr4; orc_union32 var12 = { 0 }; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union32 var40; ptr4 = (orc_union16 *)ex->arrays[4]; /* 2: loadpw */ var35.i = (int)0x00000002; /* 2 or 9.88131e-324f */ /* 4: loadpw */ var36.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: absw */ var37.i = ORC_ABS(var34.i); /* 3: subw */ var38.i = var37.i - var35.i; /* 5: maxsw */ var39.i = ORC_MAX(var38.i, var36.i); /* 6: convuwl */ var40.i = (orc_uint16)var39.i; /* 7: accl */ var12.i = var12.i + var40.i; } ex->accumulators[0] = var12.i; } OrcCode *_orc_code_orc_stats_moment_s16; void orc_stats_moment_s16 (orc_int32 * ORC_RESTRICT a1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_stats_moment_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); *a1 = orc_executor_get_accumulator (ex, ORC_VAR_A1); } #endif /* orc_stats_above_s16 */ #ifdef DISABLE_ORC void orc_stats_above_s16 (orc_int32 * ORC_RESTRICT a1, const orc_int16 * ORC_RESTRICT s1, int n){ int i; const orc_union16 * ORC_RESTRICT ptr4; orc_union32 var12 = { 0 }; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union32 var42; ptr4 = (orc_union16 *)s1; /* 2: loadpw */ var35.i = (int)0x00000001; /* 1 or 4.94066e-324f */ /* 4: loadpw */ var36.i = (int)0x00000000; /* 0 or 0f */ /* 6: loadpw */ var37.i = (int)0x00000001; /* 1 or 4.94066e-324f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: absw */ var38.i = ORC_ABS(var34.i); /* 3: subw */ var39.i = var38.i - var35.i; /* 5: maxsw */ var40.i = ORC_MAX(var39.i, var36.i); /* 7: minsw */ var41.i = ORC_MIN(var40.i, var37.i); /* 8: convuwl */ var42.i = (orc_uint16)var41.i; /* 9: accl */ var12.i = var12.i + var42.i; } *a1 = var12.i; } #else static void _backup_orc_stats_above_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; const orc_union16 * ORC_RESTRICT ptr4; orc_union32 var12 = { 0 }; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union32 var42; ptr4 = (orc_union16 *)ex->arrays[4]; /* 2: loadpw */ var35.i = (int)0x00000001; /* 1 or 4.94066e-324f */ /* 4: loadpw */ var36.i = (int)0x00000000; /* 0 or 0f */ /* 6: loadpw */ var37.i = (int)0x00000001; /* 1 or 4.94066e-324f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: absw */ var38.i = ORC_ABS(var34.i); /* 3: subw */ var39.i = var38.i - var35.i; /* 5: maxsw */ var40.i = ORC_MAX(var39.i, var36.i); /* 7: minsw */ var41.i = ORC_MIN(var40.i, var37.i); /* 8: convuwl */ var42.i = (orc_uint16)var41.i; /* 9: accl */ var12.i = var12.i + var42.i; } ex->accumulators[0] = var12.i; } OrcCode *_orc_code_orc_stats_above_s16; void orc_stats_above_s16 (orc_int32 * ORC_RESTRICT a1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_stats_above_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); *a1 = orc_executor_get_accumulator (ex, ORC_VAR_A1); } #endif /* orc_accw */ #ifdef DISABLE_ORC void orc_accw (int * ORC_RESTRICT a1, const orc_int16 * ORC_RESTRICT s1, int n){ int i; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var12 = { 0 }; orc_union16 var33; orc_union16 var34; ptr4 = (orc_union16 *)s1; for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 1: absw */ var34.i = ORC_ABS(var33.i); /* 2: accw */ var12.i = var12.i + var34.i; } *a1 = (var12.i & 0xffff); } #else static void _backup_orc_accw (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var12 = { 0 }; orc_union16 var33; orc_union16 var34; ptr4 = (orc_union16 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 1: absw */ var34.i = ORC_ABS(var33.i); /* 2: accw */ var12.i = var12.i + var34.i; } ex->accumulators[0] = (var12.i & 0xffff); } OrcCode *_orc_code_orc_accw; void orc_accw (int * ORC_RESTRICT a1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_accw; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); *a1 = orc_executor_get_accumulator (ex, ORC_VAR_A1); } #endif /* orc_avg2_8xn_u8 */ #ifdef DISABLE_ORC void orc_avg2_8xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m){ int i; int j; int n = 8; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: avgub */ var34 = ((orc_uint8)var32 + (orc_uint8)var33 + 1)>>1; /* 3: storeb */ ptr0[i] = var34; } } } #else static void _backup_orc_avg2_8xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 8; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: avgub */ var34 = ((orc_uint8)var32 + (orc_uint8)var33 + 1)>>1; /* 3: storeb */ ptr0[i] = var34; } } } OrcCode *_orc_code_orc_avg2_8xn_u8; void orc_avg2_8xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_avg2_8xn_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 8; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; func = c->exec; func (ex); } #endif /* orc_avg2_12xn_u8 */ #ifdef DISABLE_ORC void orc_avg2_12xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m){ int i; int j; int n = 12; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: avgub */ var34 = ((orc_uint8)var32 + (orc_uint8)var33 + 1)>>1; /* 3: storeb */ ptr0[i] = var34; } } } #else static void _backup_orc_avg2_12xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 12; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: avgub */ var34 = ((orc_uint8)var32 + (orc_uint8)var33 + 1)>>1; /* 3: storeb */ ptr0[i] = var34; } } } OrcCode *_orc_code_orc_avg2_12xn_u8; void orc_avg2_12xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_avg2_12xn_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 12; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; func = c->exec; func (ex); } #endif /* orc_avg2_16xn_u8 */ #ifdef DISABLE_ORC void orc_avg2_16xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m){ int i; int j; int n = 16; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: avgub */ var34 = ((orc_uint8)var32 + (orc_uint8)var33 + 1)>>1; /* 3: storeb */ ptr0[i] = var34; } } } #else static void _backup_orc_avg2_16xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 16; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: avgub */ var34 = ((orc_uint8)var32 + (orc_uint8)var33 + 1)>>1; /* 3: storeb */ ptr0[i] = var34; } } } OrcCode *_orc_code_orc_avg2_16xn_u8; void orc_avg2_16xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_avg2_16xn_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 16; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; func = c->exec; func (ex); } #endif /* orc_avg2_32xn_u8 */ #ifdef DISABLE_ORC void orc_avg2_32xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m){ int i; int j; int n = 32; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: avgub */ var34 = ((orc_uint8)var32 + (orc_uint8)var33 + 1)>>1; /* 3: storeb */ ptr0[i] = var34; } } } #else static void _backup_orc_avg2_32xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 32; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: avgub */ var34 = ((orc_uint8)var32 + (orc_uint8)var33 + 1)>>1; /* 3: storeb */ ptr0[i] = var34; } } } OrcCode *_orc_code_orc_avg2_32xn_u8; void orc_avg2_32xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_avg2_32xn_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 32; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; func = c->exec; func (ex); } #endif /* orc_avg2_nxm_u8 */ #ifdef DISABLE_ORC void orc_avg2_nxm_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int n, int m){ int i; int j; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: avgub */ var34 = ((orc_uint8)var32 + (orc_uint8)var33 + 1)>>1; /* 3: storeb */ ptr0[i] = var34; } } } #else static void _backup_orc_avg2_nxm_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: avgub */ var34 = ((orc_uint8)var32 + (orc_uint8)var33 + 1)>>1; /* 3: storeb */ ptr0[i] = var34; } } } OrcCode *_orc_code_orc_avg2_nxm_u8; void orc_avg2_nxm_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int n, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_avg2_nxm_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; func = c->exec; func (ex); } #endif /* orc_combine4_8xn_u8 */ #ifdef DISABLE_ORC void orc_combine4_8xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int m){ int i; int j; int n = 8; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; const orc_int8 * ORC_RESTRICT ptr7; orc_int8 var34; orc_union16 var35; orc_int8 var36; orc_union16 var37; orc_int8 var38; orc_union16 var39; orc_int8 var40; orc_union16 var41; orc_union16 var42; orc_int8 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union16 var54; orc_union16 var55; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); ptr6 = ORC_PTR_OFFSET(s3, s3_stride * j); ptr7 = ORC_PTR_OFFSET(s4, s4_stride * j); /* 2: loadpw */ var35.i = p1; /* 6: loadpw */ var37.i = p2; /* 11: loadpw */ var39.i = p3; /* 16: loadpw */ var41.i = p4; /* 19: loadpw */ var42.i = (int)0x00000008; /* 8 or 3.95253e-323f */ for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var44.i = (orc_uint8)var34; /* 3: mullw */ var45.i = (var44.i * var35.i) & 0xffff; /* 4: loadb */ var36 = ptr5[i]; /* 5: convubw */ var46.i = (orc_uint8)var36; /* 7: mullw */ var47.i = (var46.i * var37.i) & 0xffff; /* 8: addw */ var48.i = var45.i + var47.i; /* 9: loadb */ var38 = ptr6[i]; /* 10: convubw */ var49.i = (orc_uint8)var38; /* 12: mullw */ var50.i = (var49.i * var39.i) & 0xffff; /* 13: addw */ var51.i = var48.i + var50.i; /* 14: loadb */ var40 = ptr7[i]; /* 15: convubw */ var52.i = (orc_uint8)var40; /* 17: mullw */ var53.i = (var52.i * var41.i) & 0xffff; /* 18: addw */ var54.i = var51.i + var53.i; /* 20: addw */ var55.i = var54.i + var42.i; /* 21: convsuswb */ var43 = ORC_CLAMP_UB(var55.i); /* 22: storeb */ ptr0[i] = var43; } } } #else static void _backup_orc_combine4_8xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 8; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; const orc_int8 * ORC_RESTRICT ptr7; orc_int8 var34; orc_union16 var35; orc_int8 var36; orc_union16 var37; orc_int8 var38; orc_union16 var39; orc_int8 var40; orc_union16 var41; orc_union16 var42; orc_int8 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union16 var54; orc_union16 var55; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); ptr6 = ORC_PTR_OFFSET(ex->arrays[6], ex->params[6] * j); ptr7 = ORC_PTR_OFFSET(ex->arrays[7], ex->params[7] * j); /* 2: loadpw */ var35.i = ex->params[24]; /* 6: loadpw */ var37.i = ex->params[25]; /* 11: loadpw */ var39.i = ex->params[26]; /* 16: loadpw */ var41.i = ex->params[27]; /* 19: loadpw */ var42.i = (int)0x00000008; /* 8 or 3.95253e-323f */ for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var44.i = (orc_uint8)var34; /* 3: mullw */ var45.i = (var44.i * var35.i) & 0xffff; /* 4: loadb */ var36 = ptr5[i]; /* 5: convubw */ var46.i = (orc_uint8)var36; /* 7: mullw */ var47.i = (var46.i * var37.i) & 0xffff; /* 8: addw */ var48.i = var45.i + var47.i; /* 9: loadb */ var38 = ptr6[i]; /* 10: convubw */ var49.i = (orc_uint8)var38; /* 12: mullw */ var50.i = (var49.i * var39.i) & 0xffff; /* 13: addw */ var51.i = var48.i + var50.i; /* 14: loadb */ var40 = ptr7[i]; /* 15: convubw */ var52.i = (orc_uint8)var40; /* 17: mullw */ var53.i = (var52.i * var41.i) & 0xffff; /* 18: addw */ var54.i = var51.i + var53.i; /* 20: addw */ var55.i = var54.i + var42.i; /* 21: convsuswb */ var43 = ORC_CLAMP_UB(var55.i); /* 22: storeb */ ptr0[i] = var43; } } } OrcCode *_orc_code_orc_combine4_8xn_u8; void orc_combine4_8xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_combine4_8xn_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 8; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->params[ORC_VAR_S3] = s3_stride; ex->arrays[ORC_VAR_S4] = (void *)s4; ex->params[ORC_VAR_S4] = s4_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; func = c->exec; func (ex); } #endif /* orc_combine4_12xn_u8 */ #ifdef DISABLE_ORC void orc_combine4_12xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int m){ int i; int j; int n = 12; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; const orc_int8 * ORC_RESTRICT ptr7; orc_int8 var34; orc_union16 var35; orc_int8 var36; orc_union16 var37; orc_int8 var38; orc_union16 var39; orc_int8 var40; orc_union16 var41; orc_union16 var42; orc_int8 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union16 var54; orc_union16 var55; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); ptr6 = ORC_PTR_OFFSET(s3, s3_stride * j); ptr7 = ORC_PTR_OFFSET(s4, s4_stride * j); /* 2: loadpw */ var35.i = p1; /* 6: loadpw */ var37.i = p2; /* 11: loadpw */ var39.i = p3; /* 16: loadpw */ var41.i = p4; /* 19: loadpw */ var42.i = (int)0x00000008; /* 8 or 3.95253e-323f */ for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var44.i = (orc_uint8)var34; /* 3: mullw */ var45.i = (var44.i * var35.i) & 0xffff; /* 4: loadb */ var36 = ptr5[i]; /* 5: convubw */ var46.i = (orc_uint8)var36; /* 7: mullw */ var47.i = (var46.i * var37.i) & 0xffff; /* 8: addw */ var48.i = var45.i + var47.i; /* 9: loadb */ var38 = ptr6[i]; /* 10: convubw */ var49.i = (orc_uint8)var38; /* 12: mullw */ var50.i = (var49.i * var39.i) & 0xffff; /* 13: addw */ var51.i = var48.i + var50.i; /* 14: loadb */ var40 = ptr7[i]; /* 15: convubw */ var52.i = (orc_uint8)var40; /* 17: mullw */ var53.i = (var52.i * var41.i) & 0xffff; /* 18: addw */ var54.i = var51.i + var53.i; /* 20: addw */ var55.i = var54.i + var42.i; /* 21: convsuswb */ var43 = ORC_CLAMP_UB(var55.i); /* 22: storeb */ ptr0[i] = var43; } } } #else static void _backup_orc_combine4_12xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 12; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; const orc_int8 * ORC_RESTRICT ptr7; orc_int8 var34; orc_union16 var35; orc_int8 var36; orc_union16 var37; orc_int8 var38; orc_union16 var39; orc_int8 var40; orc_union16 var41; orc_union16 var42; orc_int8 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union16 var54; orc_union16 var55; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); ptr6 = ORC_PTR_OFFSET(ex->arrays[6], ex->params[6] * j); ptr7 = ORC_PTR_OFFSET(ex->arrays[7], ex->params[7] * j); /* 2: loadpw */ var35.i = ex->params[24]; /* 6: loadpw */ var37.i = ex->params[25]; /* 11: loadpw */ var39.i = ex->params[26]; /* 16: loadpw */ var41.i = ex->params[27]; /* 19: loadpw */ var42.i = (int)0x00000008; /* 8 or 3.95253e-323f */ for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var44.i = (orc_uint8)var34; /* 3: mullw */ var45.i = (var44.i * var35.i) & 0xffff; /* 4: loadb */ var36 = ptr5[i]; /* 5: convubw */ var46.i = (orc_uint8)var36; /* 7: mullw */ var47.i = (var46.i * var37.i) & 0xffff; /* 8: addw */ var48.i = var45.i + var47.i; /* 9: loadb */ var38 = ptr6[i]; /* 10: convubw */ var49.i = (orc_uint8)var38; /* 12: mullw */ var50.i = (var49.i * var39.i) & 0xffff; /* 13: addw */ var51.i = var48.i + var50.i; /* 14: loadb */ var40 = ptr7[i]; /* 15: convubw */ var52.i = (orc_uint8)var40; /* 17: mullw */ var53.i = (var52.i * var41.i) & 0xffff; /* 18: addw */ var54.i = var51.i + var53.i; /* 20: addw */ var55.i = var54.i + var42.i; /* 21: convsuswb */ var43 = ORC_CLAMP_UB(var55.i); /* 22: storeb */ ptr0[i] = var43; } } } OrcCode *_orc_code_orc_combine4_12xn_u8; void orc_combine4_12xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_combine4_12xn_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 12; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->params[ORC_VAR_S3] = s3_stride; ex->arrays[ORC_VAR_S4] = (void *)s4; ex->params[ORC_VAR_S4] = s4_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; func = c->exec; func (ex); } #endif /* orc_combine4_16xn_u8 */ #ifdef DISABLE_ORC void orc_combine4_16xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int m){ int i; int j; int n = 16; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; const orc_int8 * ORC_RESTRICT ptr7; orc_int8 var34; orc_union16 var35; orc_int8 var36; orc_union16 var37; orc_int8 var38; orc_union16 var39; orc_int8 var40; orc_union16 var41; orc_union16 var42; orc_int8 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union16 var54; orc_union16 var55; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); ptr6 = ORC_PTR_OFFSET(s3, s3_stride * j); ptr7 = ORC_PTR_OFFSET(s4, s4_stride * j); /* 2: loadpw */ var35.i = p1; /* 6: loadpw */ var37.i = p2; /* 11: loadpw */ var39.i = p3; /* 16: loadpw */ var41.i = p4; /* 19: loadpw */ var42.i = (int)0x00000008; /* 8 or 3.95253e-323f */ for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var44.i = (orc_uint8)var34; /* 3: mullw */ var45.i = (var44.i * var35.i) & 0xffff; /* 4: loadb */ var36 = ptr5[i]; /* 5: convubw */ var46.i = (orc_uint8)var36; /* 7: mullw */ var47.i = (var46.i * var37.i) & 0xffff; /* 8: addw */ var48.i = var45.i + var47.i; /* 9: loadb */ var38 = ptr6[i]; /* 10: convubw */ var49.i = (orc_uint8)var38; /* 12: mullw */ var50.i = (var49.i * var39.i) & 0xffff; /* 13: addw */ var51.i = var48.i + var50.i; /* 14: loadb */ var40 = ptr7[i]; /* 15: convubw */ var52.i = (orc_uint8)var40; /* 17: mullw */ var53.i = (var52.i * var41.i) & 0xffff; /* 18: addw */ var54.i = var51.i + var53.i; /* 20: addw */ var55.i = var54.i + var42.i; /* 21: convsuswb */ var43 = ORC_CLAMP_UB(var55.i); /* 22: storeb */ ptr0[i] = var43; } } } #else static void _backup_orc_combine4_16xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 16; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; const orc_int8 * ORC_RESTRICT ptr7; orc_int8 var34; orc_union16 var35; orc_int8 var36; orc_union16 var37; orc_int8 var38; orc_union16 var39; orc_int8 var40; orc_union16 var41; orc_union16 var42; orc_int8 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union16 var54; orc_union16 var55; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); ptr6 = ORC_PTR_OFFSET(ex->arrays[6], ex->params[6] * j); ptr7 = ORC_PTR_OFFSET(ex->arrays[7], ex->params[7] * j); /* 2: loadpw */ var35.i = ex->params[24]; /* 6: loadpw */ var37.i = ex->params[25]; /* 11: loadpw */ var39.i = ex->params[26]; /* 16: loadpw */ var41.i = ex->params[27]; /* 19: loadpw */ var42.i = (int)0x00000008; /* 8 or 3.95253e-323f */ for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var44.i = (orc_uint8)var34; /* 3: mullw */ var45.i = (var44.i * var35.i) & 0xffff; /* 4: loadb */ var36 = ptr5[i]; /* 5: convubw */ var46.i = (orc_uint8)var36; /* 7: mullw */ var47.i = (var46.i * var37.i) & 0xffff; /* 8: addw */ var48.i = var45.i + var47.i; /* 9: loadb */ var38 = ptr6[i]; /* 10: convubw */ var49.i = (orc_uint8)var38; /* 12: mullw */ var50.i = (var49.i * var39.i) & 0xffff; /* 13: addw */ var51.i = var48.i + var50.i; /* 14: loadb */ var40 = ptr7[i]; /* 15: convubw */ var52.i = (orc_uint8)var40; /* 17: mullw */ var53.i = (var52.i * var41.i) & 0xffff; /* 18: addw */ var54.i = var51.i + var53.i; /* 20: addw */ var55.i = var54.i + var42.i; /* 21: convsuswb */ var43 = ORC_CLAMP_UB(var55.i); /* 22: storeb */ ptr0[i] = var43; } } } OrcCode *_orc_code_orc_combine4_16xn_u8; void orc_combine4_16xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_combine4_16xn_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 16; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->params[ORC_VAR_S3] = s3_stride; ex->arrays[ORC_VAR_S4] = (void *)s4; ex->params[ORC_VAR_S4] = s4_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; func = c->exec; func (ex); } #endif /* orc_combine4_24xn_u8 */ #ifdef DISABLE_ORC void orc_combine4_24xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int m){ int i; int j; int n = 24; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; const orc_int8 * ORC_RESTRICT ptr7; orc_int8 var34; orc_union16 var35; orc_int8 var36; orc_union16 var37; orc_int8 var38; orc_union16 var39; orc_int8 var40; orc_union16 var41; orc_union16 var42; orc_int8 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union16 var54; orc_union16 var55; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); ptr6 = ORC_PTR_OFFSET(s3, s3_stride * j); ptr7 = ORC_PTR_OFFSET(s4, s4_stride * j); /* 2: loadpw */ var35.i = p1; /* 6: loadpw */ var37.i = p2; /* 11: loadpw */ var39.i = p3; /* 16: loadpw */ var41.i = p4; /* 19: loadpw */ var42.i = (int)0x00000008; /* 8 or 3.95253e-323f */ for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var44.i = (orc_uint8)var34; /* 3: mullw */ var45.i = (var44.i * var35.i) & 0xffff; /* 4: loadb */ var36 = ptr5[i]; /* 5: convubw */ var46.i = (orc_uint8)var36; /* 7: mullw */ var47.i = (var46.i * var37.i) & 0xffff; /* 8: addw */ var48.i = var45.i + var47.i; /* 9: loadb */ var38 = ptr6[i]; /* 10: convubw */ var49.i = (orc_uint8)var38; /* 12: mullw */ var50.i = (var49.i * var39.i) & 0xffff; /* 13: addw */ var51.i = var48.i + var50.i; /* 14: loadb */ var40 = ptr7[i]; /* 15: convubw */ var52.i = (orc_uint8)var40; /* 17: mullw */ var53.i = (var52.i * var41.i) & 0xffff; /* 18: addw */ var54.i = var51.i + var53.i; /* 20: addw */ var55.i = var54.i + var42.i; /* 21: convsuswb */ var43 = ORC_CLAMP_UB(var55.i); /* 22: storeb */ ptr0[i] = var43; } } } #else static void _backup_orc_combine4_24xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 24; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; const orc_int8 * ORC_RESTRICT ptr7; orc_int8 var34; orc_union16 var35; orc_int8 var36; orc_union16 var37; orc_int8 var38; orc_union16 var39; orc_int8 var40; orc_union16 var41; orc_union16 var42; orc_int8 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union16 var54; orc_union16 var55; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); ptr6 = ORC_PTR_OFFSET(ex->arrays[6], ex->params[6] * j); ptr7 = ORC_PTR_OFFSET(ex->arrays[7], ex->params[7] * j); /* 2: loadpw */ var35.i = ex->params[24]; /* 6: loadpw */ var37.i = ex->params[25]; /* 11: loadpw */ var39.i = ex->params[26]; /* 16: loadpw */ var41.i = ex->params[27]; /* 19: loadpw */ var42.i = (int)0x00000008; /* 8 or 3.95253e-323f */ for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var44.i = (orc_uint8)var34; /* 3: mullw */ var45.i = (var44.i * var35.i) & 0xffff; /* 4: loadb */ var36 = ptr5[i]; /* 5: convubw */ var46.i = (orc_uint8)var36; /* 7: mullw */ var47.i = (var46.i * var37.i) & 0xffff; /* 8: addw */ var48.i = var45.i + var47.i; /* 9: loadb */ var38 = ptr6[i]; /* 10: convubw */ var49.i = (orc_uint8)var38; /* 12: mullw */ var50.i = (var49.i * var39.i) & 0xffff; /* 13: addw */ var51.i = var48.i + var50.i; /* 14: loadb */ var40 = ptr7[i]; /* 15: convubw */ var52.i = (orc_uint8)var40; /* 17: mullw */ var53.i = (var52.i * var41.i) & 0xffff; /* 18: addw */ var54.i = var51.i + var53.i; /* 20: addw */ var55.i = var54.i + var42.i; /* 21: convsuswb */ var43 = ORC_CLAMP_UB(var55.i); /* 22: storeb */ ptr0[i] = var43; } } } OrcCode *_orc_code_orc_combine4_24xn_u8; void orc_combine4_24xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_combine4_24xn_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 24; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->params[ORC_VAR_S3] = s3_stride; ex->arrays[ORC_VAR_S4] = (void *)s4; ex->params[ORC_VAR_S4] = s4_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; func = c->exec; func (ex); } #endif /* orc_combine4_32xn_u8 */ #ifdef DISABLE_ORC void orc_combine4_32xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int m){ int i; int j; int n = 32; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; const orc_int8 * ORC_RESTRICT ptr7; orc_int8 var34; orc_union16 var35; orc_int8 var36; orc_union16 var37; orc_int8 var38; orc_union16 var39; orc_int8 var40; orc_union16 var41; orc_union16 var42; orc_int8 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union16 var54; orc_union16 var55; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); ptr6 = ORC_PTR_OFFSET(s3, s3_stride * j); ptr7 = ORC_PTR_OFFSET(s4, s4_stride * j); /* 2: loadpw */ var35.i = p1; /* 6: loadpw */ var37.i = p2; /* 11: loadpw */ var39.i = p3; /* 16: loadpw */ var41.i = p4; /* 19: loadpw */ var42.i = (int)0x00000008; /* 8 or 3.95253e-323f */ for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var44.i = (orc_uint8)var34; /* 3: mullw */ var45.i = (var44.i * var35.i) & 0xffff; /* 4: loadb */ var36 = ptr5[i]; /* 5: convubw */ var46.i = (orc_uint8)var36; /* 7: mullw */ var47.i = (var46.i * var37.i) & 0xffff; /* 8: addw */ var48.i = var45.i + var47.i; /* 9: loadb */ var38 = ptr6[i]; /* 10: convubw */ var49.i = (orc_uint8)var38; /* 12: mullw */ var50.i = (var49.i * var39.i) & 0xffff; /* 13: addw */ var51.i = var48.i + var50.i; /* 14: loadb */ var40 = ptr7[i]; /* 15: convubw */ var52.i = (orc_uint8)var40; /* 17: mullw */ var53.i = (var52.i * var41.i) & 0xffff; /* 18: addw */ var54.i = var51.i + var53.i; /* 20: addw */ var55.i = var54.i + var42.i; /* 21: convsuswb */ var43 = ORC_CLAMP_UB(var55.i); /* 22: storeb */ ptr0[i] = var43; } } } #else static void _backup_orc_combine4_32xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 32; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; const orc_int8 * ORC_RESTRICT ptr7; orc_int8 var34; orc_union16 var35; orc_int8 var36; orc_union16 var37; orc_int8 var38; orc_union16 var39; orc_int8 var40; orc_union16 var41; orc_union16 var42; orc_int8 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union16 var54; orc_union16 var55; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); ptr6 = ORC_PTR_OFFSET(ex->arrays[6], ex->params[6] * j); ptr7 = ORC_PTR_OFFSET(ex->arrays[7], ex->params[7] * j); /* 2: loadpw */ var35.i = ex->params[24]; /* 6: loadpw */ var37.i = ex->params[25]; /* 11: loadpw */ var39.i = ex->params[26]; /* 16: loadpw */ var41.i = ex->params[27]; /* 19: loadpw */ var42.i = (int)0x00000008; /* 8 or 3.95253e-323f */ for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var44.i = (orc_uint8)var34; /* 3: mullw */ var45.i = (var44.i * var35.i) & 0xffff; /* 4: loadb */ var36 = ptr5[i]; /* 5: convubw */ var46.i = (orc_uint8)var36; /* 7: mullw */ var47.i = (var46.i * var37.i) & 0xffff; /* 8: addw */ var48.i = var45.i + var47.i; /* 9: loadb */ var38 = ptr6[i]; /* 10: convubw */ var49.i = (orc_uint8)var38; /* 12: mullw */ var50.i = (var49.i * var39.i) & 0xffff; /* 13: addw */ var51.i = var48.i + var50.i; /* 14: loadb */ var40 = ptr7[i]; /* 15: convubw */ var52.i = (orc_uint8)var40; /* 17: mullw */ var53.i = (var52.i * var41.i) & 0xffff; /* 18: addw */ var54.i = var51.i + var53.i; /* 20: addw */ var55.i = var54.i + var42.i; /* 21: convsuswb */ var43 = ORC_CLAMP_UB(var55.i); /* 22: storeb */ ptr0[i] = var43; } } } OrcCode *_orc_code_orc_combine4_32xn_u8; void orc_combine4_32xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_combine4_32xn_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 32; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->params[ORC_VAR_S3] = s3_stride; ex->arrays[ORC_VAR_S4] = (void *)s4; ex->params[ORC_VAR_S4] = s4_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; func = c->exec; func (ex); } #endif /* orc_combine4_nxm_u8 */ #ifdef DISABLE_ORC void orc_combine4_nxm_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int n, int m){ int i; int j; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; const orc_int8 * ORC_RESTRICT ptr7; orc_int8 var34; orc_union16 var35; orc_int8 var36; orc_union16 var37; orc_int8 var38; orc_union16 var39; orc_int8 var40; orc_union16 var41; orc_union16 var42; orc_int8 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union16 var54; orc_union16 var55; orc_union16 var56; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); ptr6 = ORC_PTR_OFFSET(s3, s3_stride * j); ptr7 = ORC_PTR_OFFSET(s4, s4_stride * j); /* 2: loadpw */ var35.i = p1; /* 6: loadpw */ var37.i = p2; /* 11: loadpw */ var39.i = p3; /* 16: loadpw */ var41.i = p4; /* 19: loadpw */ var42.i = (int)0x00000008; /* 8 or 3.95253e-323f */ for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var44.i = (orc_uint8)var34; /* 3: mullw */ var45.i = (var44.i * var35.i) & 0xffff; /* 4: loadb */ var36 = ptr5[i]; /* 5: convubw */ var46.i = (orc_uint8)var36; /* 7: mullw */ var47.i = (var46.i * var37.i) & 0xffff; /* 8: addw */ var48.i = var45.i + var47.i; /* 9: loadb */ var38 = ptr6[i]; /* 10: convubw */ var49.i = (orc_uint8)var38; /* 12: mullw */ var50.i = (var49.i * var39.i) & 0xffff; /* 13: addw */ var51.i = var48.i + var50.i; /* 14: loadb */ var40 = ptr7[i]; /* 15: convubw */ var52.i = (orc_uint8)var40; /* 17: mullw */ var53.i = (var52.i * var41.i) & 0xffff; /* 18: addw */ var54.i = var51.i + var53.i; /* 20: addw */ var55.i = var54.i + var42.i; /* 21: shrsw */ var56.i = var55.i >> 4; /* 22: convsuswb */ var43 = ORC_CLAMP_UB(var56.i); /* 23: storeb */ ptr0[i] = var43; } } } #else static void _backup_orc_combine4_nxm_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; const orc_int8 * ORC_RESTRICT ptr7; orc_int8 var34; orc_union16 var35; orc_int8 var36; orc_union16 var37; orc_int8 var38; orc_union16 var39; orc_int8 var40; orc_union16 var41; orc_union16 var42; orc_int8 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union16 var54; orc_union16 var55; orc_union16 var56; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); ptr6 = ORC_PTR_OFFSET(ex->arrays[6], ex->params[6] * j); ptr7 = ORC_PTR_OFFSET(ex->arrays[7], ex->params[7] * j); /* 2: loadpw */ var35.i = ex->params[24]; /* 6: loadpw */ var37.i = ex->params[25]; /* 11: loadpw */ var39.i = ex->params[26]; /* 16: loadpw */ var41.i = ex->params[27]; /* 19: loadpw */ var42.i = (int)0x00000008; /* 8 or 3.95253e-323f */ for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var44.i = (orc_uint8)var34; /* 3: mullw */ var45.i = (var44.i * var35.i) & 0xffff; /* 4: loadb */ var36 = ptr5[i]; /* 5: convubw */ var46.i = (orc_uint8)var36; /* 7: mullw */ var47.i = (var46.i * var37.i) & 0xffff; /* 8: addw */ var48.i = var45.i + var47.i; /* 9: loadb */ var38 = ptr6[i]; /* 10: convubw */ var49.i = (orc_uint8)var38; /* 12: mullw */ var50.i = (var49.i * var39.i) & 0xffff; /* 13: addw */ var51.i = var48.i + var50.i; /* 14: loadb */ var40 = ptr7[i]; /* 15: convubw */ var52.i = (orc_uint8)var40; /* 17: mullw */ var53.i = (var52.i * var41.i) & 0xffff; /* 18: addw */ var54.i = var51.i + var53.i; /* 20: addw */ var55.i = var54.i + var42.i; /* 21: shrsw */ var56.i = var55.i >> 4; /* 22: convsuswb */ var43 = ORC_CLAMP_UB(var56.i); /* 23: storeb */ ptr0[i] = var43; } } } OrcCode *_orc_code_orc_combine4_nxm_u8; void orc_combine4_nxm_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int n, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_combine4_nxm_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->params[ORC_VAR_S3] = s3_stride; ex->arrays[ORC_VAR_S4] = (void *)s4; ex->params[ORC_VAR_S4] = s4_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; func = c->exec; func (ex); } #endif /* orc_combine2_8xn_u8 */ #ifdef DISABLE_ORC void orc_combine2_8xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int p1, int p2, int p3, int p4, int m){ int i; int j; int n = 8; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var34; orc_int8 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_int8 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); /* 4: loadpw */ var36.i = p1; /* 6: loadpw */ var37.i = p2; /* 9: loadpw */ var38.i = p3; for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var40.i = (orc_uint8)var34; /* 2: loadb */ var35 = ptr5[i]; /* 3: convubw */ var41.i = (orc_uint8)var35; /* 5: mullw */ var42.i = (var40.i * var36.i) & 0xffff; /* 7: mullw */ var43.i = (var41.i * var37.i) & 0xffff; /* 8: addw */ var44.i = var42.i + var43.i; /* 10: addw */ var45.i = var44.i + var38.i; /* 11: shrsw */ var46.i = var45.i >> p4; /* 12: convsuswb */ var39 = ORC_CLAMP_UB(var46.i); /* 13: storeb */ ptr0[i] = var39; } } } #else static void _backup_orc_combine2_8xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 8; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var34; orc_int8 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_int8 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); /* 4: loadpw */ var36.i = ex->params[24]; /* 6: loadpw */ var37.i = ex->params[25]; /* 9: loadpw */ var38.i = ex->params[26]; for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var40.i = (orc_uint8)var34; /* 2: loadb */ var35 = ptr5[i]; /* 3: convubw */ var41.i = (orc_uint8)var35; /* 5: mullw */ var42.i = (var40.i * var36.i) & 0xffff; /* 7: mullw */ var43.i = (var41.i * var37.i) & 0xffff; /* 8: addw */ var44.i = var42.i + var43.i; /* 10: addw */ var45.i = var44.i + var38.i; /* 11: shrsw */ var46.i = var45.i >> ex->params[27]; /* 12: convsuswb */ var39 = ORC_CLAMP_UB(var46.i); /* 13: storeb */ ptr0[i] = var39; } } } OrcCode *_orc_code_orc_combine2_8xn_u8; void orc_combine2_8xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int p1, int p2, int p3, int p4, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_combine2_8xn_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 8; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; func = c->exec; func (ex); } #endif /* orc_combine2_12xn_u8 */ #ifdef DISABLE_ORC void orc_combine2_12xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int p1, int p2, int p3, int p4, int m){ int i; int j; int n = 12; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var34; orc_int8 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_int8 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); /* 4: loadpw */ var36.i = p1; /* 6: loadpw */ var37.i = p2; /* 9: loadpw */ var38.i = p3; for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var40.i = (orc_uint8)var34; /* 2: loadb */ var35 = ptr5[i]; /* 3: convubw */ var41.i = (orc_uint8)var35; /* 5: mullw */ var42.i = (var40.i * var36.i) & 0xffff; /* 7: mullw */ var43.i = (var41.i * var37.i) & 0xffff; /* 8: addw */ var44.i = var42.i + var43.i; /* 10: addw */ var45.i = var44.i + var38.i; /* 11: shrsw */ var46.i = var45.i >> p4; /* 12: convsuswb */ var39 = ORC_CLAMP_UB(var46.i); /* 13: storeb */ ptr0[i] = var39; } } } #else static void _backup_orc_combine2_12xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 12; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var34; orc_int8 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_int8 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); /* 4: loadpw */ var36.i = ex->params[24]; /* 6: loadpw */ var37.i = ex->params[25]; /* 9: loadpw */ var38.i = ex->params[26]; for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var40.i = (orc_uint8)var34; /* 2: loadb */ var35 = ptr5[i]; /* 3: convubw */ var41.i = (orc_uint8)var35; /* 5: mullw */ var42.i = (var40.i * var36.i) & 0xffff; /* 7: mullw */ var43.i = (var41.i * var37.i) & 0xffff; /* 8: addw */ var44.i = var42.i + var43.i; /* 10: addw */ var45.i = var44.i + var38.i; /* 11: shrsw */ var46.i = var45.i >> ex->params[27]; /* 12: convsuswb */ var39 = ORC_CLAMP_UB(var46.i); /* 13: storeb */ ptr0[i] = var39; } } } OrcCode *_orc_code_orc_combine2_12xn_u8; void orc_combine2_12xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int p1, int p2, int p3, int p4, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_combine2_12xn_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 12; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; func = c->exec; func (ex); } #endif /* orc_combine2_16xn_u8 */ #ifdef DISABLE_ORC void orc_combine2_16xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int p1, int p2, int p3, int p4, int m){ int i; int j; int n = 16; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var34; orc_int8 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_int8 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); /* 4: loadpw */ var36.i = p1; /* 6: loadpw */ var37.i = p2; /* 9: loadpw */ var38.i = p3; for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var40.i = (orc_uint8)var34; /* 2: loadb */ var35 = ptr5[i]; /* 3: convubw */ var41.i = (orc_uint8)var35; /* 5: mullw */ var42.i = (var40.i * var36.i) & 0xffff; /* 7: mullw */ var43.i = (var41.i * var37.i) & 0xffff; /* 8: addw */ var44.i = var42.i + var43.i; /* 10: addw */ var45.i = var44.i + var38.i; /* 11: shrsw */ var46.i = var45.i >> p4; /* 12: convsuswb */ var39 = ORC_CLAMP_UB(var46.i); /* 13: storeb */ ptr0[i] = var39; } } } #else static void _backup_orc_combine2_16xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 16; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var34; orc_int8 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_int8 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); /* 4: loadpw */ var36.i = ex->params[24]; /* 6: loadpw */ var37.i = ex->params[25]; /* 9: loadpw */ var38.i = ex->params[26]; for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var40.i = (orc_uint8)var34; /* 2: loadb */ var35 = ptr5[i]; /* 3: convubw */ var41.i = (orc_uint8)var35; /* 5: mullw */ var42.i = (var40.i * var36.i) & 0xffff; /* 7: mullw */ var43.i = (var41.i * var37.i) & 0xffff; /* 8: addw */ var44.i = var42.i + var43.i; /* 10: addw */ var45.i = var44.i + var38.i; /* 11: shrsw */ var46.i = var45.i >> ex->params[27]; /* 12: convsuswb */ var39 = ORC_CLAMP_UB(var46.i); /* 13: storeb */ ptr0[i] = var39; } } } OrcCode *_orc_code_orc_combine2_16xn_u8; void orc_combine2_16xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int p1, int p2, int p3, int p4, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_combine2_16xn_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 16; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; func = c->exec; func (ex); } #endif /* orc_combine2_nxm_u8 */ #ifdef DISABLE_ORC void orc_combine2_nxm_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int p1, int p2, int p3, int p4, int n, int m){ int i; int j; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var34; orc_int8 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_int8 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); /* 4: loadpw */ var36.i = p1; /* 6: loadpw */ var37.i = p2; /* 9: loadpw */ var38.i = p3; for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var40.i = (orc_uint8)var34; /* 2: loadb */ var35 = ptr5[i]; /* 3: convubw */ var41.i = (orc_uint8)var35; /* 5: mullw */ var42.i = (var40.i * var36.i) & 0xffff; /* 7: mullw */ var43.i = (var41.i * var37.i) & 0xffff; /* 8: addw */ var44.i = var42.i + var43.i; /* 10: addw */ var45.i = var44.i + var38.i; /* 11: shrsw */ var46.i = var45.i >> p4; /* 12: convsuswb */ var39 = ORC_CLAMP_UB(var46.i); /* 13: storeb */ ptr0[i] = var39; } } } #else static void _backup_orc_combine2_nxm_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var34; orc_int8 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_int8 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); /* 4: loadpw */ var36.i = ex->params[24]; /* 6: loadpw */ var37.i = ex->params[25]; /* 9: loadpw */ var38.i = ex->params[26]; for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var40.i = (orc_uint8)var34; /* 2: loadb */ var35 = ptr5[i]; /* 3: convubw */ var41.i = (orc_uint8)var35; /* 5: mullw */ var42.i = (var40.i * var36.i) & 0xffff; /* 7: mullw */ var43.i = (var41.i * var37.i) & 0xffff; /* 8: addw */ var44.i = var42.i + var43.i; /* 10: addw */ var45.i = var44.i + var38.i; /* 11: shrsw */ var46.i = var45.i >> ex->params[27]; /* 12: convsuswb */ var39 = ORC_CLAMP_UB(var46.i); /* 13: storeb */ ptr0[i] = var39; } } } OrcCode *_orc_code_orc_combine2_nxm_u8; void orc_combine2_nxm_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int p1, int p2, int p3, int p4, int n, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_combine2_nxm_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; func = c->exec; func (ex); } #endif /* orc_sad_nxm_u8 */ #ifdef DISABLE_ORC void orc_sad_nxm_u8 (orc_uint32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int n, int m){ int i; int j; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_union32 var12 = { 0 }; orc_int8 var32; orc_int8 var33; for (j = 0; j < m; j++) { ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: accsadubl */ var12.i = var12.i + ORC_ABS((orc_int32)(orc_uint8)var32 - (orc_int32)(orc_uint8)var33); } } *a1 = var12.i; } #else static void _backup_orc_sad_nxm_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_union32 var12 = { 0 }; orc_int8 var32; orc_int8 var33; for (j = 0; j < m; j++) { ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: accsadubl */ var12.i = var12.i + ORC_ABS((orc_int32)(orc_uint8)var32 - (orc_int32)(orc_uint8)var33); } } ex->accumulators[0] = var12.i; } OrcCode *_orc_code_orc_sad_nxm_u8; void orc_sad_nxm_u8 (orc_uint32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int n, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_sad_nxm_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; func = c->exec; func (ex); *a1 = orc_executor_get_accumulator (ex, ORC_VAR_A1); } #endif /* orc_sad_8x8_u8 */ #ifdef DISABLE_ORC void orc_sad_8x8_u8 (orc_uint32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride){ int i; int j; int n = 8; int m = 8; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_union32 var12 = { 0 }; orc_int8 var32; orc_int8 var33; for (j = 0; j < m; j++) { ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: accsadubl */ var12.i = var12.i + ORC_ABS((orc_int32)(orc_uint8)var32 - (orc_int32)(orc_uint8)var33); } } *a1 = var12.i; } #else static void _backup_orc_sad_8x8_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 8; int m = 8; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_union32 var12 = { 0 }; orc_int8 var32; orc_int8 var33; for (j = 0; j < m; j++) { ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: accsadubl */ var12.i = var12.i + ORC_ABS((orc_int32)(orc_uint8)var32 - (orc_int32)(orc_uint8)var33); } } ex->accumulators[0] = var12.i; } OrcCode *_orc_code_orc_sad_8x8_u8; void orc_sad_8x8_u8 (orc_uint32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_sad_8x8_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 8; ORC_EXECUTOR_M(ex) = 8; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; func = c->exec; func (ex); *a1 = orc_executor_get_accumulator (ex, ORC_VAR_A1); } #endif /* orc_sad_12x12_u8 */ #ifdef DISABLE_ORC void orc_sad_12x12_u8 (orc_uint32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride){ int i; int j; int n = 12; int m = 12; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_union32 var12 = { 0 }; orc_int8 var32; orc_int8 var33; for (j = 0; j < m; j++) { ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: accsadubl */ var12.i = var12.i + ORC_ABS((orc_int32)(orc_uint8)var32 - (orc_int32)(orc_uint8)var33); } } *a1 = var12.i; } #else static void _backup_orc_sad_12x12_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 12; int m = 12; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_union32 var12 = { 0 }; orc_int8 var32; orc_int8 var33; for (j = 0; j < m; j++) { ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: accsadubl */ var12.i = var12.i + ORC_ABS((orc_int32)(orc_uint8)var32 - (orc_int32)(orc_uint8)var33); } } ex->accumulators[0] = var12.i; } OrcCode *_orc_code_orc_sad_12x12_u8; void orc_sad_12x12_u8 (orc_uint32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_sad_12x12_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 12; ORC_EXECUTOR_M(ex) = 12; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; func = c->exec; func (ex); *a1 = orc_executor_get_accumulator (ex, ORC_VAR_A1); } #endif /* orc_sad_16xn_u8 */ #ifdef DISABLE_ORC void orc_sad_16xn_u8 (orc_uint32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m){ int i; int j; int n = 16; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_union32 var12 = { 0 }; orc_int8 var32; orc_int8 var33; for (j = 0; j < m; j++) { ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: accsadubl */ var12.i = var12.i + ORC_ABS((orc_int32)(orc_uint8)var32 - (orc_int32)(orc_uint8)var33); } } *a1 = var12.i; } #else static void _backup_orc_sad_16xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 16; int m = ex->params[ORC_VAR_A1]; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_union32 var12 = { 0 }; orc_int8 var32; orc_int8 var33; for (j = 0; j < m; j++) { ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: accsadubl */ var12.i = var12.i + ORC_ABS((orc_int32)(orc_uint8)var32 - (orc_int32)(orc_uint8)var33); } } ex->accumulators[0] = var12.i; } OrcCode *_orc_code_orc_sad_16xn_u8; void orc_sad_16xn_u8 (orc_uint32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_sad_16xn_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 16; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; func = c->exec; func (ex); *a1 = orc_executor_get_accumulator (ex, ORC_VAR_A1); } #endif /* orc_sad_32xn_u8 */ #ifdef DISABLE_ORC void orc_sad_32xn_u8 (orc_uint32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m){ int i; int j; int n = 32; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_union32 var12 = { 0 }; orc_int8 var32; orc_int8 var33; for (j = 0; j < m; j++) { ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: accsadubl */ var12.i = var12.i + ORC_ABS((orc_int32)(orc_uint8)var32 - (orc_int32)(orc_uint8)var33); } } *a1 = var12.i; } #else static void _backup_orc_sad_32xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 32; int m = ex->params[ORC_VAR_A1]; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_union32 var12 = { 0 }; orc_int8 var32; orc_int8 var33; for (j = 0; j < m; j++) { ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: accsadubl */ var12.i = var12.i + ORC_ABS((orc_int32)(orc_uint8)var32 - (orc_int32)(orc_uint8)var33); } } ex->accumulators[0] = var12.i; } OrcCode *_orc_code_orc_sad_32xn_u8; void orc_sad_32xn_u8 (orc_uint32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_sad_32xn_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 32; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; func = c->exec; func (ex); *a1 = orc_executor_get_accumulator (ex, ORC_VAR_A1); } #endif void schro_orc_init (void) { #ifndef DISABLE_ORC { /* orc_add2_rshift_add_s16_22_op */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_add2_rshift_add_s16_22_op"); orc_program_set_backup_function (p, _backup_orc_add2_rshift_add_s16_22_op); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_source (p, 2, "s3"); orc_program_add_constant (p, 4, 0x00000002, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_S3, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_add2_rshift_add_s16_22_op = orc_program_take_code (p); orc_program_free (p); } { /* orc_add2_rshift_add_s16_22 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_add2_rshift_add_s16_22"); orc_program_set_backup_function (p, _backup_orc_add2_rshift_add_s16_22); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_constant (p, 4, 0x00000002, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_add2_rshift_add_s16_22 = orc_program_take_code (p); orc_program_free (p); } { /* orc_add2_rshift_sub_s16_22_op */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_add2_rshift_sub_s16_22_op"); orc_program_set_backup_function (p, _backup_orc_add2_rshift_sub_s16_22_op); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_source (p, 2, "s3"); orc_program_add_constant (p, 4, 0x00000002, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_S3, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_add2_rshift_sub_s16_22_op = orc_program_take_code (p); orc_program_free (p); } { /* orc_add2_rshift_sub_s16_22 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_add2_rshift_sub_s16_22"); orc_program_set_backup_function (p, _backup_orc_add2_rshift_sub_s16_22); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_constant (p, 4, 0x00000002, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_add2_rshift_sub_s16_22 = orc_program_take_code (p); orc_program_free (p); } { /* orc_add2_rshift_add_s16_11_op */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_add2_rshift_add_s16_11_op"); orc_program_set_backup_function (p, _backup_orc_add2_rshift_add_s16_11_op); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_source (p, 2, "s3"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "avgsw", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_S3, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_add2_rshift_add_s16_11_op = orc_program_take_code (p); orc_program_free (p); } { /* orc_add2_rshift_add_s16_11 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_add2_rshift_add_s16_11"); orc_program_set_backup_function (p, _backup_orc_add2_rshift_add_s16_11); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "avgsw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_add2_rshift_add_s16_11 = orc_program_take_code (p); orc_program_free (p); } { /* orc_add2_rshift_sub_s16_11_op */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_add2_rshift_sub_s16_11_op"); orc_program_set_backup_function (p, _backup_orc_add2_rshift_sub_s16_11_op); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_source (p, 2, "s3"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "avgsw", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_S3, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_add2_rshift_sub_s16_11_op = orc_program_take_code (p); orc_program_free (p); } { /* orc_add2_rshift_sub_s16_11 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_add2_rshift_sub_s16_11"); orc_program_set_backup_function (p, _backup_orc_add2_rshift_sub_s16_11); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "avgsw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_add2_rshift_sub_s16_11 = orc_program_take_code (p); orc_program_free (p); } { /* orc_add_const_rshift_s16_11 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_add_const_rshift_s16_11"); orc_program_set_backup_function (p, _backup_orc_add_const_rshift_s16_11); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_constant (p, 4, 0x00000001, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_add_const_rshift_s16_11 = orc_program_take_code (p); orc_program_free (p); } { /* orc_add_const_rshift_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_add_const_rshift_s16"); orc_program_set_backup_function (p, _backup_orc_add_const_rshift_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_P2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_add_const_rshift_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_add_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_add_s16"); orc_program_set_backup_function (p, _backup_orc_add_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_add_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_add_s16_2d */ OrcProgram *p; p = orc_program_new (); orc_program_set_2d (p); orc_program_set_name (p, "orc_add_s16_2d"); orc_program_set_backup_function (p, _backup_orc_add_s16_2d); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_add_s16_2d = orc_program_take_code (p); orc_program_free (p); } { /* orc_addc_rshift_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_addc_rshift_s16"); orc_program_set_backup_function (p, _backup_orc_addc_rshift_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_addc_rshift_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_lshift1_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_lshift1_s16"); orc_program_set_backup_function (p, _backup_orc_lshift1_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_constant (p, 4, 0x00000001, "c1"); orc_program_append_2 (p, "shlw", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_C1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_lshift1_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_lshift2_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_lshift2_s16"); orc_program_set_backup_function (p, _backup_orc_lshift2_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_constant (p, 4, 0x00000002, "c1"); orc_program_append_2 (p, "shlw", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_C1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_lshift2_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_lshift_s16_ip */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_lshift_s16_ip"); orc_program_set_backup_function (p, _backup_orc_lshift_s16_ip); orc_program_add_destination (p, 2, "d1"); orc_program_add_parameter (p, 2, "p1"); orc_program_append_2 (p, "shlw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_P1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_lshift_s16_ip = orc_program_take_code (p); orc_program_free (p); } { /* orc_mas2_add_s16_op */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_mas2_add_s16_op"); orc_program_set_backup_function (p, _backup_orc_mas2_add_s16_op); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_source (p, 2, "s3"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 4, "p2"); orc_program_add_parameter (p, 4, "p3"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 4, "t2"); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_S3, ORC_VAR_D1); orc_program_append_2 (p, "mulswl", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "shrsl", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P3, ORC_VAR_D1); orc_program_append_2 (p, "convlw", 0, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_mas2_add_s16_op = orc_program_take_code (p); orc_program_free (p); } { /* orc_mas2_add_s16_ip */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_mas2_add_s16_ip"); orc_program_set_backup_function (p, _backup_orc_mas2_add_s16_ip); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 4, "p2"); orc_program_add_parameter (p, 4, "p3"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 4, "t2"); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); orc_program_append_2 (p, "mulswl", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "shrsl", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P3, ORC_VAR_D1); orc_program_append_2 (p, "convlw", 0, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_mas2_add_s16_ip = orc_program_take_code (p); orc_program_free (p); } { /* orc_mas2_sub_s16_op */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_mas2_sub_s16_op"); orc_program_set_backup_function (p, _backup_orc_mas2_sub_s16_op); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_source (p, 2, "s3"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 4, "p2"); orc_program_add_parameter (p, 4, "p3"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 4, "t2"); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_S3, ORC_VAR_D1); orc_program_append_2 (p, "mulswl", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "shrsl", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P3, ORC_VAR_D1); orc_program_append_2 (p, "convlw", 0, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_mas2_sub_s16_op = orc_program_take_code (p); orc_program_free (p); } { /* orc_mas2_sub_s16_ip */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_mas2_sub_s16_ip"); orc_program_set_backup_function (p, _backup_orc_mas2_sub_s16_ip); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 4, "p2"); orc_program_add_parameter (p, 4, "p3"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 4, "t2"); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); orc_program_append_2 (p, "mulswl", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "shrsl", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P3, ORC_VAR_D1); orc_program_append_2 (p, "convlw", 0, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_mas2_sub_s16_ip = orc_program_take_code (p); orc_program_free (p); } { /* orc_mas4_across_add_s16_1991_op */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_mas4_across_add_s16_1991_op"); orc_program_set_backup_function (p, _backup_orc_mas4_across_add_s16_1991_op); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_source (p, 2, "s3"); orc_program_add_source (p, 2, "s4"); orc_program_add_source (p, 2, "s5"); orc_program_add_constant (p, 4, 0x00000009, "c1"); orc_program_add_parameter (p, 4, "p1"); orc_program_add_parameter (p, 4, "p2"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_add_temporary (p, 4, "t3"); orc_program_add_temporary (p, 4, "t4"); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_S3, ORC_VAR_S4, ORC_VAR_D1); orc_program_append_2 (p, "mulswl", 0, ORC_VAR_T3, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_S5, ORC_VAR_D1); orc_program_append_2 (p, "convswl", 0, ORC_VAR_T4, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "subl", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_T4, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "shrsl", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "convlw", 0, ORC_VAR_T1, ORC_VAR_T3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_mas4_across_add_s16_1991_op = orc_program_take_code (p); orc_program_free (p); } { /* orc_mas4_across_add_s16_1991_ip */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_mas4_across_add_s16_1991_ip"); orc_program_set_backup_function (p, _backup_orc_mas4_across_add_s16_1991_ip); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_constant (p, 4, 0x00000001, "c1"); orc_program_add_constant (p, 4, 0x00000002, "c2"); orc_program_add_constant (p, 4, 0x00000009, "c3"); orc_program_add_constant (p, 4, 0x00000003, "c4"); orc_program_add_parameter (p, 4, "p1"); orc_program_add_parameter (p, 4, "p2"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_add_temporary (p, 4, "t3"); orc_program_add_temporary (p, 4, "t4"); orc_program_append_2 (p, "loadoffw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "loadoffw", 0, ORC_VAR_T2, ORC_VAR_S1, ORC_VAR_C2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_append_2 (p, "mulswl", 0, ORC_VAR_T3, ORC_VAR_T1, ORC_VAR_C3, ORC_VAR_D1); orc_program_append_2 (p, "loadw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "loadoffw", 0, ORC_VAR_T2, ORC_VAR_S1, ORC_VAR_C4, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_append_2 (p, "convswl", 0, ORC_VAR_T4, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "subl", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_T4, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "shrsl", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "convlw", 0, ORC_VAR_T1, ORC_VAR_T3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_mas4_across_add_s16_1991_ip = orc_program_take_code (p); orc_program_free (p); } { /* orc_mas4_across_sub_s16_1991_op */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_mas4_across_sub_s16_1991_op"); orc_program_set_backup_function (p, _backup_orc_mas4_across_sub_s16_1991_op); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_source (p, 2, "s3"); orc_program_add_source (p, 2, "s4"); orc_program_add_source (p, 2, "s5"); orc_program_add_constant (p, 4, 0x00000009, "c1"); orc_program_add_parameter (p, 4, "p1"); orc_program_add_parameter (p, 4, "p2"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_add_temporary (p, 4, "t3"); orc_program_add_temporary (p, 4, "t4"); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_S3, ORC_VAR_S4, ORC_VAR_D1); orc_program_append_2 (p, "mulswl", 0, ORC_VAR_T3, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_S5, ORC_VAR_D1); orc_program_append_2 (p, "convswl", 0, ORC_VAR_T4, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "subl", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_T4, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "shrsl", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "convlw", 0, ORC_VAR_T1, ORC_VAR_T3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_mas4_across_sub_s16_1991_op = orc_program_take_code (p); orc_program_free (p); } { /* orc_mas4_across_sub_s16_1991_ip */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_mas4_across_sub_s16_1991_ip"); orc_program_set_backup_function (p, _backup_orc_mas4_across_sub_s16_1991_ip); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_constant (p, 4, 0x00000001, "c1"); orc_program_add_constant (p, 4, 0x00000002, "c2"); orc_program_add_constant (p, 4, 0x00000009, "c3"); orc_program_add_constant (p, 4, 0x00000003, "c4"); orc_program_add_parameter (p, 4, "p1"); orc_program_add_parameter (p, 4, "p2"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_add_temporary (p, 4, "t3"); orc_program_add_temporary (p, 4, "t4"); orc_program_append_2 (p, "loadoffw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "loadoffw", 0, ORC_VAR_T2, ORC_VAR_S1, ORC_VAR_C2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_append_2 (p, "mulswl", 0, ORC_VAR_T3, ORC_VAR_T1, ORC_VAR_C3, ORC_VAR_D1); orc_program_append_2 (p, "loadw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "loadoffw", 0, ORC_VAR_T2, ORC_VAR_S1, ORC_VAR_C4, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_append_2 (p, "convswl", 0, ORC_VAR_T4, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "subl", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_T4, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "shrsl", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "convlw", 0, ORC_VAR_T1, ORC_VAR_T3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_mas4_across_sub_s16_1991_ip = orc_program_take_code (p); orc_program_free (p); } { /* orc_subtract_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_subtract_s16"); orc_program_set_backup_function (p, _backup_orc_subtract_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_append_2 (p, "subw", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_subtract_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_add_s16_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_add_s16_u8"); orc_program_set_backup_function (p, _backup_orc_add_s16_u8); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_add_s16_u8 = orc_program_take_code (p); orc_program_free (p); } { /* orc_add_s16_u8_2d */ OrcProgram *p; p = orc_program_new (); orc_program_set_2d (p); orc_program_set_name (p, "orc_add_s16_u8_2d"); orc_program_set_backup_function (p, _backup_orc_add_s16_u8_2d); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_add_s16_u8_2d = orc_program_take_code (p); orc_program_free (p); } { /* orc_convert_s16_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_convert_s16_u8"); orc_program_set_backup_function (p, _backup_orc_convert_s16_u8); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_append_2 (p, "convubw", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_convert_s16_u8 = orc_program_take_code (p); orc_program_free (p); } { /* orc_convert_u8_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_convert_u8_s16"); orc_program_set_backup_function (p, _backup_orc_convert_u8_s16); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_convert_u8_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_offsetconvert_u8_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_offsetconvert_u8_s16"); orc_program_set_backup_function (p, _backup_orc_offsetconvert_u8_s16); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_constant (p, 4, 0x00000080, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_offsetconvert_u8_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_offsetconvert_s16_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_offsetconvert_s16_u8"); orc_program_set_backup_function (p, _backup_orc_offsetconvert_s16_u8); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_constant (p, 4, 0x00000080, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_offsetconvert_s16_u8 = orc_program_take_code (p); orc_program_free (p); } { /* orc_subtract_s16_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_subtract_s16_u8"); orc_program_set_backup_function (p, _backup_orc_subtract_s16_u8); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_subtract_s16_u8 = orc_program_take_code (p); orc_program_free (p); } { /* orc_multiply_and_add_s16_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_multiply_and_add_s16_u8"); orc_program_set_backup_function (p, _backup_orc_multiply_and_add_s16_u8); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_multiply_and_add_s16_u8 = orc_program_take_code (p); orc_program_free (p); } { /* orc_splat_s16_ns */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_splat_s16_ns"); orc_program_set_backup_function (p, _backup_orc_splat_s16_ns); orc_program_add_destination (p, 2, "d1"); orc_program_add_parameter (p, 2, "p1"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_D1, ORC_VAR_P1, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_splat_s16_ns = orc_program_take_code (p); orc_program_free (p); } { /* orc_splat_s16_2d_4xn */ OrcProgram *p; p = orc_program_new (); orc_program_set_constant_n (p, 4); orc_program_set_2d (p); orc_program_set_name (p, "orc_splat_s16_2d_4xn"); orc_program_set_backup_function (p, _backup_orc_splat_s16_2d_4xn); orc_program_add_destination (p, 2, "d1"); orc_program_add_parameter (p, 2, "p1"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_D1, ORC_VAR_P1, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_splat_s16_2d_4xn = orc_program_take_code (p); orc_program_free (p); } { /* orc_splat_s16_2d_8xn */ OrcProgram *p; p = orc_program_new (); orc_program_set_constant_n (p, 8); orc_program_set_2d (p); orc_program_set_name (p, "orc_splat_s16_2d_8xn"); orc_program_set_backup_function (p, _backup_orc_splat_s16_2d_8xn); orc_program_add_destination (p, 2, "d1"); orc_program_add_parameter (p, 2, "p1"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_D1, ORC_VAR_P1, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_splat_s16_2d_8xn = orc_program_take_code (p); orc_program_free (p); } { /* orc_splat_s16_2d */ OrcProgram *p; p = orc_program_new (); orc_program_set_2d (p); orc_program_set_name (p, "orc_splat_s16_2d"); orc_program_set_backup_function (p, _backup_orc_splat_s16_2d); orc_program_add_destination (p, 2, "d1"); orc_program_add_parameter (p, 2, "p1"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_D1, ORC_VAR_P1, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_splat_s16_2d = orc_program_take_code (p); orc_program_free (p); } { /* orc_splat_u8_ns */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_splat_u8_ns"); orc_program_set_backup_function (p, _backup_orc_splat_u8_ns); orc_program_add_destination (p, 1, "d1"); orc_program_add_parameter (p, 1, "p1"); orc_program_append_2 (p, "copyb", 0, ORC_VAR_D1, ORC_VAR_P1, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_splat_u8_ns = orc_program_take_code (p); orc_program_free (p); } { /* orc_splat_u8_2d */ OrcProgram *p; p = orc_program_new (); orc_program_set_2d (p); orc_program_set_name (p, "orc_splat_u8_2d"); orc_program_set_backup_function (p, _backup_orc_splat_u8_2d); orc_program_add_destination (p, 1, "d1"); orc_program_add_parameter (p, 1, "p1"); orc_program_append_2 (p, "copyb", 0, ORC_VAR_D1, ORC_VAR_P1, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_splat_u8_2d = orc_program_take_code (p); orc_program_free (p); } { /* orc_average_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_average_u8"); orc_program_set_backup_function (p, _backup_orc_average_u8); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_append_2 (p, "avgub", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_average_u8 = orc_program_take_code (p); orc_program_free (p); } { /* orc_rrshift6_add_s16_2d */ OrcProgram *p; p = orc_program_new (); orc_program_set_2d (p); orc_program_set_name (p, "orc_rrshift6_add_s16_2d"); orc_program_set_backup_function (p, _backup_orc_rrshift6_add_s16_2d); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_constant (p, 4, 0x00000020, "c1"); orc_program_add_constant (p, 4, 0x00000006, "c2"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_rrshift6_add_s16_2d = orc_program_take_code (p); orc_program_free (p); } { /* orc_rrshift6_sub_s16_2d */ OrcProgram *p; p = orc_program_new (); orc_program_set_2d (p); orc_program_set_name (p, "orc_rrshift6_sub_s16_2d"); orc_program_set_backup_function (p, _backup_orc_rrshift6_sub_s16_2d); orc_program_add_destination (p, 2, "d1"); orc_program_add_destination (p, 2, "d2"); orc_program_add_constant (p, 4, 0x00001fe0, "c1"); orc_program_add_constant (p, 4, 0x00000006, "c2"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_D2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C2, ORC_VAR_D1); orc_program_append_2 (p, "copyw", 0, ORC_VAR_D2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_rrshift6_sub_s16_2d = orc_program_take_code (p); orc_program_free (p); } { /* orc_rrshift6_s16_ip_2d */ OrcProgram *p; p = orc_program_new (); orc_program_set_2d (p); orc_program_set_name (p, "orc_rrshift6_s16_ip_2d"); orc_program_set_backup_function (p, _backup_orc_rrshift6_s16_ip_2d); orc_program_add_destination (p, 2, "d1"); orc_program_add_constant (p, 4, 0x00001fe0, "c1"); orc_program_add_constant (p, 4, 0x00000006, "c2"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_C2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_rrshift6_s16_ip_2d = orc_program_take_code (p); orc_program_free (p); } { /* orc_rrshift6_s16_ip */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_rrshift6_s16_ip"); orc_program_set_backup_function (p, _backup_orc_rrshift6_s16_ip); orc_program_add_destination (p, 2, "d1"); orc_program_add_constant (p, 4, 0x00001fe0, "c1"); orc_program_add_constant (p, 4, 0x00000006, "c2"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_C2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_rrshift6_s16_ip = orc_program_take_code (p); orc_program_free (p); } { /* orc_unpack_yuyv_y */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_unpack_yuyv_y"); orc_program_set_backup_function (p, _backup_orc_unpack_yuyv_y); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_append_2 (p, "select0wb", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_unpack_yuyv_y = orc_program_take_code (p); orc_program_free (p); } { /* orc_unpack_yuyv_u */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_unpack_yuyv_u"); orc_program_set_backup_function (p, _backup_orc_unpack_yuyv_u); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "select0lw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "select1wb", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_unpack_yuyv_u = orc_program_take_code (p); orc_program_free (p); } { /* orc_unpack_yuyv_v */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_unpack_yuyv_v"); orc_program_set_backup_function (p, _backup_orc_unpack_yuyv_v); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "select1lw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "select1wb", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_unpack_yuyv_v = orc_program_take_code (p); orc_program_free (p); } { /* orc_packyuyv */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_packyuyv"); orc_program_set_backup_function (p, _backup_orc_packyuyv); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_source (p, 1, "s3"); orc_program_add_temporary (p, 1, "t1"); orc_program_add_temporary (p, 1, "t2"); orc_program_add_temporary (p, 2, "t3"); orc_program_add_temporary (p, 2, "t4"); orc_program_add_temporary (p, 2, "t5"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T5, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "select0wb", 0, ORC_VAR_T1, ORC_VAR_T5, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "select1wb", 0, ORC_VAR_T2, ORC_VAR_T5, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mergebw", 0, ORC_VAR_T3, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_D1); orc_program_append_2 (p, "mergebw", 0, ORC_VAR_T4, ORC_VAR_T2, ORC_VAR_S3, ORC_VAR_D1); orc_program_append_2 (p, "mergewl", 0, ORC_VAR_D1, ORC_VAR_T3, ORC_VAR_T4, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_packyuyv = orc_program_take_code (p); orc_program_free (p); } { /* orc_unpack_uyvy_y */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_unpack_uyvy_y"); orc_program_set_backup_function (p, _backup_orc_unpack_uyvy_y); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_append_2 (p, "select1wb", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_unpack_uyvy_y = orc_program_take_code (p); orc_program_free (p); } { /* orc_unpack_uyvy_u */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_unpack_uyvy_u"); orc_program_set_backup_function (p, _backup_orc_unpack_uyvy_u); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "select0lw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "select0wb", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_unpack_uyvy_u = orc_program_take_code (p); orc_program_free (p); } { /* orc_unpack_uyvy_v */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_unpack_uyvy_v"); orc_program_set_backup_function (p, _backup_orc_unpack_uyvy_v); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "select1lw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "select0wb", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_unpack_uyvy_v = orc_program_take_code (p); orc_program_free (p); } { /* orc_interleave2_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_interleave2_s16"); orc_program_set_backup_function (p, _backup_orc_interleave2_s16); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_append_2 (p, "mergewl", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_interleave2_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_interleave2_rrshift1_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_interleave2_rrshift1_s16"); orc_program_set_backup_function (p, _backup_orc_interleave2_rrshift1_s16); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_constant (p, 4, 0x00000001, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "mergewl", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_interleave2_rrshift1_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_deinterleave2_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_deinterleave2_s16"); orc_program_set_backup_function (p, _backup_orc_deinterleave2_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_destination (p, 2, "d2"); orc_program_add_source (p, 4, "s1"); orc_program_add_temporary (p, 4, "t1"); orc_program_append_2 (p, "copyl", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "select0lw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "select1lw", 0, ORC_VAR_D2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_deinterleave2_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_deinterleave2_lshift1_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_deinterleave2_lshift1_s16"); orc_program_set_backup_function (p, _backup_orc_deinterleave2_lshift1_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_destination (p, 2, "d2"); orc_program_add_source (p, 4, "s1"); orc_program_add_constant (p, 4, 0x00000001, "c1"); orc_program_add_temporary (p, 4, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_add_temporary (p, 2, "t3"); orc_program_append_2 (p, "copyl", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "select0lw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "shlw", 0, ORC_VAR_D1, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "select1lw", 0, ORC_VAR_T3, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "shlw", 0, ORC_VAR_D2, ORC_VAR_T3, ORC_VAR_C1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_deinterleave2_lshift1_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_haar_deint_lshift1_split_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_haar_deint_lshift1_split_s16"); orc_program_set_backup_function (p, _backup_orc_haar_deint_lshift1_split_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_destination (p, 2, "d2"); orc_program_add_source (p, 4, "s1"); orc_program_add_constant (p, 4, 0x00000001, "c1"); orc_program_add_constant (p, 4, 0x00000000, "c2"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_add_temporary (p, 4, "t3"); orc_program_append_2 (p, "copyl", 0, ORC_VAR_T3, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "select0lw", 0, ORC_VAR_T1, ORC_VAR_T3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "select1lw", 0, ORC_VAR_T2, ORC_VAR_T3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "shlw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "shlw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "copyw", 0, ORC_VAR_D2, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "avgsw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_haar_deint_lshift1_split_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_haar_deint_split_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_haar_deint_split_s16"); orc_program_set_backup_function (p, _backup_orc_haar_deint_split_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_destination (p, 2, "d2"); orc_program_add_source (p, 4, "s1"); orc_program_add_constant (p, 4, 0x00000000, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_add_temporary (p, 4, "t3"); orc_program_append_2 (p, "copyl", 0, ORC_VAR_T3, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "select0lw", 0, ORC_VAR_T1, ORC_VAR_T3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "select1lw", 0, ORC_VAR_T2, ORC_VAR_T3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "copyw", 0, ORC_VAR_D2, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "avgsw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_haar_deint_split_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_haar_split_s16_lo */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_haar_split_s16_lo"); orc_program_set_backup_function (p, _backup_orc_haar_split_s16_lo); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_constant (p, 4, 0x00000000, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "avgsw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_haar_split_s16_lo = orc_program_take_code (p); orc_program_free (p); } { /* orc_haar_split_s16_hi */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_haar_split_s16_hi"); orc_program_set_backup_function (p, _backup_orc_haar_split_s16_hi); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_append_2 (p, "subw", 0, ORC_VAR_D1, ORC_VAR_S2, ORC_VAR_S1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_haar_split_s16_hi = orc_program_take_code (p); orc_program_free (p); } { /* orc_haar_split_s16_op */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_haar_split_s16_op"); orc_program_set_backup_function (p, _backup_orc_haar_split_s16_op); orc_program_add_destination (p, 2, "d1"); orc_program_add_destination (p, 2, "d2"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_constant (p, 4, 0x00000000, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "copyw", 0, ORC_VAR_D2, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "avgsw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_haar_split_s16_op = orc_program_take_code (p); orc_program_free (p); } { /* orc_haar_split_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_haar_split_s16"); orc_program_set_backup_function (p, _backup_orc_haar_split_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_destination (p, 2, "d2"); orc_program_add_constant (p, 4, 0x00000000, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T2, ORC_VAR_D2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "copyw", 0, ORC_VAR_D2, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "avgsw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_haar_split_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_haar_synth_s16_lo */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_haar_synth_s16_lo"); orc_program_set_backup_function (p, _backup_orc_haar_synth_s16_lo); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_constant (p, 4, 0x00000000, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "avgsw", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_haar_synth_s16_lo = orc_program_take_code (p); orc_program_free (p); } { /* orc_haar_synth_s16_hi */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_haar_synth_s16_hi"); orc_program_set_backup_function (p, _backup_orc_haar_synth_s16_hi); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_constant (p, 4, 0x00000000, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_add_temporary (p, 2, "t3"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "avgsw", 0, ORC_VAR_T3, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_T3, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_haar_synth_s16_hi = orc_program_take_code (p); orc_program_free (p); } { /* orc_haar_synth_s16_op */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_haar_synth_s16_op"); orc_program_set_backup_function (p, _backup_orc_haar_synth_s16_op); orc_program_add_destination (p, 2, "d1"); orc_program_add_destination (p, 2, "d2"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_constant (p, 4, 0x00000000, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_add_temporary (p, 2, "t3"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "avgsw", 0, ORC_VAR_T3, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_T3, ORC_VAR_D1); orc_program_append_2 (p, "copyw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_D2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_haar_synth_s16_op = orc_program_take_code (p); orc_program_free (p); } { /* orc_haar_synth_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_haar_synth_s16"); orc_program_set_backup_function (p, _backup_orc_haar_synth_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_destination (p, 2, "d2"); orc_program_add_constant (p, 4, 0x00000000, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_add_temporary (p, 2, "t3"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T2, ORC_VAR_D2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "avgsw", 0, ORC_VAR_T3, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T3, ORC_VAR_D1); orc_program_append_2 (p, "copyw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_D2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_haar_synth_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_haar_synth_rrshift1_int_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_haar_synth_rrshift1_int_s16"); orc_program_set_backup_function (p, _backup_orc_haar_synth_rrshift1_int_s16); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_constant (p, 4, 0x00000000, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "avgsw", 0, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "avgsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "avgsw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "mergewl", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_haar_synth_rrshift1_int_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_haar_synth_int_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_haar_synth_int_s16"); orc_program_set_backup_function (p, _backup_orc_haar_synth_int_s16); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_constant (p, 4, 0x00000000, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "avgsw", 0, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "mergewl", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_haar_synth_int_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_haar_sub_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_haar_sub_s16"); orc_program_set_backup_function (p, _backup_orc_haar_sub_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_append_2 (p, "subw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_haar_sub_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_haar_add_half_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_haar_add_half_s16"); orc_program_set_backup_function (p, _backup_orc_haar_add_half_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_constant (p, 4, 0x00000000, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "avgsw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_haar_add_half_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_haar_add_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_haar_add_s16"); orc_program_set_backup_function (p, _backup_orc_haar_add_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_haar_add_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_haar_sub_half_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_haar_sub_half_s16"); orc_program_set_backup_function (p, _backup_orc_haar_sub_half_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_constant (p, 4, 0x00000000, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "avgsw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_haar_sub_half_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_sum_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_sum_u8"); orc_program_set_backup_function (p, _backup_orc_sum_u8); orc_program_add_source (p, 1, "s1"); orc_program_add_accumulator (p, 4, "a1"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 4, "t2"); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convuwl", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "accl", 0, ORC_VAR_A1, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_sum_u8 = orc_program_take_code (p); orc_program_free (p); } { /* orc_sum_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_sum_s16"); orc_program_set_backup_function (p, _backup_orc_sum_s16); orc_program_add_source (p, 2, "s1"); orc_program_add_accumulator (p, 4, "a1"); orc_program_add_temporary (p, 4, "t1"); orc_program_append_2 (p, "convswl", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "accl", 0, ORC_VAR_A1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_sum_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_sum_square_diff_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_sum_square_diff_u8"); orc_program_set_backup_function (p, _backup_orc_sum_square_diff_u8); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_accumulator (p, 4, "a1"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_add_temporary (p, 4, "t3"); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "convuwl", 0, ORC_VAR_T3, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "accl", 0, ORC_VAR_A1, ORC_VAR_T3, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_sum_square_diff_u8 = orc_program_take_code (p); orc_program_free (p); } { /* orc_dequantise_s16_2d_4xn */ OrcProgram *p; p = orc_program_new (); orc_program_set_constant_n (p, 4); orc_program_set_2d (p); orc_program_set_name (p, "orc_dequantise_s16_2d_4xn"); orc_program_set_backup_function (p, _backup_orc_dequantise_s16_2d_4xn); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_constant (p, 4, 0x00000002, "c1"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "signw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "absw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_dequantise_s16_2d_4xn = orc_program_take_code (p); orc_program_free (p); } { /* orc_dequantise_s16_2d_8xn */ OrcProgram *p; p = orc_program_new (); orc_program_set_constant_n (p, 8); orc_program_set_2d (p); orc_program_set_name (p, "orc_dequantise_s16_2d_8xn"); orc_program_set_backup_function (p, _backup_orc_dequantise_s16_2d_8xn); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_constant (p, 4, 0x00000002, "c1"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "signw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "absw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_dequantise_s16_2d_8xn = orc_program_take_code (p); orc_program_free (p); } { /* orc_dequantise_s16_ip_2d_8xn */ OrcProgram *p; p = orc_program_new (); orc_program_set_constant_n (p, 8); orc_program_set_2d (p); orc_program_set_name (p, "orc_dequantise_s16_ip_2d_8xn"); orc_program_set_backup_function (p, _backup_orc_dequantise_s16_ip_2d_8xn); orc_program_add_destination (p, 2, "d1"); orc_program_add_constant (p, 4, 0x00000002, "c1"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "signw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "absw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_dequantise_s16_ip_2d_8xn = orc_program_take_code (p); orc_program_free (p); } { /* orc_dequantise_s16_ip_2d */ OrcProgram *p; p = orc_program_new (); orc_program_set_2d (p); orc_program_set_name (p, "orc_dequantise_s16_ip_2d"); orc_program_set_backup_function (p, _backup_orc_dequantise_s16_ip_2d); orc_program_add_destination (p, 2, "d1"); orc_program_add_constant (p, 4, 0x00000002, "c1"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "signw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "absw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_dequantise_s16_ip_2d = orc_program_take_code (p); orc_program_free (p); } { /* orc_dequantise_s16_ip */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_dequantise_s16_ip"); orc_program_set_backup_function (p, _backup_orc_dequantise_s16_ip); orc_program_add_destination (p, 2, "d1"); orc_program_add_constant (p, 4, 0x00000002, "c1"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "signw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "absw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_dequantise_s16_ip = orc_program_take_code (p); orc_program_free (p); } { /* orc_dequantise_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_dequantise_s16"); orc_program_set_backup_function (p, _backup_orc_dequantise_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_constant (p, 4, 0x00000002, "c1"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "signw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "absw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_dequantise_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_dequantise_var_s16_ip */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_dequantise_var_s16_ip"); orc_program_set_backup_function (p, _backup_orc_dequantise_var_s16_ip); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_constant (p, 4, 0x00000002, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "signw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "absw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_dequantise_var_s16_ip = orc_program_take_code (p); orc_program_free (p); } { /* orc_quantise1_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_quantise1_s16"); orc_program_set_backup_function (p, _backup_orc_quantise1_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_constant (p, 4, 0x00000002, "c1"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_parameter (p, 2, "p3"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "signw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "absw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "shlw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "mulhuw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "shruw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P3, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_quantise1_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_quantise2_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_quantise2_s16"); orc_program_set_backup_function (p, _backup_orc_quantise2_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_constant (p, 4, 0x00000002, "c1"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "signw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "absw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "shlw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "shruw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_quantise2_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_quantdequant1_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_quantdequant1_s16"); orc_program_set_backup_function (p, _backup_orc_quantdequant1_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_destination (p, 2, "d2"); orc_program_add_constant (p, 4, 0x00000002, "c1"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_parameter (p, 2, "p3"); orc_program_add_parameter (p, 2, "p4"); orc_program_add_parameter (p, 2, "p5"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T1, ORC_VAR_D2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "signw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "absw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "shlw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "mulhuw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "shruw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P3, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_append_2 (p, "copyw", 0, ORC_VAR_D1, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "signw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P4, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P5, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_D2, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_quantdequant1_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_quantdequant3_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_quantdequant3_s16"); orc_program_set_backup_function (p, _backup_orc_quantdequant3_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_destination (p, 2, "d2"); orc_program_add_constant (p, 4, 0x00000002, "c1"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_parameter (p, 2, "p3"); orc_program_add_parameter (p, 2, "p4"); orc_program_add_parameter (p, 2, "p5"); orc_program_add_parameter (p, 4, "p6"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_add_temporary (p, 4, "t3"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T1, ORC_VAR_D2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "signw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "absw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "shlw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "muluwl", 0, ORC_VAR_T3, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_P6, ORC_VAR_D1); orc_program_append_2 (p, "shrul", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_P3, ORC_VAR_D1); orc_program_append_2 (p, "convlw", 0, ORC_VAR_T1, ORC_VAR_T3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_append_2 (p, "copyw", 0, ORC_VAR_D1, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "signw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P4, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P5, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_D2, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_quantdequant3_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_quantdequant2_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_quantdequant2_s16"); orc_program_set_backup_function (p, _backup_orc_quantdequant2_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_destination (p, 2, "d2"); orc_program_add_constant (p, 4, 0x00000002, "c1"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_parameter (p, 2, "p3"); orc_program_add_parameter (p, 2, "p4"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T1, ORC_VAR_D2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "signw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "absw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "shlw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "shruw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_append_2 (p, "copyw", 0, ORC_VAR_D1, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "signw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P3, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P4, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_D2, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_quantdequant2_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_downsample_vert_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_downsample_vert_u8"); orc_program_set_backup_function (p, _backup_orc_downsample_vert_u8); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_source (p, 1, "s3"); orc_program_add_source (p, 1, "s4"); orc_program_add_constant (p, 4, 0x00000006, "c1"); orc_program_add_constant (p, 4, 0x0000001a, "c2"); orc_program_add_constant (p, 4, 0x00000020, "c3"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_add_temporary (p, 2, "t3"); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_S4, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T3, ORC_VAR_S3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T3, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C3, ORC_VAR_D1); orc_program_append_2 (p, "shruw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "convwb", 0, ORC_VAR_D1, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_downsample_vert_u8 = orc_program_take_code (p); orc_program_free (p); } { /* orc_downsample_horiz_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_downsample_horiz_u8"); orc_program_set_backup_function (p, _backup_orc_downsample_horiz_u8); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_constant (p, 4, 0x00000006, "c1"); orc_program_add_constant (p, 4, 0x0000001a, "c2"); orc_program_add_constant (p, 4, 0x00000020, "c3"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_add_temporary (p, 1, "t3"); orc_program_add_temporary (p, 2, "t4"); orc_program_add_temporary (p, 2, "t5"); orc_program_add_temporary (p, 2, "t6"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "select0wb", 0, ORC_VAR_T3, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T4, ORC_VAR_T3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "select1wb", 0, ORC_VAR_T3, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T5, ORC_VAR_T3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T4, ORC_VAR_T4, ORC_VAR_T5, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T4, ORC_VAR_T4, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "select1wb", 0, ORC_VAR_T3, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T5, ORC_VAR_T3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "select0wb", 0, ORC_VAR_T3, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T6, ORC_VAR_T3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T5, ORC_VAR_T5, ORC_VAR_T6, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T5, ORC_VAR_T5, ORC_VAR_C2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T4, ORC_VAR_T4, ORC_VAR_T5, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T4, ORC_VAR_T4, ORC_VAR_C3, ORC_VAR_D1); orc_program_append_2 (p, "shruw", 0, ORC_VAR_T4, ORC_VAR_T4, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "convwb", 0, ORC_VAR_D1, ORC_VAR_T4, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_downsample_horiz_u8 = orc_program_take_code (p); orc_program_free (p); } { /* orc_stats_moment_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_stats_moment_s16"); orc_program_set_backup_function (p, _backup_orc_stats_moment_s16); orc_program_add_source (p, 2, "s1"); orc_program_add_accumulator (p, 4, "a1"); orc_program_add_constant (p, 4, 0x00000002, "c1"); orc_program_add_constant (p, 4, 0x00000000, "c2"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 4, "t2"); orc_program_append_2 (p, "absw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "maxsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C2, ORC_VAR_D1); orc_program_append_2 (p, "convuwl", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "accl", 0, ORC_VAR_A1, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_stats_moment_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_stats_above_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_stats_above_s16"); orc_program_set_backup_function (p, _backup_orc_stats_above_s16); orc_program_add_source (p, 2, "s1"); orc_program_add_accumulator (p, 4, "a1"); orc_program_add_constant (p, 4, 0x00000001, "c1"); orc_program_add_constant (p, 4, 0x00000000, "c2"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 4, "t2"); orc_program_append_2 (p, "absw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "maxsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C2, ORC_VAR_D1); orc_program_append_2 (p, "minsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "convuwl", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "accl", 0, ORC_VAR_A1, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_stats_above_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_accw */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_accw"); orc_program_set_backup_function (p, _backup_orc_accw); orc_program_add_source (p, 2, "s1"); orc_program_add_accumulator (p, 2, "a1"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "absw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "accw", 0, ORC_VAR_A1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_accw = orc_program_take_code (p); orc_program_free (p); } { /* orc_avg2_8xn_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_constant_n (p, 8); orc_program_set_2d (p); orc_program_set_name (p, "orc_avg2_8xn_u8"); orc_program_set_backup_function (p, _backup_orc_avg2_8xn_u8); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_append_2 (p, "avgub", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_avg2_8xn_u8 = orc_program_take_code (p); orc_program_free (p); } { /* orc_avg2_12xn_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_constant_n (p, 12); orc_program_set_2d (p); orc_program_set_name (p, "orc_avg2_12xn_u8"); orc_program_set_backup_function (p, _backup_orc_avg2_12xn_u8); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_append_2 (p, "avgub", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_avg2_12xn_u8 = orc_program_take_code (p); orc_program_free (p); } { /* orc_avg2_16xn_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_constant_n (p, 16); orc_program_set_2d (p); orc_program_set_name (p, "orc_avg2_16xn_u8"); orc_program_set_backup_function (p, _backup_orc_avg2_16xn_u8); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_append_2 (p, "avgub", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_avg2_16xn_u8 = orc_program_take_code (p); orc_program_free (p); } { /* orc_avg2_32xn_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_constant_n (p, 32); orc_program_set_2d (p); orc_program_set_name (p, "orc_avg2_32xn_u8"); orc_program_set_backup_function (p, _backup_orc_avg2_32xn_u8); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_append_2 (p, "avgub", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_avg2_32xn_u8 = orc_program_take_code (p); orc_program_free (p); } { /* orc_avg2_nxm_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_2d (p); orc_program_set_name (p, "orc_avg2_nxm_u8"); orc_program_set_backup_function (p, _backup_orc_avg2_nxm_u8); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_append_2 (p, "avgub", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_avg2_nxm_u8 = orc_program_take_code (p); orc_program_free (p); } { /* orc_combine4_8xn_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_constant_n (p, 8); orc_program_set_2d (p); orc_program_set_name (p, "orc_combine4_8xn_u8"); orc_program_set_backup_function (p, _backup_orc_combine4_8xn_u8); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_source (p, 1, "s3"); orc_program_add_source (p, 1, "s4"); orc_program_add_constant (p, 4, 0x00000008, "c1"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_parameter (p, 2, "p3"); orc_program_add_parameter (p, 2, "p4"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P3, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S4, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P4, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_combine4_8xn_u8 = orc_program_take_code (p); orc_program_free (p); } { /* orc_combine4_12xn_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_constant_n (p, 12); orc_program_set_2d (p); orc_program_set_name (p, "orc_combine4_12xn_u8"); orc_program_set_backup_function (p, _backup_orc_combine4_12xn_u8); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_source (p, 1, "s3"); orc_program_add_source (p, 1, "s4"); orc_program_add_constant (p, 4, 0x00000008, "c1"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_parameter (p, 2, "p3"); orc_program_add_parameter (p, 2, "p4"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P3, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S4, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P4, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_combine4_12xn_u8 = orc_program_take_code (p); orc_program_free (p); } { /* orc_combine4_16xn_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_constant_n (p, 16); orc_program_set_2d (p); orc_program_set_name (p, "orc_combine4_16xn_u8"); orc_program_set_backup_function (p, _backup_orc_combine4_16xn_u8); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_source (p, 1, "s3"); orc_program_add_source (p, 1, "s4"); orc_program_add_constant (p, 4, 0x00000008, "c1"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_parameter (p, 2, "p3"); orc_program_add_parameter (p, 2, "p4"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P3, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S4, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P4, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_combine4_16xn_u8 = orc_program_take_code (p); orc_program_free (p); } { /* orc_combine4_24xn_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_constant_n (p, 24); orc_program_set_2d (p); orc_program_set_name (p, "orc_combine4_24xn_u8"); orc_program_set_backup_function (p, _backup_orc_combine4_24xn_u8); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_source (p, 1, "s3"); orc_program_add_source (p, 1, "s4"); orc_program_add_constant (p, 4, 0x00000008, "c1"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_parameter (p, 2, "p3"); orc_program_add_parameter (p, 2, "p4"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P3, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S4, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P4, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_combine4_24xn_u8 = orc_program_take_code (p); orc_program_free (p); } { /* orc_combine4_32xn_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_constant_n (p, 32); orc_program_set_2d (p); orc_program_set_name (p, "orc_combine4_32xn_u8"); orc_program_set_backup_function (p, _backup_orc_combine4_32xn_u8); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_source (p, 1, "s3"); orc_program_add_source (p, 1, "s4"); orc_program_add_constant (p, 4, 0x00000008, "c1"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_parameter (p, 2, "p3"); orc_program_add_parameter (p, 2, "p4"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P3, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S4, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P4, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_combine4_32xn_u8 = orc_program_take_code (p); orc_program_free (p); } { /* orc_combine4_nxm_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_2d (p); orc_program_set_name (p, "orc_combine4_nxm_u8"); orc_program_set_backup_function (p, _backup_orc_combine4_nxm_u8); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_source (p, 1, "s3"); orc_program_add_source (p, 1, "s4"); orc_program_add_constant (p, 4, 0x00000008, "c1"); orc_program_add_constant (p, 4, 0x00000004, "c2"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_parameter (p, 2, "p3"); orc_program_add_parameter (p, 2, "p4"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P3, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S4, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P4, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C2, ORC_VAR_D1); orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_combine4_nxm_u8 = orc_program_take_code (p); orc_program_free (p); } { /* orc_combine2_8xn_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_constant_n (p, 8); orc_program_set_2d (p); orc_program_set_name (p, "orc_combine2_8xn_u8"); orc_program_set_backup_function (p, _backup_orc_combine2_8xn_u8); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_parameter (p, 2, "p3"); orc_program_add_parameter (p, 2, "p4"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P3, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P4, ORC_VAR_D1); orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_combine2_8xn_u8 = orc_program_take_code (p); orc_program_free (p); } { /* orc_combine2_12xn_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_constant_n (p, 12); orc_program_set_2d (p); orc_program_set_name (p, "orc_combine2_12xn_u8"); orc_program_set_backup_function (p, _backup_orc_combine2_12xn_u8); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_parameter (p, 2, "p3"); orc_program_add_parameter (p, 2, "p4"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P3, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P4, ORC_VAR_D1); orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_combine2_12xn_u8 = orc_program_take_code (p); orc_program_free (p); } { /* orc_combine2_16xn_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_constant_n (p, 16); orc_program_set_2d (p); orc_program_set_name (p, "orc_combine2_16xn_u8"); orc_program_set_backup_function (p, _backup_orc_combine2_16xn_u8); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_parameter (p, 2, "p3"); orc_program_add_parameter (p, 2, "p4"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P3, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P4, ORC_VAR_D1); orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_combine2_16xn_u8 = orc_program_take_code (p); orc_program_free (p); } { /* orc_combine2_nxm_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_2d (p); orc_program_set_name (p, "orc_combine2_nxm_u8"); orc_program_set_backup_function (p, _backup_orc_combine2_nxm_u8); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_parameter (p, 2, "p3"); orc_program_add_parameter (p, 2, "p4"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P3, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P4, ORC_VAR_D1); orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_combine2_nxm_u8 = orc_program_take_code (p); orc_program_free (p); } { /* orc_sad_nxm_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_2d (p); orc_program_set_name (p, "orc_sad_nxm_u8"); orc_program_set_backup_function (p, _backup_orc_sad_nxm_u8); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_accumulator (p, 4, "a1"); orc_program_append_2 (p, "accsadubl", 0, ORC_VAR_A1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_sad_nxm_u8 = orc_program_take_code (p); orc_program_free (p); } { /* orc_sad_8x8_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_constant_n (p, 8); orc_program_set_2d (p); orc_program_set_constant_m (p, 8); orc_program_set_name (p, "orc_sad_8x8_u8"); orc_program_set_backup_function (p, _backup_orc_sad_8x8_u8); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_accumulator (p, 4, "a1"); orc_program_append_2 (p, "accsadubl", 0, ORC_VAR_A1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_sad_8x8_u8 = orc_program_take_code (p); orc_program_free (p); } { /* orc_sad_12x12_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_constant_n (p, 12); orc_program_set_2d (p); orc_program_set_constant_m (p, 12); orc_program_set_name (p, "orc_sad_12x12_u8"); orc_program_set_backup_function (p, _backup_orc_sad_12x12_u8); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_accumulator (p, 4, "a1"); orc_program_append_2 (p, "accsadubl", 0, ORC_VAR_A1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_sad_12x12_u8 = orc_program_take_code (p); orc_program_free (p); } { /* orc_sad_16xn_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_constant_n (p, 16); orc_program_set_2d (p); orc_program_set_name (p, "orc_sad_16xn_u8"); orc_program_set_backup_function (p, _backup_orc_sad_16xn_u8); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_accumulator (p, 4, "a1"); orc_program_append_2 (p, "accsadubl", 0, ORC_VAR_A1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_sad_16xn_u8 = orc_program_take_code (p); orc_program_free (p); } { /* orc_sad_32xn_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_constant_n (p, 32); orc_program_set_2d (p); orc_program_set_name (p, "orc_sad_32xn_u8"); orc_program_set_backup_function (p, _backup_orc_sad_32xn_u8); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_accumulator (p, 4, "a1"); orc_program_append_2 (p, "accsadubl", 0, ORC_VAR_A1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_sad_32xn_u8 = orc_program_take_code (p); orc_program_free (p); } #endif } schroedinger-1.0.11/testsuite/perf/report.c0000644000175000017500000000342111556115124015634 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #define WIDTH 2400 int16_t tmp[WIDTH+100]; int orc_profile_get_min (OrcProfile *prof) { int i; int min; min = prof->hist_time[0]; for(i=0;i<10;i++){ if (prof->hist_count[i] > 0) { if (prof->hist_time[i] < min) { min = prof->hist_time[i]; } } } return min; } void wavelet_speed (SchroFrame *frame, int filter) { OrcProfile prof1; OrcProfile prof2; double ave_fwd, ave_rev; int i; SchroFrameData *fd = frame->components + 0; orc_profile_init (&prof1); orc_profile_init (&prof2); for(i=0;i<10;i++){ orc_profile_start (&prof1); schro_wavelet_transform_2d (fd, filter, tmp); orc_profile_stop (&prof1); orc_profile_start (&prof2); schro_wavelet_inverse_transform_2d (fd, fd, filter, tmp); orc_profile_stop (&prof2); } //orc_profile_get_ave_std (&prof1, &ave_fwd, &std); //printf("fwd %g (%g)\n", ave, std); //orc_profile_get_ave_std (&prof2, &ave_rev, &std); //printf("rev %g (%g)\n", ave, std); ave_fwd = orc_profile_get_min (&prof1); ave_rev = orc_profile_get_min (&prof2); printf("%d %d %g %g %g %g\n", frame->width, frame->height, ave_fwd, ave_rev, ave_fwd/(frame->width*frame->height), ave_rev/(frame->width*frame->height)); } int main (int argc, char *argv[]) { int i; SchroFrame *frame; int width, height; width = 1920; height = 1080; orc_init(); frame = schro_frame_new_and_alloc (NULL, SCHRO_FRAME_FORMAT_S16_444, width, height); for(i=0;i<7;i++) { wavelet_speed (frame, i); } schro_frame_unref (frame); return 0; } schroedinger-1.0.11/testsuite/perf/unpack_speed.c0000644000175000017500000015413411556115124016772 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #include #define N 10000 uint8_t packed_data[N*16]; const int16_t _schro_table_unpack_sint[1024][10]; const int8_t test2_table_unpack_sint[256][17]; const int8_t test3_table_unpack_sint[1024][21]; int16_t a[N]; int16_t b[N]; int16_t c[N]; int16_t table[65536]; int orc_profile_get_min (OrcProfile *prof) { int i; int min; min = prof->hist_time[0]; for(i=0;i<10;i++){ if (prof->hist_count[i] > 0) { if (prof->hist_time[i] < min) { min = prof->hist_time[i]; } } } return min; } static void _schro_unpack_shift_in (SchroUnpack * unpack) { if (unpack->n_bits_left >= 32) { /* the fast path */ if (unpack->n_bits_in_shift_register == 0) { unpack->shift_register = (unpack->data[0] << 24) | (unpack-> data[1] << 16) | (unpack->data[2] << 8) | (unpack->data[3]); unpack->data += 4; unpack->n_bits_left -= 32; unpack->n_bits_in_shift_register = 32; } else { while (unpack->n_bits_in_shift_register <= 24) { unpack->shift_register |= unpack->data[0] << (24 - unpack->n_bits_in_shift_register); unpack->data++; unpack->n_bits_left -= 8; unpack->n_bits_in_shift_register += 8; } } return; } if (unpack->n_bits_left == 0) { unsigned int value = (unpack->guard_bit) ? 0xffffffff : 0; unpack->overrun += 32 - unpack->n_bits_in_shift_register; unpack->shift_register |= (value >> unpack->n_bits_in_shift_register); unpack->n_bits_in_shift_register = 32; return; } while (unpack->n_bits_left >= 8 && unpack->n_bits_in_shift_register <= 24) { unpack->shift_register |= unpack->data[0] << (24 - unpack->n_bits_in_shift_register); unpack->data++; unpack->n_bits_left -= 8; unpack->n_bits_in_shift_register += 8; } if (unpack->n_bits_left > 0 && unpack->n_bits_in_shift_register + unpack->n_bits_left <= 32) { unsigned int value; value = unpack->data[0] >> (8 - unpack->n_bits_left); unpack->shift_register |= value << (32 - unpack->n_bits_in_shift_register - unpack->n_bits_left); unpack->data++; unpack->n_bits_in_shift_register += unpack->n_bits_left; unpack->n_bits_left = 0; } } static unsigned int _schro_unpack_shift_out (SchroUnpack * unpack, int n) { unsigned int value; if (n == 0) return 0; value = unpack->shift_register >> (32 - n); unpack->shift_register <<= n; unpack->n_bits_in_shift_register -= n; unpack->n_bits_read += n; return value; } /* test 1 */ void test1_unpack_decode_sint_s16 (int16_t * dest, SchroUnpack * unpack, int n) { int i; int j; const int16_t *table_entry; int x; int z; while (n > 0) { while (unpack->n_bits_in_shift_register < 8 + SCHRO_UNPACK_TABLE_SHIFT) { _schro_unpack_shift_in (unpack); } i = unpack->shift_register >> (32 - SCHRO_UNPACK_TABLE_SHIFT); table_entry = schro_table_unpack_sint[i]; x = table_entry[0]; if ((x & 0xf) == 0) { int y = x >> 4; i = (unpack->shift_register & 0xffffff) >> (24 - SCHRO_UNPACK_TABLE_SHIFT); table_entry = schro_table_unpack_sint[i]; x = table_entry[0]; if ((x & 0xf) == 0) { dest[0] = schro_unpack_decode_sint_slow (unpack); dest++; n--; } else { int bits = ((x & 0xf) >> 1) - 1; z = x >> 4; if (z > 0) { dest[0] = z + (y << bits); } else { dest[0] = z - (y << bits); } _schro_unpack_shift_out (unpack, (x & 0xf) + 8); dest++; n--; } } else { j = 0; do { dest[j] = x >> 4; j++; n--; x = table_entry[j]; } while (n > 0 && x & 0xf); x = table_entry[j - 1]; _schro_unpack_shift_out (unpack, x & 0xf); dest += j; } } } /* test 2 */ #define SHIFT 8 void test2_unpack_decode_sint_s16 (int16_t * dest, SchroUnpack * unpack, int n) { int i; int j; int m; while (n > 0) { while (unpack->n_bits_in_shift_register < 8 + SHIFT) { _schro_unpack_shift_in (unpack); } i = unpack->shift_register >> (32 - SHIFT); if (test2_table_unpack_sint[i][0] == 0) { dest[0] = schro_unpack_decode_sint_slow (unpack); dest++; n--; } else { m = MIN(n, test2_table_unpack_sint[i][0]); for(j=0;j 0) { while (unpack->n_bits_in_shift_register < 8 + SHIFT) { _schro_unpack_shift_in (unpack); } i = unpack->shift_register >> (32 - SHIFT); table_entry = table[i]; if (table_entry[0] == 0) { dest[0] = schro_unpack_decode_sint_slow (unpack); dest++; n--; } else { m = MIN(n, table_entry[0]); for(j=0;j #include #include #include #include #include #include #include #include #define N 100 int16_t a[N]; int16_t b[N]; int16_t c[N]; int16_t table[65536]; int orc_profile_get_min (OrcProfile *prof) { int i; int min; min = prof->hist_time[0]; for(i=0;i<10;i++){ if (prof->hist_count[i] > 0) { if (prof->hist_time[i] < min) { min = prof->hist_time[i]; } } } return min; } #if 0 static int __schro_dequantise (int q, int quant_factor, int quant_offset) { if (q == 0) return 0; if (q < 0) { return -((-q * quant_factor + quant_offset + 2)>>2); } else { return (q * quant_factor + quant_offset + 2)>>2; } } #endif #if 0 static int __schro_quantise_shift (int value, int quant_shift) { unsigned int x; if (value == 0) return 0; if (value < 0) { x = (-value)>>quant_shift; value = -x; } else { x = value>>quant_shift; value = x; } return value; } #endif #if 0 static int __schro_quantise_table (int value, int16_t *table) { return table[value]; } #endif void schro_dequantise_s16_ref (int16_t *dest, int16_t *src, int quant_index, schro_bool is_intra, int n) { int i; int quant_factor = schro_table_quant[quant_index]; int quant_offset = is_intra ? schro_table_offset_1_2[quant_index] : schro_table_offset_3_8[quant_index]; for(i=0;i>2); } else { dest[i] = (src[i] * quant_factor + quant_offset + 2)>>2; } } } #if 0 void schro_dequantise_s16_table (int16_t *dest, int16_t *src, int quant_index, schro_bool is_intra, int n) { int i; for(i=0;i> 2); } } else { schro_quantise_s16_ref (dest, src, quant_index, is_intra, n); } } #endif void schro_dequantise_s16_test (int16_t *dest, int16_t *src, int quant_index, schro_bool is_intra, int n) { int quant_factor = schro_table_quant[quant_index]; int quant_offset = is_intra ? schro_table_offset_1_2[quant_index] : schro_table_offset_3_8[quant_index]; int i; quant_offset += 2; for(i=0;i>2); } else { dest[i] = (src[i] * quant_factor + quant_offset)>>2; } } } void generate_table (int16_t *table, int quant_index, schro_bool is_intra) { int i; for(i=0;i<65536;i++){ table[i] = i-32768; } schro_dequantise_s16_ref (table, table, quant_index, is_intra, 65536); } void dequantise_speed (int quant_index, int n) { OrcProfile prof1; OrcProfile prof3; double ave1; double ave3; int i; int j; schro_bool is_intra = TRUE; int quant_factor; int quant_offset; quant_factor = 10; quant_offset = 10; orc_profile_init (&prof1); orc_profile_init (&prof3); for(i=0;i<10;i++) { for(j=0;j #include #include #include #include #include int16_t tmp[2048+100]; int16_t *data; int orc_profile_get_min (OrcProfile *prof) { int i; int min; min = prof->hist_time[0]; for(i=0;i<10;i++){ if (prof->hist_count[i] > 0) { if (prof->hist_time[i] < min) { min = prof->hist_time[i]; } } } return min; } void wavelet_speed (int filter, int width, int height) { OrcProfile prof1; OrcProfile prof2; double ave_fwd, ave_rev; int i; SchroFrameData fd; fd.format = SCHRO_FRAME_FORMAT_S16_444; fd.data = data; fd.stride = width*2; fd.width = width; fd.height = height; orc_profile_init (&prof1); orc_profile_init (&prof2); for(i=0;i<10;i++){ orc_profile_start (&prof1); schro_wavelet_transform_2d (&fd, filter, tmp); orc_profile_stop (&prof1); orc_profile_start (&prof2); schro_wavelet_inverse_transform_2d (&fd, &fd, filter, tmp); orc_profile_stop (&prof2); } //orc_profile_get_ave_std (&prof1, &ave_fwd, &std); //printf("fwd %g (%g)\n", ave, std); //orc_profile_get_ave_std (&prof2, &ave_rev, &std); //printf("rev %g (%g)\n", ave, std); ave_fwd = orc_profile_get_min (&prof1); ave_rev = orc_profile_get_min (&prof2); printf("%d %d %g %g %g %g\n", width, height, ave_fwd, ave_rev, ave_fwd/(width*height), ave_rev/(width*height)); } int main (int argc, char *argv[]) { int i; schro_init(); data = malloc(2048*512*2); #if 0 for(i=0;i<8;i++){ printf("wavelet %d\n", i); wavelet_speed (i, 256, 256); } #endif for(i=16;i<=2048;i+=16){ wavelet_speed (3, i, 256); } free(data); return 0; } schroedinger-1.0.11/testsuite/abi.c0000644000175000017500000000677211320237456014136 00000000000000 #include #include int main (int argc, char *argv[]) { #define X(sym) printf("%s: %p\n", #sym, sym); /* schro.h */ X(schro_init); /* schrobuffer.h */ X(schro_buffer_new); X(schro_buffer_new_and_alloc); X(schro_buffer_new_with_data); X(schro_buffer_new_subbuffer); X(schro_buffer_dup); X(schro_buffer_ref); X(schro_buffer_unref); X(schro_tag_new); X(schro_tag_free); /* schrodebug.h */ X(schro_debug_log); X(schro_debug_set_level); X(schro_debug_get_level); X(schro_debug_set_log_function); /* schrodecoder.h */ X(schro_decoder_new); X(schro_decoder_free); X(schro_decoder_reset); X(schro_decoder_get_video_format); X(schro_decoder_add_output_picture); X(schro_decoder_push_ready); X(schro_decoder_push); /* deprecated. Don't know how to check this without triggering warning */ //X(schro_decoder_set_flushing); X(schro_decoder_set_picture_order); X(schro_decoder_push_end_of_stream); X(schro_decoder_pull); X(schro_decoder_wait); X(schro_decoder_set_earliest_frame); X(schro_decoder_set_skip_ratio); X(schro_decoder_get_picture_number); X(schro_decoder_need_output_frame); X(schro_decoder_autoparse_wait); X(schro_decoder_autoparse_push); X(schro_decoder_autoparse_push_end_of_sequence); X(schro_decoder_get_picture_tag); /* schroencoder.h */ X(schro_encoder_new); X(schro_encoder_free); X(schro_encoder_get_video_format); X(schro_encoder_set_video_format); X(schro_encoder_end_of_stream); X(schro_encoder_push_ready); X(schro_encoder_push_frame); X(schro_encoder_push_frame_full); X(schro_encoder_force_sequence_header); X(schro_encoder_encode_auxiliary_data); X(schro_encoder_encode_parse_info); X(schro_encoder_insert_buffer); X(schro_encoder_frame_insert_buffer); X(schro_encoder_start); X(schro_encoder_set_packet_assembly); X(schro_encoder_wait); X(schro_encoder_pull); X(schro_encoder_pull_full); X(schro_encoder_encode_sequence_header); X(schro_encoder_get_n_settings); X(schro_encoder_get_setting_info); X(schro_encoder_setting_set_double); X(schro_encoder_setting_get_double); /* schroframe.h */ X(schro_frame_new); X(schro_frame_new_and_alloc); X(schro_frame_new_from_data_I420); X(schro_frame_new_from_data_YV12); X(schro_frame_new_from_data_YUY2); X(schro_frame_new_from_data_UYVY); X(schro_frame_new_from_data_UYVY_full); X(schro_frame_new_from_data_AYUV); X(schro_frame_new_from_data_v216); X(schro_frame_new_from_data_v210); X(schro_frame_set_free_callback); X(schro_frame_unref); X(schro_frame_ref); X(schro_frame_dup); X(schro_frame_clone); X(schro_frame_convert); X(schro_frame_add); X(schro_frame_subtract); X(schro_frame_shift_left); X(schro_frame_shift_right); X(schro_frame_downsample); X(schro_frame_upsample_horiz); X(schro_frame_upsample_vert); X(schro_frame_calculate_average_luma); X(schro_frame_convert_to_444); X(schro_frame_md5); /* schroparse */ X(schro_parse_decode_sequence_header); /* schrovideoformat.h */ X(schro_video_format_validate); X(schro_video_format_set_std_video_format); X(schro_video_format_get_std_video_format); X(schro_video_format_set_std_frame_rate); X(schro_video_format_get_std_frame_rate); X(schro_video_format_set_std_aspect_ratio); X(schro_video_format_get_std_aspect_ratio); X(schro_video_format_set_std_signal_range); X(schro_video_format_get_std_signal_range); X(schro_video_format_set_std_colour_spec); X(schro_video_format_get_std_colour_spec); return 0; } schroedinger-1.0.11/testsuite/manual/0000775000175000017500000000000011707140273014561 500000000000000schroedinger-1.0.11/testsuite/manual/build_from_git0000755000175000017500000000041411320237456017412 00000000000000#!/bin/sh set -x rm -rf tmp-build-dir mkdir tmp-build-dir cd tmp-build-dir && git clone git://diracvideo.org/git/schroedinger.git && cd schroedinger && ./autogen.sh && make && make distcheck && cd ../.. && rm -rf tmp-build-dir && echo SUCCESS! schroedinger-1.0.11/testsuite/manual/Makefile.am0000644000175000017500000000003611320237456016533 00000000000000 EXTRA_DIST = build_from_git schroedinger-1.0.11/testsuite/manual/Makefile.in0000664000175000017500000002532411707140262016552 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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@ subdir = testsuite/manual DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-auto-alt.m4 \ $(top_srcdir)/m4/as-compiler-flag.m4 \ $(top_srcdir)/m4/as-host-defines.m4 \ $(top_srcdir)/m4/as-version.m4 $(top_srcdir)/m4/gst-args.m4 \ $(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)/m4/pkg.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUDA_CFLAGS = @CUDA_CFLAGS@ CUDA_LIBS = @CUDA_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ GCOV = @GCOV@ GCOV_CFLAGS = @GCOV_CFLAGS@ GCOV_LIBS = @GCOV_LIBS@ GREP = @GREP@ GTHREAD_CFLAGS = @GTHREAD_CFLAGS@ GTHREAD_LIBS = @GTHREAD_LIBS@ GTKDOC_CHECK = @GTKDOC_CHECK@ 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@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ NVCC = @NVCC@ NVCCFLAGS = @NVCCFLAGS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENGL_CFLAGS = @OPENGL_CFLAGS@ OPENGL_LIBS = @OPENGL_LIBS@ ORCC = @ORCC@ ORC_CFLAGS = @ORC_CFLAGS@ ORC_LIBS = @ORC_LIBS@ 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@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SCHRO_CFLAGS = @SCHRO_CFLAGS@ SCHRO_LIBS = @SCHRO_LIBS@ SCHRO_LIBVERSION = @SCHRO_LIBVERSION@ SCHRO_MAJORMINOR = @SCHRO_MAJORMINOR@ SCHRO_PKG_DEPS = @SCHRO_PKG_DEPS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ THREAD_IMPL = @THREAD_IMPL@ VERSION = @VERSION@ 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_CXX = @ac_ct_CXX@ 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@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = build_from_git 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) --foreign testsuite/manual/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign testsuite/manual/Makefile .PRECIOUS: 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 tags: TAGS TAGS: ctags: CTAGS CTAGS: 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 \ 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 uninstall uninstall-am # 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: schroedinger-1.0.11/testsuite/coder/0000775000175000017500000000000011707140273014400 500000000000000schroedinger-1.0.11/testsuite/coder/arith_dirac_byte.c0000644000175000017500000001625611702131150017755 00000000000000 #include "config.h" #include #include #include #include #include "arith.h" static uint16_t division_factor[257] = { 0, 0, 32768, 21845, 16384, 13107, 10923, 9362, 8192, 7282, 6554, 5958, 5461, 5041, 4681, 4369, 4096, 3855, 3641, 3449, 3277, 3121, 2979, 2849, 2731, 2621, 2521, 2427, 2341, 2260, 2185, 2114, 2048, 1986, 1928, 1872, 1820, 1771, 1725, 1680, 1638, 1598, 1560, 1524, 1489, 1456, 1425, 1394, 1365, 1337, 1311, 1285, 1260, 1237, 1214, 1192, 1170, 1150, 1130, 1111, 1092, 1074, 1057, 1040, 1024, 1008, 993, 978, 964, 950, 936, 923, 910, 898, 886, 874, 862, 851, 840, 830, 819, 809, 799, 790, 780, 771, 762, 753, 745, 736, 728, 720, 712, 705, 697, 690, 683, 676, 669, 662, 655, 649, 643, 636, 630, 624, 618, 612, 607, 601, 596, 590, 585, 580, 575, 570, 565, 560, 555, 551, 546, 542, 537, 533, 529, 524, 520, 516, 512, 508, 504, 500, 496, 493, 489, 485, 482, 478, 475, 471, 468, 465, 462, 458, 455, 452, 449, 446, 443, 440, 437, 434, 431, 428, 426, 423, 420, 417, 415, 412, 410, 407, 405, 402, 400, 397, 395, 392, 390, 388, 386, 383, 381, 379, 377, 374, 372, 370, 368, 366, 364, 362, 360, 358, 356, 354, 352, 350, 349, 347, 345, 343, 341, 340, 338, 336, 334, 333, 331, 329, 328, 326, 324, 323, 321, 320, 318, 317, 315, 314, 312, 311, 309, 308, 306, 305, 303, 302, 301, 299, 298, 297, 295, 294, 293, 291, 290, 289, 287, 286, 285, 284, 282, 281, 280, 279, 278, 277, 275, 274, 273, 272, 271, 270, 269, 267, 266, 265, 264, 263, 262, 261, 260, 259, 258, 257, 256 }; void arith_dirac_byte_init (Arith *arith) { memset (arith, 0, sizeof(*arith)); arith->code = 0; arith->range0 = 0; arith->range1 = 0xffff; arith->cntr = 0; arith->offset = 0; arith->contexts[0].count[0] = 1; arith->contexts[0].count[1] = 1; arith->contexts[0].next = 0; } void arith_dirac_byte_flush (Arith *arith) { while (arith->cntr < 8) { arith->range0 <<= 1; arith->cntr++; } if (arith->range0 >= (1<<24)) { arith->data[arith->offset-1]++; while (arith->carry) { arith->data[arith->offset] = 0x00; arith->carry--; arith->offset++; } } else { while (arith->carry) { arith->data[arith->offset] = 0xff; arith->carry--; arith->offset++; } } arith->data[arith->offset] = arith->range0 >> 16; arith->offset++; arith->data[arith->offset] = arith->range0 >> 8; arith->offset++; arith->data[arith->offset] = arith->range0 >> 0; arith->offset++; } static void arith_dirac_byte_encode (Arith *arith, int i, int value) { unsigned int range; unsigned int scaler; unsigned int weight; unsigned int probability0; unsigned int range_x_prob; //printf("[%04x %04x]\n", arith->range0, arith->range1); weight = arith->contexts[i].count[0] + arith->contexts[i].count[1]; scaler = division_factor[weight]; probability0 = arith->contexts[i].count[0] * scaler; range = arith->range1 - arith->range0 + 1; range_x_prob = (range * probability0) >> 16; if (value) { arith->range0 = arith->range0 + range_x_prob; } else { arith->range1 = arith->range0 + range_x_prob - 1; } arith->contexts[i].count[value]++; if (arith->contexts[i].count[0] + arith->contexts[i].count[1] > 255) { arith->contexts[i].count[0] >>= 1; arith->contexts[i].count[0]++; arith->contexts[i].count[1] >>= 1; arith->contexts[i].count[1]++; } while (arith->range1 - arith->range0 < 0x8000) { arith->range0 <<= 1; arith->range1 <<= 1; arith->range1++; arith->cntr++; if (arith->cntr == 8) { int range; //printf("byte shift\n"); if (arith->range0 < (1<<24) && arith->range1 >= (1<<24)) { arith->carry++; } else { if (arith->range0 >= (1<<24)) { arith->data[arith->offset-1]++; while (arith->carry) { arith->data[arith->offset] = 0x00; arith->carry--; arith->offset++; } } else { while (arith->carry) { arith->data[arith->offset] = 0xff; arith->carry--; arith->offset++; } } arith->data[arith->offset] = arith->range0 >> 16; arith->offset++; } range = arith->range1 - arith->range0; arith->range0 &= 0xffff; arith->range1 = arith->range0 + range; arith->cntr = 0; } } } static int arith_dirac_byte_decode (Arith *arith, int i) { unsigned int count; unsigned int range; unsigned int scaler; unsigned int weight; unsigned int probability0; unsigned int range_x_prob; int value; //printf("[%04x %04x] %04x\n", arith->range0, arith->range1, arith->code); weight = arith->contexts[i].count[0] + arith->contexts[i].count[1]; scaler = division_factor[weight]; probability0 = arith->contexts[i].count[0] * scaler; count = arith->code - arith->range0 + 1; range = arith->range1 - arith->range0 + 1; range_x_prob = (range * probability0) >> 16; value = count > range_x_prob; if (value) { arith->range0 = arith->range0 + range_x_prob; } else { arith->range1 = arith->range0 + range_x_prob - 1; } arith->contexts[i].count[value]++; if (arith->contexts[i].count[0] + arith->contexts[i].count[1] > 255) { arith->contexts[i].count[0] >>= 1; arith->contexts[i].count[0]++; arith->contexts[i].count[1] >>= 1; arith->contexts[i].count[1]++; } while (arith->range1 - arith->range0 < 0x8000) { arith->range0 <<= 1; arith->range1 <<= 1; arith->range1++; arith->code <<= 1; arith->code |= (arith->data[arith->offset] >> (7-arith->cntr))&1; arith->cntr++; if (arith->cntr == 8) { int range; //printf("byte shift\n"); arith->offset++; #if 0 if (arith->range0 < (1<<24) && arith->range1 >= (1<<24)) { arith->carry++; } else { if (arith->range0 >= (1<<24)) { arith->data[arith->offset-1]++; while (arith->carry) { arith->data[arith->offset] = 0x00; arith->carry--; arith->offset++; } } else { while (arith->carry) { arith->data[arith->offset] = 0xff; arith->carry--; arith->offset++; } } arith->data[arith->offset] = arith->range0 >> 16; arith->offset++; } #endif range = arith->range1 - arith->range0; arith->range0 &= 0xffff; arith->range1 = arith->range0 + range; arith->code &= 0xffff; if (arith->code < arith->range0) { arith->code |= (1<<16); } arith->cntr = 0; } } return value; } DEFINE_EFFICIENCY(dirac_byte) DEFINE_SPEED(dirac_byte) DEFINE_ENCODE(dirac_byte) DEFINE_DECODE(dirac_byte) schroedinger-1.0.11/testsuite/coder/arith_exp.c0000644000175000017500000002127510735025462016456 00000000000000 #include "config.h" #include #include #define OIL_ENABLE_UNSTABLE_API #include #include #include "arith.h" const unsigned int lut[256] = { //LUT corresponds to window = 16 @ p0=0.5 & 256 @ p=1.0 0, 2, 5, 8, 11, 15, 20, 24, 29, 35, 41, 47, 53, 60, 67, 74, 82, 89, 97, 106, 114, 123, 132, 141, 150, 160, 170, 180, 190, 201, 211, 222, 233, 244, 256, 267, 279, 291, 303, 315, 327, 340, 353, 366, 379, 392, 405, 419, 433, 447, 461, 475, 489, 504, 518, 533, 548, 563, 578, 593, 609, 624, 640, 656, 672, 688, 705, 721, 738, 754, 771, 788, 805, 822, 840, 857, 875, 892, 910, 928, 946, 964, 983, 1001, 1020, 1038, 1057, 1076, 1095, 1114, 1133, 1153, 1172, 1192, 1211, 1231, 1251, 1271, 1291, 1311, 1332, 1352, 1373, 1393, 1414, 1435, 1456, 1477, 1498, 1520, 1541, 1562, 1584, 1606, 1628, 1649, 1671, 1694, 1716, 1738, 1760, 1783, 1806, 1828, 1851, 1874, 1897, 1920, 1935, 1942, 1949, 1955, 1961, 1968, 1974, 1980, 1985, 1991, 1996, 2001, 2006, 2011, 2016, 2021, 2025, 2029, 2033, 2037, 2040, 2044, 2047, 2050, 2053, 2056, 2058, 2061, 2063, 2065, 2066, 2068, 2069, 2070, 2071, 2072, 2072, 2072, 2072, 2072, 2072, 2071, 2070, 2069, 2068, 2066, 2065, 2063, 2060, 2058, 2055, 2052, 2049, 2045, 2042, 2038, 2033, 2029, 2024, 2019, 2013, 2008, 2002, 1996, 1989, 1982, 1975, 1968, 1960, 1952, 1943, 1934, 1925, 1916, 1906, 1896, 1885, 1874, 1863, 1851, 1839, 1827, 1814, 1800, 1786, 1772, 1757, 1742, 1727, 1710, 1694, 1676, 1659, 1640, 1622, 1602, 1582, 1561, 1540, 1518, 1495, 1471, 1447, 1422, 1396, 1369, 1341, 1312, 1282, 1251, 1219, 1186, 1151, 1114, 1077, 1037, 995, 952, 906, 857, 805, 750, 690, 625, 553, 471, 376, 255 }; #if 0 static uint16_t division_factor[257] = { 0, 0, 32768, 21845, 16384, 13107, 10923, 9362, 8192, 7282, 6554, 5958, 5461, 5041, 4681, 4369, 4096, 3855, 3641, 3449, 3277, 3121, 2979, 2849, 2731, 2621, 2521, 2427, 2341, 2260, 2185, 2114, 2048, 1986, 1928, 1872, 1820, 1771, 1725, 1680, 1638, 1598, 1560, 1524, 1489, 1456, 1425, 1394, 1365, 1337, 1311, 1285, 1260, 1237, 1214, 1192, 1170, 1150, 1130, 1111, 1092, 1074, 1057, 1040, 1024, 1008, 993, 978, 964, 950, 936, 923, 910, 898, 886, 874, 862, 851, 840, 830, 819, 809, 799, 790, 780, 771, 762, 753, 745, 736, 728, 720, 712, 705, 697, 690, 683, 676, 669, 662, 655, 649, 643, 636, 630, 624, 618, 612, 607, 601, 596, 590, 585, 580, 575, 570, 565, 560, 555, 551, 546, 542, 537, 533, 529, 524, 520, 516, 512, 508, 504, 500, 496, 493, 489, 485, 482, 478, 475, 471, 468, 465, 462, 458, 455, 452, 449, 446, 443, 440, 437, 434, 431, 428, 426, 423, 420, 417, 415, 412, 410, 407, 405, 402, 400, 397, 395, 392, 390, 388, 386, 383, 381, 379, 377, 374, 372, 370, 368, 366, 364, 362, 360, 358, 356, 354, 352, 350, 349, 347, 345, 343, 341, 340, 338, 336, 334, 333, 331, 329, 328, 326, 324, 323, 321, 320, 318, 317, 315, 314, 312, 311, 309, 308, 306, 305, 303, 302, 301, 299, 298, 297, 295, 294, 293, 291, 290, 289, 287, 286, 285, 284, 282, 281, 280, 279, 278, 277, 275, 274, 273, 272, 271, 270, 269, 267, 266, 265, 264, 263, 262, 261, 260, 259, 258, 257, 256 }; #endif void arith_exp_init (Arith *arith) { memset (arith, 0, sizeof(*arith)); arith->code = 0; arith->range0 = 0; arith->range1 = 0x10000; arith->cntr = 0; arith->offset = 0; arith->contexts[0].count[0] = 1; arith->contexts[0].count[1] = 1; arith->contexts[0].next = 0; arith->contexts[0].probability = 0x8000; arith->contexts[0].n = 0; } void arith_exp_flush (Arith *arith) { while (arith->cntr < 8) { arith->range0 <<= 1; arith->cntr++; } if (arith->range0 >= (1<<24)) { arith->data[arith->offset-1]++; while (arith->carry) { arith->data[arith->offset] = 0x00; arith->carry--; arith->offset++; } } else { while (arith->carry) { arith->data[arith->offset] = 0xff; arith->carry--; arith->offset++; } } arith->data[arith->offset] = arith->range0 >> 16; arith->offset++; arith->data[arith->offset] = arith->range0 >> 8; arith->offset++; arith->data[arith->offset] = arith->range0 >> 0; arith->offset++; } static void arith_exp_encode (Arith *arith, int i, int value) { unsigned int range; unsigned int probability0; unsigned int range_x_prob; probability0 = arith->contexts[i].probability; range = arith->range1; range_x_prob = (range * probability0) >> 16; if (value) { arith->range0 = arith->range0 + range_x_prob; arith->range1 -= range_x_prob; } else { arith->range1 = range_x_prob; } //arith->contexts[i].count[value]++; //arith->contexts[i].n++; if (value) { arith->contexts[i].probability -= lut[arith->contexts[i].probability>>8]; } else { arith->contexts[i].probability += lut[255-(arith->contexts[i].probability>>8)]; } #if 0 if (arith->contexts[i].n == 16) { unsigned int scaler; unsigned int weight; arith->contexts[i].n = 0; if (arith->contexts[i].count[0] + arith->contexts[i].count[1] > 255) { arith->contexts[i].count[0] >>= 1; arith->contexts[i].count[0]++; arith->contexts[i].count[1] >>= 1; arith->contexts[i].count[1]++; } weight = arith->contexts[i].count[0] + arith->contexts[i].count[1]; scaler = division_factor[weight]; arith->contexts[i].probability = arith->contexts[i].count[0] * scaler; } #endif while (arith->range1 < 0x8000) { arith->range0 <<= 1; arith->range1 <<= 1; arith->cntr++; if (arith->cntr == 8) { if (arith->range0 < (1<<24) && (arith->range0 + arith->range1) >= (1<<24)) { arith->carry++; } else { if (arith->range0 >= (1<<24)) { arith->data[arith->offset-1]++; while (arith->carry) { arith->data[arith->offset] = 0x00; arith->carry--; arith->offset++; } } else { while (arith->carry) { arith->data[arith->offset] = 0xff; arith->carry--; arith->offset++; } } arith->data[arith->offset] = arith->range0 >> 16; arith->offset++; } arith->range0 &= 0xffff; arith->cntr = 0; } } } static int arith_exp_decode (Arith *arith, int i) { unsigned int count; unsigned int range; unsigned int probability0; unsigned int range_x_prob; int value; //printf("[%04x %04x] %04x\n", arith->range0, arith->range1, arith->code); probability0 = arith->contexts[i].probability; count = arith->code - arith->range0 + 1; range = arith->range1; range_x_prob = (range * probability0) >> 16; value = count > range_x_prob; if (value) { arith->range0 = arith->range0 + range_x_prob; arith->range1 -= range_x_prob; } else { arith->range1 = range_x_prob; } //arith->contexts[i].count[value]++; //arith->contexts[i].n++; if (value) { arith->contexts[i].probability -= lut[arith->contexts[i].probability>>8]; } else { arith->contexts[i].probability += lut[255-(arith->contexts[i].probability>>8)]; } #if 0 if (arith->contexts[i].n == 16) { unsigned int scaler; unsigned int weight; arith->contexts[i].n = 0; if (arith->contexts[i].count[0] + arith->contexts[i].count[1] > 255) { arith->contexts[i].count[0] >>= 1; arith->contexts[i].count[0]++; arith->contexts[i].count[1] >>= 1; arith->contexts[i].count[1]++; } weight = arith->contexts[i].count[0] + arith->contexts[i].count[1]; scaler = division_factor[weight]; arith->contexts[i].probability = arith->contexts[i].count[0] * scaler; } #endif while (arith->range1 < 0x8000) { arith->range0 <<= 1; arith->range1 <<= 1; arith->code <<= 1; arith->code |= (arith->data[arith->offset] >> (7-arith->cntr))&1; arith->cntr++; if (arith->cntr == 8) { arith->offset++; arith->range0 &= 0xffff; arith->code &= 0xffff; if (arith->code < arith->range0) { arith->code |= (1<<16); } arith->cntr = 0; } } return value; } DEFINE_EFFICIENCY(exp) DEFINE_SPEED(exp) DEFINE_ENCODE(exp) DEFINE_DECODE(exp) schroedinger-1.0.11/testsuite/coder/arith_dirac.c0000644000175000017500000001070610735025462016741 00000000000000 #include "config.h" #include #include #include #include #define OIL_ENABLE_UNSTABLE_API #include "arith.h" static uint16_t division_factor[257] = { 0, 0, 32768, 21845, 16384, 13107, 10923, 9362, 8192, 7282, 6554, 5958, 5461, 5041, 4681, 4369, 4096, 3855, 3641, 3449, 3277, 3121, 2979, 2849, 2731, 2621, 2521, 2427, 2341, 2260, 2185, 2114, 2048, 1986, 1928, 1872, 1820, 1771, 1725, 1680, 1638, 1598, 1560, 1524, 1489, 1456, 1425, 1394, 1365, 1337, 1311, 1285, 1260, 1237, 1214, 1192, 1170, 1150, 1130, 1111, 1092, 1074, 1057, 1040, 1024, 1008, 993, 978, 964, 950, 936, 923, 910, 898, 886, 874, 862, 851, 840, 830, 819, 809, 799, 790, 780, 771, 762, 753, 745, 736, 728, 720, 712, 705, 697, 690, 683, 676, 669, 662, 655, 649, 643, 636, 630, 624, 618, 612, 607, 601, 596, 590, 585, 580, 575, 570, 565, 560, 555, 551, 546, 542, 537, 533, 529, 524, 520, 516, 512, 508, 504, 500, 496, 493, 489, 485, 482, 478, 475, 471, 468, 465, 462, 458, 455, 452, 449, 446, 443, 440, 437, 434, 431, 428, 426, 423, 420, 417, 415, 412, 410, 407, 405, 402, 400, 397, 395, 392, 390, 388, 386, 383, 381, 379, 377, 374, 372, 370, 368, 366, 364, 362, 360, 358, 356, 354, 352, 350, 349, 347, 345, 343, 341, 340, 338, 336, 334, 333, 331, 329, 328, 326, 324, 323, 321, 320, 318, 317, 315, 314, 312, 311, 309, 308, 306, 305, 303, 302, 301, 299, 298, 297, 295, 294, 293, 291, 290, 289, 287, 286, 285, 284, 282, 281, 280, 279, 278, 277, 275, 274, 273, 272, 271, 270, 269, 267, 266, 265, 264, 263, 262, 261, 260, 259, 258, 257, 256 }; void arith_dirac_init (Arith *arith) { memset (arith, 0, sizeof(*arith)); arith->code = 0; arith->range0 = 0; arith->range1 = 0xffff; arith->cntr = 0; arith->offset = 0; arith->contexts[0].count[0] = 1; arith->contexts[0].count[1] = 1; arith->contexts[0].next = 0; } static void push_bit (Arith *arith, int value) { arith->output_byte <<= 1; arith->output_byte |= value; arith->output_bits++; if (arith->output_bits == 8) { arith->data[arith->offset] = arith->output_byte; arith->offset++; arith->output_byte = 0; arith->output_bits = 0; } } void arith_dirac_flush (Arith *arith) { int i; /* FIXME being lazy. */ for(i=0;i<16;i++){ push_bit(arith, 0); } arith->offset++; } static void arith_dirac_encode (Arith *arith, int i, int value) { unsigned int range; unsigned int scaler; unsigned int weight; unsigned int probability0; unsigned int range_x_prob; weight = arith->contexts[i].count[0] + arith->contexts[i].count[1]; scaler = division_factor[weight]; probability0 = arith->contexts[i].count[0] * scaler; range = arith->range1 - arith->range0 + 1; range_x_prob = (range * probability0) >> 16; if (value) { arith->range0 = arith->range0 + range_x_prob; } else { arith->range1 = arith->range0 + range_x_prob - 1; } arith->contexts[i].count[value]++; if (arith->contexts[i].count[0] + arith->contexts[i].count[1] > 255) { arith->contexts[i].count[0] >>= 1; arith->contexts[i].count[0]++; arith->contexts[i].count[1] >>= 1; arith->contexts[i].count[1]++; } do { if ((arith->range1 & (1<<15)) == (arith->range0 & (1<<15))) { int value; value = arith->range0 >> 15; push_bit (arith, value); while(arith->cntr) { push_bit (arith, !value); arith->cntr--; } arith->range0 <<= 1; arith->range0 &= 0xffff; arith->range1 <<= 1; arith->range1 &= 0xffff; arith->range1++; } else if ((arith->range0 & (1<<14)) && !(arith->range1 & (1<<14))) { arith->range0 ^= (1<<14); arith->range1 ^= (1<<14); arith->range0 <<= 1; arith->range0 &= 0xffff; arith->range1 <<= 1; arith->range1 &= 0xffff; arith->range1++; arith->cntr++; } else { break; } } while (1); } DEFINE_EFFICIENCY(dirac) DEFINE_SPEED(dirac) DEFINE_ENCODE(dirac) schroedinger-1.0.11/testsuite/coder/arith.h0000644000175000017500000000427611541755167015621 00000000000000 #ifndef _ARITH_H_ #define _ARITH_H_ #include "../common.h" #include typedef struct _Arith Arith; typedef struct _Context Context; struct _Context { int mps; int state; int count[2]; int next; int probability; int n; }; struct _Arith { int code; int range0; int range1; #if 0 int a; int c; int st; int ct; int bp; #endif int cntr; int st; unsigned int output_byte; int output_bits; unsigned char *data; int offset; int carry; Context contexts[10]; }; #define DEFINE_EFFICIENCY(name) \ int efficiency_arith_ ## name (int x, unsigned char *data, int n) \ { \ Arith a; \ int i; \ int value; \ arith_ ## name ## _init (&a); \ a.data = data; \ for(i=0;i #include "arith.h" typedef struct _State State; struct _State { int qe_value; int next_lps; int next_mps; int switch_mps; }; static State states[] = { { 0x5a1d, 1, 1, 1 }, /* 0 */ { 0x2586, 14, 2, 0 }, { 0x1114, 16, 3, 0 }, { 0x080b, 18, 4, 0 }, { 0x03d8, 20, 5, 0 }, { 0x01da, 23, 6, 0 }, /* 5 */ { 0x00e5, 25, 7, 0 }, { 0x006f, 28, 8, 0 }, { 0x0036, 30, 9, 0 }, { 0x001a, 33, 10, 0 }, { 0x000d, 35, 11, 0 }, /* 10 */ { 0x0006, 9, 12, 0 }, { 0x0003, 10, 13, 0 }, { 0x0001, 12, 13, 0 }, { 0x5a7f, 15, 15, 1 }, { 0x3f25, 36, 16, 0 }, /* 15 */ { 0x2cf2, 38, 17, 0 }, { 0x207c, 39, 18, 0 }, { 0x17b9, 40, 18, 0 }, { 0x1182, 42, 20, 0 }, { 0x0cef, 43, 21, 0 }, /* 20 */ { 0x09a1, 45, 22, 0 }, { 0x072f, 46, 23, 0 }, { 0x055c, 48, 24, 0 }, { 0x0406, 49, 25, 0 }, { 0x0303, 51, 26, 0 }, /* 25 */ { 0x0240, 52, 27, 0 }, { 0x01b1, 54, 28, 0 }, { 0x0144, 56, 29, 0 }, { 0x00f5, 57, 30, 0 }, { 0x00b7, 59, 31, 0 }, /* 30 */ { 0x008a, 60, 32, 0 }, { 0x0068, 62, 33, 0 }, { 0x004e, 63, 34, 0 }, { 0x003b, 32, 35, 0 }, { 0x002c, 33, 9, 0 }, /* 35 */ { 0x5ae1, 37, 37, 1 }, { 0x484c, 64, 38, 0 }, { 0x3a0d, 65, 39, 0 }, { 0x2ef1, 67, 40, 0 }, { 0x261f, 68, 41, 0 }, /* 40 */ { 0x1f33, 69, 42, 0 }, { 0x1948, 70, 43, 0 }, { 0x1518, 72, 44, 0 }, { 0x1177, 73, 45, 0 }, { 0x0e74, 74, 46, 0 }, /* 45 */ { 0x0bfb, 75, 47, 0 }, { 0x09f8, 77, 48, 0 }, { 0x0861, 78, 49, 0 }, { 0x0706, 79, 50, 0 }, { 0x05cd, 48, 51, 0 }, /* 50 */ { 0x04de, 50, 52, 0 }, { 0x040f, 50, 53, 0 }, { 0x0363, 51, 54, 0 }, { 0x02d4, 52, 55, 0 }, { 0x025c, 53, 56, 0 }, /* 55 */ { 0x01f8, 54, 57, 0 }, { 0x01a4, 55, 58, 0 }, { 0x0160, 56, 59, 0 }, { 0x0125, 57, 60, 0 }, { 0x00f6, 58, 61, 0 }, /* 60 */ { 0x00cb, 59, 62, 0 }, { 0x00ab, 61, 63, 0 }, { 0x008f, 61, 32, 0 }, { 0x5b12, 65, 65, 1 }, { 0x4d04, 80, 66, 0 }, /* 65 */ { 0x412c, 81, 67, 0 }, { 0x37d8, 82, 68, 0 }, { 0x2fe8, 83, 69, 0 }, { 0x293c, 84, 70, 0 }, { 0x2379, 86, 71, 0 }, /* 70 */ { 0x1edf, 87, 72, 0 }, { 0x1aa9, 87, 73, 0 }, { 0x174e, 72, 74, 0 }, { 0x1424, 72, 75, 0 }, { 0x119c, 74, 76, 0 }, /* 75 */ { 0x0f6b, 74, 77, 0 }, { 0x0d51, 75, 78, 0 }, { 0x0bb6, 77, 79, 0 }, { 0x0a40, 77, 48, 0 }, { 0x5832, 80, 81, 1 }, /* 80 */ { 0x4d1c, 88, 82, 0 }, { 0x438e, 89, 83, 0 }, { 0x3bdd, 90, 84, 0 }, { 0x34ee, 91, 85, 0 }, { 0x2eae, 92, 86, 0 }, /* 85 */ { 0x299a, 93, 87, 0 }, { 0x2516, 86, 71, 0 }, { 0x5570, 88, 89, 1 }, { 0x4ca9, 95, 90, 0 }, { 0x44d9, 96, 91, 0 }, /* 90 */ { 0x3e22, 97, 92, 0 }, { 0x3824, 99, 93, 0 }, { 0x32b4, 99, 94, 0 }, { 0x2e17, 93, 86, 0 }, { 0x56a8, 95, 96, 1 }, /* 95 */ { 0x4f46,101, 97, 0 }, { 0x47e5,102, 98, 0 }, { 0x41cf,103, 99, 0 }, { 0x3c3d,104,100, 0 }, { 0x375e, 99, 93, 0 }, /* 100 */ { 0x5231,105,102, 0 }, { 0x4c0f,106,103, 0 }, { 0x4639,107,104, 0 }, { 0x415e,103, 99, 0 }, { 0x5627,105,106, 1 }, /* 105 */ { 0x50e7,108,107, 0 }, { 0x4b85,109,103, 0 }, { 0x5597,110,109, 0 }, { 0x50ef,111,107, 0 }, { 0x5a10,110,111, 1 }, /* 110 */ { 0x5522,112,109, 0 }, { 0x59eb,112,111, 1 } }; #define a range0 #define c code #define bp offset #define ct cntr static void byte_out (Arith *coder) { int t; t = coder->c >> 19; if (t > 0xff) { coder->data[coder->bp]++; while (coder->st) { coder->bp++; coder->data[coder->bp] = 0; coder->st--; } coder->bp++; coder->data[coder->bp] = t; } else { coder->bp++; coder->data[coder->bp] = t; } } static void renorm_e (Arith *coder) { do { coder->a <<= 1; coder->c <<= 1; coder->ct--; if (coder->ct == 0) { byte_out(coder); coder->ct = 8; } } while (coder->a < 0x8000); } static void code_lps(Arith *coder, int s) { int qe; qe = states[coder->contexts[s].state].qe_value; coder->a -= qe; if (coder->a >= qe) { coder->c += coder->a; coder->a = qe; } if(states[coder->contexts[s].state].switch_mps) { coder->contexts[s].mps ^= 1; } coder->contexts[s].state = states[coder->contexts[s].state].next_lps; renorm_e(coder); } static void code_mps(Arith *coder, int s) { int qe; qe = states[coder->contexts[s].state].qe_value; coder->a -= qe; if (coder->a < 0x8000) { if (coder->a < qe) { coder->c += coder->a; coder->a = qe; } coder->contexts[s].state = states[coder->contexts[s].state].next_mps; renorm_e(coder); } } static void arith_qm_encode (Arith *coder, int s, int value) { if (coder->contexts[s].mps == value) { code_mps(coder,s); } else { code_lps(coder,s); } } void arith_qm_init (Arith *coder) { coder->contexts[0].state = 0; coder->contexts[0].mps = 0; coder->st = 0; coder->a = 0x10000; coder->c = 0; coder->ct = 11; coder->bp = -1; } void arith_qm_flush (Arith *coder) { coder->bp++; } DEFINE_EFFICIENCY(qm) DEFINE_SPEED(qm) schroedinger-1.0.11/testsuite/coder/arith_dirac_stats.c0000644000175000017500000001152010735025462020152 00000000000000 #include "config.h" #include #include #include #include #include "arith.h" static uint16_t division_factor[257] = { 0, 0, 32768, 21845, 16384, 13107, 10923, 9362, 8192, 7282, 6554, 5958, 5461, 5041, 4681, 4369, 4096, 3855, 3641, 3449, 3277, 3121, 2979, 2849, 2731, 2621, 2521, 2427, 2341, 2260, 2185, 2114, 2048, 1986, 1928, 1872, 1820, 1771, 1725, 1680, 1638, 1598, 1560, 1524, 1489, 1456, 1425, 1394, 1365, 1337, 1311, 1285, 1260, 1237, 1214, 1192, 1170, 1150, 1130, 1111, 1092, 1074, 1057, 1040, 1024, 1008, 993, 978, 964, 950, 936, 923, 910, 898, 886, 874, 862, 851, 840, 830, 819, 809, 799, 790, 780, 771, 762, 753, 745, 736, 728, 720, 712, 705, 697, 690, 683, 676, 669, 662, 655, 649, 643, 636, 630, 624, 618, 612, 607, 601, 596, 590, 585, 580, 575, 570, 565, 560, 555, 551, 546, 542, 537, 533, 529, 524, 520, 516, 512, 508, 504, 500, 496, 493, 489, 485, 482, 478, 475, 471, 468, 465, 462, 458, 455, 452, 449, 446, 443, 440, 437, 434, 431, 428, 426, 423, 420, 417, 415, 412, 410, 407, 405, 402, 400, 397, 395, 392, 390, 388, 386, 383, 381, 379, 377, 374, 372, 370, 368, 366, 364, 362, 360, 358, 356, 354, 352, 350, 349, 347, 345, 343, 341, 340, 338, 336, 334, 333, 331, 329, 328, 326, 324, 323, 321, 320, 318, 317, 315, 314, 312, 311, 309, 308, 306, 305, 303, 302, 301, 299, 298, 297, 295, 294, 293, 291, 290, 289, 287, 286, 285, 284, 282, 281, 280, 279, 278, 277, 275, 274, 273, 272, 271, 270, 269, 267, 266, 265, 264, 263, 262, 261, 260, 259, 258, 257, 256 }; void arith_dirac_stats_init (Arith *arith) { memset (arith, 0, sizeof(*arith)); arith->code = 0; arith->range0 = 0; arith->range1 = 0xffff; arith->cntr = 0; arith->offset = 0; arith->contexts[0].count[0] = 1; arith->contexts[0].count[1] = 1; arith->contexts[0].next = 0; arith->contexts[0].probability = 0x8000; arith->contexts[0].n = 0; } static void push_bit (Arith *arith, int value) { arith->output_byte <<= 1; arith->output_byte |= value; arith->output_bits++; if (arith->output_bits == 8) { arith->data[arith->offset] = arith->output_byte; arith->offset++; arith->output_byte = 0; arith->output_bits = 0; } } void arith_dirac_stats_flush (Arith *arith) { int i; /* FIXME being lazy. */ for(i=0;i<16;i++){ push_bit(arith, 0); } arith->offset++; } static void arith_dirac_stats_encode (Arith *arith, int i, int value) { unsigned int range; //unsigned int scaler; //unsigned int weight; unsigned int probability0; unsigned int range_x_prob; //weight = arith->contexts[i].count[0] + arith->contexts[i].count[1]; //scaler = division_factor[weight]; probability0 = arith->contexts[i].probability; range = arith->range1 - arith->range0 + 1; range_x_prob = (range * probability0) >> 16; if (value) { arith->range0 = arith->range0 + range_x_prob; } else { arith->range1 = arith->range0 + range_x_prob - 1; } arith->contexts[i].count[value]++; arith->contexts[i].n++; if (arith->contexts[i].n == 16) { unsigned int scaler; unsigned int weight; arith->contexts[i].n = 0; if (arith->contexts[i].count[0] + arith->contexts[i].count[1] > 255) { arith->contexts[i].count[0] >>= 1; arith->contexts[i].count[0]++; arith->contexts[i].count[1] >>= 1; arith->contexts[i].count[1]++; } weight = arith->contexts[i].count[0] + arith->contexts[i].count[1]; scaler = division_factor[weight]; arith->contexts[i].probability = arith->contexts[i].count[0] * scaler; } do { if ((arith->range1 & (1<<15)) == (arith->range0 & (1<<15))) { int value; value = arith->range0 >> 15; push_bit (arith, value); while(arith->cntr) { push_bit (arith, !value); arith->cntr--; } arith->range0 <<= 1; arith->range0 &= 0xffff; arith->range1 <<= 1; arith->range1 &= 0xffff; arith->range1++; } else if ((arith->range0 & (1<<14)) && !(arith->range1 & (1<<14))) { arith->range0 ^= (1<<14); arith->range1 ^= (1<<14); arith->range0 <<= 1; arith->range0 &= 0xffff; arith->range1 <<= 1; arith->range1 &= 0xffff; arith->range1++; arith->cntr++; } else { break; } } while (1); } DEFINE_EFFICIENCY(dirac_stats) DEFINE_SPEED(dirac_stats) schroedinger-1.0.11/testsuite/coder/speed.c0000644000175000017500000000201311541755167015570 00000000000000 #include "config.h" #include #include #include #include #include "arith.h" #define N 1000 double speed_arith_dirac (int x, unsigned char *data, int n); double speed_arith_qm (int x, unsigned char *data, int n); double speed_arith_dirac_byte (int x, unsigned char *data, int n); double speed_arith_dirac_stats (int x, unsigned char *data, int n); double speed_arith_dirac_both (int x, unsigned char *data, int n); double speed_arith_exp (int x, unsigned char *data, int n); unsigned char data[N]; int main (int argc, char *argv[]) { int x; double a, b, c, d, e, f; schro_init(); for(x = 0; x <= 256; x += 1) { a = speed_arith_dirac (x, data, N); b = speed_arith_qm (x, data, N); c = speed_arith_dirac_byte (x, data, N); d = speed_arith_dirac_stats (x, data, N); e = speed_arith_dirac_both (x, data, N); f = speed_arith_exp (x, data, N); printf("%g %g %g %g %g %g %g\n", x/256.0, a, b, c, d, e, f); } return 0; } schroedinger-1.0.11/testsuite/coder/coding_efficiency.c0000644000175000017500000000254311541755167020127 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include "arith.h" #define N 100000 int efficiency_arith_dirac (int x, unsigned char *data, int n); int efficiency_arith_exp (int x, unsigned char *data, int n); int efficiency_arith_dirac_byte (int x, unsigned char *data, int n); int efficiency_arith_dirac_stats (int x, unsigned char *data, int n); int efficiency_arith_dirac_both (int x, unsigned char *data, int n); int efficiency_arith_qm (int x, unsigned char *data, int n); double efficiency_entropy (double x) { if (x == 0 || x == 1) return 0; return (x*log(x) + (1-x)*log(1-x))/log(0.5); } unsigned char data[N]; int main (int argc, char *argv[]) { int x; double a, b, c, d, e, f; double y; schro_init(); for(x = 0; x <= 256; x += 1) { y = efficiency_entropy (x/256.0); a = efficiency_arith_dirac (x, data, N) / (double)N / y; b = efficiency_arith_qm (x, data, N) / (double)N / y; c = efficiency_arith_dirac_byte (x, data, N) / (double)N / y; d = efficiency_arith_dirac_stats (x, data, N) / (double)N / y; e = efficiency_arith_dirac_both (x, data, N) / (double)N / y; f = efficiency_arith_exp (x, data, N) / (double)N / y; printf("%g %g %g %g %g %g %g\n", x/256.0, a, b, c, d, e, f); } return 0; } schroedinger-1.0.11/testsuite/coder/speed2.c0000644000175000017500000000351411541755167015661 00000000000000 #include "config.h" #include #include #include #include #include "arith.h" #define N 1000 double speed_arith_dirac (int x, unsigned char *data, int n); double speed_arith_qm (int x, unsigned char *data, int n); double speed_arith_dirac_byte (int x, unsigned char *data, int n); double speed_arith_dirac_stats (int x, unsigned char *data, int n); double speed_arith_dirac_both (int x, unsigned char *data, int n); double speed_arith_exp (int x, unsigned char *data, int n); unsigned char data[N]; int main (int argc, char *argv[]) { int x; schro_init(); printf("Number of cycles for 5%% 0's, 95%% 1's:\n"); x = 256*0.05; printf(" Dirac (original) %g\n", speed_arith_dirac (x, data, N)); printf(" Dirac (bytewise shift) %g\n", speed_arith_dirac_byte (x, data, N)); printf(" Dirac (periodic stats update) %g\n", speed_arith_dirac_stats (x, data, N)); printf(" Dirac (both) %g\n", speed_arith_dirac_both (x, data, N)); printf(" Dirac (experimental) %g\n", speed_arith_exp (x, data, N)); printf(" QM coder %g\n", speed_arith_qm (x, data, N)); printf("Number of cycles for 40%% 0's, 60%% 1's:\n"); x = 256*0.40; printf(" Dirac (original) %g\n", speed_arith_dirac (x, data, N)); printf(" Dirac (bytewise shift) %g\n", speed_arith_dirac_byte (x, data, N)); printf(" Dirac (periodic stats update) %g\n", speed_arith_dirac_stats (x, data, N)); printf(" Dirac (both) %g\n", speed_arith_dirac_both (x, data, N)); printf(" Dirac (experimental) %g\n", speed_arith_exp (x, data, N)); printf(" QM coder %g\n", speed_arith_qm (x, data, N)); return 0; } schroedinger-1.0.11/testsuite/coder/decode.c0000644000175000017500000000305011702131172015674 00000000000000 #include "config.h" #include #include #include #include #include "arith.h" #include "../common.h" #define N 10000 int encode_arith_dirac (unsigned char *out_data, unsigned char *in_data, int n); int encode_arith_dirac_byte (unsigned char *out_data, unsigned char *in_data, int n); int encode_arith_dirac_both (unsigned char *out_data, unsigned char *in_data, int n); int encode_arith_exp (unsigned char *out_data, unsigned char *in_data, int n); void decode_arith_dirac_byte (unsigned char *out_data, unsigned char *in_data, int n); void decode_arith_dirac_both (unsigned char *out_data, unsigned char *in_data, int n); void decode_arith_exp (unsigned char *out_data, unsigned char *in_data, int n); unsigned char out_data[N]; unsigned char in_data[N]; unsigned char c_data[N]; static void dumpbits (unsigned char *bits, int n) { int i; for(i=0;i #include #include #include #include "arith.h" void arith_bit_init (Arith *arith) { memset (arith, 0, sizeof(*arith)); arith->code = 0; arith->range0 = 0; arith->range1 = 0xffff; arith->cntr = 0; arith->offset = 0; arith->contexts[0].count[0] = 1; arith->contexts[0].count[1] = 1; arith->contexts[0].next = 0; } void arith_bit_flush (Arith *arith) { } static void push_bit (Arith *arith, int value) { arith->output_byte <<= 1; arith->output_byte |= value; arith->output_bits++; if (arith->output_bits == 8) { arith->data[arith->offset] = arith->output_byte; arith->offset++; arith->output_byte = 0; arith->output_bits = 0; } } static void arith_bit_encode (Arith *arith, int i, int value) { push_bit(arith, value); } DEFINE_EFFICIENCY(bit) DEFINE_SPEED(bit) schroedinger-1.0.11/testsuite/coder/arith_dirac_both.c0000644000175000017500000001520510735025462017754 00000000000000 #include "config.h" #include #include #include #include #include "arith.h" static uint16_t division_factor[257] = { 0, 0, 32768, 21845, 16384, 13107, 10923, 9362, 8192, 7282, 6554, 5958, 5461, 5041, 4681, 4369, 4096, 3855, 3641, 3449, 3277, 3121, 2979, 2849, 2731, 2621, 2521, 2427, 2341, 2260, 2185, 2114, 2048, 1986, 1928, 1872, 1820, 1771, 1725, 1680, 1638, 1598, 1560, 1524, 1489, 1456, 1425, 1394, 1365, 1337, 1311, 1285, 1260, 1237, 1214, 1192, 1170, 1150, 1130, 1111, 1092, 1074, 1057, 1040, 1024, 1008, 993, 978, 964, 950, 936, 923, 910, 898, 886, 874, 862, 851, 840, 830, 819, 809, 799, 790, 780, 771, 762, 753, 745, 736, 728, 720, 712, 705, 697, 690, 683, 676, 669, 662, 655, 649, 643, 636, 630, 624, 618, 612, 607, 601, 596, 590, 585, 580, 575, 570, 565, 560, 555, 551, 546, 542, 537, 533, 529, 524, 520, 516, 512, 508, 504, 500, 496, 493, 489, 485, 482, 478, 475, 471, 468, 465, 462, 458, 455, 452, 449, 446, 443, 440, 437, 434, 431, 428, 426, 423, 420, 417, 415, 412, 410, 407, 405, 402, 400, 397, 395, 392, 390, 388, 386, 383, 381, 379, 377, 374, 372, 370, 368, 366, 364, 362, 360, 358, 356, 354, 352, 350, 349, 347, 345, 343, 341, 340, 338, 336, 334, 333, 331, 329, 328, 326, 324, 323, 321, 320, 318, 317, 315, 314, 312, 311, 309, 308, 306, 305, 303, 302, 301, 299, 298, 297, 295, 294, 293, 291, 290, 289, 287, 286, 285, 284, 282, 281, 280, 279, 278, 277, 275, 274, 273, 272, 271, 270, 269, 267, 266, 265, 264, 263, 262, 261, 260, 259, 258, 257, 256 }; void arith_dirac_both_init (Arith *arith) { memset (arith, 0, sizeof(*arith)); arith->code = 0; arith->range0 = 0; arith->range1 = 0x10000; arith->cntr = 0; arith->offset = 0; arith->contexts[0].count[0] = 1; arith->contexts[0].count[1] = 1; arith->contexts[0].next = 0; arith->contexts[0].probability = 0x8000; arith->contexts[0].n = 0; } void arith_dirac_both_flush (Arith *arith) { while (arith->cntr < 8) { arith->range0 <<= 1; arith->cntr++; } if (arith->range0 >= (1<<24)) { arith->data[arith->offset-1]++; while (arith->carry) { arith->data[arith->offset] = 0x00; arith->carry--; arith->offset++; } } else { while (arith->carry) { arith->data[arith->offset] = 0xff; arith->carry--; arith->offset++; } } arith->data[arith->offset] = arith->range0 >> 16; arith->offset++; arith->data[arith->offset] = arith->range0 >> 8; arith->offset++; arith->data[arith->offset] = arith->range0 >> 0; arith->offset++; } static void arith_dirac_both_encode (Arith *arith, int i, int value) { unsigned int range; unsigned int probability0; unsigned int range_x_prob; probability0 = arith->contexts[i].probability; range = arith->range1; range_x_prob = (range * probability0) >> 16; if (value) { arith->range0 = arith->range0 + range_x_prob; arith->range1 -= range_x_prob; } else { arith->range1 = range_x_prob; } arith->contexts[i].count[value]++; arith->contexts[i].n++; if (arith->contexts[i].n == 16) { unsigned int scaler; unsigned int weight; arith->contexts[i].n = 0; if (arith->contexts[i].count[0] + arith->contexts[i].count[1] > 255) { arith->contexts[i].count[0] >>= 1; arith->contexts[i].count[0]++; arith->contexts[i].count[1] >>= 1; arith->contexts[i].count[1]++; } weight = arith->contexts[i].count[0] + arith->contexts[i].count[1]; scaler = division_factor[weight]; arith->contexts[i].probability = arith->contexts[i].count[0] * scaler; } while (arith->range1 < 0x8000) { arith->range0 <<= 1; arith->range1 <<= 1; arith->cntr++; if (arith->cntr == 8) { if (arith->range0 < (1<<24) && (arith->range0 + arith->range1) >= (1<<24)) { arith->carry++; } else { if (arith->range0 >= (1<<24)) { arith->data[arith->offset-1]++; while (arith->carry) { arith->data[arith->offset] = 0x00; arith->carry--; arith->offset++; } } else { while (arith->carry) { arith->data[arith->offset] = 0xff; arith->carry--; arith->offset++; } } arith->data[arith->offset] = arith->range0 >> 16; arith->offset++; } arith->range0 &= 0xffff; arith->cntr = 0; } } } static int arith_dirac_both_decode (Arith *arith, int i) { unsigned int count; unsigned int range; unsigned int probability0; unsigned int range_x_prob; int value; //printf("[%04x %04x] %04x\n", arith->range0, arith->range1, arith->code); probability0 = arith->contexts[i].probability; count = arith->code - arith->range0 + 1; range = arith->range1; range_x_prob = (range * probability0) >> 16; value = count > range_x_prob; if (value) { arith->range0 = arith->range0 + range_x_prob; arith->range1 -= range_x_prob; } else { arith->range1 = range_x_prob; } arith->contexts[i].count[value]++; arith->contexts[i].n++; if (arith->contexts[i].n == 16) { unsigned int scaler; unsigned int weight; arith->contexts[i].n = 0; if (arith->contexts[i].count[0] + arith->contexts[i].count[1] > 255) { arith->contexts[i].count[0] >>= 1; arith->contexts[i].count[0]++; arith->contexts[i].count[1] >>= 1; arith->contexts[i].count[1]++; } weight = arith->contexts[i].count[0] + arith->contexts[i].count[1]; scaler = division_factor[weight]; arith->contexts[i].probability = arith->contexts[i].count[0] * scaler; } while (arith->range1 < 0x8000) { arith->range0 <<= 1; arith->range1 <<= 1; arith->code <<= 1; arith->code |= (arith->data[arith->offset] >> (7-arith->cntr))&1; arith->cntr++; if (arith->cntr == 8) { arith->offset++; arith->range0 &= 0xffff; arith->code &= 0xffff; if (arith->code < arith->range0) { arith->code |= (1<<16); } arith->cntr = 0; } } return value; } DEFINE_EFFICIENCY(dirac_both) DEFINE_SPEED(dirac_both) DEFINE_ENCODE(dirac_both) DEFINE_DECODE(dirac_both) schroedinger-1.0.11/testsuite/coder/Makefile.am0000644000175000017500000000110111541755167016355 00000000000000 noinst_PROGRAMS = coding_efficiency speed speed2 decode AM_CFLAGS = $(SCHRO_CFLAGS) $(ERROR_CFLAGS) $(ORC_CFLAGS) LDADD = ../libschrotest.la $(SCHRO_LIBS) -lorc-test-0.4 $(ORC_LIBS) $(LIBM) CODERS = arith_qm.c arith_exp.c arith_dirac.c arith_bit.c arith_dirac_byte.c arith_dirac_stats.c arith_dirac_both.c EXTRA_DIST = arith.h coding_efficiency_SOURCES = coding_efficiency.c $(CODERS) speed_SOURCES = speed.c $(CODERS) speed2_SOURCES = speed2.c $(CODERS) decode_SOURCES = decode.c $(CODERS) plots: ./speed >s ./plot_speed ./coding_efficiency >e ./plot_efficiency schroedinger-1.0.11/testsuite/coder/Makefile.in0000664000175000017500000004400011707140262016361 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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@ noinst_PROGRAMS = coding_efficiency$(EXEEXT) speed$(EXEEXT) \ speed2$(EXEEXT) decode$(EXEEXT) subdir = testsuite/coder DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-auto-alt.m4 \ $(top_srcdir)/m4/as-compiler-flag.m4 \ $(top_srcdir)/m4/as-host-defines.m4 \ $(top_srcdir)/m4/as-version.m4 $(top_srcdir)/m4/gst-args.m4 \ $(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)/m4/pkg.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) am__objects_1 = arith_qm.$(OBJEXT) arith_exp.$(OBJEXT) \ arith_dirac.$(OBJEXT) arith_bit.$(OBJEXT) \ arith_dirac_byte.$(OBJEXT) arith_dirac_stats.$(OBJEXT) \ arith_dirac_both.$(OBJEXT) am_coding_efficiency_OBJECTS = coding_efficiency.$(OBJEXT) \ $(am__objects_1) coding_efficiency_OBJECTS = $(am_coding_efficiency_OBJECTS) coding_efficiency_LDADD = $(LDADD) am__DEPENDENCIES_1 = coding_efficiency_DEPENDENCIES = ../libschrotest.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) am_decode_OBJECTS = decode.$(OBJEXT) $(am__objects_1) decode_OBJECTS = $(am_decode_OBJECTS) decode_LDADD = $(LDADD) decode_DEPENDENCIES = ../libschrotest.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_speed_OBJECTS = speed.$(OBJEXT) $(am__objects_1) speed_OBJECTS = $(am_speed_OBJECTS) speed_LDADD = $(LDADD) speed_DEPENDENCIES = ../libschrotest.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_speed2_OBJECTS = speed2.$(OBJEXT) $(am__objects_1) speed2_OBJECTS = $(am_speed2_OBJECTS) speed2_LDADD = $(LDADD) speed2_DEPENDENCIES = ../libschrotest.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(coding_efficiency_SOURCES) $(decode_SOURCES) \ $(speed_SOURCES) $(speed2_SOURCES) DIST_SOURCES = $(coding_efficiency_SOURCES) $(decode_SOURCES) \ $(speed_SOURCES) $(speed2_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUDA_CFLAGS = @CUDA_CFLAGS@ CUDA_LIBS = @CUDA_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ GCOV = @GCOV@ GCOV_CFLAGS = @GCOV_CFLAGS@ GCOV_LIBS = @GCOV_LIBS@ GREP = @GREP@ GTHREAD_CFLAGS = @GTHREAD_CFLAGS@ GTHREAD_LIBS = @GTHREAD_LIBS@ GTKDOC_CHECK = @GTKDOC_CHECK@ 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@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ NVCC = @NVCC@ NVCCFLAGS = @NVCCFLAGS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENGL_CFLAGS = @OPENGL_CFLAGS@ OPENGL_LIBS = @OPENGL_LIBS@ ORCC = @ORCC@ ORC_CFLAGS = @ORC_CFLAGS@ ORC_LIBS = @ORC_LIBS@ 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@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SCHRO_CFLAGS = @SCHRO_CFLAGS@ SCHRO_LIBS = @SCHRO_LIBS@ SCHRO_LIBVERSION = @SCHRO_LIBVERSION@ SCHRO_MAJORMINOR = @SCHRO_MAJORMINOR@ SCHRO_PKG_DEPS = @SCHRO_PKG_DEPS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ THREAD_IMPL = @THREAD_IMPL@ VERSION = @VERSION@ 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_CXX = @ac_ct_CXX@ 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@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CFLAGS = $(SCHRO_CFLAGS) $(ERROR_CFLAGS) $(ORC_CFLAGS) LDADD = ../libschrotest.la $(SCHRO_LIBS) -lorc-test-0.4 $(ORC_LIBS) $(LIBM) CODERS = arith_qm.c arith_exp.c arith_dirac.c arith_bit.c arith_dirac_byte.c arith_dirac_stats.c arith_dirac_both.c EXTRA_DIST = arith.h coding_efficiency_SOURCES = coding_efficiency.c $(CODERS) speed_SOURCES = speed.c $(CODERS) speed2_SOURCES = speed2.c $(CODERS) decode_SOURCES = decode.c $(CODERS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(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) --foreign testsuite/coder/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign testsuite/coder/Makefile .PRECIOUS: 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-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list coding_efficiency$(EXEEXT): $(coding_efficiency_OBJECTS) $(coding_efficiency_DEPENDENCIES) @rm -f coding_efficiency$(EXEEXT) $(LINK) $(coding_efficiency_OBJECTS) $(coding_efficiency_LDADD) $(LIBS) decode$(EXEEXT): $(decode_OBJECTS) $(decode_DEPENDENCIES) @rm -f decode$(EXEEXT) $(LINK) $(decode_OBJECTS) $(decode_LDADD) $(LIBS) speed$(EXEEXT): $(speed_OBJECTS) $(speed_DEPENDENCIES) @rm -f speed$(EXEEXT) $(LINK) $(speed_OBJECTS) $(speed_LDADD) $(LIBS) speed2$(EXEEXT): $(speed2_OBJECTS) $(speed2_DEPENDENCIES) @rm -f speed2$(EXEEXT) $(LINK) $(speed2_OBJECTS) $(speed2_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arith_bit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arith_dirac.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arith_dirac_both.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arith_dirac_byte.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arith_dirac_stats.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arith_exp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arith_qm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coding_efficiency.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/decode.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/speed.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/speed2.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 $(PROGRAMS) 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-noinstPROGRAMS \ 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 all all-am check check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS ctags 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 uninstall uninstall-am plots: ./speed >s ./plot_speed ./coding_efficiency >e ./plot_efficiency # 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: schroedinger-1.0.11/testsuite/quant.c0000644000175000017500000000724211702130257014517 00000000000000 #include "config.h" #include #include #include #include #include "schroedinger/schrotables.c" #if 0 static int dequantise (int q, int quant_factor, int quant_offset) { if (q == 0) return 0; if (q < 0) { return ((q * quant_factor - quant_offset + 2)>>2); } else { return (q * quant_factor + quant_offset + 2)>>2; } } static int quantise (int value, int quant_factor, int quant_offset) { unsigned int x; if (value == 0) return 0; if (value < 0) { x = ((-value)<<2) - quant_offset + (quant_factor>>1); //x = (x*(uint64_t)inv_quant_factor)>>32; x /= quant_factor; value = -x; } else { x = (value<<2) - quant_offset + (quant_factor>>1); //x = (x*(uint64_t)inv_quant_factor)>>32; x /= quant_factor; value = x; } return value; } #endif void test_quant (int quant_index, int ack); void test_dequant (int quant_index); #define N 2000 int16_t a[N]; int16_t b[N]; int16_t c[N]; int16_t d[N]; int main (int argc, char *argv[]) { int i; schro_init(); schro_tables_init(); #if 0 for(i=0;i<65536;i+=256) { printf("%d\n", i); test_quant (3, i); } #endif for(i=0;i<61;i++) { test_quant (i, 0); } for(i=0;i<61;i++) { test_dequant (i); } return 0; } void test_quant (int quant_index, int ack) { int quant_factor = schro_table_quant[quant_index]; int quant_offset = schro_table_offset_1_2[quant_index]; int quant_shift = quant_index/4 + 2; int error = FALSE; int i; int bad_count; //printf("index %d:\n", quant_index); for(i=0;i<2000;i++){ a[i] = i - 1000; b[i] = i - 1000; c[i] = i - 1000; d[i] = i - 1000; } for(i=0;i 8), quant_shift, quant_factor, quant_offset + 2, N); } else { int inv_quant; inv_quant = schro_table_inverse_quant[quant_index]; orc_quantdequant3_s16 (b, d, inv_quant, quant_offset - quant_factor/2, quant_shift + 16, quant_factor, quant_offset + 2, 32768, N); } bad_count=0; for(i=0;i b[i] + 1) error = TRUE; //if (a[i] != b[i]) error = TRUE; if (a[i] != b[i]) bad_count++; } printf("index %d: %d\n", quant_index, bad_count); if (error) { for(i=0;i c[i] + 1) error = TRUE; } if (error) { for(i=0;i #include #include #include #include #include #include #include "common.h" int16_t tmp[2000]; int16_t tmp2[2000]; int filtershift[] = { 1, 1, 1, 0, 1, 0, 1 }; void dump (int16_t *a, int n); void dump_cmp (int16_t *a, int16_t *b, int n); #define SHIFT 8 #define N (1<>n_levels;i++){ a[i]=floor(0.5 + 100 * random_std()); } } else { for(i=N>>(n_levels-level+1);i>(n_levels-level);i++){ a[i]=floor(0.5 + 100 * random_std()); } } for(i=0;i>(n_levels-1-i),filter); } for(i=0;i<256;i++){ p2 += a[i]*a[i]; } gain += p2/p1; } //printf("%d %g %g\n", level, gain/10000, sqrt(gain/10000)); return sqrt(gain/10000); } int main (int argc, char *argv[]) { int filter; int n_levels; schro_init(); filter = 0; if (argc > 1) { filter = strtol(argv[1], NULL, 0); } { double a[5]; double b[9]; int i; double min; for(n_levels=1;n_levels<=4;n_levels++){ printf("n_levels=%d:\n", n_levels); for(i=0;i<=n_levels;i++){ a[i] = gain_test (filter, i, n_levels); } for(i=0;i<=n_levels;i++){ printf("%d %5.3f\n", i, a[i]); } b[0] = a[0] * a[0] / (1<<(n_levels*filtershift[filter])); for(i=0;i #include #include #include #include #include #include "common.h" int filtershift[] = { 1, 1, 1, 0, 1, 0, 1 }; int fail = 0; int verbose = 1; void iwt_ref(SchroFrameData *p, int filter); void iiwt_ref(SchroFrameData *p, int filter); void iwt_test(SchroFrameData *p, int filter); void iiwt_test(SchroFrameData *p, int filter); void fwd_test (int filter, int width, int height) { int i; SchroFrame *test; SchroFrame *ref; SchroFrame *orig; SchroFrameData *fd_test; SchroFrameData *fd_ref; SchroFrameData *fd_orig; char name[TEST_PATTERN_NAME_SIZE] = { 0 }; test = schro_frame_new_and_alloc (NULL, SCHRO_FRAME_FORMAT_S16_444, width, height); fd_test = test->components + 0; orig = schro_frame_new_and_alloc (NULL, SCHRO_FRAME_FORMAT_S16_444, width, height); fd_orig = orig->components + 0; ref = schro_frame_new_and_alloc (NULL, SCHRO_FRAME_FORMAT_S16_444, width, height); fd_ref = ref->components + 0; for(i=0;icomponents + 0; test = schro_frame_new_and_alloc (NULL, SCHRO_FRAME_FORMAT_S16_444, width, height); fd_test = test->components + 0; ref = schro_frame_new_and_alloc (NULL, SCHRO_FRAME_FORMAT_S16_444, width, height); fd_ref = ref->components + 0; for(i=0;icomponents + 0; test = schro_frame_new_and_alloc (NULL, SCHRO_FRAME_FORMAT_S16_444, width, height); fd_test = test->components + 0; ref = schro_frame_new_and_alloc (NULL, SCHRO_FRAME_FORMAT_S16_444, width, height); fd_ref = ref->components + 0; test_pattern_generate (fd_orig, name, 0); printf(" forward test \"%s\":\n", name); fflush(stdout); schro_frame_convert (ref, orig); schro_frame_convert (test, orig); iwt_ref(fd_ref,filter); iwt_test(fd_test,filter); if (!frame_data_compare(fd_test, fd_ref)) { printf(" failed\n"); if (verbose) frame_data_dump_full (fd_test, fd_ref, fd_orig); fail = TRUE; } schro_frame_unref (orig); schro_frame_unref (test); schro_frame_unref (ref); } void inv_random_test (int filter, int width, int height) { SchroFrame *test; SchroFrame *orig; SchroFrame *ref; SchroFrameData *fd_test; SchroFrameData *fd_orig; SchroFrameData *fd_ref; char name[TEST_PATTERN_NAME_SIZE] = { 0 }; orig = schro_frame_new_and_alloc (NULL, SCHRO_FRAME_FORMAT_S16_444, width, height); fd_orig = orig->components + 0; test = schro_frame_new_and_alloc (NULL, SCHRO_FRAME_FORMAT_S16_444, width, height); fd_test = test->components + 0; ref = schro_frame_new_and_alloc (NULL, SCHRO_FRAME_FORMAT_S16_444, width, height); fd_ref = ref->components + 0; test_pattern_generate (fd_orig, name, 0); printf(" reverse test \"%s\":\n", name); fflush(stdout); iwt_ref(fd_orig,filter); schro_frame_convert (test, orig); schro_frame_convert (ref, orig); iiwt_ref(fd_ref,filter); iiwt_test(fd_test,filter); if (!frame_data_compare(fd_test, fd_ref)) { printf(" failed\n"); if (verbose) frame_data_dump_full (fd_test, fd_ref, fd_orig); fail = TRUE; } schro_frame_unref (orig); schro_frame_unref (test); schro_frame_unref (ref); } void fwd_random_test_s32 (int filter, int width, int height) { SchroFrame *test; SchroFrame *orig; SchroFrame *ref; SchroFrameData *fd_orig; SchroFrameData *fd_test; SchroFrameData *fd_ref; char name[TEST_PATTERN_NAME_SIZE] = { 0 }; orig = schro_frame_new_and_alloc (NULL, SCHRO_FRAME_FORMAT_S16_444, width, height); fd_orig = orig->components + 0; test = schro_frame_new_and_alloc (NULL, SCHRO_FRAME_FORMAT_S32_444, width, height); fd_test = test->components + 0; ref = schro_frame_new_and_alloc (NULL, SCHRO_FRAME_FORMAT_S16_444, width, height); fd_ref = ref->components + 0; test_pattern_generate (fd_orig, name, 0); printf(" forward test 32-bit \"%s\":\n", name); fflush(stdout); schro_frame_convert (ref, orig); schro_frame_convert (test, orig); iwt_ref(fd_ref,filter); iwt_test(fd_test,filter); if (!frame_data_compare(fd_test, fd_ref)) { printf(" failed\n"); if (verbose) frame_data_dump_full (fd_test, fd_ref, fd_orig); fail = TRUE; } schro_frame_unref (orig); schro_frame_unref (test); schro_frame_unref (ref); } void inv_random_test_s32 (int filter, int width, int height) { SchroFrame *test; SchroFrame *orig; SchroFrame *ref; SchroFrameData *fd_test; SchroFrameData *fd_orig; SchroFrameData *fd_ref; char name[TEST_PATTERN_NAME_SIZE] = { 0 }; orig = schro_frame_new_and_alloc (NULL, SCHRO_FRAME_FORMAT_S16_444, width, height); fd_orig = orig->components + 0; test = schro_frame_new_and_alloc (NULL, SCHRO_FRAME_FORMAT_S32_444, width, height); fd_test = test->components + 0; ref = schro_frame_new_and_alloc (NULL, SCHRO_FRAME_FORMAT_S16_444, width, height); fd_ref = ref->components + 0; test_pattern_generate (fd_orig, name, 0); printf(" reverse test 32-bit \"%s\":\n", name); fflush(stdout); iwt_ref(fd_orig,filter); schro_frame_convert (test, orig); schro_frame_convert (ref, orig); iiwt_ref(fd_ref,filter); iiwt_test(fd_test,filter); if (!frame_data_compare(fd_test, fd_ref)) { printf(" failed\n"); if (verbose) frame_data_dump_full (fd_test, fd_ref, fd_orig); fail = TRUE; } schro_frame_unref (orig); schro_frame_unref (test); schro_frame_unref (ref); } int main (int argc, char *argv[]) { int filter; int width; int height; schro_init(); for(filter=0;filter<=SCHRO_WAVELET_DAUBECHIES_9_7;filter++){ printf("Filter %d:\n", filter); fwd_test(filter, 20, 20); inv_test(filter, 20, 20); } for(width = 2; width <= 40; width+=2) { for(height = 2; height <= 40; height+=2) { printf("Size %dx%d:\n", width, height); for(filter=0;filter<=SCHRO_WAVELET_DAUBECHIES_9_7;filter++){ printf(" filter %d:\n", filter); fwd_random_test(filter, width, height); inv_random_test(filter, width, height); fwd_random_test_s32(filter, width, height); inv_random_test_s32(filter, width, height); } } } return fail; } void rshift (SchroFrameData *p, int n) { int i; int j; int16_t *data; if (n==0) return; for(j=0;jheight;j++){ data = OFFSET(p->data,j*p->stride); for(i=0;iwidth;i++){ data[i] >>= n; } } } void lshift (SchroFrameData *p, int n) { int i; int j; int16_t *data; if (n==0) return; for(j=0;jheight;j++){ data = OFFSET(p->data,j*p->stride); for(i=0;iwidth;i++){ data[i] <<= n; } } } void copy (int16_t *d, int ds, int16_t *s, int ss, int n) { int i; int16_t *xd, *xs; for(i=0;iheight;i++){ data = OFFSET(p->data,i*p->stride); copy(tmpbuf, sizeof(int16_t), data, sizeof(int16_t), p->width); split (tmpbuf, p->width, filter); orc_deinterleave2_s16 (lo, hi, tmpbuf, p->width/2); copy(data, sizeof(int16_t), lo, sizeof(int16_t), p->width/2); copy(data + p->width/2, sizeof(int16_t), hi, sizeof(int16_t), p->width/2); } for(i=0;iwidth;i++){ data = OFFSET(p->data,i*sizeof(int16_t)); copy(tmpbuf, sizeof(int16_t), data, p->stride, p->height); split (tmpbuf, p->height, filter); copy(data, p->stride, tmpbuf, sizeof(int16_t), p->height); } } void iiwt_ref(SchroFrameData *p, int filter) { int16_t tmp1[100], *hi; int16_t tmp2[100], *lo; int16_t tmp3[100], *tmpbuf; int16_t *data; int i; hi = tmp1 + 4; lo = tmp2 + 4; tmpbuf = tmp3 + 8; for(i=0;iwidth;i++){ data = OFFSET(p->data,i*sizeof(int16_t)); copy(tmpbuf, sizeof(int16_t), data, p->stride, p->height); synth (tmpbuf, p->height, filter); copy(data, p->stride, tmpbuf, sizeof(int16_t), p->height); } for(i=0;iheight;i++){ data = OFFSET(p->data,i*p->stride); copy(hi, sizeof(int16_t), data, sizeof(int16_t), p->width/2); copy(lo, sizeof(int16_t), data + p->width/2, sizeof(int16_t), p->width/2); orc_interleave2_s16 (tmpbuf, hi, lo, p->width/2); synth (tmpbuf, p->width, filter); copy(data, sizeof(int16_t), tmpbuf, sizeof(int16_t), p->width); } rshift(p, filtershift[filter]); } void iwt_test(SchroFrameData *p, int filter) { int16_t *tmp; tmp = malloc(((p->width+8)*2)*sizeof(int32_t)); schro_wavelet_transform_2d (p, filter, tmp); free(tmp); } void iiwt_test(SchroFrameData *p, int filter) { int16_t *tmp; tmp = malloc(((p->width+8)*2)*sizeof(int32_t)); schro_wavelet_inverse_transform_2d (p, p, filter, tmp); free(tmp); } schroedinger-1.0.11/testsuite/motion2.c0000644000175000017500000001111211541755167014763 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #include "common.h" void schro_frame_create_pattern (SchroFrame *frame, int type) { int i,j,k; SchroFrameData *comp; switch (type) { case 0: orc_random_bits (&context, frame->components[0].data, frame->components[0].length); orc_random_bits (&context, frame->components[1].data, frame->components[1].length); orc_random_bits (&context, frame->components[2].data, frame->components[2].length); break; case 1: for(k=0;k<3;k++){ comp = &frame->components[k]; for(j=0;jheight;j++){ for(i=0;iwidth;i++){ SCHRO_GET(comp->data, j*comp->stride + i, uint8_t) = i*4 + j*2; } } } break; } } int schro_frame_compare (SchroFrame *a, SchroFrame *b) { SchroFrameData *comp_a; SchroFrameData *comp_b; int k; int i,j; for(k=0;k<3;k++){ comp_a = &a->components[k]; comp_b = &b->components[k]; for(j=0;jheight;j++){ for(i=0;iwidth;i++){ if (SCHRO_GET(comp_a->data, j*comp_a->stride + i, uint8_t) != SCHRO_GET(comp_b->data, j*comp_b->stride + i, uint8_t)) { SCHRO_ERROR("difference comp=%d x=%d y=%d", k, i, j); return FALSE; } } } } return TRUE; } void schro_frame_dump (SchroFrame *frame) { SchroFrameData *comp; int i,j; comp = &frame->components[0]; for(j=0;j<20;j++){ for(i=0;i<20;i++) { printf("%-3d ", SCHRO_GET(comp->data, j*comp->stride + i, uint8_t)); } printf("\n"); } } int main (int argc, char *argv[]) { SchroFrame *dest; SchroFrame *dest_u8; SchroFrame *ref; SchroFrame *addframe; SchroUpsampledFrame *uref; SchroParams params; SchroVideoFormat video_format; SchroMotionVector *motion_vectors; int i,j; schro_init(); memset (&video_format, 0, sizeof(video_format)); memset (¶ms, 0, sizeof(params)); video_format.width = 720; video_format.height = 480; video_format.chroma_format = SCHRO_CHROMA_420; schro_video_format_validate (&video_format); params.video_format = &video_format; params.xbsep_luma = 8; params.ybsep_luma = 8; params.xblen_luma = 12; params.yblen_luma = 12; schro_params_calculate_mc_sizes(¶ms); dest = schro_frame_new_and_alloc (NULL, SCHRO_FRAME_FORMAT_S16_420, video_format.width, video_format.height); ref = schro_frame_new_and_alloc_extended (NULL, SCHRO_FRAME_FORMAT_U8_420, video_format.width, video_format.height, 32); dest_u8 = schro_frame_new_and_alloc (NULL, SCHRO_FRAME_FORMAT_U8_420, video_format.width, video_format.height); addframe = schro_frame_new_and_alloc (NULL, SCHRO_FRAME_FORMAT_S16_420, video_format.width, video_format.height); schro_frame_clear(dest); schro_frame_create_pattern(ref,1); motion_vectors = malloc(sizeof(SchroMotionVector) * params.x_num_blocks * params.y_num_blocks); memset (motion_vectors, 0, sizeof(SchroMotionVector) * params.x_num_blocks * params.y_num_blocks); printf("sizeof(SchroMotionVector) = %lu\n",(unsigned long) sizeof(SchroMotionVector)); printf("num blocks %d x %d\n", params.x_num_blocks, params.y_num_blocks); for(j=0;j #include #include #include #include #include #include double filter[100]; double sinc(double x) { if (x == 0) return 1.0; return sin(x)/x; } double env(double x, double width) { return (x + width/2) * (x - width/2); } void create_filter (int n) { int i; double sum; double x; for(i=0;i #include #include #include #include #include #include int main (int argc, char *argv[]) { int i; double x; int j,k; schro_init(); for(i=0;i<100;i++){ x = i*1; j = schro_utils_multiplier_to_quant_index (x); k = schro_table_quant[j]; printf("%g %d %d\n", x, j, k); } exit(0); } schroedinger-1.0.11/testsuite/extension.c0000644000175000017500000000642111541755167015417 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #include #include "common.h" void upsample_line (uint8_t *dest, int dstr, uint8_t *src, int sstr, int n); void ref_h_upsample (SchroFrame *dest, SchroFrame *src); void ref_v_upsample (SchroFrame *dest, SchroFrame *src); void test (int width, int height); int failed = 0; int dump_all = FALSE; int main (int argc, char *argv[]) { schro_init(); test (100, 100); if (failed) { printf("FAILED\n"); } else { printf("SUCCESS\n"); } return failed; } void schro_upsampled_frame_get_subdata_prec1 (SchroUpsampledFrame *upframe, int component, int x, int y, SchroFrameData *fd); void test (int width, int height) { SchroFrame *frame; SchroUpsampledFrame *upframe; char name[TEST_PATTERN_NAME_SIZE]; SchroFrameData fd_ref; SchroFrameData fd; int x,y; int ok; fd_ref.data = schro_malloc (16 * 16); fd_ref.stride = 16; fd_ref.width = 16; fd_ref.height = 16;; fd.width = 16; fd.height = 16;; frame = schro_frame_new_and_alloc_extended (NULL, SCHRO_FRAME_FORMAT_U8_420, width, height, 32); test_pattern_generate (frame->components + 0, name, 0); test_pattern_generate (frame->components + 1, name, 0); test_pattern_generate (frame->components + 2, name, 0); schro_frame_mc_edgeextend (frame); upframe = schro_upsampled_frame_new (schro_frame_ref(frame)); schro_upsampled_frame_upsample (upframe); #if 0 /* just the corners */ for(y=-10;y<-8;y++){ for(x=-10;x<-8;x++){ printf ("%d,%d\n", x, y); schro_upsampled_frame_get_block_precN (upframe, 0, x, y, 1, &fd_ref); schro_upsampled_frame_get_subdata_prec1 (upframe, 0, x, y, &fd); frame_data_dump_full (&fd, &fd_ref, &fd_ref); } } for(y=200-16;y<200-16+2;y++){ for(x=184;x<186;x++){ printf ("%d,%d\n", x, y); schro_upsampled_frame_get_block_precN (upframe, 0, x, y, 1, &fd_ref); schro_upsampled_frame_get_subdata_prec1 (upframe, 0, x, y, &fd); frame_data_dump_full (&fd, &fd_ref, &fd_ref); } } for(y=-10;y<-8;y++){ for(x=184;x<186;x++){ printf ("%d,%d\n", x, y); schro_upsampled_frame_get_block_precN (upframe, 0, x, y, 1, &fd_ref); schro_upsampled_frame_get_subdata_prec1 (upframe, 0, x, y, &fd); frame_data_dump_full (&fd, &fd_ref, &fd_ref); } } for(y=184;y<186;y++){ for(x=-10;x<-8;x++){ printf ("%d,%d\n", x, y); schro_upsampled_frame_get_block_precN (upframe, 0, x, y, 1, &fd_ref); schro_upsampled_frame_get_subdata_prec1 (upframe, 0, x, y, &fd); frame_data_dump_full (&fd, &fd_ref, &fd_ref); } } #endif for(y=-32*2;y<100+32*2-16*2;y++) { for(x=-32*2;x<100+32*2-16*2;x++) { schro_upsampled_frame_get_block_fast_precN (upframe, 0, x, y, 1, &fd_ref, &fd_ref); schro_upsampled_frame_get_subdata_prec1 (upframe, 0, x, y, &fd); ok = frame_data_compare (&fd, &fd_ref); if (dump_all || !ok) { printf ("%d,%d\n", x, y); frame_data_dump_full (&fd, &fd_ref, &fd_ref); } if (!ok) { failed = TRUE; } } } schro_frame_unref (frame); } schroedinger-1.0.11/testsuite/ramp.c0000644000175000017500000000154011426074213014323 00000000000000 #include #include void ramp(int n); void test(int n); int sum; int main (int argc, char *argv[]) { int i; for(i=2;i<=32;i+=2){ ramp(i); } sum = 0; for(i=0;i<256;i++){ test(i); } printf("sum %d\n", sum); return 0; } void ramp(int n) { int i; int xoff = n/2; printf("%d: ", n); for(i=0;i>3) + ((n*(8-i) + 4)>>3); v = ((n*i)>>3) + ((n*(8-i))>>3); ref = ((n*i + n*(8-i) + 4)>>3); printf("%d ", v); sum += (ref - v) * (ref - v); } printf ("\n"); } schroedinger-1.0.11/testsuite/wavelet_gain.c0000644000175000017500000001164011541755167016047 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #include #include "common.h" int16_t tmp[2000]; int16_t tmp2[2000]; int filtershift[] = { 1, 1, 1, 0, 1, 2, 0, 1 }; void synth(int16_t *a, int filter, int n); void split (int16_t *a, int filter, int n); void synth_schro_ext (int16_t *a, int filter, int n); void split_schro_ext (int16_t *a, int n, int filter); void deinterleave (int16_t *a, int n); void interleave (int16_t *a, int n); void dump (int16_t *a, int n); void dump_cmp (int16_t *a, int16_t *b, int n); #define SHIFT 8 #define N (1<>4);i++){ a[i]=floor(0.5 + amplitude*random_std()); } } else if (level<5) { for(i=((N>>5)<>4)<>4);i++){ a[i]=floor(0.5 + amplitude*random_std()/3.608); } for(i=(N>>4);i<(N>>3);i++){ a[i]=floor(0.5 + amplitude*random_std()/1.972); } for(i=(N>>3);i<(N>>2);i++){ a[i]=floor(0.5 + amplitude*random_std()/1.382); } for(i=(N>>2);i<(N>>1);i++){ a[i]=floor(0.5 + amplitude*random_std()/0.991); } for(i=(N>>1);i<(N>>0);i++){ a[i]=floor(0.5 + amplitude*random_std()/0.821); } } else if (level==6) { double alpha = 1.282; double beta = 0.821; for(i=0;i<(N>>4);i++){ a[i]=floor(0.5 + amplitude*random_std()/(alpha*alpha*alpha*alpha)); } for(i=(N>>4);i<(N>>3);i++){ a[i]=floor(0.5 + amplitude*random_std()/(alpha*alpha*alpha*beta)); } for(i=(N>>3);i<(N>>2);i++){ a[i]=floor(0.5 + amplitude*random_std()/(alpha*alpha*beta)); } for(i=(N>>2);i<(N>>1);i++){ a[i]=floor(0.5 + amplitude*random_std()/(alpha*beta)); } for(i=(N>>1);i<(N>>0);i++){ a[i]=floor(0.5 + amplitude*random_std()/(beta)); } } interleave(a,N>>3); synth(a,N>>3,filter); interleave(a,N>>2); synth(a,N>>2,filter); interleave(a,N>>1); synth(a,N>>1,filter); interleave(a,N); synth(a,N,filter); for(i=0;i>1);i++){ double x; x = power[i]/n_cycles; x /= (amplitude*amplitude); #if 0 if (level == 0) { x /= (1<<(filtershift[filter]*4)); } else { x /= (1<<(filtershift[filter]*(5-level))); } #endif /* divide by size of subband */ #if 0 if (level == 0) { x /= (1<<(SHIFT-4+level)); } else { x /= (1<<(SHIFT-5+level)); } #endif /* divide by FFT normalization */ x /= (1< 1) { filter = strtol(argv[1], NULL, 0); } if (1) { for(level=0;level<=6;level++){ random_test(filter, level); } } else { response_test (filter); } return 0; } schroedinger-1.0.11/testsuite/wavelet_noise_2d.c0000644000175000017500000000716611556115124016630 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #include "common.h" #define SHIFT 8 #define SIZE (1<>5) #define AMPLITUDE 100 int fail = 0; float costable[SIZE*SIZE]; float sintable[SIZE*SIZE]; float dr[SIZE*SIZE]; float di[SIZE*SIZE]; float sr[SIZE*SIZE]; float si[SIZE*SIZE]; float power[SIZE*SIZE]; void generate_noise (SchroFrame *frame, int n_transforms, double *weights) { int i; int j; int k; int l; int pos; int w, h, x_offset, y_offset, y_skip; int16_t *data; SchroFrameData *comp; for(k=0;k<3;k++){ comp = frame->components + k; for(l=0;l<1+3*n_transforms;l++){ pos = schro_subband_get_position (l); w = comp->width >> (n_transforms - SCHRO_SUBBAND_SHIFT(pos)); h = comp->height >> (n_transforms - SCHRO_SUBBAND_SHIFT(pos)); y_skip = 1<<(n_transforms - SCHRO_SUBBAND_SHIFT(pos)); if (pos&1) { x_offset = w; } else { x_offset = 0; } if (pos&2) { y_offset = y_skip / 2; } else { y_offset = 0; } //printf("%d %d w %d h %d x_offset %d y_offset %d y_skip %d\n", l, pos, w, h, x_offset, y_offset, y_skip); for(j=0;jdata, (j*y_skip + y_offset)*comp->stride); data += x_offset; for(i=0;iintra_subband_weights[filter][transform_depth-1]); schro_wavelet_inverse_transform_2d (frame->components + 0, frame->components + 1, filter, tmp); for(j=0;jcomponents[0].data, frame->components[0].stride * j); for(i=0;i #include #include #include #include #include int main (int argc, char *argv[]) { int i; double ppd_max; double ppd; schro_init(); ppd_max = 720 / (2.0*atan(0.5/3.0)*180/M_PI); for(i=0;i<100;i++) { ppd = ppd_max * (i/100.0); printf("%d %g %g %g %g\n", i, ppd, 1.0/schro_encoder_perceptual_weight_constant (ppd), 1.0/schro_encoder_perceptual_weight_moo (ppd), 1.0/schro_encoder_perceptual_weight_ccir959 (ppd)); } return 0; } schroedinger-1.0.11/testsuite/decode.c0000644000175000017500000000543211541755167014627 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include "common.h" int verbose = FALSE; void decode (FILE *file); void parse (FILE *file); int main (int argc, char *argv[]) { FILE *file; schro_init(); if (argc < 2) { printf("decode stream.drc\n"); exit(1); } file = fopen (argv[1], "r"); if (file == NULL) { printf("cannot open %s\n", argv[1]); return 1; } decode (file); //parse (file); fclose (file); return 0; } static void buffer_free (SchroBuffer *buf, void *priv) { free (priv); } void decode (FILE *file) { SchroDecoder *decoder; SchroBuffer *buffer; SchroVideoFormat *format = NULL; SchroFrame *frame; int go; int it; int eos = FALSE; int eof = FALSE; void *packet; int size; int ret; int width, height; decoder = schro_decoder_new(); while(!eos) { ret = parse_packet (file, &packet, &size); if (!ret) { exit(1); } printf("packet size %d\n", size); if (size == 0) { eof = TRUE; schro_decoder_push_end_of_stream (decoder); } else { buffer = schro_buffer_new_with_data (packet, size); buffer->free = buffer_free; buffer->priv = packet; it = schro_decoder_push (decoder, buffer); if (it == SCHRO_DECODER_FIRST_ACCESS_UNIT) { format = schro_decoder_get_video_format (decoder); } } go = 1; while (go) { it = schro_decoder_wait (decoder); switch (it) { case SCHRO_DECODER_NEED_BITS: go = 0; break; case SCHRO_DECODER_NEED_FRAME: schro_video_format_get_picture_luma_size (format, &width, &height); frame = schro_frame_new_and_alloc (NULL, schro_params_get_frame_format(8, format->chroma_format), width, height); schro_decoder_add_output_picture (decoder, frame); break; case SCHRO_DECODER_OK: if (verbose) printf("picture number %d\n", schro_decoder_get_picture_number (decoder)); frame = schro_decoder_pull (decoder); if (frame) { schro_frame_unref (frame); } break; case SCHRO_DECODER_EOS: printf("got eos\n"); if (eof) { eos = TRUE; } go = 0; break; case SCHRO_DECODER_ERROR: exit(0); break; } } } printf("freeing decoder\n"); schro_decoder_free (decoder); free(format); } void parse (FILE *file) { void *packet; int size; int ret; while(1) { ret = parse_packet (file, &packet, &size); if (!ret) { exit(1); } if (packet) free (packet); if (size == 0) return; } } schroedinger-1.0.11/testsuite/cuda/0000775000175000017500000000000011707140274014221 500000000000000schroedinger-1.0.11/testsuite/cuda/cuda.c0000644000175000017500000000571311541755167015236 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #include #include #include #include "common.h" void upsample_line (uint8_t *dest, int dstr, uint8_t *src, int sstr, int n); void ref_h_upsample (SchroFrame *dest, SchroFrame *src); void ref_v_upsample (SchroFrame *dest, SchroFrame *src); void test (int width, int height); int failed = 0; int dump_all = FALSE; SchroMemoryDomain *cpu_domain; SchroMemoryDomain *cuda_domain; int main (int argc, char *argv[]) { //int width, height; schro_init(); cpu_domain = schro_memory_domain_new_local (); cuda_domain = schro_memory_domain_new_cuda (); #if 0 for(width=1;width<=20;width++){ for(height=1;height<=20;height++){ test (width, height); } } #endif test (640, 480); if (failed) { printf("FAILED\n"); } else { printf("SUCCESS\n"); } return failed; } void test (int width, int height) { SchroFrame *frame_u8; SchroFrame *frame; SchroFrame *frame_ref; SchroFrame *frame_test; SchroFrame *frame_cuda; SchroParams params; char name[TEST_PATTERN_NAME_SIZE]; int i; int ok; params.iwt_luma_width = width; params.iwt_luma_height = height; params.iwt_chroma_width = width/2; params.iwt_chroma_height = height/2; params.transform_depth = 1; frame_u8 = schro_frame_new_and_alloc (cpu_domain, SCHRO_FRAME_FORMAT_U8_420, width, height); frame = schro_frame_new_and_alloc (cpu_domain, SCHRO_FRAME_FORMAT_S16_420, width, height); frame_cuda = schro_frame_new_and_alloc (cuda_domain, SCHRO_FRAME_FORMAT_S16_420, width, height); frame_ref = schro_frame_new_and_alloc (cpu_domain, SCHRO_FRAME_FORMAT_S16_420, width, height); frame_test = schro_frame_new_and_alloc (cpu_domain, SCHRO_FRAME_FORMAT_S16_420, width, height); for(i=0;icomponents + 0, name, i); test_pattern_generate (frame_u8->components + 1, name, i); test_pattern_generate (frame_u8->components + 2, name, i); schro_frame_convert (frame, frame_u8); schro_frame_convert (frame_ref, frame_u8); schro_frame_inverse_iwt_transform (frame_ref, ¶ms); schro_frame_to_gpu (frame_cuda, frame); schro_gpuframe_inverse_iwt_transform (frame_cuda, ¶ms); schro_gpuframe_to_cpu (frame_test, frame_cuda); ok = frame_compare (frame_ref, frame_test); printf(" pattern %s: %s\n", name, ok ? "OK" : "broken"); if (dump_all || !ok) { frame_data_dump_full (frame_test->components + 0, frame_ref->components + 0, frame->components + 0); failed = TRUE; } } schro_frame_unref (frame); schro_frame_unref (frame_ref); schro_frame_unref (frame_test); schro_frame_unref (frame_cuda); } schroedinger-1.0.11/testsuite/cuda/Makefile.am0000644000175000017500000000033211541755167016202 00000000000000 if HAVE_CUDA noinst_PROGRAMS = cuda endif AM_CFLAGS = $(SCHRO_CFLAGS) $(ERROR_CFLAGS) $(ORC_CFLAGS) \ -DSCHRO_ENABLE_UNSTABLE_API -I$(srcdir)/.. LDADD = $(SCHRO_LIBS) ../libschrotest.la cuda_SOURCES = cuda.c schroedinger-1.0.11/testsuite/cuda/Makefile.in0000664000175000017500000003646211707140262016216 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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@ @HAVE_CUDA_TRUE@noinst_PROGRAMS = cuda$(EXEEXT) subdir = testsuite/cuda DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-auto-alt.m4 \ $(top_srcdir)/m4/as-compiler-flag.m4 \ $(top_srcdir)/m4/as-host-defines.m4 \ $(top_srcdir)/m4/as-version.m4 $(top_srcdir)/m4/gst-args.m4 \ $(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)/m4/pkg.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) am_cuda_OBJECTS = cuda.$(OBJEXT) cuda_OBJECTS = $(am_cuda_OBJECTS) cuda_LDADD = $(LDADD) am__DEPENDENCIES_1 = cuda_DEPENDENCIES = $(am__DEPENDENCIES_1) ../libschrotest.la DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(cuda_SOURCES) DIST_SOURCES = $(cuda_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUDA_CFLAGS = @CUDA_CFLAGS@ CUDA_LIBS = @CUDA_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ GCOV = @GCOV@ GCOV_CFLAGS = @GCOV_CFLAGS@ GCOV_LIBS = @GCOV_LIBS@ GREP = @GREP@ GTHREAD_CFLAGS = @GTHREAD_CFLAGS@ GTHREAD_LIBS = @GTHREAD_LIBS@ GTKDOC_CHECK = @GTKDOC_CHECK@ 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@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ NVCC = @NVCC@ NVCCFLAGS = @NVCCFLAGS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENGL_CFLAGS = @OPENGL_CFLAGS@ OPENGL_LIBS = @OPENGL_LIBS@ ORCC = @ORCC@ ORC_CFLAGS = @ORC_CFLAGS@ ORC_LIBS = @ORC_LIBS@ 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@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SCHRO_CFLAGS = @SCHRO_CFLAGS@ SCHRO_LIBS = @SCHRO_LIBS@ SCHRO_LIBVERSION = @SCHRO_LIBVERSION@ SCHRO_MAJORMINOR = @SCHRO_MAJORMINOR@ SCHRO_PKG_DEPS = @SCHRO_PKG_DEPS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ THREAD_IMPL = @THREAD_IMPL@ VERSION = @VERSION@ 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_CXX = @ac_ct_CXX@ 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@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CFLAGS = $(SCHRO_CFLAGS) $(ERROR_CFLAGS) $(ORC_CFLAGS) \ -DSCHRO_ENABLE_UNSTABLE_API -I$(srcdir)/.. LDADD = $(SCHRO_LIBS) ../libschrotest.la cuda_SOURCES = cuda.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(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) --foreign testsuite/cuda/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign testsuite/cuda/Makefile .PRECIOUS: 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-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list cuda$(EXEEXT): $(cuda_OBJECTS) $(cuda_DEPENDENCIES) @rm -f cuda$(EXEEXT) $(LINK) $(cuda_OBJECTS) $(cuda_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cuda.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 $(PROGRAMS) 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-noinstPROGRAMS \ 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 all all-am check check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS ctags 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 uninstall uninstall-am # 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: schroedinger-1.0.11/testsuite/divide.c0000644000175000017500000000065511320237456014641 00000000000000 #include #include #include #include #include #include int main (int argc, char *argv[]) { int i; int a, b; schro_init(); for(i=-32768;i<32768;i++){ a = schro_divide(i,3); //b = (i*21845 + 10922)>>16; b = schro_divide3(i); if (a != b) printf("%d: %d %d %c\n", i, a, b, (a==b)?' ':'*'); } exit(0); } schroedinger-1.0.11/testsuite/streams/0000775000175000017500000000000011707140273014762 500000000000000schroedinger-1.0.11/testsuite/streams/Makefile.am0000644000175000017500000000007510735025462016740 00000000000000 EXTRA_DIST = make_vts_streams clean-local: -rm -rf *.drc schroedinger-1.0.11/testsuite/streams/Makefile.in0000664000175000017500000002542111707140262016751 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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@ subdir = testsuite/streams DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-auto-alt.m4 \ $(top_srcdir)/m4/as-compiler-flag.m4 \ $(top_srcdir)/m4/as-host-defines.m4 \ $(top_srcdir)/m4/as-version.m4 $(top_srcdir)/m4/gst-args.m4 \ $(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)/m4/pkg.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUDA_CFLAGS = @CUDA_CFLAGS@ CUDA_LIBS = @CUDA_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ GCOV = @GCOV@ GCOV_CFLAGS = @GCOV_CFLAGS@ GCOV_LIBS = @GCOV_LIBS@ GREP = @GREP@ GTHREAD_CFLAGS = @GTHREAD_CFLAGS@ GTHREAD_LIBS = @GTHREAD_LIBS@ GTKDOC_CHECK = @GTKDOC_CHECK@ 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@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ NVCC = @NVCC@ NVCCFLAGS = @NVCCFLAGS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENGL_CFLAGS = @OPENGL_CFLAGS@ OPENGL_LIBS = @OPENGL_LIBS@ ORCC = @ORCC@ ORC_CFLAGS = @ORC_CFLAGS@ ORC_LIBS = @ORC_LIBS@ 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@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SCHRO_CFLAGS = @SCHRO_CFLAGS@ SCHRO_LIBS = @SCHRO_LIBS@ SCHRO_LIBVERSION = @SCHRO_LIBVERSION@ SCHRO_MAJORMINOR = @SCHRO_MAJORMINOR@ SCHRO_PKG_DEPS = @SCHRO_PKG_DEPS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ THREAD_IMPL = @THREAD_IMPL@ VERSION = @VERSION@ 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_CXX = @ac_ct_CXX@ 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@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = make_vts_streams 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) --foreign testsuite/streams/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign testsuite/streams/Makefile .PRECIOUS: 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 tags: TAGS TAGS: ctags: CTAGS CTAGS: 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-local 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 \ clean-local 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 \ uninstall uninstall-am clean-local: -rm -rf *.drc # 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: schroedinger-1.0.11/testsuite/streams/make_vts_streams0000775000175000017500000001161111707112173020175 00000000000000#!/bin/dash set -e #export SCHRO_DUMP=1 #export SCHRO_DEBUG=5 #export G_SLICE=always_malloc export SCHRO_MOTION_REF=1 encode() { echo "ENCODING $testname with $schroopts" gst-launch-0.10 \ videotestsrc num-buffers=30 ! \ timeoverlay ! \ textoverlay text=$testname halignment=center font-desc="sans 20" deltay=-100 ! \ ffmpegcolorspace ! \ video/x-raw-yuv,format=\(fourcc\)"$format",width=$width,height=$height,framerate=30/1 ! \ schroenc enable-md5=1 au_distance=30 $schroopts ! \ filesink location=vts.$testname.drc } width=320 height=240 format=I420 #testname="test" #schroopts="rate-control=4 magic-lambda=0.01 enable-phasecorr-estimation=1" #encode #exit 0 testname="default" schroopts="rate-control=0" encode #exit 0 # gop structure testname="intra-only" schroopts="gop-structure=1" encode testname="backref" schroopts="gop-structure=2" encode testname="biref" schroopts="gop-structure=4" encode # noarith testname="noarith" schroopts="gop-structure=1 enable-noarith=1" encode # rate control testname="CBR-250kb" schroopts="rate-control=1 bitrate=250000" encode testname="CBR-500kb" schroopts="rate-control=1 bitrate=500000" encode testname="CBR-1Mb" schroopts="rate-control=1 bitrate=1000000" encode testname="CBR-2Mb" schroopts="rate-control=1 bitrate=2000000" encode testname="LD-2Mb" schroopts="rate-control=2 bitrate=2000000" encode testname="LD-4Mb" schroopts="rate-control=2 bitrate=4000000" encode testname="LD-8Mb" schroopts="rate-control=2 bitrate=8000000" encode testname="lossless" schroopts="rate-control=3" encode testname="constant-lambda" schroopts="rate-control=4" encode testname="constant-error" schroopts="rate-control=5" encode # noise threshold testname="10dB" schroopts="rate-control=0 noise-threshold=10" encode testname="20dB" schroopts="rate-control=0 noise-threshold=20" encode testname="30dB" schroopts="rate-control=0 noise-threshold=30" encode testname="40dB" schroopts="rate-control=0 noise-threshold=40" encode # perceptual weighting testname="percep-none" schroopts="perceptual-weighting=1" encode testname="percep-ccir959" schroopts="perceptual-weighting=1" encode testname="percep-moo" schroopts="perceptual-weighting=2" encode testname="percep-manos-sakrison" schroopts="perceptual-weighting=3" encode # filtering testname="cwm" schroopts="filtering=1 filter-value=4" encode testname="gaussian" schroopts="filtering=2 filter-value=5" encode testname="add-noise" schroopts="filtering=3 filter-value=10" encode testname="adaptive-gaussian" schroopts="filtering=4" encode # transform depth testname="transform-0" schroopts="transform-depth=0" encode testname="transform-1" schroopts="transform-depth=1" encode testname="transform-2" schroopts="transform-depth=2" encode testname="transform-3" schroopts="transform-depth=3" encode testname="transform-4" schroopts="transform-depth=4" encode # intra wavelet for i in 0 1 2 3 4 5 6 ; do testname="intra-wavelet-$i" schroopts="gop-structure=1 intra-wavelet=$i" encode done for i in 0 1 2 3 4 5 6 ; do testname="inter-wavelet-$i" schroopts="inter-wavelet=$i" encode done for i in 0 1 2 3 ; do testname="mv-precision-$i" schroopts="mv-precision=$i" encode done for i in 1 2 3 ; do for j in 1 2 3 ; do testname="MB-size-$i-overlap-$j" schroopts="motion-block-size=$i motion-block-overlap=$j" encode done done # codeblocks testname="no-multiquant" schroopts="enable-multiquant=false" encode testname="dc-multiquant" schroopts="enable-dc-multiquant=TRUE" encode for i in 1 2 3 4 do testname="codeblock-$i" schroopts="codeblock-size=$i" encode done # various tools testname="phasecorr" schroopts="enable-phasecorr-estimation=true" encode #testname="global-motion" #schroopts="enable-global-motion=true" #encode # Broken #testname="interlaced-coding" #schroopts="interlaced-coding=true" #encode testname="old-scene-change-detection" schroopts="enable-scene-change-detection=false" encode testname="scene-change-detection" schroopts="enable-scene-change-detection=true" encode testname="hierarchical-estimation" schroopts="enable-hierarchical-estimation=true" encode testname="deep-estimation" schroopts="mv-precision=2 enable-hierarchical-estimation=true enable-deep-estimation=true" encode testname="rdo-cbr" schroopts="rate-control=1 bitrate=2000000 enable-rdo-cbr=true" encode # profiles testname="profile-vc2-low-delay" schroopts="force-profile=vc2_low_delay" encode testname="profile-vc2-simple" schroopts="force-profile=vc2_simple" encode testname="profile-vc2-main" schroopts="force-profile=vc2_main" encode testname="profile-main" schroopts="force-profile=main" encode testname="profile-vc2-simple-lossless" schroopts="force-profile=vc2_simple rate-control=lossless" encode testname="profile-vc2-main-lossless" schroopts="force-profile=vc2_main rate-control=lossless" encode testname="profile-main-lossless" schroopts="force-profile=main rate-control=lossless" encode schroedinger-1.0.11/testsuite/perceptual_weight.c0000644000175000017500000000310511541755167017112 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include "common.h" int main (int argc, char *argv[]) { int filter; int j; int n; int i; SchroEncoder *encoder; double min; double x; schro_init(); encoder = schro_encoder_new (); for(filter=0;filter<8;filter++){ for(j=0;j<4;j++){ printf("filter %d n_levels %d\n", filter, j+1); n = 3*(j+1)+1; min = encoder->intra_subband_weights[filter][j][0]; for(i=0;iintra_subband_weights[filter][j][i] < min) { min = encoder->intra_subband_weights[filter][j][i]; } } for(i=0;iintra_subband_weights[filter][j][i]/min; printf("%2d %6.3f %6.3f %d\n", i, encoder->intra_subband_weights[filter][j][i], x, gain_to_quant_index(x)); } } } for(filter=0;filter<8;filter++){ for(j=0;j<4;j++){ printf("filter %d n_levels %d\n", filter, j+1); n = 3*(j+1)+1; min = encoder->inter_subband_weights[filter][j][0]; for(i=0;iinter_subband_weights[filter][j][i] < min) { min = encoder->inter_subband_weights[filter][j][i]; } } for(i=0;iinter_subband_weights[filter][j][i]/min; printf("%2d %6.3f %6.3f %d\n", i, encoder->inter_subband_weights[filter][j][i], x, gain_to_quant_index(x)); } } } return 0; } schroedinger-1.0.11/testsuite/tables2/0000775000175000017500000000000011707140273014640 500000000000000schroedinger-1.0.11/testsuite/tables2/wavelet_tables.c0000644000175000017500000001324211541755167017737 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #include #include "common.h" int16_t tmp[2000]; int16_t tmp2[2000]; int filtershift[] = { 1, 1, 1, 0, 1, 0, 1 }; void dump (int16_t *a, int n); void dump_cmp (int16_t *a, int16_t *b, int n); void solve (double *matrix, double *col, int n); #define SHIFT 8 #define N (1<>n_levels);i++){ a[i]=floor(0.5 + amplitude*random_std()); } } else { for(i=(N>>n_levels);i<(N>>(n_levels-1));i++){ a[i]=floor(0.5 + amplitude*random_std()); } } for(i=n_levels-1;i>=0;i--){ interleave(a,N>>i); synth(a,N>>i,filter); } for(i=0;i>1);i++){ double x; x = power[i]/n_cycles; x /= (amplitude*amplitude); /* divide by FFT normalization */ x /= (1< 1e10) return 60; x *= x; x *= x; while (x*x > 2) { x *= 0.5; i++; if (i >= 60) break; } return i; } float wavelet_noise_curve[SCHRO_N_WAVELETS][8][N/2]; double wavelet_gain[SCHRO_N_WAVELETS][2]; int main (int argc, char *argv[]) { int filter; double curve[N]; int i; int j; schro_init(); printf("/* This file is autogenerated */\n"); printf("\n"); printf("#include \n"); printf("\n"); printf("const float schro_tables_wavelet_noise_curve[SCHRO_N_WAVELETS][8][%d] = {\n", N/2); for(filter=0;filter>1), i&1); printf(" { /* wavelet type %d, n_levels %d, %s */\n", filter, 1+(i>>1), (i&1)?"low":"high"); for(j=0;j #include #include #include #include #include #define SHIFT SCHRO_UNPACK_TABLE_SHIFT #define SIZE (1<\n"); printf("\n"); printf("#define X(a,b) (((a)<<4)|(b))\n"); printf("const int16_t schro_table_unpack_sint[%d][%d] = {\n", SIZE, SHIFT); for(i=0;i>8; data[1] = (i<<(16-SHIFT))&0xff; data[2] = 0; data[3] = 0; memset (array, 0, SHIFT*2*sizeof(int)); schro_unpack_init_with_data (&unpack, data, 4, 1); schro_unpack_limit_bits_remaining (&unpack, SHIFT); printf(" /* %3d */ { ", i); j = 0; x = schro_unpack_decode_sint_slow (&unpack); while (schro_unpack_get_bits_read (&unpack) <= SHIFT) { array[j*2] = x; array[j*2+1] = schro_unpack_get_bits_read (&unpack); j++; x = schro_unpack_decode_sint_slow (&unpack); } if (j == SHIFT) j--; if (array[1] == 0) { array[0] = 0xf + ((((i>>8)&1)<<3) | (((i>>6)&1)<<2) | (((i>>4)&1)<<1) | (((i>>2)&1)<<0)); j = 1; } for(k=0;k #include #include #include unsigned int get_quant (int i) { unsigned long long base; base = 1ULL<<(i/4); switch(i&3) { case 0: return 4*base; case 1: return (503829 * base + 52958) / 105917; case 2: return (665857 * base + 58854) / 117708; case 3: return (440253 * base + 32722) / 65444; } return 0; } unsigned int get_offset_3_8 (int i) { unsigned long long quant = get_quant(i); if (i == 0) return 1; return (quant * 3 + 4)/8; } int get_offset_1_2 (int i) { unsigned long long quant = get_quant(i); if (i == 0) return 1; if (i == 1) return 2; return (quant + 1)/2; } uint16_t get_inv_quant (int i) { int quant_factor = get_quant(i); int quant_shift = i/4 + 2; return floor(0.5 + 65536.0 / quant_factor * (1<>2); } else { return (q * quant_factor + quant_offset + 2)>>2; } } static int quantize (int value, int quant_factor, int quant_offset) { unsigned int x; if (value == 0) return 0; if (value < 0) { x = (-value)<<2; x /= quant_factor; value = -x; } else { x = value<<2; x /= quant_factor; value = x; } return value; } typedef struct _ErrorFuncInfo ErrorFuncInfo; struct _ErrorFuncInfo { int quant_factor; int quant_offset; double power; }; static double error_pow2(int x, void *priv) { ErrorFuncInfo *efi = priv; int q; int value; int y; q = quantize (x, efi->quant_factor, efi->quant_offset); value = dequantize (q, efi->quant_factor, efi->quant_offset); y = abs (value - x); return pow (y, efi->power); } static int maxbit (unsigned int x) { int i; for(i=0;x;i++){ x >>= 1; } return i; } static int onebits (int value) { int i; int n_bits; int ones = 0; if (value < 0) value = -value; if (value == 0) return 0; value++; n_bits = maxbit (value); for(i=0;i>(n_bits - 2 - i))&1; } return ones; } static int zerobits (int value) { int i; int n_bits; int zeros = 0; if (value < 0) value = -value; if (value == 0) return 0; value++; n_bits = maxbit (value); for(i=0;i>(n_bits - 2 - i))&1); } return zeros; } #define SHIFT 3 static int iexpx (int x) { if (x < (1<>SHIFT)-1); } int main (int argc, char *argv[]) { int i; int n = 60; printf("\n"); printf("#include \"config.h\"\n"); printf("\n"); printf("#include \n"); printf("\n"); /* schro_table_offset_3_8 */ printf("const uint32_t schro_table_offset_3_8[%d] = {\n", n + 1); for(i=0;i>SHIFT) > 0) { x *= 1.0/(1<<((j>>SHIFT)-1)); } printf("%g, ", x); if ((j&0x7)==0x7) printf("\n"); } printf(" },\n"); } printf("};\n\n"); /* schro_table_zerobits_hist */ printf("const double schro_table_zerobits_hist_shift3_1_2[60][%d] = {\n", ((16-SHIFT)<>SHIFT) > 0) { x *= 1.0/(1<<((j>>SHIFT)-1)); } printf("%g, ", x); if ((j&0x7)==0x7) printf("\n"); } printf(" },\n"); } printf("};\n\n"); printf("#endif\n"); return 0; } schroedinger-1.0.11/testsuite/tables2/Makefile.am0000644000175000017500000000071511541755167016627 00000000000000 noinst_PROGRAMS = \ lowdelay_tables \ quant_tables \ unpack_tables if ENABLE_ENCODER noinst_PROGRAMS += \ wavelet_tables endif AM_CFLAGS = $(SCHRO_CFLAGS) $(ERROR_CFLAGS) $(ORC_CFLAGS) -I$(srcdir)/.. \ -DSCHRO_ENABLE_UNSTABLE_API LDADD = ../libschrotest.la $(SCHRO_LIBS) $(LIBM) lowdelay_tables_SOURCES = lowdelay_tables.c wavelet_tables_SOURCES = wavelet_tables.c quant_tables_SOURCES = quant_tables.c unpack_tables_SOURCES = unpack_tables.c schroedinger-1.0.11/testsuite/tables2/Makefile.in0000664000175000017500000004262411707140262016633 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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@ noinst_PROGRAMS = lowdelay_tables$(EXEEXT) quant_tables$(EXEEXT) \ unpack_tables$(EXEEXT) $(am__EXEEXT_1) @ENABLE_ENCODER_TRUE@am__append_1 = \ @ENABLE_ENCODER_TRUE@ wavelet_tables subdir = testsuite/tables2 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-auto-alt.m4 \ $(top_srcdir)/m4/as-compiler-flag.m4 \ $(top_srcdir)/m4/as-host-defines.m4 \ $(top_srcdir)/m4/as-version.m4 $(top_srcdir)/m4/gst-args.m4 \ $(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)/m4/pkg.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @ENABLE_ENCODER_TRUE@am__EXEEXT_1 = wavelet_tables$(EXEEXT) PROGRAMS = $(noinst_PROGRAMS) am_lowdelay_tables_OBJECTS = lowdelay_tables.$(OBJEXT) lowdelay_tables_OBJECTS = $(am_lowdelay_tables_OBJECTS) lowdelay_tables_LDADD = $(LDADD) am__DEPENDENCIES_1 = lowdelay_tables_DEPENDENCIES = ../libschrotest.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_quant_tables_OBJECTS = quant_tables.$(OBJEXT) quant_tables_OBJECTS = $(am_quant_tables_OBJECTS) quant_tables_LDADD = $(LDADD) quant_tables_DEPENDENCIES = ../libschrotest.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) am_unpack_tables_OBJECTS = unpack_tables.$(OBJEXT) unpack_tables_OBJECTS = $(am_unpack_tables_OBJECTS) unpack_tables_LDADD = $(LDADD) unpack_tables_DEPENDENCIES = ../libschrotest.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) am_wavelet_tables_OBJECTS = wavelet_tables.$(OBJEXT) wavelet_tables_OBJECTS = $(am_wavelet_tables_OBJECTS) wavelet_tables_LDADD = $(LDADD) wavelet_tables_DEPENDENCIES = ../libschrotest.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(lowdelay_tables_SOURCES) $(quant_tables_SOURCES) \ $(unpack_tables_SOURCES) $(wavelet_tables_SOURCES) DIST_SOURCES = $(lowdelay_tables_SOURCES) $(quant_tables_SOURCES) \ $(unpack_tables_SOURCES) $(wavelet_tables_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUDA_CFLAGS = @CUDA_CFLAGS@ CUDA_LIBS = @CUDA_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ GCOV = @GCOV@ GCOV_CFLAGS = @GCOV_CFLAGS@ GCOV_LIBS = @GCOV_LIBS@ GREP = @GREP@ GTHREAD_CFLAGS = @GTHREAD_CFLAGS@ GTHREAD_LIBS = @GTHREAD_LIBS@ GTKDOC_CHECK = @GTKDOC_CHECK@ 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@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ NVCC = @NVCC@ NVCCFLAGS = @NVCCFLAGS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENGL_CFLAGS = @OPENGL_CFLAGS@ OPENGL_LIBS = @OPENGL_LIBS@ ORCC = @ORCC@ ORC_CFLAGS = @ORC_CFLAGS@ ORC_LIBS = @ORC_LIBS@ 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@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SCHRO_CFLAGS = @SCHRO_CFLAGS@ SCHRO_LIBS = @SCHRO_LIBS@ SCHRO_LIBVERSION = @SCHRO_LIBVERSION@ SCHRO_MAJORMINOR = @SCHRO_MAJORMINOR@ SCHRO_PKG_DEPS = @SCHRO_PKG_DEPS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ THREAD_IMPL = @THREAD_IMPL@ VERSION = @VERSION@ 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_CXX = @ac_ct_CXX@ 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@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CFLAGS = $(SCHRO_CFLAGS) $(ERROR_CFLAGS) $(ORC_CFLAGS) -I$(srcdir)/.. \ -DSCHRO_ENABLE_UNSTABLE_API LDADD = ../libschrotest.la $(SCHRO_LIBS) $(LIBM) lowdelay_tables_SOURCES = lowdelay_tables.c wavelet_tables_SOURCES = wavelet_tables.c quant_tables_SOURCES = quant_tables.c unpack_tables_SOURCES = unpack_tables.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(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) --foreign testsuite/tables2/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign testsuite/tables2/Makefile .PRECIOUS: 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-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list lowdelay_tables$(EXEEXT): $(lowdelay_tables_OBJECTS) $(lowdelay_tables_DEPENDENCIES) @rm -f lowdelay_tables$(EXEEXT) $(LINK) $(lowdelay_tables_OBJECTS) $(lowdelay_tables_LDADD) $(LIBS) quant_tables$(EXEEXT): $(quant_tables_OBJECTS) $(quant_tables_DEPENDENCIES) @rm -f quant_tables$(EXEEXT) $(LINK) $(quant_tables_OBJECTS) $(quant_tables_LDADD) $(LIBS) unpack_tables$(EXEEXT): $(unpack_tables_OBJECTS) $(unpack_tables_DEPENDENCIES) @rm -f unpack_tables$(EXEEXT) $(LINK) $(unpack_tables_OBJECTS) $(unpack_tables_LDADD) $(LIBS) wavelet_tables$(EXEEXT): $(wavelet_tables_OBJECTS) $(wavelet_tables_DEPENDENCIES) @rm -f wavelet_tables$(EXEEXT) $(LINK) $(wavelet_tables_OBJECTS) $(wavelet_tables_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lowdelay_tables.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quant_tables.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unpack_tables.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wavelet_tables.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 $(PROGRAMS) 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-noinstPROGRAMS \ 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 all all-am check check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS ctags 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 uninstall uninstall-am # 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: schroedinger-1.0.11/testsuite/tables2/lowdelay_tables.c0000644000175000017500000000453211541755167020112 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #include "common.h" int16_t tmp[2000]; int16_t tmp2[2000]; int filtershift[] = { 1, 1, 1, 0, 1, 0, 1 }; void dump (int16_t *a, int n); void dump_cmp (int16_t *a, int16_t *b, int n); #define SHIFT 8 #define N (1<>n_levels;i++){ a[i]=floor(0.5 + 100 * random_std()); } } else { for(i=N>>(n_levels-level+1);i>(n_levels-level);i++){ a[i]=floor(0.5 + 100 * random_std()); } } for(i=0;i>(n_levels-1-i)); synth(a,N>>(n_levels-1-i),filter); } for(i=0;i<256;i++){ p2 += a[i]*a[i]; } gain += p2/p1; } //printf("%d %g %g\n", level, gain/10000, sqrt(gain/10000)); return sqrt(gain/10000); } int quant_index (double x) { int i = 0; x *= x; x *= x; while (x*x > 2) { x *= 0.5; i++; } return i; } int main (int argc, char *argv[]) { int filter; int n_levels; schro_init(); filter = 0; if (argc > 1) { filter = strtol(argv[1], NULL, 0); } { double a[5]; double b[9]; int i; double min; for(n_levels=1;n_levels<=4;n_levels++){ printf("n_levels=%d:\n", n_levels); for(i=0;i<=n_levels;i++){ a[i] = gain_test (filter, i, n_levels); } for(i=0;i<=n_levels;i++){ printf("%d %5.3f\n", i, a[i]); } b[0] = a[0] * a[0] / (1<<(n_levels*filtershift[filter])); for(i=0;i #include #include #include #include typedef struct _ColorMatrix ColorMatrix; struct _ColorMatrix { double m[4][4]; }; void color_matrix_build (ColorMatrix *dst); void color_matrix_apply_u8 (ColorMatrix *m, uint8_t *dest, uint8_t *src); void color_matrix_apply_f64_u8 (ColorMatrix *m, double *dest, uint8_t *src); void color_matrix_dump(ColorMatrix *m); uint8_t colors[][3] = { { 168, 44, 136 }, { 61, 153, 99 }, { 35, 174, 152 }, #if 0 { 235, 128, 128 }, { 226, 0, 155 }, { 179, 170, 0 }, { 150, 46, 21 }, { 105, 212, 235 }, { 76, 85, 255 }, { 29, 255, 107 }, { 16, 128, 128 }, #endif }; int main (int argc, char *argv[]) { ColorMatrix m; double dest[3]; //uint8_t src[3]; int i; color_matrix_build (&m); color_matrix_dump (&m); for(i=0;i<8;i++){ color_matrix_apply_f64_u8 (&m, dest, colors[i]); #if 0 src[0] = (i&2)?191:0; src[1] = (i&4)?191:0; src[2] = (i&1)?191:0; color_matrix_apply_f64_u8 (&m, dest, src); #endif printf("%8.4g %8.4g %8.4g\n", dest[0], dest[1], dest[2]); } return 0; } void color_matrix_set_identity (ColorMatrix *m) { int i,j; for(i=0;i<4;i++){ for(j=0;j<4;j++){ m->m[i][j] = (i==j); } } } /* Prettyprint a 4x4 matrix @m@ */ void color_matrix_dump(ColorMatrix *m) { int i,j; printf("[\n"); for (i = 0; i < 4; i++) { printf(" "); for (j = 0; j < 4; j++) { printf(" %8.5g", m->m[i][j]); } printf("\n"); } printf("]\n"); } /* Perform 4x4 matrix multiplication: * - @dst@ = @a@ * @b@ * - @dst@ may be a pointer to @a@ andor @b@ */ void color_matrix_multiply (ColorMatrix *dst, ColorMatrix *a, ColorMatrix *b) { ColorMatrix tmp; int i,j,k; for (i = 0; i < 4; i++) { for (j = 0; j < 4; j++) { double x = 0; for (k = 0; k < 4; k++) { x += a->m[i][k] * b->m[k][j]; } tmp.m[i][j] = x; } } memcpy(dst, &tmp, sizeof(ColorMatrix)); } void color_matrix_offset_components (ColorMatrix *m, double a1, double a2, double a3) { ColorMatrix a; color_matrix_set_identity (&a); a.m[0][3] = a1; a.m[1][3] = a2; a.m[2][3] = a3; color_matrix_multiply (m, &a, m); } void color_matrix_scale_components (ColorMatrix *m, double a1, double a2, double a3) { ColorMatrix a; color_matrix_set_identity (&a); a.m[0][0] = a1; a.m[1][1] = a2; a.m[2][2] = a3; color_matrix_multiply (m, &a, m); } void color_matrix_YCbCr_to_RGB (ColorMatrix *m, double Kr, double Kb) { double Kg = 1.0 - Kr - Kb; ColorMatrix k = { { {1., 0., 2*(1-Kr), 0.}, {1., -2*Kb*(1-Kb)/Kg, -2*Kr*(1-Kr)/Kg, 0.}, {1., 2*(1-Kb), 0., 0.}, {0., 0., 0., 1.}, } }; color_matrix_multiply (m, &k, m); } void color_matrix_RGB_to_YCbCr (ColorMatrix *m, double Kr, double Kb) { double Kg = 1.0 - Kr - Kb; ColorMatrix k; double x; k.m[0][0] = Kr; k.m[0][1] = Kg; k.m[0][2] = Kb; k.m[0][3] = 0; x = 1/(2*(1-Kb)); k.m[1][0] = -x*Kr; k.m[1][1] = -x*Kg; k.m[1][2] = x*(1-Kb); k.m[1][3] = 0; x = 1/(2*(1-Kr)); k.m[2][0] = x*(1-Kr); k.m[2][1] = -x*Kg; k.m[2][2] = -x*Kb; k.m[2][3] = 0; k.m[3][0] = 0; k.m[3][1] = 0; k.m[3][2] = 0; k.m[3][3] = 1; color_matrix_multiply (m, &k, m); } void color_matrix_build (ColorMatrix *dst) { #if 0 /* * At this point, everything is in YCbCr * All components are in the range [0,255] */ color_matrix_set_identity (dst); /* offset required to get input video black to (0.,0.,0.) */ color_matrix_offset_components (dst, -16, -128, -128); /* scale required to get input video black to (0.,0.,0.) */ color_matrix_scale_components (dst, (1/219.0), (1/224.0), (1/224.0)); /* colour matrix, YCbCr -> RGB */ /* Requires Y in [0,1.0], Cb&Cr in [-0.5,0.5] */ color_matrix_YCbCr_to_RGB (dst, 0.2990, 0.1140); // SD //color_matrix_YCbCr_to_RGB (dst, 0.2126, 0.0722); // HD /* * We are now in RGB space */ /* scale to output range. */ color_matrix_scale_components (dst, 255.0, 255.0, 255.0); #else color_matrix_set_identity (dst); color_matrix_scale_components (dst, (1/255.0), (1/255.0), (1/255.0)); color_matrix_RGB_to_YCbCr (dst, 0.2990, 0.1140); // SD //color_matrix_RGB_to_YCbCr (dst, 0.2126, 0.0722); // HD color_matrix_RGB_to_YCbCr (dst, 0.212, 0.087); // SMPTE 240M color_matrix_scale_components (dst, 219.0, 224.0, 224.0); color_matrix_offset_components (dst, 16, 128, 128); #endif } void color_matrix_apply_u8 (ColorMatrix *m, uint8_t *dest, uint8_t *src) { int i; for (i = 0; i < 3; i++) { double x = 0; x += m->m[i][0] * src[0]; x += m->m[i][1] * src[1]; x += m->m[i][2] * src[2]; x += m->m[i][3]; dest[i] = CLAMP(floor(x + 0.5),0,255); } } void color_matrix_apply_f64_u8 (ColorMatrix *m, double *dest, uint8_t *src) { int i; for (i = 0; i < 3; i++) { double x = 0; x += m->m[i][0] * src[0]; x += m->m[i][1] * src[1]; x += m->m[i][2] * src[2]; x += m->m[i][3]; dest[i] = CLAMP(floor(x + 0.5),0,255); //dest[i] = x; } } /* * SMPTE 170M * ========== * * NTSC, SD, 525 lines * * color primaries: * "SMPTE C set" * r 0.630 0.340 * g 0.310 0.595 * b 0.155 0.070 * w D65 * * "NTSC 1953" * r 0.67 0.33 * g 0.21 0.71 * b 0.14 0.08 * w D65 * * transfer function: * * LT= [(Vr + 0.099)/1.099]^(1/0.4500) for 0.0812 ≤ Vr ≤ 1 * LT = Vr/4.500 for 0 ≤ Vr < 0.0812 * * also defines SD SMPTE color bars */ /* * EBU 3213-E * ========== * * r 0.64 0.33 * g 0.29 0.60 * b 0.15 0.06 * w D65 * */ schroedinger-1.0.11/testsuite/bits.c0000644000175000017500000000303010735025462014325 00000000000000 #include #include void dump_bits (SchroBits *bits, int n) { int i; for(i=0;ibuffer->data[(i>>3)] >> (7 - (i&7))) & 1); } printf(" (%d bytes)\n", n); } int main (int argc, char *argv[]) { int i; SchroBuffer *buffer = schro_buffer_new_and_alloc (100); SchroBits *bits; int value; int fail = 0; int n; schro_init(); printf("unsigned int\n"); for(i=0;i<21;i++) { bits = schro_bits_new(); schro_bits_encode_init (bits, buffer); schro_bits_encode_uint(bits,i); schro_bits_flush (bits); n = schro_bits_get_offset (bits); schro_bits_free (bits); bits = schro_bits_new(); schro_bits_decode_init (bits, buffer); printf("%3d:", i); dump_bits (bits, n); value = schro_bits_decode_uint (bits); if (value != i) { printf("decode failed (%d != %d)\n", value, i); fail = 1; } schro_bits_free (bits); } printf("\n"); printf("signed int\n"); for(i=-5;i<6;i++) { bits = schro_bits_new(); schro_bits_encode_init (bits, buffer); schro_bits_encode_sint(bits,i); schro_bits_flush (bits); n = schro_bits_get_offset (bits); schro_bits_free (bits); bits = schro_bits_new(); schro_bits_decode_init (bits, buffer); printf("%3d:", i); dump_bits (bits, n); value = schro_bits_decode_sint (bits); if (value != i) { printf("decode failed (%d != %d)\n", value, i); fail = 1; } schro_bits_free (bits); } printf("\n"); return fail; } schroedinger-1.0.11/testsuite/Makefile.am0000664000175000017500000000761311707134275015274 00000000000000 SUBDIRS = . perf coder installation prototype streams tables2 dirac \ manual cache cuda opengl buildnoinstdir = $(libdir) buildnoinst_LTLIBRARIES = libschrotest.la noinst_PROGRAMS = arith arith_encode \ wavelet_2d \ phasecorrelation motion \ quant decode decode_coded_order decode_loop divide \ upsample \ motion2 sort fft \ wavelet_noise_gain \ wavelet_max_gain \ downsample taps ramp \ colorspace filter_coeff utils extension if HAVE_ORCC noinst_PROGRAMS += orc_test endif if ENABLE_ENCODER noinst_PROGRAMS += encode ssim wavelet_gain \ wavelet_gain_curve perceptual_weight perceptual_curves \ wavelet_noise_2d unpack abi endif noinst_HEADERS = common.h if BUILD_BROKEN_TESTS noinst_PROGRAMS += bits bits2 bits3 endif TESTS = arith encode wavelet_2d unpack downsample AM_CFLAGS = $(SCHRO_CFLAGS) $(ERROR_CFLAGS) $(ORC_CFLAGS) \ -DSCHRO_ENABLE_UNSTABLE_API LDADD = libschrotest.la $(SCHRO_LIBS) -lorc-test-0.4 $(ORC_LIBS) $(LIBM) libschrotest_la_SOURCES = common.c libschrotest_la_LIBADD = $(SCHRO_LIBS) $(ORC_LIBS) -lorc-test-0.4 $(LIBM) install-buildnoinstLTLIBRARIES: #arith_CFLAGS = $(SCHRO_CFLAGS) #arith_LDADD = $(SCHRO_LIBS) arith_SOURCES = arith.c #arith_encode_CFLAGS = $(SCHRO_CFLAGS) #arith_encode_LDADD = $(SCHRO_LIBS) arith_encode_SOURCES = arith_encode.c # arith_decode_CFLAGS = $(SCHRO_CFLAGS) # arith_decode_LDADD = $(SCHRO_LIBS) # arith_decode_SOURCES = arith_decode.c # arith_fixup_shift_CFLAGS = $(SCHRO_CFLAGS) # arith_fixup_shift_LDADD = $(SCHRO_LIBS) # arith_fixup_shift_SOURCES = arith_fixup_shift.c #bits_CFLAGS = $(SCHRO_CFLAGS) #bits_LDADD = $(SCHRO_LIBS) bits_SOURCES = bits.c #bits2_CFLAGS = $(SCHRO_CFLAGS) #bits2_LDADD = $(SCHRO_LIBS) bits2_SOURCES = bits2.c #codes_CFLAGS = $(SCHRO_CFLAGS) #codes_LDADD = $(SCHRO_LIBS) #codes_SOURCES = codes.c #encode_CFLAGS = $(SCHRO_CFLAGS) #encode_LDADD = $(SCHRO_LIBS) encode_SOURCES = encode.c #encode_big_CFLAGS = $(SCHRO_CFLAGS) #encode_big_LDADD = $(SCHRO_LIBS) #encode_big_SOURCES = encode_big.c #wavelet_CFLAGS = $(SCHRO_CFLAGS) #wavelet_LDADD = $(SCHRO_LIBS) #wavelet_SOURCES = wavelet.c wavelet_gain_SOURCES = wavelet_gain.c wavelet_noise_gain_SOURCES = wavelet_noise_gain.c wavelet_gain_curve_SOURCES = wavelet_gain_curve.c #wavelet2_CFLAGS = $(SCHRO_CFLAGS) #wavelet2_LDADD = $(SCHRO_LIBS) #wavelet2_SOURCES = wavelet2.c #wavelet_2d_CFLAGS = $(SCHRO_CFLAGS) #wavelet_2d_LDADD = $(SCHRO_LIBS) wavelet_2d_SOURCES = wavelet_2d.c nodist_wavelet_2d_SOURCES = $(top_srcdir)/schroedinger/tmp-orc.c wavelet_max_gain_SOURCES = wavelet_max_gain.c wavelet_noise_2d_SOURCES = wavelet_noise_2d.c #phasecorrelation_CFLAGS = $(SCHRO_CFLAGS) #phasecorrelation_LDADD = $(SCHRO_LIBS) -lm phasecorrelation_SOURCES = phasecorrelation.c #motion_CFLAGS = $(SCHRO_CFLAGS) #motion_LDADD = $(SCHRO_LIBS) motion_SOURCES = motion.c #motion2_CFLAGS = $(SCHRO_CFLAGS) #motion2_LDADD = $(SCHRO_LIBS) motion2_SOURCES = motion2.c #quant_CFLAGS = #quant_LDADD = -lm quant_SOURCES = quant.c nodist_quant_SOURCES = $(top_srcdir)/schroedinger/tmp-orc.c #sort_CFLAGS = $(SCHRO_CFLAGS) #sort_LDADD = $(SCHRO_LIBS) sort_SOURCES = sort.c #ssim_CFLAGS = $(SCHRO_CFLAGS) #ssim_LDADD = $(SCHRO_LIBS) ssim_SOURCES = ssim.c #fft_CFLAGS = $(SCHRO_CFLAGS) #fft_LDADD = $(SCHRO_LIBS) fft_SOURCES = fft.c perceptual_weight_SOURCES = perceptual_weight.c #perceptual_curves_CFLAGS = $(SCHRO_CFLAGS) #perceptual_curves_LDADD = $(SCHRO_LIBS) perceptual_curves_SOURCES = perceptual_curves.c orc_test_CFLAGS = $(ORC_CFLAGS) orc_test_LDADD = $(ORC_LIBS) -lorc-test-0.4 orc_test.c: $(top_srcdir)/schroedinger/schroorc.orc $(ORCC) --test -o $@ $< zzuf_test: zzuf -A -s0:10000 -r0.00001 -c -v ./decode test_stream.drc test-%.drc: num=`echo $@ | sed 's/test-\(.*\)\.drc/\1/'`; \ zzuf -A -s$$num -r0.00001 -c -v cat test_stream.drc >$@ zzuf_files: n=0; \ while [ $$n -lt 100 ] ; do \ zzuf -A -s$$n -r0.00001 -c -v cat test_stream.drc >test-$$n.drc; \ n=$$(($$n+1)); \ done schroedinger-1.0.11/testsuite/bits3.c0000644000175000017500000000257611161526031014416 00000000000000 #include #include #include #include int fail; void dump_bits (SchroBits *bits, int n) { int i; for(i=0;ibuffer->data[(i>>3)] >> (7 - (i&7))) & 1); } printf("\n"); } int test (void) { SchroBuffer *buffer = schro_buffer_new_and_alloc (300); SchroBits *bits; SchroBits bits2; int i; int chunk1; int chunk2; int ref[10]; int x; chunk1 = rand()&0x1f; bits = schro_bits_new (); schro_bits_encode_init (bits, buffer); for(i=0;i/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; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; skip=0; \ srcdir=$(srcdir); export srcdir; \ list=' $(TESTS) '; \ $(am__tty_colors); \ if test -n "$$list"; then \ for tst in $$list; do \ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ col=$$red; res=XPASS; \ ;; \ *) \ col=$$grn; res=PASS; \ ;; \ esac; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xfail=`expr $$xfail + 1`; \ col=$$lgn; res=XFAIL; \ ;; \ *) \ failed=`expr $$failed + 1`; \ col=$$red; res=FAIL; \ ;; \ esac; \ else \ skip=`expr $$skip + 1`; \ col=$$blu; res=SKIP; \ fi; \ echo "$${col}$$res$${std}: $$tst"; \ done; \ if test "$$all" -eq 1; then \ tests="test"; \ All=""; \ else \ tests="tests"; \ All="All "; \ fi; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ banner="$$All$$all $$tests passed"; \ else \ if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ banner="$$failed of $$all $$tests failed"; \ else \ if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ fi; \ fi; \ dashes="$$banner"; \ skipped=""; \ if test "$$skip" -ne 0; then \ if test "$$skip" -eq 1; then \ skipped="($$skip test was not run)"; \ else \ skipped="($$skip tests were not run)"; \ fi; \ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$skipped"; \ fi; \ report=""; \ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ report="Please report to $(PACKAGE_BUGREPORT)"; \ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$report"; \ fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ if test "$$failed" -eq 0; then \ echo "$$grn$$dashes"; \ else \ echo "$$red$$dashes"; \ fi; \ echo "$$banner"; \ test -z "$$skipped" || echo "$$skipped"; \ test -z "$$report" || echo "$$report"; \ echo "$$dashes$$std"; \ test "$$failed" -eq 0; \ else :; fi 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 \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ 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 $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-recursive all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(HEADERS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(buildnoinstdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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-buildnoinstLTLIBRARIES clean-generic clean-libtool \ clean-noinstPROGRAMS mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-buildnoinstLTLIBRARIES 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 -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-buildnoinstLTLIBRARIES .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) check-am \ ctags-recursive install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-TESTS check-am clean \ clean-buildnoinstLTLIBRARIES clean-generic clean-libtool \ clean-noinstPROGRAMS ctags ctags-recursive distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-buildnoinstLTLIBRARIES 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-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-recursive uninstall uninstall-am \ uninstall-buildnoinstLTLIBRARIES install-buildnoinstLTLIBRARIES: orc_test.c: $(top_srcdir)/schroedinger/schroorc.orc $(ORCC) --test -o $@ $< zzuf_test: zzuf -A -s0:10000 -r0.00001 -c -v ./decode test_stream.drc test-%.drc: num=`echo $@ | sed 's/test-\(.*\)\.drc/\1/'`; \ zzuf -A -s$$num -r0.00001 -c -v cat test_stream.drc >$@ zzuf_files: n=0; \ while [ $$n -lt 100 ] ; do \ zzuf -A -s$$n -r0.00001 -c -v cat test_stream.drc >test-$$n.drc; \ n=$$(($$n+1)); \ done # 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: schroedinger-1.0.11/testsuite/encode.c0000644000175000017500000000407411541755167014642 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include static void frame_free (SchroFrame *frame, void *priv) { free (priv); } static void test (int w, int h) { int size; uint8_t *picture; SchroEncoder *encoder; SchroBuffer *buffer; SchroFrame *frame; SchroVideoFormat *format; int n_frames; int go; encoder = schro_encoder_new(); format = schro_encoder_get_video_format(encoder); format->width = w; format->height = h; format->clean_width = w; format->clean_height = h; format->left_offset = 0; format->top_offset = 0; schro_encoder_set_video_format (encoder, format); free (format); schro_encoder_start (encoder); size = ROUND_UP_4 (w) * ROUND_UP_2 (h); size += (ROUND_UP_8 (w)/2) * (ROUND_UP_2 (h)/2); size += (ROUND_UP_8 (w)/2) * (ROUND_UP_2 (h)/2); n_frames = 0; go = 1; while (go) { int x; switch (schro_encoder_wait (encoder)) { case SCHRO_STATE_NEED_FRAME: if (n_frames < 100) { //SCHRO_ERROR("frame %d", n_frames); picture = malloc(size); memset (picture, 128, size); frame = schro_frame_new_from_data_I420 (picture, w, h); schro_frame_set_free_callback (frame, frame_free, picture); schro_encoder_push_frame (encoder, frame); n_frames++; } else { schro_encoder_end_of_stream (encoder); } break; case SCHRO_STATE_HAVE_BUFFER: buffer = schro_encoder_pull (encoder, &x); //printf("%d\n", x); schro_buffer_unref (buffer); break; case SCHRO_STATE_AGAIN: break; case SCHRO_STATE_END_OF_STREAM: go = 0; break; default: break; } } schro_encoder_free (encoder); } #define SIZE 128 int main (int argc, char *argv[]) { int h, w; schro_init(); test(853,480); if (0) { for(w=SIZE;w #include #include #include #include #include #include int main (int argc, char *argv[]) { SchroFrame *dest; SchroFrame *ref; SchroFrame *addframe; SchroUpsampledFrame *uref; SchroParams params; SchroVideoFormat video_format; SchroMotionVector *motion_vectors; int i; int j; OrcProfile prof; double ave, std; schro_init(); memset (&video_format, 0, sizeof(video_format)); memset (¶ms, 0, sizeof(params)); schro_video_format_set_std_video_format (&video_format, SCHRO_VIDEO_FORMAT_CUSTOM); video_format.width = 720; video_format.height = 480; video_format.chroma_format = SCHRO_CHROMA_420; schro_video_format_validate (&video_format); params.video_format = &video_format; params.xbsep_luma = 8; params.ybsep_luma = 8; params.xblen_luma = 12; params.yblen_luma = 12; schro_params_calculate_mc_sizes(¶ms); dest = schro_frame_new_and_alloc (NULL, SCHRO_FRAME_FORMAT_S16_420, video_format.width, video_format.height); schro_frame_clear(dest); ref = schro_frame_new_and_alloc_extended (NULL, SCHRO_FRAME_FORMAT_U8_420, video_format.width, video_format.height, 32); schro_frame_clear(ref); addframe = schro_frame_new_and_alloc (NULL, SCHRO_FRAME_FORMAT_S16_420, video_format.width, video_format.height); schro_frame_clear(addframe); uref = schro_upsampled_frame_new (ref); schro_upsampled_frame_upsample (uref); motion_vectors = malloc(sizeof(SchroMotionVector) * params.x_num_blocks * params.y_num_blocks); memset (motion_vectors, 0, sizeof(SchroMotionVector) * params.x_num_blocks * params.y_num_blocks); printf("sizeof(SchroMotionVector) = %lu\n",(unsigned long) sizeof(SchroMotionVector)); printf("num blocks %d x %d\n", params.x_num_blocks, params.y_num_blocks); for(i=0;imotion_vectors; motion->motion_vectors = motion_vectors; orc_profile_start(&prof); schro_motion_render (motion, dest, addframe, FALSE, NULL); orc_profile_stop(&prof); motion->motion_vectors = mv_save; schro_motion_free (motion); } orc_profile_get_ave_std (&prof, &ave, &std); printf("cycles %g %g\n", ave, std); } schro_upsampled_frame_free (uref); schro_frame_unref (dest); free (motion_vectors); return 0; } schroedinger-1.0.11/testsuite/orc_test.c0000644000175000017500000154444011703750711015224 00000000000000 /* autogenerated from schroorc.orc */ #include #include #include #include #ifndef _ORC_INTEGER_TYPEDEFS_ #define _ORC_INTEGER_TYPEDEFS_ #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #include typedef int8_t orc_int8; typedef int16_t orc_int16; typedef int32_t orc_int32; typedef int64_t orc_int64; typedef uint8_t orc_uint8; typedef uint16_t orc_uint16; typedef uint32_t orc_uint32; typedef uint64_t orc_uint64; #define ORC_UINT64_C(x) UINT64_C(x) #elif defined(_MSC_VER) typedef signed __int8 orc_int8; typedef signed __int16 orc_int16; typedef signed __int32 orc_int32; typedef signed __int64 orc_int64; typedef unsigned __int8 orc_uint8; typedef unsigned __int16 orc_uint16; typedef unsigned __int32 orc_uint32; typedef unsigned __int64 orc_uint64; #define ORC_UINT64_C(x) (x##Ui64) #define inline __inline #else #include typedef signed char orc_int8; typedef short orc_int16; typedef int orc_int32; typedef unsigned char orc_uint8; typedef unsigned short orc_uint16; typedef unsigned int orc_uint32; #if INT_MAX == LONG_MAX typedef long long orc_int64; typedef unsigned long long orc_uint64; #define ORC_UINT64_C(x) (x##ULL) #else typedef long orc_int64; typedef unsigned long orc_uint64; #define ORC_UINT64_C(x) (x##UL) #endif #endif typedef union { orc_int16 i; orc_int8 x2[2]; } orc_union16; typedef union { orc_int32 i; float f; orc_int16 x2[2]; orc_int8 x4[4]; } orc_union32; typedef union { orc_int64 i; double f; orc_int32 x2[2]; float x2f[2]; orc_int16 x4[4]; } orc_union64; #endif #ifndef ORC_RESTRICT #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define ORC_RESTRICT restrict #elif defined(__GNUC__) && __GNUC__ >= 4 #define ORC_RESTRICT __restrict__ #else #define ORC_RESTRICT #endif #endif #include #include /* begin Orc C target preamble */ #define ORC_CLAMP(x,a,b) ((x)<(a) ? (a) : ((x)>(b) ? (b) : (x))) #define ORC_ABS(a) ((a)<0 ? -(a) : (a)) #define ORC_MIN(a,b) ((a)<(b) ? (a) : (b)) #define ORC_MAX(a,b) ((a)>(b) ? (a) : (b)) #define ORC_SB_MAX 127 #define ORC_SB_MIN (-1-ORC_SB_MAX) #define ORC_UB_MAX 255 #define ORC_UB_MIN 0 #define ORC_SW_MAX 32767 #define ORC_SW_MIN (-1-ORC_SW_MAX) #define ORC_UW_MAX 65535 #define ORC_UW_MIN 0 #define ORC_SL_MAX 2147483647 #define ORC_SL_MIN (-1-ORC_SL_MAX) #define ORC_UL_MAX 4294967295U #define ORC_UL_MIN 0 #define ORC_CLAMP_SB(x) ORC_CLAMP(x,ORC_SB_MIN,ORC_SB_MAX) #define ORC_CLAMP_UB(x) ORC_CLAMP(x,ORC_UB_MIN,ORC_UB_MAX) #define ORC_CLAMP_SW(x) ORC_CLAMP(x,ORC_SW_MIN,ORC_SW_MAX) #define ORC_CLAMP_UW(x) ORC_CLAMP(x,ORC_UW_MIN,ORC_UW_MAX) #define ORC_CLAMP_SL(x) ORC_CLAMP(x,ORC_SL_MIN,ORC_SL_MAX) #define ORC_CLAMP_UL(x) ORC_CLAMP(x,ORC_UL_MIN,ORC_UL_MAX) #define ORC_SWAP_W(x) ((((x)&0xff)<<8) | (((x)&0xff00)>>8)) #define ORC_SWAP_L(x) ((((x)&0xff)<<24) | (((x)&0xff00)<<8) | (((x)&0xff0000)>>8) | (((x)&0xff000000)>>24)) #define ORC_SWAP_Q(x) ((((x)&ORC_UINT64_C(0xff))<<56) | (((x)&ORC_UINT64_C(0xff00))<<40) | (((x)&ORC_UINT64_C(0xff0000))<<24) | (((x)&ORC_UINT64_C(0xff000000))<<8) | (((x)&ORC_UINT64_C(0xff00000000))>>8) | (((x)&ORC_UINT64_C(0xff0000000000))>>24) | (((x)&ORC_UINT64_C(0xff000000000000))>>40) | (((x)&ORC_UINT64_C(0xff00000000000000))>>56)) #define ORC_PTR_OFFSET(ptr,offset) ((void *)(((unsigned char *)(ptr)) + (offset))) #define ORC_DENORMAL(x) ((x) & ((((x)&0x7f800000) == 0) ? 0xff800000 : 0xffffffff)) #define ORC_ISNAN(x) ((((x)&0x7f800000) == 0x7f800000) && (((x)&0x007fffff) != 0)) #define ORC_DENORMAL_DOUBLE(x) ((x) & ((((x)&ORC_UINT64_C(0x7ff0000000000000)) == 0) ? ORC_UINT64_C(0xfff0000000000000) : ORC_UINT64_C(0xffffffffffffffff))) #define ORC_ISNAN_DOUBLE(x) ((((x)&ORC_UINT64_C(0x7ff0000000000000)) == ORC_UINT64_C(0x7ff0000000000000)) && (((x)&ORC_UINT64_C(0x000fffffffffffff)) != 0)) #ifndef ORC_RESTRICT #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define ORC_RESTRICT restrict #elif defined(__GNUC__) && __GNUC__ >= 4 #define ORC_RESTRICT __restrict__ #else #define ORC_RESTRICT #endif #endif /* end Orc C target preamble */ /* orc_add2_rshift_add_s16_22_vert */ static void _backup_orc_add2_rshift_add_s16_22_vert (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; /* 3: loadpw */ var35.i = (int)0x00000002; /* 2 or 9.88131e-324f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 1: loadw */ var34 = ptr5[i]; /* 2: addw */ var38.i = var33.i + var34.i; /* 4: addw */ var39.i = var38.i + var35.i; /* 5: shrsw */ var40.i = var39.i >> 2; /* 6: loadw */ var36 = ptr0[i]; /* 7: addw */ var37.i = var36.i + var40.i; /* 8: storew */ ptr0[i] = var37; } } /* orc_add2_rshift_add_s32_22_vert */ static void _backup_orc_add2_rshift_add_s32_22_vert (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var33; orc_union32 var34; orc_union32 var35; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; ptr5 = (orc_union32 *)ex->arrays[5]; /* 3: loadpl */ var35.i = (int)0x00000002; /* 2 or 9.88131e-324f */ for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr4[i]; /* 1: loadl */ var34 = ptr5[i]; /* 2: addl */ var38.i = var33.i + var34.i; /* 4: addl */ var39.i = var38.i + var35.i; /* 5: shrsl */ var40.i = var39.i >> 2; /* 6: loadl */ var36 = ptr0[i]; /* 7: addl */ var37.i = var36.i + var40.i; /* 8: storel */ ptr0[i] = var37; } } /* orc_add2_rshift_add_s16_22 */ static void _backup_orc_add2_rshift_add_s16_22 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; /* 3: loadpw */ var34.i = (int)0x00000002; /* 2 or 9.88131e-324f */ for (i = 0; i < n; i++) { /* 0: loadoffw */ var37 = ptr4[i + 1]; /* 1: loadw */ var33 = ptr4[i]; /* 2: addw */ var38.i = var33.i + var37.i; /* 4: addw */ var39.i = var38.i + var34.i; /* 5: shrsw */ var40.i = var39.i >> 2; /* 6: loadw */ var35 = ptr0[i]; /* 7: addw */ var36.i = var35.i + var40.i; /* 8: storew */ ptr0[i] = var36; } } /* orc_add2_rshift_add_s32_22 */ static void _backup_orc_add2_rshift_add_s32_22 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var33; orc_union32 var34; orc_union32 var35; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; /* 3: loadpl */ var34.i = (int)0x00000002; /* 2 or 9.88131e-324f */ for (i = 0; i < n; i++) { /* 0: loadoffl */ var37 = ptr4[i + 1]; /* 1: loadl */ var33 = ptr4[i]; /* 2: addl */ var38.i = var33.i + var37.i; /* 4: addl */ var39.i = var38.i + var34.i; /* 5: shrsl */ var40.i = var39.i >> 2; /* 6: loadl */ var35 = ptr0[i]; /* 7: addl */ var36.i = var35.i + var40.i; /* 8: storel */ ptr0[i] = var36; } } /* orc_add2_rshift_sub_s16_22_vert */ static void _backup_orc_add2_rshift_sub_s16_22_vert (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; /* 3: loadpw */ var35.i = (int)0x00000002; /* 2 or 9.88131e-324f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 1: loadw */ var34 = ptr5[i]; /* 2: addw */ var38.i = var33.i + var34.i; /* 4: addw */ var39.i = var38.i + var35.i; /* 5: shrsw */ var40.i = var39.i >> 2; /* 6: loadw */ var36 = ptr0[i]; /* 7: subw */ var37.i = var36.i - var40.i; /* 8: storew */ ptr0[i] = var37; } } /* orc_add2_rshift_sub_s16_22 */ static void _backup_orc_add2_rshift_sub_s16_22 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; /* 3: loadpw */ var34.i = (int)0x00000002; /* 2 or 9.88131e-324f */ for (i = 0; i < n; i++) { /* 0: loadoffw */ var37 = ptr4[i + 1]; /* 1: loadw */ var33 = ptr4[i]; /* 2: addw */ var38.i = var33.i + var37.i; /* 4: addw */ var39.i = var38.i + var34.i; /* 5: shrsw */ var40.i = var39.i >> 2; /* 6: loadw */ var35 = ptr0[i]; /* 7: subw */ var36.i = var35.i - var40.i; /* 8: storew */ ptr0[i] = var36; } } /* orc_add2_rshift_add_s16_11_op */ static void _backup_orc_add2_rshift_add_s16_11_op (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; ptr6 = (orc_union16 *)ex->arrays[6]; for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr5[i]; /* 1: loadw */ var34 = ptr6[i]; /* 2: avgsw */ var37.i = (var33.i + var34.i + 1)>>1; /* 3: loadw */ var35 = ptr4[i]; /* 4: addw */ var36.i = var35.i + var37.i; /* 5: storew */ ptr0[i] = var36; } } /* orc_add2_rshift_add_s16_11 */ static void _backup_orc_add2_rshift_add_s16_11 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadoffw */ var36 = ptr4[i + 1]; /* 1: loadw */ var33 = ptr4[i]; /* 2: avgsw */ var37.i = (var33.i + var36.i + 1)>>1; /* 3: loadw */ var34 = ptr0[i]; /* 4: addw */ var35.i = var34.i + var37.i; /* 5: storew */ ptr0[i] = var35; } } /* orc_add2_rshift_sub_s16_11_vert */ static void _backup_orc_add2_rshift_sub_s16_11_vert (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 1: loadw */ var34 = ptr5[i]; /* 2: avgsw */ var37.i = (var33.i + var34.i + 1)>>1; /* 3: loadw */ var35 = ptr0[i]; /* 4: subw */ var36.i = var35.i - var37.i; /* 5: storew */ ptr0[i] = var36; } } /* orc_add2_rshift_sub_s32_11_vert */ static void _backup_orc_add2_rshift_sub_s32_11_vert (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var33; orc_union32 var34; orc_union32 var35; orc_union32 var36; orc_union32 var37; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; ptr5 = (orc_union32 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr4[i]; /* 1: loadl */ var34 = ptr5[i]; /* 2: avgsl */ var37.i = ((orc_int64)var33.i + (orc_int64)var34.i + 1)>>1; /* 3: loadl */ var35 = ptr0[i]; /* 4: subl */ var36.i = var35.i - var37.i; /* 5: storel */ ptr0[i] = var36; } } /* orc_add2_rshift_sub_s16_11 */ static void _backup_orc_add2_rshift_sub_s16_11 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadoffw */ var36 = ptr4[i + 1]; /* 1: loadw */ var33 = ptr4[i]; /* 2: avgsw */ var37.i = (var33.i + var36.i + 1)>>1; /* 3: loadw */ var34 = ptr0[i]; /* 4: subw */ var35.i = var34.i - var37.i; /* 5: storew */ ptr0[i] = var35; } } /* orc_add2_rshift_sub_s32_11 */ static void _backup_orc_add2_rshift_sub_s32_11 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var33; orc_union32 var34; orc_union32 var35; orc_union32 var36; orc_union32 var37; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadoffl */ var36 = ptr4[i + 1]; /* 1: loadl */ var33 = ptr4[i]; /* 2: avgsl */ var37.i = ((orc_int64)var33.i + (orc_int64)var36.i + 1)>>1; /* 3: loadl */ var34 = ptr0[i]; /* 4: subl */ var35.i = var34.i - var37.i; /* 5: storel */ ptr0[i] = var35; } } /* orc_add_const_rshift_s16_11 */ static void _backup_orc_add_const_rshift_s16_11 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; /* 1: loadpw */ var34.i = (int)0x00000001; /* 1 or 4.94066e-324f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 2: addw */ var36.i = var33.i + var34.i; /* 3: shrsw */ var35.i = var36.i >> 1; /* 4: storew */ ptr0[i] = var35; } } /* orc_add_const_rshift_s16 */ static void _backup_orc_add_const_rshift_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; ptr0 = (orc_union16 *)ex->arrays[0]; /* 1: loadpw */ var34.i = ex->params[24]; for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr0[i]; /* 2: addw */ var36.i = var33.i + var34.i; /* 3: shrsw */ var35.i = var36.i >> ex->params[25]; /* 4: storew */ ptr0[i] = var35; } } /* orc_add_const_rshift_s32 */ static void _backup_orc_add_const_rshift_s32 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; orc_union32 var33; orc_union32 var34; orc_union32 var35; orc_union32 var36; ptr0 = (orc_union32 *)ex->arrays[0]; /* 1: loadpl */ var34.i = ex->params[24]; for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr0[i]; /* 2: addl */ var36.i = var33.i + var34.i; /* 3: shrsl */ var35.i = var36.i >> ex->params[25]; /* 4: storel */ ptr0[i] = var35; } } /* orc_add_s16 */ static void _backup_orc_add_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: loadw */ var33 = ptr5[i]; /* 2: addw */ var34.i = var32.i + var33.i; /* 3: storew */ ptr0[i] = var34; } } /* orc_add_s16_2d */ static void _backup_orc_add_s16_2d (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_union16 var33; orc_union16 var34; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr0[i]; /* 1: loadw */ var33 = ptr4[i]; /* 2: addw */ var34.i = var32.i + var33.i; /* 3: storew */ ptr0[i] = var34; } } } /* orc_addc_rshift_s16 */ static void _backup_orc_addc_rshift_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 1: loadw */ var34 = ptr5[i]; /* 2: addw */ var36.i = var33.i + var34.i; /* 3: shrsw */ var35.i = var36.i >> ex->params[24]; /* 4: storew */ ptr0[i] = var35; } } /* orc_lshift1_s16 */ static void _backup_orc_lshift1_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_union16 var33; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: shlw */ var33.i = var32.i << 1; /* 2: storew */ ptr0[i] = var33; } } /* orc_lshift2_s16 */ static void _backup_orc_lshift2_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_union16 var33; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: shlw */ var33.i = var32.i << 2; /* 2: storew */ ptr0[i] = var33; } } /* orc_lshift_s16_ip */ static void _backup_orc_lshift_s16_ip (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var32; orc_union16 var33; ptr0 = (orc_union16 *)ex->arrays[0]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr0[i]; /* 1: shlw */ var33.i = var32.i << ex->params[24]; /* 2: storew */ ptr0[i] = var33; } } /* orc_lshift_s32_ip */ static void _backup_orc_lshift_s32_ip (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; orc_union32 var32; orc_union32 var33; ptr0 = (orc_union32 *)ex->arrays[0]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr0[i]; /* 1: shll */ var33.i = var32.i << ex->params[24]; /* 2: storel */ ptr0[i] = var33; } } /* orc_mas2_add_s16_op */ static void _backup_orc_mas2_add_s16_op (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union32 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; orc_union16 var44; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; ptr6 = (orc_union16 *)ex->arrays[6]; /* 3: loadpw */ var36.i = ex->params[24]; /* 5: loadpl */ var37.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr5[i]; /* 1: loadw */ var35 = ptr6[i]; /* 2: addw */ var40.i = var34.i + var35.i; /* 4: mulswl */ var41.i = var40.i * var36.i; /* 6: addl */ var42.i = var41.i + var37.i; /* 7: shrsl */ var43.i = var42.i >> ex->params[26]; /* 8: convlw */ var44.i = var43.i; /* 9: loadw */ var38 = ptr4[i]; /* 10: addw */ var39.i = var38.i + var44.i; /* 11: storew */ ptr0[i] = var39; } } /* orc_mas2_add_s16_ip */ static void _backup_orc_mas2_add_s16_ip (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var34; orc_union16 var35; orc_union32 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; orc_union16 var44; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; /* 3: loadpw */ var35.i = ex->params[24]; /* 5: loadpl */ var36.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadoffw */ var39 = ptr4[i + 1]; /* 1: loadw */ var34 = ptr4[i]; /* 2: addw */ var40.i = var34.i + var39.i; /* 4: mulswl */ var41.i = var40.i * var35.i; /* 6: addl */ var42.i = var41.i + var36.i; /* 7: shrsl */ var43.i = var42.i >> ex->params[26]; /* 8: convlw */ var44.i = var43.i; /* 9: loadw */ var37 = ptr0[i]; /* 10: addw */ var38.i = var37.i + var44.i; /* 11: storew */ ptr0[i] = var38; } } /* orc_mas2_sub_s16_op */ static void _backup_orc_mas2_sub_s16_op (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union32 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; orc_union16 var44; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; ptr6 = (orc_union16 *)ex->arrays[6]; /* 3: loadpw */ var36.i = ex->params[24]; /* 5: loadpl */ var37.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr5[i]; /* 1: loadw */ var35 = ptr6[i]; /* 2: addw */ var40.i = var34.i + var35.i; /* 4: mulswl */ var41.i = var40.i * var36.i; /* 6: addl */ var42.i = var41.i + var37.i; /* 7: shrsl */ var43.i = var42.i >> ex->params[26]; /* 8: convlw */ var44.i = var43.i; /* 9: loadw */ var38 = ptr4[i]; /* 10: subw */ var39.i = var38.i - var44.i; /* 11: storew */ ptr0[i] = var39; } } /* orc_mas2_sub_s16_ip */ static void _backup_orc_mas2_sub_s16_ip (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var34; orc_union16 var35; orc_union32 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; orc_union16 var44; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; /* 3: loadpw */ var35.i = ex->params[24]; /* 5: loadpl */ var36.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadoffw */ var39 = ptr4[i + 1]; /* 1: loadw */ var34 = ptr4[i]; /* 2: addw */ var40.i = var34.i + var39.i; /* 4: mulswl */ var41.i = var40.i * var35.i; /* 6: addl */ var42.i = var41.i + var36.i; /* 7: shrsl */ var43.i = var42.i >> ex->params[26]; /* 8: convlw */ var44.i = var43.i; /* 9: loadw */ var37 = ptr0[i]; /* 10: subw */ var38.i = var37.i - var44.i; /* 11: storew */ ptr0[i] = var38; } } /* orc_mas4_vert_add_s16_1991 */ static void _backup_orc_mas4_vert_add_s16_1991 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; const orc_union16 * ORC_RESTRICT ptr7; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union32 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union32 var45; orc_union16 var46; orc_union32 var47; orc_union32 var48; orc_union32 var49; orc_union32 var50; orc_union16 var51; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; ptr6 = (orc_union16 *)ex->arrays[6]; ptr7 = (orc_union16 *)ex->arrays[7]; /* 3: loadpw */ var38.i = (int)0x00000009; /* 9 or 4.44659e-323f */ /* 10: loadpl */ var41.i = ex->params[24]; for (i = 0; i < n; i++) { /* 0: loadw */ var36 = ptr5[i]; /* 1: loadw */ var37 = ptr6[i]; /* 2: addw */ var44.i = var36.i + var37.i; /* 4: mulswl */ var45.i = var44.i * var38.i; /* 5: loadw */ var39 = ptr4[i]; /* 6: loadw */ var40 = ptr7[i]; /* 7: addw */ var46.i = var39.i + var40.i; /* 8: convswl */ var47.i = var46.i; /* 9: subl */ var48.i = var45.i - var47.i; /* 11: addl */ var49.i = var48.i + var41.i; /* 12: shrsl */ var50.i = var49.i >> ex->params[25]; /* 13: convlw */ var51.i = var50.i; /* 14: loadw */ var42 = ptr0[i]; /* 15: addw */ var43.i = var42.i + var51.i; /* 16: storew */ ptr0[i] = var43; } } /* orc_mas4_vert_add_s32_1991 */ static void _backup_orc_mas4_vert_add_s32_1991 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; const orc_union32 * ORC_RESTRICT ptr6; const orc_union32 * ORC_RESTRICT ptr7; orc_union32 var35; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; orc_union32 var44; orc_union32 var45; orc_union32 var46; orc_union32 var47; orc_union32 var48; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; ptr5 = (orc_union32 *)ex->arrays[5]; ptr6 = (orc_union32 *)ex->arrays[6]; ptr7 = (orc_union32 *)ex->arrays[7]; /* 3: loadpl */ var37.i = (int)0x00000009; /* 9 or 4.44659e-323f */ /* 9: loadpl */ var40.i = ex->params[24]; for (i = 0; i < n; i++) { /* 0: loadl */ var35 = ptr5[i]; /* 1: loadl */ var36 = ptr6[i]; /* 2: addl */ var43.i = var35.i + var36.i; /* 4: mulll */ var44.i = (var43.i * var37.i) & 0xffffffff; /* 5: loadl */ var38 = ptr4[i]; /* 6: loadl */ var39 = ptr7[i]; /* 7: addl */ var45.i = var38.i + var39.i; /* 8: subl */ var46.i = var44.i - var45.i; /* 10: addl */ var47.i = var46.i + var40.i; /* 11: shrsl */ var48.i = var47.i >> ex->params[25]; /* 12: loadl */ var41 = ptr0[i]; /* 13: addl */ var42.i = var41.i + var48.i; /* 14: storel */ ptr0[i] = var42; } } /* orc_mas4_horiz_add_s16_1991_ip */ static void _backup_orc_mas4_horiz_add_s16_1991_ip (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var36; orc_union32 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union32 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union32 var47; orc_union32 var48; orc_union32 var49; orc_union32 var50; orc_union16 var51; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; /* 3: loadpw */ var36.i = (int)0x00000009; /* 9 or 4.44659e-323f */ /* 10: loadpl */ var37.i = ex->params[24]; for (i = 0; i < n; i++) { /* 0: loadoffw */ var40 = ptr4[i + 1]; /* 1: loadoffw */ var41 = ptr4[i + 2]; /* 2: addw */ var42.i = var40.i + var41.i; /* 4: mulswl */ var43.i = var42.i * var36.i; /* 5: loadw */ var44 = ptr4[i]; /* 6: loadoffw */ var45 = ptr4[i + 3]; /* 7: addw */ var46.i = var44.i + var45.i; /* 8: convswl */ var47.i = var46.i; /* 9: subl */ var48.i = var43.i - var47.i; /* 11: addl */ var49.i = var48.i + var37.i; /* 12: shrsl */ var50.i = var49.i >> ex->params[25]; /* 13: convlw */ var51.i = var50.i; /* 14: loadw */ var38 = ptr0[i]; /* 15: addw */ var39.i = var38.i + var51.i; /* 16: storew */ ptr0[i] = var39; } } /* orc_mas4_vert_sub_s16_1991 */ static void _backup_orc_mas4_vert_sub_s16_1991 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; const orc_union16 * ORC_RESTRICT ptr7; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union32 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union32 var45; orc_union16 var46; orc_union32 var47; orc_union32 var48; orc_union32 var49; orc_union32 var50; orc_union16 var51; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; ptr6 = (orc_union16 *)ex->arrays[6]; ptr7 = (orc_union16 *)ex->arrays[7]; /* 3: loadpw */ var38.i = (int)0x00000009; /* 9 or 4.44659e-323f */ /* 10: loadpl */ var41.i = ex->params[24]; for (i = 0; i < n; i++) { /* 0: loadw */ var36 = ptr5[i]; /* 1: loadw */ var37 = ptr6[i]; /* 2: addw */ var44.i = var36.i + var37.i; /* 4: mulswl */ var45.i = var44.i * var38.i; /* 5: loadw */ var39 = ptr4[i]; /* 6: loadw */ var40 = ptr7[i]; /* 7: addw */ var46.i = var39.i + var40.i; /* 8: convswl */ var47.i = var46.i; /* 9: subl */ var48.i = var45.i - var47.i; /* 11: addl */ var49.i = var48.i + var41.i; /* 12: shrsl */ var50.i = var49.i >> ex->params[25]; /* 13: convlw */ var51.i = var50.i; /* 14: loadw */ var42 = ptr0[i]; /* 15: subw */ var43.i = var42.i - var51.i; /* 16: storew */ ptr0[i] = var43; } } /* orc_mas4_horiz_sub_s16_1991_ip */ static void _backup_orc_mas4_horiz_sub_s16_1991_ip (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var36; orc_union32 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union32 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union32 var47; orc_union32 var48; orc_union32 var49; orc_union32 var50; orc_union16 var51; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; /* 3: loadpw */ var36.i = (int)0x00000009; /* 9 or 4.44659e-323f */ /* 10: loadpl */ var37.i = ex->params[24]; for (i = 0; i < n; i++) { /* 0: loadoffw */ var40 = ptr4[i + 1]; /* 1: loadoffw */ var41 = ptr4[i + 2]; /* 2: addw */ var42.i = var40.i + var41.i; /* 4: mulswl */ var43.i = var42.i * var36.i; /* 5: loadw */ var44 = ptr4[i]; /* 6: loadoffw */ var45 = ptr4[i + 3]; /* 7: addw */ var46.i = var44.i + var45.i; /* 8: convswl */ var47.i = var46.i; /* 9: subl */ var48.i = var43.i - var47.i; /* 11: addl */ var49.i = var48.i + var37.i; /* 12: shrsl */ var50.i = var49.i >> ex->params[25]; /* 13: convlw */ var51.i = var50.i; /* 14: loadw */ var38 = ptr0[i]; /* 15: subw */ var39.i = var38.i - var51.i; /* 16: storew */ ptr0[i] = var39; } } /* orc_subtract_s16 */ static void _backup_orc_subtract_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: loadw */ var33 = ptr5[i]; /* 2: subw */ var34.i = var32.i - var33.i; /* 3: storew */ ptr0[i] = var34; } } /* orc_add_s16_u8 */ static void _backup_orc_add_s16_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_int8 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadb */ var33 = ptr5[i]; /* 1: convubw */ var36.i = (orc_uint8)var33; /* 2: loadw */ var34 = ptr4[i]; /* 3: addw */ var35.i = var36.i + var34.i; /* 4: storew */ ptr0[i] = var35; } } /* orc_add_s16_u8_2d */ static void _backup_orc_add_s16_u8_2d (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); for (i = 0; i < n; i++) { /* 0: loadb */ var33 = ptr4[i]; /* 1: convubw */ var36.i = (orc_uint8)var33; /* 2: loadw */ var34 = ptr0[i]; /* 3: addw */ var35.i = var34.i + var36.i; /* 4: storew */ ptr0[i] = var35; } } } /* orc_convert_s16_u8 */ static void _backup_orc_convert_s16_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var32; orc_union16 var33; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_int8 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: convubw */ var33.i = (orc_uint8)var32; /* 2: storew */ ptr0[i] = var33; } } /* orc_convert_s16_s32 */ static void _backup_orc_convert_s16_s32 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var32; orc_union16 var33; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: convlw */ var33.i = var32.i; /* 2: storew */ ptr0[i] = var33; } } /* orc_convert_u8_s16 */ static void _backup_orc_convert_u8_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_int8 var33; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: convsuswb */ var33 = ORC_CLAMP_UB(var32.i); /* 2: storeb */ ptr0[i] = var33; } } /* orc_convert_s32_s16 */ static void _backup_orc_convert_s32_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_union32 var33; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: convswl */ var33.i = var32.i; /* 2: storel */ ptr0[i] = var33; } } /* orc_offsetconvert_u8_s16 */ static void _backup_orc_offsetconvert_u8_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var33; orc_union16 var34; orc_int8 var35; orc_union16 var36; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; /* 1: loadpw */ var34.i = (int)0x00000080; /* 128 or 6.32404e-322f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 2: addw */ var36.i = var33.i + var34.i; /* 3: convsuswb */ var35 = ORC_CLAMP_UB(var36.i); /* 4: storeb */ ptr0[i] = var35; } } /* orc_offsetconvert_u8_s32 */ static void _backup_orc_offsetconvert_u8_s32 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var34; orc_union32 var35; orc_int8 var36; orc_union32 var37; orc_union16 var38; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; /* 1: loadpl */ var35.i = (int)0x00000080; /* 128 or 6.32404e-322f */ for (i = 0; i < n; i++) { /* 0: loadl */ var34 = ptr4[i]; /* 2: addl */ var37.i = var34.i + var35.i; /* 3: convsuslw */ var38.i = ORC_CLAMP_UW(var37.i); /* 4: convsuswb */ var36 = ORC_CLAMP_UB(var38.i); /* 5: storeb */ ptr0[i] = var36; } } /* orc_offsetconvert_s16_u8 */ static void _backup_orc_offsetconvert_s16_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_int8 *)ex->arrays[4]; /* 2: loadpw */ var34.i = (int)0x00000080; /* 128 or 6.32404e-322f */ for (i = 0; i < n; i++) { /* 0: loadb */ var33 = ptr4[i]; /* 1: convubw */ var36.i = (orc_uint8)var33; /* 3: subw */ var35.i = var36.i - var34.i; /* 4: storew */ ptr0[i] = var35; } } /* orc_offsetconvert_s32_u8 */ static void _backup_orc_offsetconvert_s32_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var33; orc_union16 var34; orc_union32 var35; orc_union16 var36; orc_union16 var37; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_int8 *)ex->arrays[4]; /* 2: loadpw */ var34.i = (int)0x00000080; /* 128 or 6.32404e-322f */ for (i = 0; i < n; i++) { /* 0: loadb */ var33 = ptr4[i]; /* 1: convubw */ var36.i = (orc_uint8)var33; /* 3: subw */ var37.i = var36.i - var34.i; /* 4: convswl */ var35.i = var37.i; /* 5: storel */ ptr0[i] = var35; } } /* orc_offsetconvert_s32_s16 */ static void _backup_orc_offsetconvert_s32_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var33; orc_union16 var34; orc_union32 var35; orc_union16 var36; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; /* 1: loadpw */ var34.i = (int)0x00000080; /* 128 or 6.32404e-322f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 2: subw */ var36.i = var33.i - var34.i; /* 3: convswl */ var35.i = var36.i; /* 4: storel */ ptr0[i] = var35; } } /* orc_subtract_s16_u8 */ static void _backup_orc_subtract_s16_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_int8 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadb */ var33 = ptr5[i]; /* 1: convubw */ var36.i = (orc_uint8)var33; /* 2: loadw */ var34 = ptr4[i]; /* 3: subw */ var35.i = var34.i - var36.i; /* 4: storew */ ptr0[i] = var35; } } /* orc_multiply_and_add_s16_u8 */ static void _backup_orc_multiply_and_add_s16_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_int8 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadb */ var33 = ptr5[i]; /* 1: convubw */ var37.i = (orc_uint8)var33; /* 2: loadw */ var34 = ptr4[i]; /* 3: mullw */ var38.i = (var37.i * var34.i) & 0xffff; /* 4: loadw */ var35 = ptr0[i]; /* 5: addw */ var36.i = var35.i + var38.i; /* 6: storew */ ptr0[i] = var36; } } /* orc_splat_s16_ns */ static void _backup_orc_splat_s16_ns (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var32; orc_union16 var33; ptr0 = (orc_union16 *)ex->arrays[0]; /* 0: loadpw */ var32.i = ex->params[24]; for (i = 0; i < n; i++) { /* 1: copyw */ var33.i = var32.i; /* 2: storew */ ptr0[i] = var33; } } /* orc_splat_s32_ns */ static void _backup_orc_splat_s32_ns (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; orc_union32 var32; orc_union32 var33; ptr0 = (orc_union32 *)ex->arrays[0]; /* 0: loadpl */ var32.i = ex->params[24]; for (i = 0; i < n; i++) { /* 1: copyl */ var33.i = var32.i; /* 2: storel */ ptr0[i] = var33; } } /* orc_splat_s16_2d_4xn */ static void _backup_orc_splat_s16_2d_4xn (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 4; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var32; orc_union16 var33; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); /* 0: loadpw */ var32.i = ex->params[24]; for (i = 0; i < n; i++) { /* 1: copyw */ var33.i = var32.i; /* 2: storew */ ptr0[i] = var33; } } } /* orc_splat_s16_2d_8xn */ static void _backup_orc_splat_s16_2d_8xn (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 8; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var32; orc_union16 var33; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); /* 0: loadpw */ var32.i = ex->params[24]; for (i = 0; i < n; i++) { /* 1: copyw */ var33.i = var32.i; /* 2: storew */ ptr0[i] = var33; } } } /* orc_splat_s16_2d */ static void _backup_orc_splat_s16_2d (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var32; orc_union16 var33; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); /* 0: loadpw */ var32.i = ex->params[24]; for (i = 0; i < n; i++) { /* 1: copyw */ var33.i = var32.i; /* 2: storew */ ptr0[i] = var33; } } } /* orc_splat_u8_ns */ static void _backup_orc_splat_u8_ns (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; orc_int8 var32; orc_int8 var33; ptr0 = (orc_int8 *)ex->arrays[0]; /* 0: loadpb */ var32 = ex->params[24]; for (i = 0; i < n; i++) { /* 1: copyb */ var33 = var32; /* 2: storeb */ ptr0[i] = var33; } } /* orc_splat_u8_2d */ static void _backup_orc_splat_u8_2d (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; orc_int8 var32; orc_int8 var33; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); /* 0: loadpb */ var32 = ex->params[24]; for (i = 0; i < n; i++) { /* 1: copyb */ var33 = var32; /* 2: storeb */ ptr0[i] = var33; } } } /* orc_average_u8 */ static void _backup_orc_average_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_int8 *)ex->arrays[4]; ptr5 = (orc_int8 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: avgub */ var34 = ((orc_uint8)var32 + (orc_uint8)var33 + 1)>>1; /* 3: storeb */ ptr0[i] = var34; } } /* orc_rrshift6_add_s16_2d */ static void _backup_orc_rrshift6_add_s16_2d (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_int8 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); /* 1: loadpw */ var34.i = (int)0x00000020; /* 32 or 1.58101e-322f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr5[i]; /* 2: addw */ var37.i = var33.i + var34.i; /* 3: shrsw */ var38.i = var37.i >> 6; /* 4: loadw */ var35 = ptr4[i]; /* 5: addw */ var39.i = var35.i + var38.i; /* 6: convsuswb */ var36 = ORC_CLAMP_UB(var39.i); /* 7: storeb */ ptr0[i] = var36; } } } /* orc_rrshift6_add_s32_2d */ static void _backup_orc_rrshift6_add_s32_2d (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; orc_union16 var35; orc_union32 var36; orc_int8 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); /* 1: loadpw */ var35.i = (int)0x00000020; /* 32 or 1.58101e-322f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr5[i]; /* 2: addw */ var38.i = var34.i + var35.i; /* 3: shrsw */ var39.i = var38.i >> 6; /* 4: loadl */ var36 = ptr4[i]; /* 5: convlw */ var40.i = var36.i; /* 6: addw */ var41.i = var40.i + var39.i; /* 7: convsuswb */ var37 = ORC_CLAMP_UB(var41.i); /* 8: storeb */ ptr0[i] = var37; } } } /* orc_rrshift6_sub_s16_2d */ static void _backup_orc_rrshift6_sub_s16_2d (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr1 = ORC_PTR_OFFSET(ex->arrays[1], ex->params[1] * j); /* 1: loadpw */ var34.i = (int)0x00001fe0; /* 8160 or 4.03158e-320f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr1[i]; /* 2: subw */ var38.i = var33.i - var34.i; /* 3: shrsw */ var39.i = var38.i >> 6; /* 4: copyw */ var35.i = var39.i; /* 5: storew */ ptr1[i] = var35; /* 6: loadw */ var36 = ptr0[i]; /* 7: subw */ var37.i = var36.i - var39.i; /* 8: storew */ ptr0[i] = var37; } } } /* orc_rrshift6_s16_ip_2d */ static void _backup_orc_rrshift6_s16_ip_2d (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); /* 1: loadpw */ var34.i = (int)0x00001fe0; /* 8160 or 4.03158e-320f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr0[i]; /* 2: subw */ var36.i = var33.i - var34.i; /* 3: shrsw */ var35.i = var36.i >> 6; /* 4: storew */ ptr0[i] = var35; } } } /* orc_rrshift6_s16_ip */ static void _backup_orc_rrshift6_s16_ip (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; ptr0 = (orc_union16 *)ex->arrays[0]; /* 1: loadpw */ var34.i = (int)0x00001fe0; /* 8160 or 4.03158e-320f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr0[i]; /* 2: subw */ var36.i = var33.i - var34.i; /* 3: shrsw */ var35.i = var36.i >> 6; /* 4: storew */ ptr0[i] = var35; } } /* orc_unpack_yuyv_y */ static void _backup_orc_unpack_yuyv_y (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_int8 var33; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: select0wb */ { orc_union16 _src; _src.i = var32.i; var33 = _src.x2[0]; } /* 2: storeb */ ptr0[i] = var33; } } /* orc_unpack_yuyv_u */ static void _backup_orc_unpack_yuyv_u (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var33; orc_int8 var34; orc_union16 var35; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr4[i]; /* 1: select0lw */ { orc_union32 _src; _src.i = var33.i; var35.i = _src.x2[0]; } /* 2: select1wb */ { orc_union16 _src; _src.i = var35.i; var34 = _src.x2[1]; } /* 3: storeb */ ptr0[i] = var34; } } /* orc_unpack_yuyv_v */ static void _backup_orc_unpack_yuyv_v (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var33; orc_int8 var34; orc_union16 var35; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr4[i]; /* 1: select1lw */ { orc_union32 _src; _src.i = var33.i; var35.i = _src.x2[1]; } /* 2: select1wb */ { orc_union16 _src; _src.i = var35.i; var34 = _src.x2[1]; } /* 3: storeb */ ptr0[i] = var34; } } /* orc_packyuyv */ static void _backup_orc_packyuyv (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; orc_union16 var37; orc_int8 var38; orc_int8 var39; orc_union32 var40; orc_union16 var41; orc_int8 var42; orc_int8 var43; orc_union16 var44; orc_union16 var45; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_int8 *)ex->arrays[5]; ptr6 = (orc_int8 *)ex->arrays[6]; for (i = 0; i < n; i++) { /* 0: loadw */ var37 = ptr4[i]; /* 1: copyw */ var41.i = var37.i; /* 2: select0wb */ { orc_union16 _src; _src.i = var41.i; var42 = _src.x2[0]; } /* 3: select1wb */ { orc_union16 _src; _src.i = var41.i; var43 = _src.x2[1]; } /* 4: loadb */ var38 = ptr5[i]; /* 5: mergebw */ { orc_union16 _dest; _dest.x2[0] = var42; _dest.x2[1] = var38; var44.i = _dest.i; } /* 6: loadb */ var39 = ptr6[i]; /* 7: mergebw */ { orc_union16 _dest; _dest.x2[0] = var43; _dest.x2[1] = var39; var45.i = _dest.i; } /* 8: mergewl */ { orc_union32 _dest; _dest.x2[0] = var44.i; _dest.x2[1] = var45.i; var40.i = _dest.i; } /* 9: storel */ ptr0[i] = var40; } } /* orc_unpack_uyvy_y */ static void _backup_orc_unpack_uyvy_y (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_int8 var33; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: select1wb */ { orc_union16 _src; _src.i = var32.i; var33 = _src.x2[1]; } /* 2: storeb */ ptr0[i] = var33; } } /* orc_unpack_uyvy_u */ static void _backup_orc_unpack_uyvy_u (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var33; orc_int8 var34; orc_union16 var35; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr4[i]; /* 1: select0lw */ { orc_union32 _src; _src.i = var33.i; var35.i = _src.x2[0]; } /* 2: select0wb */ { orc_union16 _src; _src.i = var35.i; var34 = _src.x2[0]; } /* 3: storeb */ ptr0[i] = var34; } } /* orc_unpack_uyvy_v */ static void _backup_orc_unpack_uyvy_v (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var33; orc_int8 var34; orc_union16 var35; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr4[i]; /* 1: select1lw */ { orc_union32 _src; _src.i = var33.i; var35.i = _src.x2[1]; } /* 2: select0wb */ { orc_union16 _src; _src.i = var35.i; var34 = _src.x2[0]; } /* 3: storeb */ ptr0[i] = var34; } } /* orc_interleave2_s16 */ static void _backup_orc_interleave2_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var32; orc_union16 var33; orc_union32 var34; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: loadw */ var33 = ptr5[i]; /* 2: mergewl */ { orc_union32 _dest; _dest.x2[0] = var32.i; _dest.x2[1] = var33.i; var34.i = _dest.i; } /* 3: storel */ ptr0[i] = var34; } } /* orc_interleave2_rrshift1_s16 */ static void _backup_orc_interleave2_rrshift1_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union32 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; /* 1: loadpw */ var35.i = (int)0x00000001; /* 1 or 4.94066e-324f */ /* 5: loadpw */ var37.i = (int)0x00000001; /* 1 or 4.94066e-324f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 2: addw */ var39.i = var34.i + var35.i; /* 3: shrsw */ var40.i = var39.i >> 1; /* 4: loadw */ var36 = ptr5[i]; /* 6: addw */ var41.i = var36.i + var37.i; /* 7: shrsw */ var42.i = var41.i >> 1; /* 8: mergewl */ { orc_union32 _dest; _dest.x2[0] = var40.i; _dest.x2[1] = var42.i; var38.i = _dest.i; } /* 9: storel */ ptr0[i] = var38; } } /* orc_deinterleave2_s16 */ static void _backup_orc_deinterleave2_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)ex->arrays[0]; ptr1 = (orc_union16 *)ex->arrays[1]; ptr4 = (orc_union32 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: splitlw */ { orc_union32 _src; _src.i = var32.i; var33.i = _src.x2[1]; var34.i = _src.x2[0]; } /* 2: storew */ ptr1[i] = var33; /* 3: storew */ ptr0[i] = var34; } } /* orc_deinterleave2_s32 */ static void _backup_orc_deinterleave2_s32 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; orc_union32 * ORC_RESTRICT ptr1; const orc_union64 * ORC_RESTRICT ptr4; orc_union64 var32; orc_union32 var33; orc_union32 var34; ptr0 = (orc_union32 *)ex->arrays[0]; ptr1 = (orc_union32 *)ex->arrays[1]; ptr4 = (orc_union64 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadq */ var32 = ptr4[i]; /* 1: splitql */ { orc_union64 _src; _src.i = var32.i; var33.i = _src.x2[1]; var34.i = _src.x2[0]; } /* 2: storel */ ptr1[i] = var33; /* 3: storel */ ptr0[i] = var34; } } /* orc_deinterleave2_lshift1_s16 */ static void _backup_orc_deinterleave2_lshift1_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var33; orc_union16 var34; orc_union16 var35; orc_union32 var36; ptr0 = (orc_union16 *)ex->arrays[0]; ptr1 = (orc_union16 *)ex->arrays[1]; ptr4 = (orc_union32 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr4[i]; /* 1: shlw */ var36.x2[0] = var33.x2[0] << 1; var36.x2[1] = var33.x2[1] << 1; /* 2: splitlw */ { orc_union32 _src; _src.i = var36.i; var34.i = _src.x2[1]; var35.i = _src.x2[0]; } /* 3: storew */ ptr1[i] = var34; /* 4: storew */ ptr0[i] = var35; } } /* orc_deinterleave2_lshift1_s32 */ static void _backup_orc_deinterleave2_lshift1_s32 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; orc_union32 * ORC_RESTRICT ptr1; const orc_union64 * ORC_RESTRICT ptr4; orc_union64 var33; orc_union32 var34; orc_union32 var35; orc_union64 var36; ptr0 = (orc_union32 *)ex->arrays[0]; ptr1 = (orc_union32 *)ex->arrays[1]; ptr4 = (orc_union64 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadq */ var33 = ptr4[i]; /* 1: shll */ var36.x2[0] = var33.x2[0] << 1; var36.x2[1] = var33.x2[1] << 1; /* 2: splitql */ { orc_union64 _src; _src.i = var36.i; var34.i = _src.x2[1]; var35.i = _src.x2[0]; } /* 3: storel */ ptr1[i] = var34; /* 4: storel */ ptr0[i] = var35; } } /* orc_haar_deint_lshift1_split_s16 */ static void _backup_orc_haar_deint_lshift1_split_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union32 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; ptr0 = (orc_union16 *)ex->arrays[0]; ptr1 = (orc_union16 *)ex->arrays[1]; ptr4 = (orc_union32 *)ex->arrays[4]; /* 6: loadpw */ var37.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadl */ var35 = ptr4[i]; /* 1: shlw */ var39.x2[0] = var35.x2[0] << 1; var39.x2[1] = var35.x2[1] << 1; /* 2: splitlw */ { orc_union32 _src; _src.i = var39.i; var40.i = _src.x2[1]; var41.i = _src.x2[0]; } /* 3: subw */ var42.i = var40.i - var41.i; /* 4: copyw */ var36.i = var42.i; /* 5: storew */ ptr1[i] = var36; /* 7: avgsw */ var43.i = (var42.i + var37.i + 1)>>1; /* 8: addw */ var38.i = var41.i + var43.i; /* 9: storew */ ptr0[i] = var38; } } /* orc_haar_deint_lshift1_split_s32 */ static void _backup_orc_haar_deint_lshift1_split_s32 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; orc_union32 * ORC_RESTRICT ptr1; const orc_union64 * ORC_RESTRICT ptr4; orc_union64 var35; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union64 var39; orc_union32 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; ptr0 = (orc_union32 *)ex->arrays[0]; ptr1 = (orc_union32 *)ex->arrays[1]; ptr4 = (orc_union64 *)ex->arrays[4]; /* 6: loadpl */ var37.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadq */ var35 = ptr4[i]; /* 1: shll */ var39.x2[0] = var35.x2[0] << 1; var39.x2[1] = var35.x2[1] << 1; /* 2: splitql */ { orc_union64 _src; _src.i = var39.i; var40.i = _src.x2[1]; var41.i = _src.x2[0]; } /* 3: subl */ var42.i = var40.i - var41.i; /* 4: copyl */ var36.i = var42.i; /* 5: storel */ ptr1[i] = var36; /* 7: avgsl */ var43.i = ((orc_int64)var42.i + (orc_int64)var37.i + 1)>>1; /* 8: addl */ var38.i = var41.i + var43.i; /* 9: storel */ ptr0[i] = var38; } } /* orc_haar_deint_split_s16 */ static void _backup_orc_haar_deint_split_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; ptr0 = (orc_union16 *)ex->arrays[0]; ptr1 = (orc_union16 *)ex->arrays[1]; ptr4 = (orc_union32 *)ex->arrays[4]; /* 5: loadpw */ var36.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadl */ var34 = ptr4[i]; /* 1: splitlw */ { orc_union32 _src; _src.i = var34.i; var38.i = _src.x2[1]; var39.i = _src.x2[0]; } /* 2: subw */ var40.i = var38.i - var39.i; /* 3: copyw */ var35.i = var40.i; /* 4: storew */ ptr1[i] = var35; /* 6: avgsw */ var41.i = (var40.i + var36.i + 1)>>1; /* 7: addw */ var37.i = var39.i + var41.i; /* 8: storew */ ptr0[i] = var37; } } /* orc_haar_deint_split_s32 */ static void _backup_orc_haar_deint_split_s32 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; orc_union32 * ORC_RESTRICT ptr1; const orc_union64 * ORC_RESTRICT ptr4; orc_union64 var34; orc_union32 var35; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; orc_union32 var41; ptr0 = (orc_union32 *)ex->arrays[0]; ptr1 = (orc_union32 *)ex->arrays[1]; ptr4 = (orc_union64 *)ex->arrays[4]; /* 5: loadpl */ var36.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadq */ var34 = ptr4[i]; /* 1: splitql */ { orc_union64 _src; _src.i = var34.i; var38.i = _src.x2[1]; var39.i = _src.x2[0]; } /* 2: subl */ var40.i = var38.i - var39.i; /* 3: copyl */ var35.i = var40.i; /* 4: storel */ ptr1[i] = var35; /* 6: avgsl */ var41.i = ((orc_int64)var40.i + (orc_int64)var36.i + 1)>>1; /* 7: addl */ var37.i = var39.i + var41.i; /* 8: storel */ ptr0[i] = var37; } } /* orc_haar_split_s16_lo */ static void _backup_orc_haar_split_s16_lo (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; /* 4: loadpw */ var36.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: copyw */ var38.i = var34.i; /* 2: loadw */ var35 = ptr5[i]; /* 3: subw */ var39.i = var35.i - var38.i; /* 5: avgsw */ var40.i = (var39.i + var36.i + 1)>>1; /* 6: addw */ var37.i = var38.i + var40.i; /* 7: storew */ ptr0[i] = var37; } } /* orc_haar_split_s16_hi */ static void _backup_orc_haar_split_s16_hi (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr5[i]; /* 1: loadw */ var33 = ptr4[i]; /* 2: subw */ var34.i = var32.i - var33.i; /* 3: storew */ ptr0[i] = var34; } } /* orc_haar_split_s16_op */ static void _backup_orc_haar_split_s16_op (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; ptr0 = (orc_union16 *)ex->arrays[0]; ptr1 = (orc_union16 *)ex->arrays[1]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; /* 6: loadpw */ var37.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: copyw */ var39.i = var34.i; /* 2: loadw */ var35 = ptr5[i]; /* 3: subw */ var40.i = var35.i - var39.i; /* 4: copyw */ var36.i = var40.i; /* 5: storew */ ptr1[i] = var36; /* 7: avgsw */ var41.i = (var40.i + var37.i + 1)>>1; /* 8: addw */ var38.i = var39.i + var41.i; /* 9: storew */ ptr0[i] = var38; } } /* orc_haar_split_s32_op */ static void _backup_orc_haar_split_s32_op (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; orc_union32 * ORC_RESTRICT ptr1; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var34; orc_union32 var35; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; orc_union32 var41; ptr0 = (orc_union32 *)ex->arrays[0]; ptr1 = (orc_union32 *)ex->arrays[1]; ptr4 = (orc_union32 *)ex->arrays[4]; ptr5 = (orc_union32 *)ex->arrays[5]; /* 6: loadpl */ var37.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadl */ var34 = ptr4[i]; /* 1: copyl */ var39.i = var34.i; /* 2: loadl */ var35 = ptr5[i]; /* 3: subl */ var40.i = var35.i - var39.i; /* 4: copyl */ var36.i = var40.i; /* 5: storel */ ptr1[i] = var36; /* 7: avgsl */ var41.i = ((orc_int64)var40.i + (orc_int64)var37.i + 1)>>1; /* 8: addl */ var38.i = var39.i + var41.i; /* 9: storel */ ptr0[i] = var38; } } /* orc_haar_split_s16 */ static void _backup_orc_haar_split_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; ptr0 = (orc_union16 *)ex->arrays[0]; ptr1 = (orc_union16 *)ex->arrays[1]; /* 7: loadpw */ var37.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr0[i]; /* 1: copyw */ var39.i = var34.i; /* 2: loadw */ var35 = ptr1[i]; /* 3: copyw */ var40.i = var35.i; /* 4: subw */ var41.i = var40.i - var39.i; /* 5: copyw */ var36.i = var41.i; /* 6: storew */ ptr1[i] = var36; /* 8: avgsw */ var42.i = (var41.i + var37.i + 1)>>1; /* 9: addw */ var38.i = var39.i + var42.i; /* 10: storew */ ptr0[i] = var38; } } /* orc_haar_synth_s16_lo */ static void _backup_orc_haar_synth_s16_lo (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; /* 1: loadpw */ var34.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr5[i]; /* 2: avgsw */ var37.i = (var33.i + var34.i + 1)>>1; /* 3: loadw */ var35 = ptr4[i]; /* 4: subw */ var36.i = var35.i - var37.i; /* 5: storew */ ptr0[i] = var36; } } /* orc_haar_synth_s16_hi */ static void _backup_orc_haar_synth_s16_hi (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; /* 2: loadpw */ var36.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var35 = ptr5[i]; /* 1: copyw */ var39.i = var35.i; /* 3: avgsw */ var40.i = (var39.i + var36.i + 1)>>1; /* 4: loadw */ var37 = ptr4[i]; /* 5: subw */ var41.i = var37.i - var40.i; /* 6: addw */ var38.i = var39.i + var41.i; /* 7: storew */ ptr0[i] = var38; } } /* orc_haar_synth_s16_op */ static void _backup_orc_haar_synth_s16_op (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; ptr0 = (orc_union16 *)ex->arrays[0]; ptr1 = (orc_union16 *)ex->arrays[1]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; /* 2: loadpw */ var36.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var35 = ptr5[i]; /* 1: copyw */ var40.i = var35.i; /* 3: avgsw */ var41.i = (var40.i + var36.i + 1)>>1; /* 4: loadw */ var37 = ptr4[i]; /* 5: subw */ var42.i = var37.i - var41.i; /* 6: copyw */ var38.i = var42.i; /* 7: storew */ ptr0[i] = var38; /* 8: addw */ var39.i = var40.i + var42.i; /* 9: storew */ ptr1[i] = var39; } } /* orc_haar_synth_s16 */ static void _backup_orc_haar_synth_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; ptr0 = (orc_union16 *)ex->arrays[0]; ptr1 = (orc_union16 *)ex->arrays[1]; /* 4: loadpw */ var37.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var35 = ptr0[i]; /* 1: copyw */ var40.i = var35.i; /* 2: loadw */ var36 = ptr1[i]; /* 3: copyw */ var41.i = var36.i; /* 5: avgsw */ var42.i = (var41.i + var37.i + 1)>>1; /* 6: subw */ var43.i = var40.i - var42.i; /* 7: copyw */ var38.i = var43.i; /* 8: storew */ ptr0[i] = var38; /* 9: addw */ var39.i = var41.i + var43.i; /* 10: storew */ ptr1[i] = var39; } } /* orc_haar_synth_rrshift1_int_s16 */ static void _backup_orc_haar_synth_rrshift1_int_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union32 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; /* 2: loadpw */ var35.i = (int)0x00000000; /* 0 or 0f */ /* 7: loadpw */ var37.i = (int)0x00000000; /* 0 or 0f */ /* 9: loadpw */ var38.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr5[i]; /* 1: copyw */ var40.i = var34.i; /* 3: avgsw */ var41.i = (var40.i + var35.i + 1)>>1; /* 4: loadw */ var36 = ptr4[i]; /* 5: subw */ var42.i = var36.i - var41.i; /* 6: addw */ var43.i = var40.i + var42.i; /* 8: avgsw */ var44.i = (var42.i + var37.i + 1)>>1; /* 10: avgsw */ var45.i = (var43.i + var38.i + 1)>>1; /* 11: mergewl */ { orc_union32 _dest; _dest.x2[0] = var44.i; _dest.x2[1] = var45.i; var39.i = _dest.i; } /* 12: storel */ ptr0[i] = var39; } } /* orc_haar_synth_int_s16 */ static void _backup_orc_haar_synth_int_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union32 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; /* 2: loadpw */ var35.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr5[i]; /* 1: copyw */ var38.i = var34.i; /* 3: avgsw */ var39.i = (var38.i + var35.i + 1)>>1; /* 4: loadw */ var36 = ptr4[i]; /* 5: subw */ var40.i = var36.i - var39.i; /* 6: addw */ var41.i = var38.i + var40.i; /* 7: mergewl */ { orc_union32 _dest; _dest.x2[0] = var40.i; _dest.x2[1] = var41.i; var37.i = _dest.i; } /* 8: storel */ ptr0[i] = var37; } } /* orc_haar_sub_s16 */ static void _backup_orc_haar_sub_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr0[i]; /* 1: loadw */ var33 = ptr4[i]; /* 2: subw */ var34.i = var32.i - var33.i; /* 3: storew */ ptr0[i] = var34; } } /* orc_haar_add_half_s16 */ static void _backup_orc_haar_add_half_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; /* 1: loadpw */ var34.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 2: avgsw */ var37.i = (var33.i + var34.i + 1)>>1; /* 3: loadw */ var35 = ptr0[i]; /* 4: addw */ var36.i = var35.i + var37.i; /* 5: storew */ ptr0[i] = var36; } } /* orc_haar_add_s16 */ static void _backup_orc_haar_add_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr0[i]; /* 1: loadw */ var33 = ptr4[i]; /* 2: addw */ var34.i = var32.i + var33.i; /* 3: storew */ ptr0[i] = var34; } } /* orc_haar_sub_half_s16 */ static void _backup_orc_haar_sub_half_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; /* 1: loadpw */ var34.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 2: avgsw */ var37.i = (var33.i + var34.i + 1)>>1; /* 3: loadw */ var35 = ptr0[i]; /* 4: subw */ var36.i = var35.i - var37.i; /* 5: storew */ ptr0[i] = var36; } } /* orc_sum_u8 */ static void _backup_orc_sum_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; const orc_int8 * ORC_RESTRICT ptr4; orc_union32 var12 = { 0 }; orc_int8 var34; orc_union16 var35; orc_union32 var36; ptr4 = (orc_int8 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var35.i = (orc_uint8)var34; /* 2: convuwl */ var36.i = (orc_uint16)var35.i; /* 3: accl */ var12.i = var12.i + var36.i; } ex->accumulators[0] = var12.i; } /* orc_sum_s16 */ static void _backup_orc_sum_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; const orc_union16 * ORC_RESTRICT ptr4; orc_union32 var12 = { 0 }; orc_union16 var33; orc_union32 var34; ptr4 = (orc_union16 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 1: convswl */ var34.i = var33.i; /* 2: accl */ var12.i = var12.i + var34.i; } ex->accumulators[0] = var12.i; } /* orc_sum_square_diff_u8 */ static void _backup_orc_sum_square_diff_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_union32 var12 = { 0 }; orc_int8 var35; orc_int8 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union32 var41; ptr4 = (orc_int8 *)ex->arrays[4]; ptr5 = (orc_int8 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadb */ var35 = ptr4[i]; /* 1: convubw */ var37.i = (orc_uint8)var35; /* 2: loadb */ var36 = ptr5[i]; /* 3: convubw */ var38.i = (orc_uint8)var36; /* 4: subw */ var39.i = var37.i - var38.i; /* 5: mullw */ var40.i = (var39.i * var39.i) & 0xffff; /* 6: convuwl */ var41.i = (orc_uint16)var40.i; /* 7: accl */ var12.i = var12.i + var41.i; } ex->accumulators[0] = var12.i; } /* orc_dequantise_s16_2d_4xn */ static void _backup_orc_dequantise_s16_2d_4xn (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 4; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); /* 4: loadpw */ var35.i = ex->params[24]; /* 6: loadpw */ var36.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 5: mullw */ var41.i = (var40.i * var35.i) & 0xffff; /* 7: addw */ var42.i = var41.i + var36.i; /* 8: shrsw */ var43.i = var42.i >> 2; /* 9: mullw */ var37.i = (var43.i * var39.i) & 0xffff; /* 10: storew */ ptr0[i] = var37; } } } /* orc_dequantise_s16_2d_8xn */ static void _backup_orc_dequantise_s16_2d_8xn (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 8; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); /* 4: loadpw */ var35.i = ex->params[24]; /* 6: loadpw */ var36.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 5: mullw */ var41.i = (var40.i * var35.i) & 0xffff; /* 7: addw */ var42.i = var41.i + var36.i; /* 8: shrsw */ var43.i = var42.i >> 2; /* 9: mullw */ var37.i = (var43.i * var39.i) & 0xffff; /* 10: storew */ ptr0[i] = var37; } } } /* orc_dequantise_s16_ip_2d_8xn */ static void _backup_orc_dequantise_s16_ip_2d_8xn (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 8; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); /* 4: loadpw */ var35.i = ex->params[24]; /* 6: loadpw */ var36.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr0[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 5: mullw */ var41.i = (var40.i * var35.i) & 0xffff; /* 7: addw */ var42.i = var41.i + var36.i; /* 8: shrsw */ var43.i = var42.i >> 2; /* 9: mullw */ var37.i = (var43.i * var39.i) & 0xffff; /* 10: storew */ ptr0[i] = var37; } } } /* orc_dequantise_s16_ip_2d */ static void _backup_orc_dequantise_s16_ip_2d (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); /* 4: loadpw */ var35.i = ex->params[24]; /* 6: loadpw */ var36.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr0[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 5: mullw */ var41.i = (var40.i * var35.i) & 0xffff; /* 7: addw */ var42.i = var41.i + var36.i; /* 8: shrsw */ var43.i = var42.i >> 2; /* 9: mullw */ var37.i = (var43.i * var39.i) & 0xffff; /* 10: storew */ ptr0[i] = var37; } } } /* orc_dequantise_s16_ip */ static void _backup_orc_dequantise_s16_ip (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; ptr0 = (orc_union16 *)ex->arrays[0]; /* 4: loadpw */ var35.i = ex->params[24]; /* 6: loadpw */ var36.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr0[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 5: mullw */ var41.i = (var40.i * var35.i) & 0xffff; /* 7: addw */ var42.i = var41.i + var36.i; /* 8: shrsw */ var43.i = var42.i >> 2; /* 9: mullw */ var37.i = (var43.i * var39.i) & 0xffff; /* 10: storew */ ptr0[i] = var37; } } /* orc_dequantise_s16 */ static void _backup_orc_dequantise_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; /* 4: loadpw */ var35.i = ex->params[24]; /* 6: loadpw */ var36.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 5: mullw */ var41.i = (var40.i * var35.i) & 0xffff; /* 7: addw */ var42.i = var41.i + var36.i; /* 8: shrsw */ var43.i = var42.i >> 2; /* 9: mullw */ var37.i = (var43.i * var39.i) & 0xffff; /* 10: storew */ ptr0[i] = var37; } } /* orc_dequantise_var_s16_ip */ static void _backup_orc_dequantise_var_s16_ip (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr0[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 4: loadw */ var35 = ptr4[i]; /* 5: mullw */ var41.i = (var40.i * var35.i) & 0xffff; /* 6: loadw */ var36 = ptr5[i]; /* 7: addw */ var42.i = var41.i + var36.i; /* 8: shrsw */ var43.i = var42.i >> 2; /* 9: mullw */ var37.i = (var43.i * var39.i) & 0xffff; /* 10: storew */ ptr0[i] = var37; } } /* orc_quantise1_s16 */ static void _backup_orc_quantise1_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; /* 5: loadpw */ var35.i = ex->params[25]; /* 7: loadpw */ var36.i = ex->params[24]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 4: shlw */ var41.i = var40.i << 2; /* 6: subw */ var42.i = var41.i - var35.i; /* 8: mulhuw */ var43.i = ((orc_uint32)((orc_uint16)var42.i) * (orc_uint32)((orc_uint16)var36.i)) >> 16; /* 9: shruw */ var44.i = ((orc_uint16)var43.i) >> ex->params[26]; /* 10: mullw */ var37.i = (var44.i * var39.i) & 0xffff; /* 11: storew */ ptr0[i] = var37; } } /* orc_quantise2_s16 */ static void _backup_orc_quantise2_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; /* 5: loadpw */ var35.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: copyw */ var37.i = var34.i; /* 2: signw */ var38.i = ORC_CLAMP(var37.i,-1,1); /* 3: absw */ var39.i = ORC_ABS(var37.i); /* 4: shlw */ var40.i = var39.i << 2; /* 6: subw */ var41.i = var40.i - var35.i; /* 7: shruw */ var42.i = ((orc_uint16)var41.i) >> ex->params[24]; /* 8: mullw */ var36.i = (var42.i * var38.i) & 0xffff; /* 9: storew */ ptr0[i] = var36; } } /* orc_quantdequant1_s16 */ static void _backup_orc_quantdequant1_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; ptr0 = (orc_union16 *)ex->arrays[0]; ptr1 = (orc_union16 *)ex->arrays[1]; /* 5: loadpw */ var35.i = ex->params[25]; /* 7: loadpw */ var36.i = ex->params[24]; /* 14: loadpw */ var38.i = ex->params[27]; /* 16: loadpw */ var39.i = ex->params[28]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr1[i]; /* 1: copyw */ var41.i = var34.i; /* 2: signw */ var42.i = ORC_CLAMP(var41.i,-1,1); /* 3: absw */ var43.i = ORC_ABS(var41.i); /* 4: shlw */ var44.i = var43.i << 2; /* 6: subw */ var45.i = var44.i - var35.i; /* 8: mulhuw */ var46.i = ((orc_uint32)((orc_uint16)var45.i) * (orc_uint32)((orc_uint16)var36.i)) >> 16; /* 9: shruw */ var47.i = ((orc_uint16)var46.i) >> ex->params[26]; /* 10: mullw */ var48.i = (var47.i * var42.i) & 0xffff; /* 11: copyw */ var37.i = var48.i; /* 12: storew */ ptr0[i] = var37; /* 13: signw */ var49.i = ORC_CLAMP(var48.i,-1,1); /* 15: mullw */ var50.i = (var47.i * var38.i) & 0xffff; /* 17: addw */ var51.i = var50.i + var39.i; /* 18: shrsw */ var52.i = var51.i >> 2; /* 19: mullw */ var40.i = (var52.i * var49.i) & 0xffff; /* 20: storew */ ptr1[i] = var40; } } /* orc_quantdequant3_s16 */ static void _backup_orc_quantdequant3_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union32 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union32 var48; orc_union32 var49; orc_union32 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union16 var54; orc_union16 var55; orc_union16 var56; ptr0 = (orc_union16 *)ex->arrays[0]; ptr1 = (orc_union16 *)ex->arrays[1]; /* 5: loadpw */ var36.i = ex->params[25]; /* 7: loadpw */ var37.i = ex->params[24]; /* 9: loadpl */ var38.i = ex->params[29]; /* 17: loadpw */ var40.i = ex->params[27]; /* 19: loadpw */ var41.i = ex->params[28]; for (i = 0; i < n; i++) { /* 0: loadw */ var35 = ptr1[i]; /* 1: copyw */ var43.i = var35.i; /* 2: signw */ var44.i = ORC_CLAMP(var43.i,-1,1); /* 3: absw */ var45.i = ORC_ABS(var43.i); /* 4: shlw */ var46.i = var45.i << 2; /* 6: subw */ var47.i = var46.i - var36.i; /* 8: muluwl */ var48.i = ((orc_uint16)var47.i) * ((orc_uint16)var37.i); /* 10: addl */ var49.i = var48.i + var38.i; /* 11: shrul */ var50.i = ((orc_uint32)var49.i) >> ex->params[26]; /* 12: convlw */ var51.i = var50.i; /* 13: mullw */ var52.i = (var51.i * var44.i) & 0xffff; /* 14: copyw */ var39.i = var52.i; /* 15: storew */ ptr0[i] = var39; /* 16: signw */ var53.i = ORC_CLAMP(var52.i,-1,1); /* 18: mullw */ var54.i = (var51.i * var40.i) & 0xffff; /* 20: addw */ var55.i = var54.i + var41.i; /* 21: shrsw */ var56.i = var55.i >> 2; /* 22: mullw */ var42.i = (var56.i * var53.i) & 0xffff; /* 23: storew */ ptr1[i] = var42; } } /* orc_quantdequant2_s16 */ static void _backup_orc_quantdequant2_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; ptr0 = (orc_union16 *)ex->arrays[0]; ptr1 = (orc_union16 *)ex->arrays[1]; /* 5: loadpw */ var35.i = ex->params[25]; /* 12: loadpw */ var37.i = ex->params[26]; /* 14: loadpw */ var38.i = ex->params[27]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr1[i]; /* 1: copyw */ var40.i = var34.i; /* 2: signw */ var41.i = ORC_CLAMP(var40.i,-1,1); /* 3: absw */ var42.i = ORC_ABS(var40.i); /* 4: shlw */ var43.i = var42.i << 2; /* 6: subw */ var44.i = var43.i - var35.i; /* 7: shruw */ var45.i = ((orc_uint16)var44.i) >> ex->params[24]; /* 8: mullw */ var46.i = (var45.i * var41.i) & 0xffff; /* 9: copyw */ var36.i = var46.i; /* 10: storew */ ptr0[i] = var36; /* 11: signw */ var47.i = ORC_CLAMP(var46.i,-1,1); /* 13: mullw */ var48.i = (var45.i * var37.i) & 0xffff; /* 15: addw */ var49.i = var48.i + var38.i; /* 16: shrsw */ var50.i = var49.i >> 2; /* 17: mullw */ var39.i = (var50.i * var47.i) & 0xffff; /* 18: storew */ ptr1[i] = var39; } } /* orc_downsample_vert_u8 */ static void _backup_orc_downsample_vert_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; const orc_int8 * ORC_RESTRICT ptr7; orc_int8 var35; orc_int8 var36; orc_union16 var37; orc_int8 var38; orc_int8 var39; orc_union16 var40; orc_union16 var41; orc_int8 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_int8 *)ex->arrays[4]; ptr5 = (orc_int8 *)ex->arrays[5]; ptr6 = (orc_int8 *)ex->arrays[6]; ptr7 = (orc_int8 *)ex->arrays[7]; /* 5: loadpw */ var37.i = (int)0x00000006; /* 6 or 2.96439e-323f */ /* 12: loadpw */ var40.i = (int)0x0000001a; /* 26 or 1.28457e-322f */ /* 15: loadpw */ var41.i = (int)0x00000020; /* 32 or 1.58101e-322f */ for (i = 0; i < n; i++) { /* 0: loadb */ var35 = ptr4[i]; /* 1: convubw */ var43.i = (orc_uint8)var35; /* 2: loadb */ var36 = ptr7[i]; /* 3: convubw */ var44.i = (orc_uint8)var36; /* 4: addw */ var45.i = var43.i + var44.i; /* 6: mullw */ var46.i = (var45.i * var37.i) & 0xffff; /* 7: loadb */ var38 = ptr5[i]; /* 8: convubw */ var47.i = (orc_uint8)var38; /* 9: loadb */ var39 = ptr6[i]; /* 10: convubw */ var48.i = (orc_uint8)var39; /* 11: addw */ var49.i = var47.i + var48.i; /* 13: mullw */ var50.i = (var49.i * var40.i) & 0xffff; /* 14: addw */ var51.i = var50.i + var46.i; /* 16: addw */ var52.i = var51.i + var41.i; /* 17: shruw */ var53.i = ((orc_uint16)var52.i) >> 6; /* 18: convwb */ var42 = var53.i; /* 19: storeb */ ptr0[i] = var42; } } /* orc_downsample_horiz_u8 */ static void _backup_orc_downsample_horiz_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_int8 var41; orc_union16 var42; orc_int8 var43; orc_union16 var44; orc_union16 var45; orc_int8 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_int8 var51; orc_int8 var52; orc_union16 var53; orc_union16 var54; orc_union16 var55; orc_union16 var56; orc_union16 var57; orc_union16 var58; orc_union16 var59; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; /* 7: loadpw */ var38.i = (int)0x00000006; /* 6 or 2.96439e-323f */ /* 14: loadpw */ var39.i = (int)0x0000001a; /* 26 or 1.28457e-322f */ /* 17: loadpw */ var40.i = (int)0x00000020; /* 32 or 1.58101e-322f */ for (i = 0; i < n; i++) { /* 0: loadw */ var42 = ptr4[i]; /* 1: select1wb */ { orc_union16 _src; _src.i = var42.i; var43 = _src.x2[1]; } /* 2: convubw */ var44.i = (orc_uint8)var43; /* 3: loadoffw */ var45 = ptr4[i + 2]; /* 4: select0wb */ { orc_union16 _src; _src.i = var45.i; var46 = _src.x2[0]; } /* 5: convubw */ var47.i = (orc_uint8)var46; /* 6: addw */ var48.i = var44.i + var47.i; /* 8: mullw */ var49.i = (var48.i * var38.i) & 0xffff; /* 9: loadoffw */ var50 = ptr4[i + 1]; /* 10: splitwb */ { orc_union16 _src; _src.i = var50.i; var51 = _src.x2[1]; var52 = _src.x2[0]; } /* 11: convubw */ var53.i = (orc_uint8)var51; /* 12: convubw */ var54.i = (orc_uint8)var52; /* 13: addw */ var55.i = var53.i + var54.i; /* 15: mullw */ var56.i = (var55.i * var39.i) & 0xffff; /* 16: addw */ var57.i = var49.i + var56.i; /* 18: addw */ var58.i = var57.i + var40.i; /* 19: shruw */ var59.i = ((orc_uint16)var58.i) >> 6; /* 20: convwb */ var41 = var59.i; /* 21: storeb */ ptr0[i] = var41; } } /* orc_stats_moment_s16 */ static void _backup_orc_stats_moment_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; const orc_union16 * ORC_RESTRICT ptr4; orc_union32 var12 = { 0 }; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union32 var40; ptr4 = (orc_union16 *)ex->arrays[4]; /* 2: loadpw */ var35.i = (int)0x00000002; /* 2 or 9.88131e-324f */ /* 4: loadpw */ var36.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: absw */ var37.i = ORC_ABS(var34.i); /* 3: subw */ var38.i = var37.i - var35.i; /* 5: maxsw */ var39.i = ORC_MAX(var38.i, var36.i); /* 6: convuwl */ var40.i = (orc_uint16)var39.i; /* 7: accl */ var12.i = var12.i + var40.i; } ex->accumulators[0] = var12.i; } /* orc_stats_above_s16 */ static void _backup_orc_stats_above_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; const orc_union16 * ORC_RESTRICT ptr4; orc_union32 var12 = { 0 }; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union32 var42; ptr4 = (orc_union16 *)ex->arrays[4]; /* 2: loadpw */ var35.i = (int)0x00000001; /* 1 or 4.94066e-324f */ /* 4: loadpw */ var36.i = (int)0x00000000; /* 0 or 0f */ /* 6: loadpw */ var37.i = (int)0x00000001; /* 1 or 4.94066e-324f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: absw */ var38.i = ORC_ABS(var34.i); /* 3: subw */ var39.i = var38.i - var35.i; /* 5: maxsw */ var40.i = ORC_MAX(var39.i, var36.i); /* 7: minsw */ var41.i = ORC_MIN(var40.i, var37.i); /* 8: convuwl */ var42.i = (orc_uint16)var41.i; /* 9: accl */ var12.i = var12.i + var42.i; } ex->accumulators[0] = var12.i; } /* orc_accw */ static void _backup_orc_accw (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var12 = { 0 }; orc_union16 var33; orc_union16 var34; ptr4 = (orc_union16 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 1: absw */ var34.i = ORC_ABS(var33.i); /* 2: accw */ var12.i = var12.i + var34.i; } ex->accumulators[0] = (var12.i & 0xffff); } /* orc_avg2_8xn_u8 */ static void _backup_orc_avg2_8xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 8; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: avgub */ var34 = ((orc_uint8)var32 + (orc_uint8)var33 + 1)>>1; /* 3: storeb */ ptr0[i] = var34; } } } /* orc_avg2_12xn_u8 */ static void _backup_orc_avg2_12xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 12; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: avgub */ var34 = ((orc_uint8)var32 + (orc_uint8)var33 + 1)>>1; /* 3: storeb */ ptr0[i] = var34; } } } /* orc_avg2_16xn_u8 */ static void _backup_orc_avg2_16xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 16; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: avgub */ var34 = ((orc_uint8)var32 + (orc_uint8)var33 + 1)>>1; /* 3: storeb */ ptr0[i] = var34; } } } /* orc_avg2_32xn_u8 */ static void _backup_orc_avg2_32xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 32; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: avgub */ var34 = ((orc_uint8)var32 + (orc_uint8)var33 + 1)>>1; /* 3: storeb */ ptr0[i] = var34; } } } /* orc_avg2_nxm_u8 */ static void _backup_orc_avg2_nxm_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: avgub */ var34 = ((orc_uint8)var32 + (orc_uint8)var33 + 1)>>1; /* 3: storeb */ ptr0[i] = var34; } } } /* orc_combine4_8xn_u8 */ static void _backup_orc_combine4_8xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 8; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; const orc_int8 * ORC_RESTRICT ptr7; orc_int8 var34; orc_union16 var35; orc_int8 var36; orc_union16 var37; orc_int8 var38; orc_union16 var39; orc_int8 var40; orc_union16 var41; orc_union16 var42; orc_int8 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union16 var54; orc_union16 var55; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); ptr6 = ORC_PTR_OFFSET(ex->arrays[6], ex->params[6] * j); ptr7 = ORC_PTR_OFFSET(ex->arrays[7], ex->params[7] * j); /* 2: loadpw */ var35.i = ex->params[24]; /* 6: loadpw */ var37.i = ex->params[25]; /* 11: loadpw */ var39.i = ex->params[26]; /* 16: loadpw */ var41.i = ex->params[27]; /* 19: loadpw */ var42.i = (int)0x00000008; /* 8 or 3.95253e-323f */ for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var44.i = (orc_uint8)var34; /* 3: mullw */ var45.i = (var44.i * var35.i) & 0xffff; /* 4: loadb */ var36 = ptr5[i]; /* 5: convubw */ var46.i = (orc_uint8)var36; /* 7: mullw */ var47.i = (var46.i * var37.i) & 0xffff; /* 8: addw */ var48.i = var45.i + var47.i; /* 9: loadb */ var38 = ptr6[i]; /* 10: convubw */ var49.i = (orc_uint8)var38; /* 12: mullw */ var50.i = (var49.i * var39.i) & 0xffff; /* 13: addw */ var51.i = var48.i + var50.i; /* 14: loadb */ var40 = ptr7[i]; /* 15: convubw */ var52.i = (orc_uint8)var40; /* 17: mullw */ var53.i = (var52.i * var41.i) & 0xffff; /* 18: addw */ var54.i = var51.i + var53.i; /* 20: addw */ var55.i = var54.i + var42.i; /* 21: convsuswb */ var43 = ORC_CLAMP_UB(var55.i); /* 22: storeb */ ptr0[i] = var43; } } } /* orc_combine4_12xn_u8 */ static void _backup_orc_combine4_12xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 12; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; const orc_int8 * ORC_RESTRICT ptr7; orc_int8 var34; orc_union16 var35; orc_int8 var36; orc_union16 var37; orc_int8 var38; orc_union16 var39; orc_int8 var40; orc_union16 var41; orc_union16 var42; orc_int8 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union16 var54; orc_union16 var55; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); ptr6 = ORC_PTR_OFFSET(ex->arrays[6], ex->params[6] * j); ptr7 = ORC_PTR_OFFSET(ex->arrays[7], ex->params[7] * j); /* 2: loadpw */ var35.i = ex->params[24]; /* 6: loadpw */ var37.i = ex->params[25]; /* 11: loadpw */ var39.i = ex->params[26]; /* 16: loadpw */ var41.i = ex->params[27]; /* 19: loadpw */ var42.i = (int)0x00000008; /* 8 or 3.95253e-323f */ for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var44.i = (orc_uint8)var34; /* 3: mullw */ var45.i = (var44.i * var35.i) & 0xffff; /* 4: loadb */ var36 = ptr5[i]; /* 5: convubw */ var46.i = (orc_uint8)var36; /* 7: mullw */ var47.i = (var46.i * var37.i) & 0xffff; /* 8: addw */ var48.i = var45.i + var47.i; /* 9: loadb */ var38 = ptr6[i]; /* 10: convubw */ var49.i = (orc_uint8)var38; /* 12: mullw */ var50.i = (var49.i * var39.i) & 0xffff; /* 13: addw */ var51.i = var48.i + var50.i; /* 14: loadb */ var40 = ptr7[i]; /* 15: convubw */ var52.i = (orc_uint8)var40; /* 17: mullw */ var53.i = (var52.i * var41.i) & 0xffff; /* 18: addw */ var54.i = var51.i + var53.i; /* 20: addw */ var55.i = var54.i + var42.i; /* 21: convsuswb */ var43 = ORC_CLAMP_UB(var55.i); /* 22: storeb */ ptr0[i] = var43; } } } /* orc_combine4_16xn_u8 */ static void _backup_orc_combine4_16xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 16; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; const orc_int8 * ORC_RESTRICT ptr7; orc_int8 var34; orc_union16 var35; orc_int8 var36; orc_union16 var37; orc_int8 var38; orc_union16 var39; orc_int8 var40; orc_union16 var41; orc_union16 var42; orc_int8 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union16 var54; orc_union16 var55; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); ptr6 = ORC_PTR_OFFSET(ex->arrays[6], ex->params[6] * j); ptr7 = ORC_PTR_OFFSET(ex->arrays[7], ex->params[7] * j); /* 2: loadpw */ var35.i = ex->params[24]; /* 6: loadpw */ var37.i = ex->params[25]; /* 11: loadpw */ var39.i = ex->params[26]; /* 16: loadpw */ var41.i = ex->params[27]; /* 19: loadpw */ var42.i = (int)0x00000008; /* 8 or 3.95253e-323f */ for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var44.i = (orc_uint8)var34; /* 3: mullw */ var45.i = (var44.i * var35.i) & 0xffff; /* 4: loadb */ var36 = ptr5[i]; /* 5: convubw */ var46.i = (orc_uint8)var36; /* 7: mullw */ var47.i = (var46.i * var37.i) & 0xffff; /* 8: addw */ var48.i = var45.i + var47.i; /* 9: loadb */ var38 = ptr6[i]; /* 10: convubw */ var49.i = (orc_uint8)var38; /* 12: mullw */ var50.i = (var49.i * var39.i) & 0xffff; /* 13: addw */ var51.i = var48.i + var50.i; /* 14: loadb */ var40 = ptr7[i]; /* 15: convubw */ var52.i = (orc_uint8)var40; /* 17: mullw */ var53.i = (var52.i * var41.i) & 0xffff; /* 18: addw */ var54.i = var51.i + var53.i; /* 20: addw */ var55.i = var54.i + var42.i; /* 21: convsuswb */ var43 = ORC_CLAMP_UB(var55.i); /* 22: storeb */ ptr0[i] = var43; } } } /* orc_combine4_24xn_u8 */ static void _backup_orc_combine4_24xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 24; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; const orc_int8 * ORC_RESTRICT ptr7; orc_int8 var34; orc_union16 var35; orc_int8 var36; orc_union16 var37; orc_int8 var38; orc_union16 var39; orc_int8 var40; orc_union16 var41; orc_union16 var42; orc_int8 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union16 var54; orc_union16 var55; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); ptr6 = ORC_PTR_OFFSET(ex->arrays[6], ex->params[6] * j); ptr7 = ORC_PTR_OFFSET(ex->arrays[7], ex->params[7] * j); /* 2: loadpw */ var35.i = ex->params[24]; /* 6: loadpw */ var37.i = ex->params[25]; /* 11: loadpw */ var39.i = ex->params[26]; /* 16: loadpw */ var41.i = ex->params[27]; /* 19: loadpw */ var42.i = (int)0x00000008; /* 8 or 3.95253e-323f */ for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var44.i = (orc_uint8)var34; /* 3: mullw */ var45.i = (var44.i * var35.i) & 0xffff; /* 4: loadb */ var36 = ptr5[i]; /* 5: convubw */ var46.i = (orc_uint8)var36; /* 7: mullw */ var47.i = (var46.i * var37.i) & 0xffff; /* 8: addw */ var48.i = var45.i + var47.i; /* 9: loadb */ var38 = ptr6[i]; /* 10: convubw */ var49.i = (orc_uint8)var38; /* 12: mullw */ var50.i = (var49.i * var39.i) & 0xffff; /* 13: addw */ var51.i = var48.i + var50.i; /* 14: loadb */ var40 = ptr7[i]; /* 15: convubw */ var52.i = (orc_uint8)var40; /* 17: mullw */ var53.i = (var52.i * var41.i) & 0xffff; /* 18: addw */ var54.i = var51.i + var53.i; /* 20: addw */ var55.i = var54.i + var42.i; /* 21: convsuswb */ var43 = ORC_CLAMP_UB(var55.i); /* 22: storeb */ ptr0[i] = var43; } } } /* orc_combine4_32xn_u8 */ static void _backup_orc_combine4_32xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 32; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; const orc_int8 * ORC_RESTRICT ptr7; orc_int8 var34; orc_union16 var35; orc_int8 var36; orc_union16 var37; orc_int8 var38; orc_union16 var39; orc_int8 var40; orc_union16 var41; orc_union16 var42; orc_int8 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union16 var54; orc_union16 var55; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); ptr6 = ORC_PTR_OFFSET(ex->arrays[6], ex->params[6] * j); ptr7 = ORC_PTR_OFFSET(ex->arrays[7], ex->params[7] * j); /* 2: loadpw */ var35.i = ex->params[24]; /* 6: loadpw */ var37.i = ex->params[25]; /* 11: loadpw */ var39.i = ex->params[26]; /* 16: loadpw */ var41.i = ex->params[27]; /* 19: loadpw */ var42.i = (int)0x00000008; /* 8 or 3.95253e-323f */ for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var44.i = (orc_uint8)var34; /* 3: mullw */ var45.i = (var44.i * var35.i) & 0xffff; /* 4: loadb */ var36 = ptr5[i]; /* 5: convubw */ var46.i = (orc_uint8)var36; /* 7: mullw */ var47.i = (var46.i * var37.i) & 0xffff; /* 8: addw */ var48.i = var45.i + var47.i; /* 9: loadb */ var38 = ptr6[i]; /* 10: convubw */ var49.i = (orc_uint8)var38; /* 12: mullw */ var50.i = (var49.i * var39.i) & 0xffff; /* 13: addw */ var51.i = var48.i + var50.i; /* 14: loadb */ var40 = ptr7[i]; /* 15: convubw */ var52.i = (orc_uint8)var40; /* 17: mullw */ var53.i = (var52.i * var41.i) & 0xffff; /* 18: addw */ var54.i = var51.i + var53.i; /* 20: addw */ var55.i = var54.i + var42.i; /* 21: convsuswb */ var43 = ORC_CLAMP_UB(var55.i); /* 22: storeb */ ptr0[i] = var43; } } } /* orc_combine4_nxm_u8 */ static void _backup_orc_combine4_nxm_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; const orc_int8 * ORC_RESTRICT ptr7; orc_int8 var34; orc_union16 var35; orc_int8 var36; orc_union16 var37; orc_int8 var38; orc_union16 var39; orc_int8 var40; orc_union16 var41; orc_union16 var42; orc_int8 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union16 var54; orc_union16 var55; orc_union16 var56; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); ptr6 = ORC_PTR_OFFSET(ex->arrays[6], ex->params[6] * j); ptr7 = ORC_PTR_OFFSET(ex->arrays[7], ex->params[7] * j); /* 2: loadpw */ var35.i = ex->params[24]; /* 6: loadpw */ var37.i = ex->params[25]; /* 11: loadpw */ var39.i = ex->params[26]; /* 16: loadpw */ var41.i = ex->params[27]; /* 19: loadpw */ var42.i = (int)0x00000008; /* 8 or 3.95253e-323f */ for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var44.i = (orc_uint8)var34; /* 3: mullw */ var45.i = (var44.i * var35.i) & 0xffff; /* 4: loadb */ var36 = ptr5[i]; /* 5: convubw */ var46.i = (orc_uint8)var36; /* 7: mullw */ var47.i = (var46.i * var37.i) & 0xffff; /* 8: addw */ var48.i = var45.i + var47.i; /* 9: loadb */ var38 = ptr6[i]; /* 10: convubw */ var49.i = (orc_uint8)var38; /* 12: mullw */ var50.i = (var49.i * var39.i) & 0xffff; /* 13: addw */ var51.i = var48.i + var50.i; /* 14: loadb */ var40 = ptr7[i]; /* 15: convubw */ var52.i = (orc_uint8)var40; /* 17: mullw */ var53.i = (var52.i * var41.i) & 0xffff; /* 18: addw */ var54.i = var51.i + var53.i; /* 20: addw */ var55.i = var54.i + var42.i; /* 21: shrsw */ var56.i = var55.i >> 4; /* 22: convsuswb */ var43 = ORC_CLAMP_UB(var56.i); /* 23: storeb */ ptr0[i] = var43; } } } /* orc_combine2_8xn_u8 */ static void _backup_orc_combine2_8xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 8; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var34; orc_int8 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_int8 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); /* 4: loadpw */ var36.i = ex->params[24]; /* 6: loadpw */ var37.i = ex->params[25]; /* 9: loadpw */ var38.i = ex->params[26]; for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var40.i = (orc_uint8)var34; /* 2: loadb */ var35 = ptr5[i]; /* 3: convubw */ var41.i = (orc_uint8)var35; /* 5: mullw */ var42.i = (var40.i * var36.i) & 0xffff; /* 7: mullw */ var43.i = (var41.i * var37.i) & 0xffff; /* 8: addw */ var44.i = var42.i + var43.i; /* 10: addw */ var45.i = var44.i + var38.i; /* 11: shrsw */ var46.i = var45.i >> ex->params[27]; /* 12: convsuswb */ var39 = ORC_CLAMP_UB(var46.i); /* 13: storeb */ ptr0[i] = var39; } } } /* orc_combine2_12xn_u8 */ static void _backup_orc_combine2_12xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 12; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var34; orc_int8 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_int8 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); /* 4: loadpw */ var36.i = ex->params[24]; /* 6: loadpw */ var37.i = ex->params[25]; /* 9: loadpw */ var38.i = ex->params[26]; for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var40.i = (orc_uint8)var34; /* 2: loadb */ var35 = ptr5[i]; /* 3: convubw */ var41.i = (orc_uint8)var35; /* 5: mullw */ var42.i = (var40.i * var36.i) & 0xffff; /* 7: mullw */ var43.i = (var41.i * var37.i) & 0xffff; /* 8: addw */ var44.i = var42.i + var43.i; /* 10: addw */ var45.i = var44.i + var38.i; /* 11: shrsw */ var46.i = var45.i >> ex->params[27]; /* 12: convsuswb */ var39 = ORC_CLAMP_UB(var46.i); /* 13: storeb */ ptr0[i] = var39; } } } /* orc_combine2_16xn_u8 */ static void _backup_orc_combine2_16xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 16; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var34; orc_int8 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_int8 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); /* 4: loadpw */ var36.i = ex->params[24]; /* 6: loadpw */ var37.i = ex->params[25]; /* 9: loadpw */ var38.i = ex->params[26]; for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var40.i = (orc_uint8)var34; /* 2: loadb */ var35 = ptr5[i]; /* 3: convubw */ var41.i = (orc_uint8)var35; /* 5: mullw */ var42.i = (var40.i * var36.i) & 0xffff; /* 7: mullw */ var43.i = (var41.i * var37.i) & 0xffff; /* 8: addw */ var44.i = var42.i + var43.i; /* 10: addw */ var45.i = var44.i + var38.i; /* 11: shrsw */ var46.i = var45.i >> ex->params[27]; /* 12: convsuswb */ var39 = ORC_CLAMP_UB(var46.i); /* 13: storeb */ ptr0[i] = var39; } } } /* orc_combine2_nxm_u8 */ static void _backup_orc_combine2_nxm_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var34; orc_int8 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_int8 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); /* 4: loadpw */ var36.i = ex->params[24]; /* 6: loadpw */ var37.i = ex->params[25]; /* 9: loadpw */ var38.i = ex->params[26]; for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var40.i = (orc_uint8)var34; /* 2: loadb */ var35 = ptr5[i]; /* 3: convubw */ var41.i = (orc_uint8)var35; /* 5: mullw */ var42.i = (var40.i * var36.i) & 0xffff; /* 7: mullw */ var43.i = (var41.i * var37.i) & 0xffff; /* 8: addw */ var44.i = var42.i + var43.i; /* 10: addw */ var45.i = var44.i + var38.i; /* 11: shrsw */ var46.i = var45.i >> ex->params[27]; /* 12: convsuswb */ var39 = ORC_CLAMP_UB(var46.i); /* 13: storeb */ ptr0[i] = var39; } } } /* orc_sad_nxm_u8 */ static void _backup_orc_sad_nxm_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_union32 var12 = { 0 }; orc_int8 var32; orc_int8 var33; for (j = 0; j < m; j++) { ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: accsadubl */ var12.i = var12.i + ORC_ABS((orc_int32)(orc_uint8)var32 - (orc_int32)(orc_uint8)var33); } } ex->accumulators[0] = var12.i; } /* orc_sad_8x8_u8 */ static void _backup_orc_sad_8x8_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 8; int m = 8; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_union32 var12 = { 0 }; orc_int8 var32; orc_int8 var33; for (j = 0; j < m; j++) { ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: accsadubl */ var12.i = var12.i + ORC_ABS((orc_int32)(orc_uint8)var32 - (orc_int32)(orc_uint8)var33); } } ex->accumulators[0] = var12.i; } /* orc_sad_12x12_u8 */ static void _backup_orc_sad_12x12_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 12; int m = 12; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_union32 var12 = { 0 }; orc_int8 var32; orc_int8 var33; for (j = 0; j < m; j++) { ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: accsadubl */ var12.i = var12.i + ORC_ABS((orc_int32)(orc_uint8)var32 - (orc_int32)(orc_uint8)var33); } } ex->accumulators[0] = var12.i; } /* orc_sad_16xn_u8 */ static void _backup_orc_sad_16xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 16; int m = ex->params[ORC_VAR_A1]; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_union32 var12 = { 0 }; orc_int8 var32; orc_int8 var33; for (j = 0; j < m; j++) { ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: accsadubl */ var12.i = var12.i + ORC_ABS((orc_int32)(orc_uint8)var32 - (orc_int32)(orc_uint8)var33); } } ex->accumulators[0] = var12.i; } /* orc_sad_32xn_u8 */ static void _backup_orc_sad_32xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 32; int m = ex->params[ORC_VAR_A1]; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_union32 var12 = { 0 }; orc_int8 var32; orc_int8 var33; for (j = 0; j < m; j++) { ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: accsadubl */ var12.i = var12.i + ORC_ABS((orc_int32)(orc_uint8)var32 - (orc_int32)(orc_uint8)var33); } } ex->accumulators[0] = var12.i; } /* orc_add2_rshift_add_s32_22_op */ static void _backup_orc_add2_rshift_add_s32_22_op (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; const orc_union32 * ORC_RESTRICT ptr6; orc_union32 var33; orc_union32 var34; orc_union32 var35; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; ptr5 = (orc_union32 *)ex->arrays[5]; ptr6 = (orc_union32 *)ex->arrays[6]; /* 3: loadpl */ var35.i = (int)0x00000002; /* 2 or 9.88131e-324f */ for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr5[i]; /* 1: loadl */ var34 = ptr6[i]; /* 2: addl */ var38.i = var33.i + var34.i; /* 4: addl */ var39.i = var38.i + var35.i; /* 5: shrsl */ var40.i = var39.i >> 2; /* 6: loadl */ var36 = ptr4[i]; /* 7: addl */ var37.i = var36.i + var40.i; /* 8: storel */ ptr0[i] = var37; } } /* orc_mas4_vert_add_s32_1991_op */ static void _backup_orc_mas4_vert_add_s32_1991_op (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; const orc_union32 * ORC_RESTRICT ptr6; const orc_union32 * ORC_RESTRICT ptr7; const orc_union32 * ORC_RESTRICT ptr8; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; orc_union32 var44; orc_union32 var45; orc_union32 var46; orc_union32 var47; orc_union32 var48; orc_union32 var49; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; ptr5 = (orc_union32 *)ex->arrays[5]; ptr6 = (orc_union32 *)ex->arrays[6]; ptr7 = (orc_union32 *)ex->arrays[7]; ptr8 = (orc_union32 *)ex->arrays[8]; /* 3: loadpl */ var38.i = (int)0x00000009; /* 9 or 4.44659e-323f */ /* 9: loadpl */ var41.i = ex->params[24]; for (i = 0; i < n; i++) { /* 0: loadl */ var36 = ptr6[i]; /* 1: loadl */ var37 = ptr7[i]; /* 2: addl */ var44.i = var36.i + var37.i; /* 4: mulll */ var45.i = (var44.i * var38.i) & 0xffffffff; /* 5: loadl */ var39 = ptr5[i]; /* 6: loadl */ var40 = ptr8[i]; /* 7: addl */ var46.i = var39.i + var40.i; /* 8: subl */ var47.i = var45.i - var46.i; /* 10: addl */ var48.i = var47.i + var41.i; /* 11: shrsl */ var49.i = var48.i >> ex->params[25]; /* 12: loadl */ var42 = ptr4[i]; /* 13: addl */ var43.i = var42.i + var49.i; /* 14: storel */ ptr0[i] = var43; } } /* orc_add2_rshift_sub_s32_22_op */ static void _backup_orc_add2_rshift_sub_s32_22_op (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; const orc_union32 * ORC_RESTRICT ptr6; orc_union32 var33; orc_union32 var34; orc_union32 var35; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; ptr5 = (orc_union32 *)ex->arrays[5]; ptr6 = (orc_union32 *)ex->arrays[6]; /* 3: loadpl */ var35.i = (int)0x00000002; /* 2 or 9.88131e-324f */ for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr5[i]; /* 1: loadl */ var34 = ptr6[i]; /* 2: addl */ var38.i = var33.i + var34.i; /* 4: addl */ var39.i = var38.i + var35.i; /* 5: shrsl */ var40.i = var39.i >> 2; /* 6: loadl */ var36 = ptr4[i]; /* 7: subl */ var37.i = var36.i - var40.i; /* 8: storel */ ptr0[i] = var37; } } /* orc_interleave2_rrshift1_s32 */ static void _backup_orc_interleave2_rrshift1_s32 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union64 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var34; orc_union32 var35; orc_union32 var36; orc_union32 var37; orc_union64 var38; orc_union32 var39; orc_union32 var40; orc_union32 var41; orc_union32 var42; ptr0 = (orc_union64 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; ptr5 = (orc_union32 *)ex->arrays[5]; /* 1: loadpl */ var35.i = (int)0x00000001; /* 1 or 4.94066e-324f */ /* 5: loadpl */ var37.i = (int)0x00000001; /* 1 or 4.94066e-324f */ for (i = 0; i < n; i++) { /* 0: loadl */ var34 = ptr4[i]; /* 2: addl */ var39.i = var34.i + var35.i; /* 3: shrsl */ var40.i = var39.i >> 1; /* 4: loadl */ var36 = ptr5[i]; /* 6: addl */ var41.i = var36.i + var37.i; /* 7: shrsl */ var42.i = var41.i >> 1; /* 8: mergelq */ { orc_union64 _dest; _dest.x2[0] = var40.i; _dest.x2[1] = var42.i; var38.i = _dest.i; } /* 9: storeq */ ptr0[i] = var38; } } /* orc_mas4_vert_sub_s32_1991_op */ static void _backup_orc_mas4_vert_sub_s32_1991_op (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; const orc_union32 * ORC_RESTRICT ptr6; const orc_union32 * ORC_RESTRICT ptr7; const orc_union32 * ORC_RESTRICT ptr8; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; orc_union32 var44; orc_union32 var45; orc_union32 var46; orc_union32 var47; orc_union32 var48; orc_union32 var49; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; ptr5 = (orc_union32 *)ex->arrays[5]; ptr6 = (orc_union32 *)ex->arrays[6]; ptr7 = (orc_union32 *)ex->arrays[7]; ptr8 = (orc_union32 *)ex->arrays[8]; /* 3: loadpl */ var38.i = (int)0x00000009; /* 9 or 4.44659e-323f */ /* 9: loadpl */ var41.i = ex->params[24]; for (i = 0; i < n; i++) { /* 0: loadl */ var36 = ptr6[i]; /* 1: loadl */ var37 = ptr7[i]; /* 2: addl */ var44.i = var36.i + var37.i; /* 4: mulll */ var45.i = (var44.i * var38.i) & 0xffffffff; /* 5: loadl */ var39 = ptr5[i]; /* 6: loadl */ var40 = ptr8[i]; /* 7: addl */ var46.i = var39.i + var40.i; /* 8: subl */ var47.i = var45.i - var46.i; /* 10: addl */ var48.i = var47.i + var41.i; /* 11: shrsl */ var49.i = var48.i >> ex->params[25]; /* 12: loadl */ var42 = ptr4[i]; /* 13: subl */ var43.i = var42.i - var49.i; /* 14: storel */ ptr0[i] = var43; } } /* orc_mas4_vert_sub_s32_1991 */ static void _backup_orc_mas4_vert_sub_s32_1991 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; const orc_union32 * ORC_RESTRICT ptr6; const orc_union32 * ORC_RESTRICT ptr7; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; orc_union32 var44; orc_union32 var45; orc_union32 var46; orc_union32 var47; orc_union32 var48; orc_union32 var49; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; ptr5 = (orc_union32 *)ex->arrays[5]; ptr6 = (orc_union32 *)ex->arrays[6]; ptr7 = (orc_union32 *)ex->arrays[7]; /* 3: loadpl */ var38.i = (int)0x00000009; /* 9 or 4.44659e-323f */ /* 9: loadpl */ var41.i = ex->params[24]; for (i = 0; i < n; i++) { /* 0: loadl */ var36 = ptr5[i]; /* 1: loadl */ var37 = ptr6[i]; /* 2: addl */ var44.i = var36.i + var37.i; /* 4: mulll */ var45.i = (var44.i * var38.i) & 0xffffffff; /* 5: loadl */ var39 = ptr4[i]; /* 6: loadl */ var40 = ptr7[i]; /* 7: addl */ var46.i = var39.i + var40.i; /* 8: subl */ var47.i = var45.i - var46.i; /* 10: addl */ var48.i = var47.i + var41.i; /* 11: shrsl */ var49.i = var48.i >> ex->params[25]; /* 12: loadl */ var42 = ptr0[i]; /* 13: subl */ var43.i = var42.i - var49.i; /* 14: storel */ ptr0[i] = var43; } } /* orc_mas4_horiz_add_s32_1991_ip */ static void _backup_orc_mas4_horiz_add_s32_1991_ip (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; orc_union32 var44; orc_union32 var45; orc_union32 var46; orc_union32 var47; orc_union32 var48; orc_union32 var49; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; /* 3: loadpl */ var36.i = (int)0x00000009; /* 9 or 4.44659e-323f */ /* 9: loadpl */ var37.i = ex->params[24]; for (i = 0; i < n; i++) { /* 0: loadoffl */ var40 = ptr4[i + 1]; /* 1: loadoffl */ var41 = ptr4[i + 2]; /* 2: addl */ var42.i = var40.i + var41.i; /* 4: mulll */ var43.i = (var42.i * var36.i) & 0xffffffff; /* 5: loadl */ var44 = ptr4[i]; /* 6: loadoffl */ var45 = ptr4[i + 3]; /* 7: addl */ var46.i = var44.i + var45.i; /* 8: subl */ var47.i = var43.i - var46.i; /* 10: addl */ var48.i = var47.i + var37.i; /* 11: shrsl */ var49.i = var48.i >> ex->params[25]; /* 12: loadl */ var38 = ptr0[i]; /* 13: addl */ var39.i = var38.i + var49.i; /* 14: storel */ ptr0[i] = var39; } } /* orc_add2_rshift_add_s32_11_op */ static void _backup_orc_add2_rshift_add_s32_11_op (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; const orc_union32 * ORC_RESTRICT ptr6; orc_union32 var33; orc_union32 var34; orc_union32 var35; orc_union32 var36; orc_union32 var37; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; ptr5 = (orc_union32 *)ex->arrays[5]; ptr6 = (orc_union32 *)ex->arrays[6]; for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr5[i]; /* 1: loadl */ var34 = ptr6[i]; /* 2: avgsl */ var37.i = ((orc_int64)var33.i + (orc_int64)var34.i + 1)>>1; /* 3: loadl */ var35 = ptr4[i]; /* 4: addl */ var36.i = var35.i + var37.i; /* 5: storel */ ptr0[i] = var36; } } /* orc_mas4_horiz_sub_s32_1991_ip */ static void _backup_orc_mas4_horiz_sub_s32_1991_ip (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; orc_union32 var44; orc_union32 var45; orc_union32 var46; orc_union32 var47; orc_union32 var48; orc_union32 var49; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; /* 3: loadpl */ var36.i = (int)0x00000009; /* 9 or 4.44659e-323f */ /* 9: loadpl */ var37.i = ex->params[24]; for (i = 0; i < n; i++) { /* 0: loadoffl */ var40 = ptr4[i + 1]; /* 1: loadoffl */ var41 = ptr4[i + 2]; /* 2: addl */ var42.i = var40.i + var41.i; /* 4: mulll */ var43.i = (var42.i * var36.i) & 0xffffffff; /* 5: loadl */ var44 = ptr4[i]; /* 6: loadoffl */ var45 = ptr4[i + 3]; /* 7: addl */ var46.i = var44.i + var45.i; /* 8: subl */ var47.i = var43.i - var46.i; /* 10: addl */ var48.i = var47.i + var37.i; /* 11: shrsl */ var49.i = var48.i >> ex->params[25]; /* 12: loadl */ var38 = ptr0[i]; /* 13: subl */ var39.i = var38.i - var49.i; /* 14: storel */ ptr0[i] = var39; } } /* orc_haar_synth_s32_lo */ static void _backup_orc_haar_synth_s32_lo (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var33; orc_union32 var34; orc_union32 var35; orc_union32 var36; orc_union32 var37; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; ptr5 = (orc_union32 *)ex->arrays[5]; /* 1: loadpl */ var34.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr5[i]; /* 2: avgsl */ var37.i = ((orc_int64)var33.i + (orc_int64)var34.i + 1)>>1; /* 3: loadl */ var35 = ptr4[i]; /* 4: subl */ var36.i = var35.i - var37.i; /* 5: storel */ ptr0[i] = var36; } } /* orc_haar_synth_int_s32 */ static void _backup_orc_haar_synth_int_s32 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union64 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var34; orc_union32 var35; orc_union32 var36; orc_union64 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; orc_union32 var41; ptr0 = (orc_union64 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; ptr5 = (orc_union32 *)ex->arrays[5]; /* 2: loadpl */ var35.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadl */ var34 = ptr5[i]; /* 1: copyl */ var38.i = var34.i; /* 3: avgsl */ var39.i = ((orc_int64)var38.i + (orc_int64)var35.i + 1)>>1; /* 4: loadl */ var36 = ptr4[i]; /* 5: subl */ var40.i = var36.i - var39.i; /* 6: addl */ var41.i = var38.i + var40.i; /* 7: mergelq */ { orc_union64 _dest; _dest.x2[0] = var40.i; _dest.x2[1] = var41.i; var37.i = _dest.i; } /* 8: storeq */ ptr0[i] = var37; } } /* orc_haar_synth_rrshift1_int_s32 */ static void _backup_orc_haar_synth_rrshift1_int_s32 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union64 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var34; orc_union32 var35; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union64 var39; orc_union32 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; orc_union32 var44; orc_union32 var45; ptr0 = (orc_union64 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; ptr5 = (orc_union32 *)ex->arrays[5]; /* 2: loadpl */ var35.i = (int)0x00000000; /* 0 or 0f */ /* 7: loadpl */ var37.i = (int)0x00000000; /* 0 or 0f */ /* 9: loadpl */ var38.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadl */ var34 = ptr5[i]; /* 1: copyl */ var40.i = var34.i; /* 3: avgsl */ var41.i = ((orc_int64)var40.i + (orc_int64)var35.i + 1)>>1; /* 4: loadl */ var36 = ptr4[i]; /* 5: subl */ var42.i = var36.i - var41.i; /* 6: addl */ var43.i = var40.i + var42.i; /* 8: avgsl */ var44.i = ((orc_int64)var42.i + (orc_int64)var37.i + 1)>>1; /* 10: avgsl */ var45.i = ((orc_int64)var43.i + (orc_int64)var38.i + 1)>>1; /* 11: mergelq */ { orc_union64 _dest; _dest.x2[0] = var44.i; _dest.x2[1] = var45.i; var39.i = _dest.i; } /* 12: storeq */ ptr0[i] = var39; } } /* orc_interleave2_s32 */ static void _backup_orc_interleave2_s32 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union64 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var32; orc_union32 var33; orc_union64 var34; ptr0 = (orc_union64 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; ptr5 = (orc_union32 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: loadl */ var33 = ptr5[i]; /* 2: mergelq */ { orc_union64 _dest; _dest.x2[0] = var32.i; _dest.x2[1] = var33.i; var34.i = _dest.i; } /* 3: storeq */ ptr0[i] = var34; } } /* orc_mas2_sub_s32_ip */ static void _backup_orc_mas2_sub_s32_ip (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var34; orc_union32 var35; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; /* 3: loadpl */ var35.i = ex->params[24]; /* 5: loadpl */ var36.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadoffl */ var39 = ptr4[i + 1]; /* 1: loadl */ var34 = ptr4[i]; /* 2: addl */ var40.i = var34.i + var39.i; /* 4: mulll */ var41.i = (var40.i * var35.i) & 0xffffffff; /* 6: addl */ var42.i = var41.i + var36.i; /* 7: shrsl */ var43.i = var42.i >> ex->params[26]; /* 8: loadl */ var37 = ptr0[i]; /* 9: subl */ var38.i = var37.i - var43.i; /* 10: storel */ ptr0[i] = var38; } } /* orc_mas2_add_s32_ip */ static void _backup_orc_mas2_add_s32_ip (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var34; orc_union32 var35; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; /* 3: loadpl */ var35.i = ex->params[24]; /* 5: loadpl */ var36.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadoffl */ var39 = ptr4[i + 1]; /* 1: loadl */ var34 = ptr4[i]; /* 2: addl */ var40.i = var34.i + var39.i; /* 4: mulll */ var41.i = (var40.i * var35.i) & 0xffffffff; /* 6: addl */ var42.i = var41.i + var36.i; /* 7: shrsl */ var43.i = var42.i >> ex->params[26]; /* 8: loadl */ var37 = ptr0[i]; /* 9: addl */ var38.i = var37.i + var43.i; /* 10: storel */ ptr0[i] = var38; } } /* orc_mas2_add_s32_op */ static void _backup_orc_mas2_add_s32_op (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; const orc_union32 * ORC_RESTRICT ptr6; orc_union32 var34; orc_union32 var35; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; ptr5 = (orc_union32 *)ex->arrays[5]; ptr6 = (orc_union32 *)ex->arrays[6]; /* 3: loadpl */ var36.i = ex->params[24]; /* 5: loadpl */ var37.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadl */ var34 = ptr5[i]; /* 1: loadl */ var35 = ptr6[i]; /* 2: addl */ var40.i = var34.i + var35.i; /* 4: mulll */ var41.i = (var40.i * var36.i) & 0xffffffff; /* 6: addl */ var42.i = var41.i + var37.i; /* 7: shrsl */ var43.i = var42.i >> ex->params[26]; /* 8: loadl */ var38 = ptr4[i]; /* 9: addl */ var39.i = var38.i + var43.i; /* 10: storel */ ptr0[i] = var39; } } /* orc_mas2_sub_s32_op */ static void _backup_orc_mas2_sub_s32_op (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; const orc_union32 * ORC_RESTRICT ptr6; orc_union32 var34; orc_union32 var35; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; ptr5 = (orc_union32 *)ex->arrays[5]; ptr6 = (orc_union32 *)ex->arrays[6]; /* 3: loadpl */ var36.i = ex->params[24]; /* 5: loadpl */ var37.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadl */ var34 = ptr5[i]; /* 1: loadl */ var35 = ptr6[i]; /* 2: addl */ var40.i = var34.i + var35.i; /* 4: mulll */ var41.i = (var40.i * var36.i) & 0xffffffff; /* 6: addl */ var42.i = var41.i + var37.i; /* 7: shrsl */ var43.i = var42.i >> ex->params[26]; /* 8: loadl */ var38 = ptr4[i]; /* 9: subl */ var39.i = var38.i - var43.i; /* 10: storel */ ptr0[i] = var39; } } /* orc_add2_rshift_sub_s32_22 */ static void _backup_orc_add2_rshift_sub_s32_22 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var33; orc_union32 var34; orc_union32 var35; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; /* 3: loadpl */ var34.i = (int)0x00000002; /* 2 or 9.88131e-324f */ for (i = 0; i < n; i++) { /* 0: loadoffl */ var37 = ptr4[i + 1]; /* 1: loadl */ var33 = ptr4[i]; /* 2: addl */ var38.i = var33.i + var37.i; /* 4: addl */ var39.i = var38.i + var34.i; /* 5: shrsl */ var40.i = var39.i >> 2; /* 6: loadl */ var35 = ptr0[i]; /* 7: subl */ var36.i = var35.i - var40.i; /* 8: storel */ ptr0[i] = var36; } } /* orc_add2_rshift_add_s32_11 */ static void _backup_orc_add2_rshift_add_s32_11 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var33; orc_union32 var34; orc_union32 var35; orc_union32 var36; orc_union32 var37; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadoffl */ var36 = ptr4[i + 1]; /* 1: loadl */ var33 = ptr4[i]; /* 2: avgsl */ var37.i = ((orc_int64)var33.i + (orc_int64)var36.i + 1)>>1; /* 3: loadl */ var34 = ptr0[i]; /* 4: addl */ var35.i = var34.i + var37.i; /* 5: storel */ ptr0[i] = var35; } } /* orc_haar_synth_s32 */ static void _backup_orc_haar_synth_s32 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; orc_union32 * ORC_RESTRICT ptr1; orc_union32 var35; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; ptr0 = (orc_union32 *)ex->arrays[0]; ptr1 = (orc_union32 *)ex->arrays[1]; /* 4: loadpl */ var37.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadl */ var35 = ptr0[i]; /* 1: copyl */ var40.i = var35.i; /* 2: loadl */ var36 = ptr1[i]; /* 3: copyl */ var41.i = var36.i; /* 5: avgsl */ var42.i = ((orc_int64)var41.i + (orc_int64)var37.i + 1)>>1; /* 6: subl */ var43.i = var40.i - var42.i; /* 7: copyl */ var38.i = var43.i; /* 8: storel */ ptr0[i] = var38; /* 9: addl */ var39.i = var41.i + var43.i; /* 10: storel */ ptr1[i] = var39; } } /* orc_splat_s32_2d */ static void _backup_orc_splat_s32_2d (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_union32 * ORC_RESTRICT ptr0; orc_union32 var32; orc_union32 var33; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); /* 0: loadpl */ var32.i = ex->params[24]; for (i = 0; i < n; i++) { /* 1: copyl */ var33.i = var32.i; /* 2: storel */ ptr0[i] = var33; } } } /* orc_dequantise_s32_ip_2d */ static void _backup_orc_dequantise_s32_ip_2d (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_union32 * ORC_RESTRICT ptr0; orc_union32 var34; orc_union32 var35; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); /* 4: loadpl */ var35.i = ex->params[24]; /* 6: loadpl */ var36.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadl */ var34 = ptr0[i]; /* 1: copyl */ var38.i = var34.i; /* 2: signl */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absl */ var40.i = ORC_ABS(var38.i); /* 5: mulll */ var41.i = (var40.i * var35.i) & 0xffffffff; /* 7: addl */ var42.i = var41.i + var36.i; /* 8: shrsl */ var43.i = var42.i >> 2; /* 9: mulll */ var37.i = (var43.i * var39.i) & 0xffffffff; /* 10: storel */ ptr0[i] = var37; } } } static int quiet = 0; static int benchmark = 0; static void help (const char *argv0) { printf("Usage:\n"); printf(" %s [OPTION]\n", argv0); printf("Help Options:\n"); printf(" -h, --help Show help options\n"); printf("Application Options:\n"); printf(" -b, --benchmark Run benchmark and show results\n"); printf(" -q, --quiet Don't output anything except on failures\n"); exit(0); } int main (int argc, char *argv[]) { int error = FALSE; int i; orc_test_init (); for(i=1;i #include #include #include #include extern OrcRandomContext context; double sgn(double x); double random_std (void); double random_triangle (void); int gain_to_quant_index (double x); double sum_f64 (double *a, int n); double multsum_f64 (double *a, double *b, int n); #define TEST_PATTERN_NAME_SIZE 100 int test_pattern_get_n_generators (void); void test_pattern_generate (SchroFrameData *frame, char *name, int n); int frame_data_compare (SchroFrameData *dest, SchroFrameData *src); void frame_data_dump (SchroFrameData *dest, SchroFrameData *src); void frame_data_dump_full (SchroFrameData *dest, SchroFrameData *src, SchroFrameData *orig); int frame_compare (SchroFrame *dest, SchroFrame *src); void frame_dump (SchroFrame *test, SchroFrame *ref); int parse_packet (FILE *file, void **data, int *size); #define rand_u8() (rand()&0xff) #define rand_f64() (((rand()/(RAND_MAX+1.0))+rand())/(RAND_MAX+1.0)) void interleave (int16_t *a, int n); void deinterleave (int16_t *a, int n); void extend(int16_t *a, int n); void synth(int16_t *a, int n, int filter); void split (int16_t *a, int n, int filter); #endif schroedinger-1.0.11/testsuite/arith.c0000644000175000017500000000630511556115124014500 00000000000000 #include "config.h" #include #include #include #include #include #define BUFFER_SIZE 10000 int debug=0; int verbose = 0; static void decode(SchroBuffer *dest, SchroBuffer *src) { SchroArith *a; int i; int j; int value; int bit; a = schro_arith_new(); schro_arith_decode_init (a, src); for(i=0;ilength;i++){ value = 0; if (verbose) printf("%d:\n", i); for(j=0;j<8;j++){ if (verbose) printf("[%04x %04x] %04x -> ", a->range[0], a->range[1], a->code); bit = schro_arith_decode_bit (a, 0); if (verbose) printf("%d\n", bit); value |= bit << (7-j); } dest->data[i] = value; } schro_arith_free(a); } static void encode (SchroBuffer *dest, SchroBuffer *src) { SchroArith *a; int i; int j; int bit; a = schro_arith_new(); schro_arith_encode_init (a, dest); for(i=0;ilength;i++){ if (verbose) printf("%d:\n", i); for(j=0;j<8;j++){ bit = (src->data[i]>>(7-j))&1; if (verbose) printf("[%04x %04x] %d\n", a->range[0], a->range[1], bit); schro_arith_encode_bit (a, 0, bit); } } schro_arith_flush (a); dest->length = a->offset; schro_arith_free(a); } SchroBuffer *buffer1; SchroBuffer *buffer2; SchroBuffer *buffer3; static int check (int n) { buffer1->length = n; buffer3->length = n; encode(buffer2, buffer1); #if 0 for(i=0;i<4;i++){ printf("%02x\n", buffer2[i]); } #endif decode(buffer3, buffer2); if (memcmp (buffer1->data, buffer3->data, n)) { return 0; } return 1; } int main (int argc, char *argv[]) { int i; int n; int fail=0; int j; schro_init(); buffer1 = schro_buffer_new_and_alloc (1000); buffer2 = schro_buffer_new_and_alloc (1000); buffer3 = schro_buffer_new_and_alloc (1000); for (j = 0; j < 40; j++){ int value; value = 0xff & rand(); for(i=0;i<100;i++){ buffer1->data[i] = value; } for(n=0;n<100;n++){ if (debug) { printf("Checking: encoding/decoding constant array (size=%d value=%d)\n", n, value); } if (!check(n)){ printf("Failed: encoding/decoding constant array (size=%d value=%d)\n", n, value); fail = 1; } } } for (j = 0; j < 8; j++) { int mask; mask = (1<<(j+1)) - 1; for(i=0;i<100;i++){ buffer1->data[i] = mask & rand(); } for(n=0;n<100;n++){ if (debug) { printf("Checking: encoding/decoding masked random array (size=%d mask=%02x)\n", n, mask); } if (!check(n)){ printf("Failed: encoding/decoding masked random array (size=%d mask=%02x)\n", n, mask); fail = 1; } } } for (j = 0; j < 8; j++) { int mask; mask = (1<<(j+1)) - 1; for(i=0;i<100;i++){ buffer1->data[i] = mask & rand(); } for(n=0;n<100;n++){ if (debug) { printf("Checking: encoding/decoding masked random array (size=%d mask=%02x)\n", n, mask); } if (!check(n)){ printf("Failed: encoding/decoding masked random array (size=%d mask=%02x)\n", n, mask); fail = 1; } } } return fail; } schroedinger-1.0.11/testsuite/upsample.c0000644000175000017500000001160111541755167015225 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #include #include "common.h" void upsample_line (uint8_t *dest, int dstr, uint8_t *src, int sstr, int n); void ref_h_upsample (SchroFrame *dest, SchroFrame *src); void ref_v_upsample (SchroFrame *dest, SchroFrame *src); void test (int width, int height); int failed = 0; int dump_all = FALSE; int main (int argc, char *argv[]) { int width, height; schro_init(); for(width=1;width<=20;width++){ for(height=1;height<=20;height++){ test (width, height); } } if (failed) { printf("FAILED\n"); } else { printf("SUCCESS\n"); } return failed; } void test (int width, int height) { SchroFrame *frame; SchroFrame *frame_ref; SchroFrame *frame_1; SchroFrame *frame_test; SchroUpsampledFrame *upframe; char name[TEST_PATTERN_NAME_SIZE]; int i; int ok; frame = schro_frame_new_and_alloc (NULL, SCHRO_FRAME_FORMAT_U8_420, width, height); frame_ref = schro_frame_new_and_alloc (NULL, SCHRO_FRAME_FORMAT_U8_420, width, height); frame_1 = schro_frame_new_and_alloc (NULL, SCHRO_FRAME_FORMAT_U8_420, width, height); printf("HORIZONTAL %dx%d\n", width, height); for(i=0;icomponents + 0, name, i); test_pattern_generate (frame->components + 1, name, i); test_pattern_generate (frame->components + 2, name, i); ref_h_upsample (frame_ref, frame); upframe = schro_upsampled_frame_new (schro_frame_ref(frame)); schro_upsampled_frame_upsample (upframe); frame_test = upframe->frames[1]; ok = frame_compare (frame_ref, frame_test); printf(" pattern %s: %s\n", name, ok ? "OK" : "broken"); if (dump_all || !ok) { frame_data_dump_full (frame_test->components + 0, frame_ref->components + 0, frame->components + 0); failed = TRUE; } schro_upsampled_frame_free (upframe); } printf("VERTICAL %dx%d\n", width, height); for(i=0;icomponents + 0, name, i); test_pattern_generate (frame->components + 1, name, i); test_pattern_generate (frame->components + 2, name, i); ref_v_upsample (frame_ref, frame); upframe = schro_upsampled_frame_new (schro_frame_ref(frame)); schro_upsampled_frame_upsample (upframe); frame_test = upframe->frames[2]; ok = frame_compare (frame_ref, frame_test); printf(" pattern %s: %s\n", name, ok ? "OK" : "broken"); if (dump_all || !ok) { frame_data_dump_full (frame_test->components + 0, frame_ref->components + 0, frame->components + 0); failed = TRUE; } schro_upsampled_frame_free (upframe); } printf("HV %dx%d\n", width, height); for(i=0;icomponents + 0, name, i); test_pattern_generate (frame->components + 1, name, i); test_pattern_generate (frame->components + 2, name, i); ref_v_upsample (frame_1, frame); ref_h_upsample (frame_ref, frame_1); upframe = schro_upsampled_frame_new (schro_frame_ref(frame)); schro_upsampled_frame_upsample (upframe); frame_test = upframe->frames[3]; ok = frame_compare (frame_ref, frame_test); printf(" pattern %s: %s\n", name, ok ? "OK" : "broken"); if (dump_all || !ok) { frame_data_dump_full (frame_test->components + 0, frame_ref->components + 0, frame->components + 0); failed = TRUE; } schro_upsampled_frame_free (upframe); } schro_frame_unref (frame); schro_frame_unref (frame_ref); } void upsample_line (uint8_t *dest, int dstr, uint8_t *src, int sstr, int n) { int i; int j; int x; int weights[8] = { -1, 3, -7, 21, 21, -7, 3, -1 }; for(i=0;i>= 5; SCHRO_GET(dest, dstr * i, uint8_t) = CLAMP(x, 0, 255); } } void ref_h_upsample (SchroFrame *dest, SchroFrame *src) { int j,k; uint8_t *d; uint8_t *s; for(k=0;k<3;k++){ for(j=0;jcomponents[k].height;j++){ d = OFFSET(dest->components[k].data, dest->components[k].stride * j); s = OFFSET(src->components[k].data, src->components[k].stride * j); upsample_line (d, 1, s, 1, dest->components[k].width); } } } void ref_v_upsample (SchroFrame *dest, SchroFrame *src) { int i,k; SchroFrameData *scomp; SchroFrameData *dcomp; for(k=0;k<3;k++){ dcomp = dest->components + k; scomp = src->components + k; for(i=0;icomponents[k].width;i++){ upsample_line (OFFSET(dcomp->data, i), dcomp->stride, OFFSET(scomp->data, i), scomp->stride, dcomp->height); } } } schroedinger-1.0.11/testsuite/sort.c0000644000175000017500000000220710735025462014360 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include void sort_u8 (uint8_t *d, int n) { int start = 0; int end = n; int i; int x; /* OMG bubble sort! */ while(start < end) { for(i=start;i d[i+1]) { x = d[i]; d[i] = d[i+1]; d[i+1] = x; } } end--; for(i=end-2;i>=start;i--){ if (d[i] > d[i+1]) { x = d[i]; d[i] = d[i+1]; d[i+1] = x; } } start++; } } #define N 9 int main (int argc, char *argv[]) { int i; int j; uint8_t list[N]; int sum1, sum2; srand(time(NULL)); for (i=0;i<100;i++){ SCHRO_ERROR("%d:", i); sum1 = 0; for(j=0;j #include #include #include #include #include "common.h" void decode (FILE *file); void parse (FILE *file); int main (int argc, char *argv[]) { FILE *file; schro_init(); if (argc < 2) { printf("decode stream.drc\n"); exit(1); } file = fopen (argv[1], "r"); if (file == NULL) { printf("cannot open %s\n", argv[1]); return 1; } decode (file); //parse (file); fclose (file); return 0; } static void buffer_free (SchroBuffer *buf, void *priv) { free (priv); } void decode (FILE *file) { SchroDecoder *decoder; SchroBuffer *buffer; SchroVideoFormat *format = NULL; SchroFrame *frame; int picture_number; int go; int it; int eos = FALSE; void *packet; int size; int ret; int parse_code; decoder = schro_decoder_new(); schro_decoder_set_picture_order (decoder, SCHRO_DECODER_PICTURE_ORDER_CODED); while(!eos) { ret = parse_packet (file, &packet, &size); if (!ret) { exit(1); } if (size == 0) { schro_decoder_push_end_of_stream (decoder); } else { parse_code = ((uint8_t *)packet)[4]; buffer = schro_buffer_new_with_data (packet, size); buffer->free = buffer_free; buffer->priv = packet; printf("pushing 0x%02x size %d\n", parse_code, size); if (SCHRO_PARSE_CODE_IS_PICTURE (parse_code)) { frame = schro_frame_new_and_alloc (NULL, schro_params_get_frame_format(8, format->chroma_format), format->width, format->height); schro_decoder_add_output_picture (decoder, frame); } it = schro_decoder_push (decoder, buffer); if (it == SCHRO_DECODER_FIRST_ACCESS_UNIT) { format = schro_decoder_get_video_format (decoder); } if (!SCHRO_PARSE_CODE_IS_PICTURE (parse_code)) { continue; } } go = 1; while (go) { it = schro_decoder_wait (decoder); switch (it) { case SCHRO_DECODER_NEED_BITS: go = 0; break; case SCHRO_DECODER_NEED_FRAME: frame = schro_frame_new_and_alloc (NULL, schro_params_get_frame_format(8, format->chroma_format), format->width, format->height); schro_decoder_add_output_picture (decoder, frame); break; case SCHRO_DECODER_OK: picture_number = schro_decoder_get_picture_number (decoder); frame = schro_decoder_pull (decoder); printf("got frame %p, picture number %d\n", frame, picture_number); if (frame) { schro_frame_unref (frame); } go = 0; break; case SCHRO_DECODER_EOS: printf("got eos\n"); eos = TRUE; go = 0; break; case SCHRO_DECODER_STALLED: printf("stall\n"); go = 0; break; case SCHRO_DECODER_ERROR: exit(0); break; } } } printf("freeing decoder\n"); schro_decoder_free (decoder); free(format); } void parse (FILE *file) { void *packet; int size; int ret; while(1) { ret = parse_packet (file, &packet, &size); if (!ret) { exit(1); } if (packet) free (packet); if (size == 0) return; } } schroedinger-1.0.11/testsuite/opengl/0000775000175000017500000000000011707140274014571 500000000000000schroedinger-1.0.11/testsuite/opengl/opengl_pushpull.c0000644000175000017500000001141111320232176020063 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include "../common.h" #include "opengl_util.h" void opengl_test_push_pull (SchroFrameFormat format, int width, int height, int todo, int custom_pattern) { char format_name[64]; SchroFrame *cpu_ref_frame; SchroFrame *cpu_test_frame; SchroFrame *opengl_frame; char pattern_name[TEST_PATTERN_NAME_SIZE]; int i; int ok; int frames = 0; int total_length; double start_push; double start_pull; double elapsed_push = 0; double elapsed_pull = 0; printf ("==========================================================\n"); if (!opengl_format_name(format, format_name, 64)) { printf ("opengl_test_push_pull: %ix%i\n", width, height); printf (" unhandled format 0x%x", format); printf ("==========================================================\n"); return; } printf ("opengl_test_push_pull: %ix%i %s\n", width, height, format_name); if (_benchmark) { schro_opengl_canvas_print_flags (" "); } cpu_ref_frame = schro_frame_new_and_alloc (_cpu_domain, format, width, height); cpu_test_frame = schro_frame_new_and_alloc (_cpu_domain, format, width, height); opengl_frame = schro_opengl_frame_new (_opengl, _opengl_domain, format, width, height); printf (" patterns\n"); for (i = 0; i < todo; ++i) { opengl_custom_pattern_generate (cpu_ref_frame, custom_pattern, i, pattern_name); schro_opengl_lock (_opengl); start_push = schro_utils_get_time (); schro_opengl_frame_push (opengl_frame, cpu_ref_frame); start_pull = schro_utils_get_time (); elapsed_push += start_pull - start_push; schro_opengl_frame_pull (cpu_test_frame, opengl_frame); elapsed_pull += schro_utils_get_time () - start_pull; schro_opengl_unlock (_opengl); ++frames; ok = frame_compare (cpu_ref_frame, cpu_test_frame); printf (" %s: %s\n", pattern_name, ok ? "OK" : "broken"); if (!ok) { if (width <= 32 && height <= 32) { frame_dump (cpu_ref_frame, cpu_ref_frame); frame_dump (cpu_test_frame, cpu_ref_frame); } opengl_test_failed (); } } if (_benchmark) { total_length = (cpu_ref_frame->components[0].length + cpu_ref_frame->components[1].length + cpu_ref_frame->components[2].length) * frames; printf (" results\n"); printf (" %i frames pushed/pulled: %.2f mbyte each\n", frames, (float)total_length / (1024 * 1024)); printf (" total %f/%f sec, %.2f/%.2f mbyte/sec\n", elapsed_push, elapsed_pull, total_length / elapsed_push / (1024 * 1024), total_length / elapsed_pull / (1024 * 1024)); printf (" avg %f/%f sec, %f sec\n", elapsed_push / frames, elapsed_pull / frames, elapsed_push / frames + elapsed_pull / frames); } schro_frame_unref (cpu_ref_frame); schro_frame_unref (cpu_test_frame); schro_frame_unref (opengl_frame); printf ("==========================================================\n"); } struct PushPullTest { SchroFrameFormat format; int width, height; int todo; int custom_pattern; }; static struct PushPullTest opengl_test_push_pull_list[] = { { SCHRO_FRAME_FORMAT_U8_444, 1920, 1080, 1, OPENGL_CUSTOM_PATTERN_RANDOM }, { SCHRO_FRAME_FORMAT_U8_444, 16, 16, -1, OPENGL_CUSTOM_PATTERN_NONE }, { SCHRO_FRAME_FORMAT_S16_444, 1920, 1080, 1, OPENGL_CUSTOM_PATTERN_RANDOM }, { SCHRO_FRAME_FORMAT_S16_444, 16, 16, -1, OPENGL_CUSTOM_PATTERN_NONE }, { SCHRO_FRAME_FORMAT_U8_444, 1920, 1080, 1, OPENGL_CUSTOM_PATTERN_RANDOM }, { SCHRO_FRAME_FORMAT_U8_444, 23, 16, -1, OPENGL_CUSTOM_PATTERN_NONE }, { SCHRO_FRAME_FORMAT_S16_444, 1920, 1080, 1, OPENGL_CUSTOM_PATTERN_RANDOM }, { SCHRO_FRAME_FORMAT_S16_444, 16, 23, -1, OPENGL_CUSTOM_PATTERN_NONE }, { SCHRO_FRAME_FORMAT_YUYV, 1920, 1080, 1, OPENGL_CUSTOM_PATTERN_RANDOM }, { SCHRO_FRAME_FORMAT_YUYV, 16, 16, -1, OPENGL_CUSTOM_PATTERN_NONE }, { SCHRO_FRAME_FORMAT_UYVY, 1920, 1080, 1, OPENGL_CUSTOM_PATTERN_RANDOM }, { SCHRO_FRAME_FORMAT_UYVY, 16, 16, -1, OPENGL_CUSTOM_PATTERN_NONE }, { SCHRO_FRAME_FORMAT_AYUV, 1920, 1080, 1, OPENGL_CUSTOM_PATTERN_RANDOM }, { SCHRO_FRAME_FORMAT_AYUV, 16, 16, -1, OPENGL_CUSTOM_PATTERN_NONE } }; void opengl_test_push_pull_run () { int i; for (i = 0; i < ARRAY_SIZE (opengl_test_push_pull_list); ++i) { opengl_test_push_pull (opengl_test_push_pull_list[i].format, opengl_test_push_pull_list[i].width, opengl_test_push_pull_list[i].height, opengl_test_push_pull_list[i].todo < 1 ? _generators : opengl_test_push_pull_list[i].todo, opengl_test_push_pull_list[i].custom_pattern); } } schroedinger-1.0.11/testsuite/opengl/opengl_combine.c0000644000175000017500000003436611320232176017641 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include "../common.h" #include "opengl_util.h" void opengl_test_add (SchroFrameFormat dest_format, SchroFrameFormat src_format, int dest_width, int dest_height, int src_width, int src_height, int todo, int custom_dest_pattern, int custom_src_pattern, int dest_pattern_drift) { char dest_format_name[64]; char src_format_name[64]; SchroFrame *cpu_dest_preref_frame; SchroFrame *cpu_dest_postref_frame; SchroFrame *cpu_src_ref_frame; SchroFrame *cpu_dest_test_frame; SchroFrame *opengl_dest_frame; SchroFrame *opengl_src_frame; char dest_pattern_name[TEST_PATTERN_NAME_SIZE]; char src_pattern_name[TEST_PATTERN_NAME_SIZE]; int i/*, r*/; int ok; int frames = 0; int repeats = 1;//_benchmark ? 64 : 1; int total_length; double start_cpu, start_opengl; double elapsed_cpu = 0, elapsed_opengl = 0; printf ("==========================================================\n"); if (!opengl_format_name (dest_format, dest_format_name, 64)) { printf ("opengl_test_add: %ix%i -> %ix%i\n", src_width, src_height, dest_width, dest_height); printf (" unhandled dest_format 0x%x\n", dest_format); printf ("==========================================================\n"); opengl_test_failed (); return; } if (!opengl_format_name (src_format, src_format_name, 64)) { printf ("opengl_test_add: %ix%i -> %ix%i\n", src_width, src_height, dest_width, dest_height); printf (" unhandled src_format 0x%x\n", src_format); printf ("==========================================================\n"); opengl_test_failed (); return; } printf ("opengl_test_add: %ix%i -> %ix%i (%s -> %s)\n", src_width, src_height, dest_width, dest_height, src_format_name, dest_format_name); cpu_dest_preref_frame = schro_frame_new_and_alloc (_cpu_domain, dest_format, dest_width, dest_height); cpu_dest_postref_frame = schro_frame_new_and_alloc (_cpu_domain, dest_format, dest_width, dest_height); cpu_src_ref_frame = schro_frame_new_and_alloc (_cpu_domain, src_format, src_width, src_height); cpu_dest_test_frame = schro_frame_new_and_alloc (_cpu_domain, dest_format, dest_width, dest_height); opengl_dest_frame = schro_opengl_frame_new (_opengl, _opengl_domain, dest_format, dest_width, dest_height); opengl_src_frame = schro_opengl_frame_new (_opengl, _opengl_domain, src_format, src_width, src_height); printf (" patterns\n"); for (i = 0; i < todo; ++i) { opengl_custom_pattern_generate (cpu_dest_preref_frame, custom_dest_pattern, i + dest_pattern_drift, dest_pattern_name); opengl_custom_pattern_generate (cpu_src_ref_frame, custom_src_pattern, i, src_pattern_name); schro_frame_convert (cpu_dest_postref_frame, cpu_dest_preref_frame); schro_opengl_lock (_opengl); schro_opengl_frame_push (opengl_dest_frame, cpu_dest_preref_frame); schro_opengl_frame_push (opengl_src_frame, cpu_src_ref_frame); schro_opengl_unlock (_opengl); start_cpu = schro_utils_get_time (); //for (r = 0; r < repeats; ++r) schro_frame_add (cpu_dest_postref_frame, cpu_src_ref_frame); elapsed_cpu += schro_utils_get_time () - start_cpu; schro_opengl_lock (_opengl); start_opengl = schro_utils_get_time (); //for (r = 0; r < repeats; ++r) schro_opengl_frame_add (opengl_dest_frame, opengl_src_frame); elapsed_opengl += schro_utils_get_time () - start_opengl; schro_opengl_frame_pull (cpu_dest_test_frame, opengl_dest_frame); schro_opengl_unlock (_opengl); ++frames; ok = frame_compare (cpu_dest_postref_frame, cpu_dest_test_frame); printf (" %s -> %s: %s\n", src_pattern_name, dest_pattern_name, ok ? "OK" : "broken"); if (!ok) { if (dest_width <= 32 && dest_height <= 32 && src_width <= 32 && src_height <= 32) { printf ("dest preref frame\n"); frame_dump (cpu_dest_preref_frame, cpu_dest_preref_frame); printf ("src ref frame\n"); frame_dump (cpu_src_ref_frame, cpu_src_ref_frame); printf ("dest postref frame = dest preref frame + src ref frame\n"); frame_dump (cpu_dest_postref_frame, cpu_dest_postref_frame); printf ("dest test frame <-> dest postref frame\n"); frame_dump (cpu_dest_test_frame, cpu_dest_postref_frame); } opengl_test_failed (); } } if (_benchmark) { total_length = (cpu_src_ref_frame->components[0].length + cpu_src_ref_frame->components[1].length + cpu_src_ref_frame->components[2].length) * frames; printf (" results\n"); printf (" %i frames added via cpu/opengl with %i repeats: %.2f " "mbyte each\n", frames, repeats, ((double)total_length * repeats) / (1024 * 1024)); printf (" total %f/%f sec, %.2f/%.2f mbyte/sec\n", elapsed_cpu, elapsed_opengl, ((double)total_length * repeats) / elapsed_cpu / (1024 * 1024), ((double)total_length * repeats) / elapsed_opengl / (1024 * 1024)); printf (" avg %.8f/%.8f sec\n", elapsed_cpu / repeats / frames, elapsed_opengl / repeats / frames); } schro_frame_unref (cpu_dest_preref_frame); schro_frame_unref (cpu_dest_postref_frame); schro_frame_unref (cpu_src_ref_frame); schro_frame_unref (cpu_dest_test_frame); schro_frame_unref (opengl_dest_frame); schro_frame_unref (opengl_src_frame); printf ("==========================================================\n"); } void opengl_test_subtract (SchroFrameFormat dest_format, SchroFrameFormat src_format, int dest_width, int dest_height, int src_width, int src_height, int todo, int custom_dest_pattern, int custom_src_pattern, int dest_pattern_drift) { char dest_format_name[64]; char src_format_name[64]; SchroFrame *cpu_dest_preref_frame; SchroFrame *cpu_dest_postref_frame; SchroFrame *cpu_src_ref_frame; SchroFrame *cpu_dest_test_frame; SchroFrame *opengl_dest_frame; SchroFrame *opengl_src_frame; char dest_pattern_name[TEST_PATTERN_NAME_SIZE]; char src_pattern_name[TEST_PATTERN_NAME_SIZE]; int i/*, r*/; int ok; int frames = 0; int repeats = 1;//_benchmark ? 64 : 1; int total_length; double start_cpu, start_opengl; double elapsed_cpu = 0, elapsed_opengl = 0; printf ("==========================================================\n"); if (!opengl_format_name (dest_format, dest_format_name, 64)) { printf ("opengl_test_add: %ix%i -> %ix%i\n", src_width, src_height, dest_width, dest_height); printf (" unhandled dest_format 0x%x\n", dest_format); printf ("==========================================================\n"); opengl_test_failed (); return; } if (!opengl_format_name (src_format, src_format_name, 64)) { printf ("opengl_test_add: %ix%i -> %ix%i\n", src_width, src_height, dest_width, dest_height); printf (" unhandled src_format 0x%x\n", src_format); printf ("==========================================================\n"); opengl_test_failed (); return; } printf ("opengl_test_subtract: %ix%i -> %ix%i (%s -> %s)\n", src_width, src_height, dest_width, dest_height, src_format_name, dest_format_name); cpu_dest_preref_frame = schro_frame_new_and_alloc (_cpu_domain, dest_format, dest_width, dest_height); cpu_dest_postref_frame = schro_frame_new_and_alloc (_cpu_domain, dest_format, dest_width, dest_height); cpu_src_ref_frame = schro_frame_new_and_alloc (_cpu_domain, src_format, src_width, src_height); cpu_dest_test_frame = schro_frame_new_and_alloc (_cpu_domain, dest_format, dest_width, dest_height); opengl_dest_frame = schro_opengl_frame_new (_opengl, _opengl_domain, dest_format, dest_width, dest_height); opengl_src_frame = schro_opengl_frame_new (_opengl, _opengl_domain, src_format, src_width, src_height); printf (" patterns\n"); for (i = 0; i < todo; ++i) { opengl_custom_pattern_generate (cpu_dest_preref_frame, custom_dest_pattern, i + dest_pattern_drift, dest_pattern_name); opengl_custom_pattern_generate (cpu_src_ref_frame, custom_src_pattern, i, src_pattern_name); schro_frame_convert (cpu_dest_postref_frame, cpu_dest_preref_frame); schro_opengl_lock (_opengl); schro_opengl_frame_push (opengl_dest_frame, cpu_dest_preref_frame); schro_opengl_frame_push (opengl_src_frame, cpu_src_ref_frame); schro_opengl_unlock (_opengl); start_cpu = schro_utils_get_time (); //for (r = 0; r < repeats; ++r) schro_frame_subtract (cpu_dest_postref_frame, cpu_src_ref_frame); elapsed_cpu += schro_utils_get_time () - start_cpu; schro_opengl_lock (_opengl); start_opengl = schro_utils_get_time (); //for (r = 0; r < repeats; ++r) schro_opengl_frame_subtract (opengl_dest_frame, opengl_src_frame); elapsed_opengl += schro_utils_get_time () - start_opengl; schro_opengl_frame_pull (cpu_dest_test_frame, opengl_dest_frame); schro_opengl_unlock (_opengl); ++frames; ok = frame_compare (cpu_dest_postref_frame, cpu_dest_test_frame); printf (" %s -> %s: %s\n", src_pattern_name, dest_pattern_name, ok ? "OK" : "broken"); if (!ok) { if (dest_width <= 32 && dest_height <= 32 && src_width <= 32 && src_height <= 32) { printf ("dest preref frame\n"); frame_dump (cpu_dest_preref_frame, cpu_dest_preref_frame); printf ("src ref frame\n"); frame_dump (cpu_src_ref_frame, cpu_src_ref_frame); printf ("dest postref frame = dest preref frame + src ref frame\n"); frame_dump (cpu_dest_postref_frame, cpu_dest_postref_frame); printf ("dest test frame <-> dest postref frame\n"); frame_dump (cpu_dest_test_frame, cpu_dest_postref_frame); } opengl_test_failed (); } } if (_benchmark) { total_length = (cpu_src_ref_frame->components[0].length + cpu_src_ref_frame->components[1].length + cpu_src_ref_frame->components[2].length) * frames; printf (" results\n"); printf (" %i frames subtracted via cpu/opengl with %i repeats: %.2f " "mbyte each\n", frames, repeats, ((double)total_length * repeats) / (1024 * 1024)); printf (" total %f/%f sec, %.2f/%.2f mbyte/sec\n", elapsed_cpu, elapsed_opengl, ((double)total_length * repeats) / elapsed_cpu / (1024 * 1024), ((double)total_length * repeats) / elapsed_opengl / (1024 * 1024)); printf (" avg %.8f/%.8f sec\n", elapsed_cpu / repeats / frames, elapsed_opengl / repeats / frames); } schro_frame_unref (cpu_dest_preref_frame); schro_frame_unref (cpu_dest_postref_frame); schro_frame_unref (cpu_src_ref_frame); schro_frame_unref (cpu_dest_test_frame); schro_frame_unref (opengl_dest_frame); schro_frame_unref (opengl_src_frame); printf ("==========================================================\n"); } struct CombineTest { SchroFrameFormat dest_format; SchroFrameFormat src_format; int dest_width, dest_height; int src_width, src_height; int todo; int custom_dest_pattern; int custom_src_pattern; int dest_pattern_drift; }; struct CombineTest opengl_test_add_list[] = { /* U8 -> S16 */ { SCHRO_FRAME_FORMAT_S16_444, SCHRO_FRAME_FORMAT_U8_444, 16, 16, 16, 16, 1, OPENGL_CUSTOM_PATTERN_CONST_MIDDLE, OPENGL_CUSTOM_PATTERN_RANDOM, 0 }, { SCHRO_FRAME_FORMAT_S16_444, SCHRO_FRAME_FORMAT_U8_444, 16, 16, 16, 16, 1, OPENGL_CUSTOM_PATTERN_CONST_MIN, OPENGL_CUSTOM_PATTERN_CONST_MAX, 0 }, { SCHRO_FRAME_FORMAT_S16_444, SCHRO_FRAME_FORMAT_U8_444, 16, 16, 16, 16, -1, OPENGL_CUSTOM_PATTERN_NONE, OPENGL_CUSTOM_PATTERN_NONE, 2 }, /* S16 -> S16 */ { SCHRO_FRAME_FORMAT_S16_444, SCHRO_FRAME_FORMAT_S16_444, 16, 16, 16, 16, 1, OPENGL_CUSTOM_PATTERN_CONST_MIN, OPENGL_CUSTOM_PATTERN_CONST_MAX, 0 }, { SCHRO_FRAME_FORMAT_S16_444, SCHRO_FRAME_FORMAT_S16_444, 16, 16, 16, 16, 1, OPENGL_CUSTOM_PATTERN_CONST_MIN, OPENGL_CUSTOM_PATTERN_RANDOM_U8, 0 } }; struct CombineTest opengl_test_subtract_list[] = { /* U8 -> S16 */ { SCHRO_FRAME_FORMAT_S16_444, SCHRO_FRAME_FORMAT_U8_444, 16, 16, 16, 16, 1, OPENGL_CUSTOM_PATTERN_CONST_MIDDLE, OPENGL_CUSTOM_PATTERN_RANDOM, 0 }, { SCHRO_FRAME_FORMAT_S16_444, SCHRO_FRAME_FORMAT_U8_444, 16, 16, 16, 16, 1, OPENGL_CUSTOM_PATTERN_CONST_MIDDLE, OPENGL_CUSTOM_PATTERN_CONST_MAX, 0 }, { SCHRO_FRAME_FORMAT_S16_444, SCHRO_FRAME_FORMAT_U8_444, 16, 16, 16, 16, -1, OPENGL_CUSTOM_PATTERN_NONE, OPENGL_CUSTOM_PATTERN_NONE, 2 }, /* S16 -> S16 */ { SCHRO_FRAME_FORMAT_S16_444, SCHRO_FRAME_FORMAT_S16_444, 16, 16, 16, 16, 1, OPENGL_CUSTOM_PATTERN_CONST_MAX, OPENGL_CUSTOM_PATTERN_CONST_MAX_U8, 0 }, { SCHRO_FRAME_FORMAT_S16_444, SCHRO_FRAME_FORMAT_S16_444, 16, 16, 16, 16, 1, OPENGL_CUSTOM_PATTERN_CONST_MAX, OPENGL_CUSTOM_PATTERN_CONST_MAX, 0 }, { SCHRO_FRAME_FORMAT_S16_444, SCHRO_FRAME_FORMAT_S16_444, 16, 16, 16, 16, 1, OPENGL_CUSTOM_PATTERN_CONST_MAX, OPENGL_CUSTOM_PATTERN_RANDOM_U8, 0 } }; void opengl_test_combine_run () { int i; /* add */ for (i = 0; i < ARRAY_SIZE (opengl_test_add_list); ++i) { opengl_test_add (opengl_test_add_list[i].dest_format, opengl_test_add_list[i].src_format, opengl_test_add_list[i].dest_width, opengl_test_add_list[i].dest_height, opengl_test_add_list[i].src_width, opengl_test_add_list[i].src_height, opengl_test_add_list[i].todo < 1 ? _generators : opengl_test_add_list[i].todo, opengl_test_add_list[i].custom_dest_pattern, opengl_test_add_list[i].custom_src_pattern, opengl_test_add_list[i].dest_pattern_drift); } /* subtract */ for (i = 0; i < ARRAY_SIZE (opengl_test_subtract_list); ++i) { opengl_test_subtract (opengl_test_subtract_list[i].dest_format, opengl_test_subtract_list[i].src_format, opengl_test_subtract_list[i].dest_width, opengl_test_subtract_list[i].dest_height, opengl_test_subtract_list[i].src_width, opengl_test_subtract_list[i].src_height, opengl_test_subtract_list[i].todo < 1 ? _generators : opengl_test_subtract_list[i].todo, opengl_test_subtract_list[i].custom_dest_pattern, opengl_test_subtract_list[i].custom_src_pattern, opengl_test_subtract_list[i].dest_pattern_drift); } } schroedinger-1.0.11/testsuite/opengl/opengl.c0000644000175000017500000007643311556115124016152 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #include "../common.h" #include "opengl_util.h" void opengl_test_convert (SchroFrameFormat dest_format, SchroFrameFormat src_format, int dest_width, int dest_height, int src_width, int src_height, int todo, int custom_pattern) { char dest_format_name[64]; char src_format_name[64]; SchroFrame *cpu_dest_ref_frame; SchroFrame *cpu_src_ref_frame; SchroFrame *cpu_dest_test_frame; SchroFrame *opengl_dest_frame; SchroFrame *opengl_src_frame; char pattern_name[TEST_PATTERN_NAME_SIZE]; int i, r; int ok; int frames = 0; int repeats = _benchmark ? 64 : 1; int total_length; double start_cpu_convert, start_opengl_convert; double elapsed_cpu_convert = 0, elapsed_opengl_convert = 0; printf ("==========================================================\n"); if (!opengl_format_name (dest_format, dest_format_name, 64)) { printf ("opengl_test_convert: %ix%i -> %ix%i\n", src_width, src_height, dest_width, dest_height); printf (" unhandled dest_format 0x%x\n", dest_format); printf ("==========================================================\n"); opengl_test_failed (); return; } if (!opengl_format_name (src_format, src_format_name, 64)) { printf ("opengl_test_convert: %ix%i -> %ix%i\n", src_width, src_height, dest_width, dest_height); printf (" unhandled src_format 0x%x\n", src_format); printf ("==========================================================\n"); opengl_test_failed (); return; } printf ("opengl_test_convert: %ix%i -> %ix%i (%s -> %s)\n", src_width, src_height, dest_width, dest_height, src_format_name, dest_format_name); cpu_dest_ref_frame = schro_frame_new_and_alloc (_cpu_domain, dest_format, dest_width, dest_height); cpu_src_ref_frame = schro_frame_new_and_alloc (_cpu_domain, src_format, src_width, src_height); cpu_dest_test_frame = schro_frame_new_and_alloc (_cpu_domain, dest_format, dest_width, dest_height); opengl_dest_frame = schro_opengl_frame_new (_opengl, _opengl_domain, dest_format, dest_width, dest_height); opengl_src_frame = schro_opengl_frame_new (_opengl, _opengl_domain, src_format, src_width, src_height); printf (" patterns\n"); for (i = 0; i < todo; ++i) { opengl_custom_pattern_generate (cpu_src_ref_frame, custom_pattern, i, pattern_name); start_cpu_convert = schro_utils_get_time (); for (r = 0; r < repeats; ++r) { schro_frame_convert (cpu_dest_ref_frame, cpu_src_ref_frame); } elapsed_cpu_convert += schro_utils_get_time () - start_cpu_convert; schro_opengl_lock (_opengl); schro_opengl_frame_push (opengl_src_frame, cpu_src_ref_frame); start_opengl_convert = schro_utils_get_time (); for (r = 0; r < repeats; ++r) { schro_opengl_frame_convert (opengl_dest_frame, opengl_src_frame); } elapsed_opengl_convert += schro_utils_get_time () - start_opengl_convert; schro_opengl_frame_pull (cpu_dest_test_frame, opengl_dest_frame); schro_opengl_unlock (_opengl); ++frames; ok = frame_compare (cpu_dest_ref_frame, cpu_dest_test_frame); printf (" %s: %s\n", pattern_name, ok ? "OK" : "broken"); if (!ok) { if (dest_width <= 32 && dest_height <= 32 && src_width <= 32 && src_height <= 32) { printf ("dest ref frame\n"); frame_dump (cpu_dest_ref_frame, cpu_dest_ref_frame); printf ("src ref frame\n"); frame_dump (cpu_src_ref_frame, cpu_src_ref_frame); printf ("dest test frame <-> dest ref frame\n"); frame_dump (cpu_dest_test_frame, cpu_dest_ref_frame); } opengl_test_failed (); } } if (_benchmark) { total_length = (cpu_src_ref_frame->components[0].length + cpu_src_ref_frame->components[1].length + cpu_src_ref_frame->components[2].length) * frames; printf (" results\n"); printf (" %i frames converted via cpu/opengl with %i repeats: %.2f " "mbyte each\n", frames, repeats, ((double)total_length * repeats) / (1024 * 1024)); printf (" total %f/%f sec, %.2f/%.2f mbyte/sec\n", elapsed_cpu_convert, elapsed_opengl_convert, ((double)total_length * repeats) / elapsed_cpu_convert / (1024 * 1024), ((double)total_length * repeats) / elapsed_opengl_convert / (1024 * 1024)); printf (" avg %.8f/%.8f sec\n", elapsed_cpu_convert / repeats / frames, elapsed_opengl_convert / repeats / frames); } schro_frame_unref (cpu_dest_ref_frame); schro_frame_unref (cpu_src_ref_frame); schro_frame_unref (cpu_dest_test_frame); schro_frame_unref (opengl_dest_frame); schro_frame_unref (opengl_src_frame); printf ("==========================================================\n"); } void opengl_test_wavelet_inverse (SchroFrameFormat format, int width, int height, int todo, int custom_pattern, int filter, int transform_depth) { char format_name[64]; char filter_name[64]; SchroFrame *cpu_preref_frame; SchroFrame *cpu_postref_frame; SchroFrame *cpu_test_frame; SchroFrame *opengl_frame; SchroFrameData *cpu_preref_frame_data; SchroFrameData *cpu_postref_frame_data; SchroFrameData *cpu_test_frame_data; SchroFrameData *opengl_frame_data; int16_t *tmp; char pattern_name[TEST_PATTERN_NAME_SIZE]; int i/*, r*/; int ok; int frames = 0; int repeats = 1;//_benchmark ? 64 : 1; int level; int total_length; double start_cpu; double start_opengl; double elapsed_cpu = 0; double elapsed_opengl = 0; printf ("==========================================================\n"); if (!opengl_format_name(format, format_name, 64)) { printf ("opengl_test_wavelet_inverse: %ix%i\n", width, height); printf (" unhandled format 0x%x", format); printf ("==========================================================\n"); return; } if (!opengl_filter_name(filter, filter_name, 64)) { printf ("opengl_test_wavelet_inverse: %ix%i %s\n", width, height, format_name); printf (" unhandled filter 0x%x", format); printf ("==========================================================\n"); return; } printf ("opengl_test_wavelet_inverse: %ix%i %s, %s, %i level%c\n", width, height, format_name, filter_name, transform_depth, transform_depth > 1 ? 's' : ' '); if (_benchmark) { schro_opengl_canvas_print_flags (" "); } cpu_preref_frame = schro_frame_new_and_alloc (_cpu_domain, format, width, height); cpu_postref_frame = schro_frame_new_and_alloc (_cpu_domain, format, width, height); cpu_test_frame = schro_frame_new_and_alloc (_cpu_domain, format, width, height); opengl_frame = schro_opengl_frame_new (_opengl, _opengl_domain, format, width, height); tmp = schro_malloc (2 * width * sizeof(int16_t)); cpu_preref_frame_data = cpu_preref_frame->components + 0; cpu_postref_frame_data = cpu_postref_frame->components + 0; cpu_test_frame_data = cpu_test_frame->components + 0; opengl_frame_data = opengl_frame->components + 0; printf (" patterns\n"); for (i = 0; i < todo; ++i) { opengl_custom_pattern_generate (cpu_preref_frame, custom_pattern, i, pattern_name); /* FIXME: use schro_frame_iwt_transform */ /* cpu forward transform */ for (level = 0; level < transform_depth; ++level) { SchroFrameData frame_data; frame_data.format = cpu_preref_frame->format; frame_data.data = cpu_preref_frame->components[0].data; frame_data.width = cpu_preref_frame->components[0].width >> level; frame_data.height = cpu_preref_frame->components[0].height >> level; frame_data.stride = cpu_preref_frame->components[0].stride << level; schro_wavelet_transform_2d (&frame_data, filter, tmp); } schro_frame_convert (cpu_postref_frame, cpu_preref_frame); schro_opengl_lock (_opengl); schro_opengl_frame_push (opengl_frame, cpu_postref_frame); start_cpu = schro_utils_get_time (); /* FIXME: use schro_frame_inverse_iwt_transform */ /* cpu inverse transform */ for (level = transform_depth - 1; level >= 0; --level) { SchroFrameData frame_data; frame_data.format = cpu_postref_frame->format; frame_data.data = cpu_postref_frame->components[0].data; frame_data.width = cpu_postref_frame->components[0].width >> level; frame_data.height = cpu_postref_frame->components[0].height >> level; frame_data.stride = cpu_postref_frame->components[0].stride << level; schro_wavelet_inverse_transform_2d (&frame_data, filter, tmp); } start_opengl = schro_utils_get_time (); elapsed_cpu += start_opengl - start_cpu; /* FIXME: use schro_opengl_frame_inverse_iwt_transform */ /* opengl vertical deinterleave */ for (level = 0; level < transform_depth; ++level) { SchroFrameData frame_data; frame_data.format = opengl_frame->format; frame_data.data = opengl_frame->components[0].data; frame_data.width = opengl_frame->components[0].width >> level; frame_data.height = opengl_frame->components[0].height >> level; frame_data.stride = opengl_frame->components[0].stride << level; schro_opengl_wavelet_vertical_deinterleave (&frame_data); } /* opengl inverse transform */ for (level = transform_depth - 1; level >= 0; --level) { SchroFrameData frame_data; frame_data.format = opengl_frame->format; frame_data.data = opengl_frame->components[0].data; frame_data.width = opengl_frame->components[0].width >> level; frame_data.height = opengl_frame->components[0].height >> level; frame_data.stride = opengl_frame->components[0].stride << level; schro_opengl_wavelet_inverse_transform (&frame_data, filter); } elapsed_opengl += schro_utils_get_time () - start_opengl; schro_opengl_frame_pull (cpu_test_frame, opengl_frame); schro_opengl_unlock (_opengl); ++frames; ok = frame_data_compare (cpu_postref_frame_data, cpu_test_frame_data); printf (" %s: %s\n", pattern_name, ok ? "OK" : "broken"); if (!ok) { if (width <= 32 && height <= 32) { printf ("preref frame\n"); frame_data_dump (cpu_preref_frame_data, cpu_preref_frame_data); printf ("postref frame\n"); frame_data_dump (cpu_postref_frame_data, cpu_postref_frame_data); printf ("test frame <-> postref frame\n"); frame_data_dump (cpu_test_frame_data, cpu_postref_frame_data); } opengl_test_failed (); } } if (_benchmark) { total_length = cpu_preref_frame_data->length * frames; printf (" results\n"); printf (" %i frames iiwt'ed via cpu/opengl with %i repeats: %.2f " "mbyte each\n", frames, repeats, ((double)total_length * repeats) / (1024 * 1024)); printf (" total %f/%f sec, %.2f/%.2f mbyte/sec\n", elapsed_cpu, elapsed_opengl, ((double)total_length * repeats) / elapsed_cpu / (1024 * 1024), ((double)total_length * repeats) / elapsed_opengl / (1024 * 1024)); printf (" avg %.8f/%.8f sec\n", elapsed_cpu / repeats / frames, elapsed_opengl / repeats / frames); } schro_frame_unref (cpu_preref_frame); schro_frame_unref (cpu_postref_frame); schro_frame_unref (cpu_test_frame); schro_frame_unref (opengl_frame); schro_free (tmp); printf ("==========================================================\n"); } void opengl_test_upsample (SchroFrameFormat format, int width, int height, int custom_pattern) { char format_name[64]; SchroFrame *cpu_ref_frame; SchroFrame *cpu_test_frame; SchroFrame *opengl_frame; SchroUpsampledFrame *upsampled_cpu_ref_frame; SchroUpsampledFrame *upsampled_opengl_frame; char pattern_name[TEST_PATTERN_NAME_SIZE]; int i, k; int ok; printf ("==========================================================\n"); if (!opengl_format_name (format, format_name, 64)) { printf ("opengl_test_upsample: %ix%i\n", width, height); printf (" unhandled format 0x%x\n", format); printf ("==========================================================\n"); opengl_test_failed (); return; } printf ("opengl_test_upsample: %ix%i (%s)\n", width, height, format_name); cpu_ref_frame = schro_frame_new_and_alloc (_cpu_domain, format, width, height); cpu_test_frame = schro_frame_new_and_alloc (_cpu_domain, format, width, height); opengl_frame = schro_opengl_frame_new (_opengl, _opengl_domain, format, width, height); printf (" patterns\n"); for (i = 0; i < 1; ++i) { opengl_custom_pattern_generate (cpu_ref_frame, custom_pattern, i, pattern_name); schro_opengl_frame_push (opengl_frame, cpu_ref_frame); upsampled_cpu_ref_frame = schro_upsampled_frame_new (schro_frame_ref (cpu_ref_frame)); upsampled_opengl_frame = schro_upsampled_frame_new (schro_frame_ref (opengl_frame)); schro_upsampled_frame_upsample (upsampled_cpu_ref_frame); schro_opengl_upsampled_frame_upsample (upsampled_opengl_frame); for (k = 1; k < 4; ++k) { schro_opengl_frame_pull (cpu_test_frame, upsampled_opengl_frame->frames[k]); ok = frame_compare (upsampled_cpu_ref_frame->frames[k], cpu_test_frame); printf (" %s: %s (%i)\n", pattern_name, ok ? "OK" : "broken", k); if (!ok) { if (width <= 32 && height <= 32) { printf ("test frame %i <-> ref frame %i\n", k ,k); frame_dump (cpu_test_frame, upsampled_cpu_ref_frame->frames[1]); } opengl_test_failed (); } } schro_upsampled_frame_free (upsampled_cpu_ref_frame); schro_upsampled_frame_free (upsampled_opengl_frame); } schro_frame_unref (cpu_ref_frame); schro_frame_unref (cpu_test_frame); schro_frame_unref (opengl_frame); printf ("==========================================================\n"); } void opengl_test_motion (int width, int height, int custom_pattern) { SchroVideoFormat video_format; SchroParams params; SchroFrame *cpu_src_frame; SchroFrame *opengl_src_frame; SchroFrame *cpu_dest_ref_frame; SchroFrame *cpu_dest_test_frame; SchroFrame *opengl_dest_frame; SchroUpsampledFrame *upsampled_cpu_frame; SchroUpsampledFrame *upsampled_opengl_frame; SchroMotionVector *motion_vectors_dc; SchroMotion motion_cpu; SchroMotion motion_opengl; char pattern_name[TEST_PATTERN_NAME_SIZE]; int i, u, v; int ok; /* video_format.width = width; video_format.height = height; video_format.chroma_format = SCHRO_CHROMA_444;*/ schro_video_format_set_std_video_format (&video_format, SCHRO_VIDEO_FORMAT_QSIF); schro_video_format_validate (&video_format); video_format.width = 32; video_format.height = 32; printf ("==========================================================\n"); printf ("opengl_test_motion: %ix%i\n", video_format.width, video_format.height); params.video_format = &video_format; params.xbsep_luma = 4; params.ybsep_luma = 4; params.xblen_luma = 6; params.yblen_luma = 6; params.num_refs = 1; params.picture_weight_2 = 1; schro_params_calculate_mc_sizes (¶ms); cpu_src_frame = schro_frame_new_and_alloc (_cpu_domain, SCHRO_FRAME_FORMAT_U8_420, video_format.width, video_format.height); opengl_src_frame = schro_opengl_frame_new (_opengl, _opengl_domain, SCHRO_FRAME_FORMAT_U8_420, video_format.width, video_format.height); cpu_dest_ref_frame = schro_frame_new_and_alloc (_cpu_domain, SCHRO_FRAME_FORMAT_S16_420, video_format.width, video_format.height); cpu_dest_test_frame = schro_frame_new_and_alloc (_cpu_domain, SCHRO_FRAME_FORMAT_S16_420,video_format.width, video_format.height); opengl_dest_frame = schro_opengl_frame_new (_opengl, _opengl_domain, SCHRO_FRAME_FORMAT_S16_420, video_format.width, video_format.height); printf (" patterns\n"); for (i = 0; i < 1; ++i) { opengl_custom_pattern_generate (cpu_src_frame, custom_pattern, i, pattern_name); schro_opengl_frame_push (opengl_src_frame, cpu_src_frame); upsampled_cpu_frame = schro_upsampled_frame_new (schro_frame_ref (cpu_src_frame)); upsampled_opengl_frame = schro_upsampled_frame_new (schro_frame_ref (opengl_src_frame)); schro_upsampled_frame_upsample (upsampled_cpu_frame); schro_opengl_upsampled_frame_upsample (upsampled_opengl_frame); motion_vectors_dc = schro_malloc0 (sizeof (SchroMotionVector) * params.x_num_blocks * params.y_num_blocks); for (v = 0; v < params.y_num_blocks; ++v) { for (u = 0; u < params.x_num_blocks; ++u) { if (u == 1 && (v == 1/* || v == 2*/)) { motion_vectors_dc[v * params.x_num_blocks + u].pred_mode = 0; motion_vectors_dc[v * params.x_num_blocks + u].using_global = FALSE; motion_vectors_dc[v * params.x_num_blocks + u].u.dc.dc[0] = 64; motion_vectors_dc[v * params.x_num_blocks + u].u.dc.dc[1] = 0; motion_vectors_dc[v * params.x_num_blocks + u].u.dc.dc[2] = 0; } else { motion_vectors_dc[v * params.x_num_blocks + u].pred_mode = 0; motion_vectors_dc[v * params.x_num_blocks + u].using_global = FALSE; motion_vectors_dc[v * params.x_num_blocks + u].u.dc.dc[0] = 0; motion_vectors_dc[v * params.x_num_blocks + u].u.dc.dc[1] = 0; motion_vectors_dc[v * params.x_num_blocks + u].u.dc.dc[2] = 0; } } } memset (&motion_cpu, 0, sizeof (SchroMotion)); memset (&motion_opengl, 0, sizeof (SchroMotion)); motion_cpu.src1 = upsampled_cpu_frame; motion_cpu.src2 = NULL; motion_cpu.motion_vectors = (SchroMotionVector *) motion_vectors_dc; motion_cpu.params = ¶ms; motion_cpu.mv_precision = 0; motion_opengl.src1 = upsampled_opengl_frame; motion_opengl.src2 = NULL; motion_opengl.motion_vectors = (SchroMotionVector *) motion_vectors_dc; motion_opengl.params = ¶ms; motion_opengl.mv_precision = 0; schro_motion_render (&motion_cpu, cpu_dest_ref_frame); schro_opengl_motion_render (&motion_opengl, opengl_dest_frame); schro_free (motion_vectors_dc); schro_opengl_frame_pull (cpu_dest_test_frame, opengl_dest_frame); ok = frame_compare (cpu_dest_ref_frame, cpu_dest_test_frame); printf (" %s: %s\n", pattern_name, ok ? "OK" : "broken"); if (!ok) { /*if (width <= 32 && height <= 32)*/ { printf ("ref frame\n"); frame_dump (cpu_dest_ref_frame, cpu_dest_ref_frame); printf ("test frame <-> ref frame\n"); frame_dump (cpu_dest_test_frame, cpu_dest_ref_frame); } opengl_test_failed (); } schro_upsampled_frame_free (upsampled_cpu_frame); schro_upsampled_frame_free (upsampled_opengl_frame); } schro_frame_unref (cpu_src_frame); schro_frame_unref (opengl_src_frame); schro_frame_unref (cpu_dest_ref_frame); schro_frame_unref (cpu_dest_test_frame); schro_frame_unref (opengl_dest_frame); printf ("==========================================================\n"); } struct ConvertTest { SchroFrameFormat dest_format; SchroFrameFormat src_format; int dest_width, dest_height; int src_width, src_height; int todo; int custom_pattern; }; struct ConvertTest opengl_test_convert_list[] = { /* S16 -> U8 */ { SCHRO_FRAME_FORMAT_S16_444, SCHRO_FRAME_FORMAT_U8_444, 1920, 1080, 1920, 1080, 1, OPENGL_CUSTOM_PATTERN_RANDOM }, { SCHRO_FRAME_FORMAT_S16_422, SCHRO_FRAME_FORMAT_U8_422, 1920, 1080, 1280, 720, 1, OPENGL_CUSTOM_PATTERN_RANDOM }, /*{ SCHRO_FRAME_FORMAT_S16_420, SCHRO_FRAME_FORMAT_U8_420, 1280, 720, 1920, 1080, 1, OPENGL_CUSTOM_PATTERN_RANDOM },*/ { SCHRO_FRAME_FORMAT_S16_444, SCHRO_FRAME_FORMAT_U8_444, 16, 16, 16, 16, -1, OPENGL_CUSTOM_PATTERN_NONE }, { SCHRO_FRAME_FORMAT_S16_422, SCHRO_FRAME_FORMAT_U8_422, 16, 16, 16, 16, -1, OPENGL_CUSTOM_PATTERN_NONE }, /*{ SCHRO_FRAME_FORMAT_S16_420, SCHRO_FRAME_FORMAT_U8_420, 16, 16, 16, 16, -1, OPENGL_CUSTOM_ATTERN_NONE },*/ { SCHRO_FRAME_FORMAT_S16_444, SCHRO_FRAME_FORMAT_U8_444, 19, 19, 21, 21, -1, OPENGL_CUSTOM_PATTERN_NONE }, { SCHRO_FRAME_FORMAT_S16_422, SCHRO_FRAME_FORMAT_U8_422, 21, 21, 19, 19, -1, OPENGL_CUSTOM_PATTERN_NONE }, /*{ SCHRO_FRAME_FORMAT_S16_420, SCHRO_FRAME_FORMAT_U8_420, 19, 21, 21, 19, -1, OPENGL_CUSTOM_PATTERN_NONE },*/ { SCHRO_FRAME_FORMAT_S16_444, SCHRO_FRAME_FORMAT_U8_444, 32, 32, 16, 16, -1, OPENGL_CUSTOM_PATTERN_NONE }, { SCHRO_FRAME_FORMAT_S16_422, SCHRO_FRAME_FORMAT_U8_422, 32, 32, 16, 16, -1, OPENGL_CUSTOM_PATTERN_NONE }, /*{ SCHRO_FRAME_FORMAT_S16_420, SCHRO_FRAME_FORMAT_U8_420, 32, 32, 16, 16, -1, OPENGL_CUSTOM_PATTERN_NONE },*/ /* U8 -> S16 */ { SCHRO_FRAME_FORMAT_U8_444, SCHRO_FRAME_FORMAT_S16_444, 1280, 720, 1920, 1080, 1, OPENGL_CUSTOM_PATTERN_RANDOM }, { SCHRO_FRAME_FORMAT_U8_422, SCHRO_FRAME_FORMAT_S16_422, 1920, 1080, 1280, 720, 1, OPENGL_CUSTOM_PATTERN_RANDOM }, /*{ SCHRO_FRAME_FORMAT_U8_420, SCHRO_FRAME_FORMAT_S16_420, 1920, 1080, 1920, 1080, 1, OPENGL_CUSTOM_PATTERN_RANDOM },*/ { SCHRO_FRAME_FORMAT_U8_444, SCHRO_FRAME_FORMAT_S16_444, 16, 16, 16, 16, -1, OPENGL_CUSTOM_PATTERN_NONE }, { SCHRO_FRAME_FORMAT_U8_422, SCHRO_FRAME_FORMAT_S16_422, 16, 16, 16, 16, -1, OPENGL_CUSTOM_PATTERN_NONE }, /*{ SCHRO_FRAME_FORMAT_U8_420, SCHRO_FRAME_FORMAT_S16_420, 16, 16, 16, 16, -1, OPENGL_CUSTOM_PATTERN_NONE },*/ { SCHRO_FRAME_FORMAT_U8_444, SCHRO_FRAME_FORMAT_S16_444, 19, 19, 21, 21, -1, OPENGL_CUSTOM_PATTERN_NONE }, { SCHRO_FRAME_FORMAT_U8_422, SCHRO_FRAME_FORMAT_S16_422, 21, 21, 19, 19, -1, OPENGL_CUSTOM_PATTERN_NONE }, /*{ SCHRO_FRAME_FORMAT_U8_420, SCHRO_FRAME_FORMAT_S16_420, 19, 21, 21, 19, -1, OPENGL_CUSTOM_PATTERN_NONE },*/ { SCHRO_FRAME_FORMAT_U8_444, SCHRO_FRAME_FORMAT_S16_444, 32, 32, 16, 16, -1, OPENGL_CUSTOM_PATTERN_NONE }, { SCHRO_FRAME_FORMAT_U8_422, SCHRO_FRAME_FORMAT_S16_422, 32, 32, 16, 16, -1, OPENGL_CUSTOM_PATTERN_NONE }, /*{ SCHRO_FRAME_FORMAT_U8_420, SCHRO_FRAME_FORMAT_S16_420, 32, 32, 16, 16, -1, OPENGL_CUSTOM_PATTERN_NONE },*/ /* U8 -> U8 */ { SCHRO_FRAME_FORMAT_U8_444, SCHRO_FRAME_FORMAT_U8_444, 1280, 720, 1920, 1080, 1, OPENGL_CUSTOM_PATTERN_RANDOM }, { SCHRO_FRAME_FORMAT_U8_422, SCHRO_FRAME_FORMAT_U8_422, 1920, 1080, 1280, 720, 1, OPENGL_CUSTOM_PATTERN_RANDOM }, /*{ SCHRO_FRAME_FORMAT_U8_420, SCHRO_FRAME_FORMAT_U8_420, 1920, 1080, 1920, 1080, 1, OPENGL_CUSTOM_PATTERN_RANDOM },*/ /* S16 -> S16 */ { SCHRO_FRAME_FORMAT_S16_444, SCHRO_FRAME_FORMAT_S16_444, 1280, 720, 1920, 1080, 1, OPENGL_CUSTOM_PATTERN_RANDOM }, { SCHRO_FRAME_FORMAT_S16_422, SCHRO_FRAME_FORMAT_S16_422, 1920, 1080, 1280, 720, 1, OPENGL_CUSTOM_PATTERN_RANDOM }, /*{ SCHRO_FRAME_FORMAT_S16_420, SCHRO_FRAME_FORMAT_S16_420, 1920, 1080, 1920, 1080, 1, OPENGL_CUSTOM_PATTERN_RANDOM },*/ /* YUYV -> U8 422 */ { SCHRO_FRAME_FORMAT_U8_422, SCHRO_FRAME_FORMAT_YUYV, 1920 / 2, 1080, 1920, 1080, 1, OPENGL_CUSTOM_PATTERN_RANDOM }, /* UYVY -> U8 422 */ { SCHRO_FRAME_FORMAT_U8_422, SCHRO_FRAME_FORMAT_UYVY, 1920 / 2, 1080, 1920, 1080, 1, OPENGL_CUSTOM_PATTERN_RANDOM }, /* AYUV -> U8 444 */ { SCHRO_FRAME_FORMAT_U8_444, SCHRO_FRAME_FORMAT_AYUV, 1920 / 4, 1080, 1920, 1080, 1, OPENGL_CUSTOM_PATTERN_RANDOM }, /* U8 422 -> YUYV */ { SCHRO_FRAME_FORMAT_YUYV, SCHRO_FRAME_FORMAT_U8_422, 1920, 1080, 1920 / 2, 1080, 1, OPENGL_CUSTOM_PATTERN_RANDOM }, /* U8 422 -> UYVY */ { SCHRO_FRAME_FORMAT_UYVY, SCHRO_FRAME_FORMAT_U8_422, 1920, 1080, 1920 / 2, 1080, 1, OPENGL_CUSTOM_PATTERN_RANDOM }, /* U8 444 -> AYUV */ { SCHRO_FRAME_FORMAT_AYUV, SCHRO_FRAME_FORMAT_U8_444, 1920, 1080, 1920 / 4, 1080, 1, OPENGL_CUSTOM_PATTERN_RANDOM } }; void opengl_test_push_pull (SchroFrameFormat format, int width, int height, int todo, int custom_pattern); void opengl_test_push_pull_run (void); void opengl_test_add (SchroFrameFormat dest_format, SchroFrameFormat src_format, int dest_width, int dest_height, int src_width, int src_height, int todo, int custom_dest_pattern, int custom_src_pattern, int dest_pattern_drift); void opengl_test_subtract (SchroFrameFormat dest_format, SchroFrameFormat src_format, int dest_width, int dest_height, int src_width, int src_height, int todo, int custom_dest_pattern, int custom_src_pattern, int dest_pattern_drift); void opengl_test_combine_run (void); int main (int argc, char *argv[]) { int i; int special = FALSE; SchroOpenGL *local_opengl; for (i = 1; i < argc; ++i) { if (!strcmp (argv[i], "-b") || !strcmp (argv[i], "--benchmark")) { _benchmark = TRUE; } if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--special")) { special = TRUE; } } _abort_on_failure = TRUE; schro_init (); _generators = test_pattern_get_n_generators (); _cpu_domain = schro_memory_domain_new_local (); _opengl_domain = schro_memory_domain_new_opengl (); local_opengl = schro_opengl_new (); _opengl = local_opengl; //opengl_test_wavelet_inverse (SCHRO_FRAME_FORMAT_S16_444, 16, 4, 1, // OPENGL_CUSTOM_PATTERN_RANDOM_U8, SCHRO_WAVELET_LE_GALL_5_3, 1); _opengl = schro_opengl_new (); if (_benchmark && !special) { /* push/pull */ opengl_test_push_pull (SCHRO_FRAME_FORMAT_U8_444, 1920, 1080, 100, OPENGL_CUSTOM_PATTERN_NONE); opengl_test_push_pull (SCHRO_FRAME_FORMAT_S16_444, 1920, 1080, 100, OPENGL_CUSTOM_PATTERN_NONE); opengl_test_push_pull (SCHRO_FRAME_FORMAT_YUYV, 1920, 1080, 100, OPENGL_CUSTOM_PATTERN_NONE); opengl_test_push_pull (SCHRO_FRAME_FORMAT_UYVY, 1920, 1080, 100, OPENGL_CUSTOM_PATTERN_NONE); opengl_test_push_pull (SCHRO_FRAME_FORMAT_AYUV, 1920, 1080, 100, OPENGL_CUSTOM_PATTERN_NONE); /* convert */ opengl_test_convert (SCHRO_FRAME_FORMAT_U8_444, SCHRO_FRAME_FORMAT_S16_444, 1920, 1080, 1920, 1080, 50, OPENGL_CUSTOM_PATTERN_RANDOM); opengl_test_convert (SCHRO_FRAME_FORMAT_S16_444, SCHRO_FRAME_FORMAT_U8_444, 1920, 1080, 1920, 1080, 50, OPENGL_CUSTOM_PATTERN_RANDOM); opengl_test_convert (SCHRO_FRAME_FORMAT_U8_422, SCHRO_FRAME_FORMAT_YUYV, 1920 / 2, 1080, 1920, 1080, 50, OPENGL_CUSTOM_PATTERN_RANDOM); opengl_test_convert (SCHRO_FRAME_FORMAT_U8_422, SCHRO_FRAME_FORMAT_UYVY, 1920 / 2, 1080, 1920, 1080, 50, OPENGL_CUSTOM_PATTERN_RANDOM); opengl_test_convert (SCHRO_FRAME_FORMAT_U8_444, SCHRO_FRAME_FORMAT_AYUV, 1920 / 4, 1080, 1920, 1080, 50, OPENGL_CUSTOM_PATTERN_RANDOM); opengl_test_convert (SCHRO_FRAME_FORMAT_YUYV, SCHRO_FRAME_FORMAT_U8_422, 1920, 1080, 1920 / 2, 1080, 50, OPENGL_CUSTOM_PATTERN_RANDOM); opengl_test_convert (SCHRO_FRAME_FORMAT_UYVY, SCHRO_FRAME_FORMAT_U8_422, 1920, 1080, 1920 / 2, 1080, 50, OPENGL_CUSTOM_PATTERN_RANDOM); opengl_test_convert (SCHRO_FRAME_FORMAT_AYUV, SCHRO_FRAME_FORMAT_U8_444, 1920, 1080, 1920 / 4, 1080, 50, OPENGL_CUSTOM_PATTERN_RANDOM); /* add */ opengl_test_add (SCHRO_FRAME_FORMAT_S16_444, SCHRO_FRAME_FORMAT_S16_444, 1920, 1080, 1920, 1080, 50, OPENGL_CUSTOM_PATTERN_CONST_MIDDLE, OPENGL_CUSTOM_PATTERN_RANDOM_S8, 0); opengl_test_add (SCHRO_FRAME_FORMAT_S16_444, SCHRO_FRAME_FORMAT_U8_444, 1920, 1080, 1920, 1080, 50, OPENGL_CUSTOM_PATTERN_CONST_MIDDLE, OPENGL_CUSTOM_PATTERN_RANDOM, 0); /* subtract */ opengl_test_subtract (SCHRO_FRAME_FORMAT_S16_444, SCHRO_FRAME_FORMAT_S16_444, 1920, 1080, 1920, 1080, 50, OPENGL_CUSTOM_PATTERN_CONST_MAX, OPENGL_CUSTOM_PATTERN_RANDOM_U8, 0); opengl_test_subtract (SCHRO_FRAME_FORMAT_S16_444, SCHRO_FRAME_FORMAT_U8_444, 1920, 1080, 1920, 1080, 50, OPENGL_CUSTOM_PATTERN_CONST_MIDDLE, OPENGL_CUSTOM_PATTERN_RANDOM, 0); } else if (special) { /*opengl_test_push_pull (SCHRO_FRAME_FORMAT_S16_444, 16, 16, 1, OPENGL_CUSTOM_PATTERN_RANDOM);*/ /*opengl_test_convert (SCHRO_FRAME_FORMAT_S16_444, SCHRO_FRAME_FORMAT_U8_444, 16, 16, 16, 16, 1, OPENGL_CUSTOM_PATTERN_RANDOM);*/ /*opengl_test_convert (SCHRO_FRAME_FORMAT_U8_444, SCHRO_FRAME_FORMAT_S16_444, 16, 16, 16, 16, 1, OPENGL_CUSTOM_PATTERN_RANDOM);*/ /*opengl_test_upsample (SCHRO_FRAME_FORMAT_U8_444, 16, 16, OPENGL_CUSTOM_PATTERN_RANDOM);*/ opengl_test_motion (720, 480, OPENGL_CUSTOM_PATTERN_RANDOM); /*opengl_test_convert (SCHRO_FRAME_FORMAT_S16_444, SCHRO_FRAME_FORMAT_S16_444, 16, 16, 16, 16, 1, OPENGL_CUSTOM_PATTERN_RANDOM);*/ /*opengl_test_wavelet_inverse (SCHRO_FRAME_FORMAT_S16_444, 16, 16, 1, OPENGL_CUSTOM_PATTERN_RANDOM_U8, SCHRO_WAVELET_LE_GALL_5_3, 1);*/ /*opengl_test_convert (SCHRO_FRAME_FORMAT_U8_422, SCHRO_FRAME_FORMAT_YUYV, 32 / 2, 16, 32, 16, 1, OPENGL_CUSTOM_PATTERN_RANDOM);*/ } else { opengl_test_push_pull_run (); /* convert */ for (i = 0; i < ARRAY_SIZE (opengl_test_convert_list); ++i) { opengl_test_convert (opengl_test_convert_list[i].dest_format, opengl_test_convert_list[i].src_format, opengl_test_convert_list[i].dest_width, opengl_test_convert_list[i].dest_height, opengl_test_convert_list[i].src_width, opengl_test_convert_list[i].src_height, opengl_test_convert_list[i].todo < 1 ? _generators : opengl_test_convert_list[i].todo, opengl_test_convert_list[i].custom_pattern); } opengl_test_combine_run (); /* inverse wavelet */ opengl_test_wavelet_inverse (SCHRO_FRAME_FORMAT_S16_444, 16, 64, 3, OPENGL_CUSTOM_PATTERN_RANDOM_U8, SCHRO_WAVELET_DESLAURIES_DUBUC_9_7, 4); opengl_test_wavelet_inverse (SCHRO_FRAME_FORMAT_S16_444, 64, 64, 3, OPENGL_CUSTOM_PATTERN_RANDOM_U8, SCHRO_WAVELET_LE_GALL_5_3, 6); opengl_test_wavelet_inverse (SCHRO_FRAME_FORMAT_S16_444, 1024, 1024, 3, OPENGL_CUSTOM_PATTERN_RANDOM_U8, SCHRO_WAVELET_LE_GALL_5_3, 3); opengl_test_wavelet_inverse (SCHRO_FRAME_FORMAT_S16_444, 16, 16, 3, OPENGL_CUSTOM_PATTERN_RANDOM_U8, SCHRO_WAVELET_LE_GALL_5_3, 4); opengl_test_wavelet_inverse (SCHRO_FRAME_FORMAT_S16_444, 16, 16, 3, OPENGL_CUSTOM_PATTERN_RANDOM_U8, SCHRO_WAVELET_DESLAURIES_DUBUC_13_7, 1); opengl_test_wavelet_inverse (SCHRO_FRAME_FORMAT_S16_444, 16, 16, 3, OPENGL_CUSTOM_PATTERN_RANDOM_U8, SCHRO_WAVELET_HAAR_0, 2); opengl_test_wavelet_inverse (SCHRO_FRAME_FORMAT_S16_444, 1024, 1024, 3, OPENGL_CUSTOM_PATTERN_RANDOM_U8, SCHRO_WAVELET_HAAR_0, 10); opengl_test_wavelet_inverse (SCHRO_FRAME_FORMAT_S16_444, 16, 16, 3, OPENGL_CUSTOM_PATTERN_RANDOM_U8, SCHRO_WAVELET_HAAR_1, 4); /* upsample */ opengl_test_upsample (SCHRO_FRAME_FORMAT_U8_444, 320, 240, OPENGL_CUSTOM_PATTERN_RANDOM); opengl_test_upsample (SCHRO_FRAME_FORMAT_U8_444, 1920, 1080, OPENGL_CUSTOM_PATTERN_RANDOM); opengl_test_upsample (SCHRO_FRAME_FORMAT_U8_444, 16, 16, OPENGL_CUSTOM_PATTERN_RANDOM); opengl_test_upsample (SCHRO_FRAME_FORMAT_U8_444, 16, 16, OPENGL_CUSTOM_PATTERN_CONST_MIN); opengl_test_upsample (SCHRO_FRAME_FORMAT_U8_444, 16, 16, OPENGL_CUSTOM_PATTERN_CONST_MIDDLE); opengl_test_upsample (SCHRO_FRAME_FORMAT_U8_444, 16, 16, OPENGL_CUSTOM_PATTERN_CONST_MAX); } schro_opengl_free (local_opengl); schro_opengl_free (_opengl); schro_memory_domain_free (_cpu_domain); schro_memory_domain_free (_opengl_domain); if (_failed) { printf ("FAILED\n"); return 1; } printf ("SUCCESS\n"); return 0; } schroedinger-1.0.11/testsuite/opengl/opengl_util.c0000644000175000017500000002671711541755167017222 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "../common.h" #include "opengl_util.h" int _benchmark = FALSE; int _failed = FALSE; int _generators = 0; int _abort_on_failure = FALSE; SchroMemoryDomain *_cpu_domain = NULL; SchroMemoryDomain *_opengl_domain = NULL; SchroOpenGL *_opengl = NULL; void opengl_test_failed (void) { _failed = TRUE; if (_abort_on_failure) { abort (); } } int opengl_format_name (SchroFrameFormat format, char *format_name, int size) { switch (format) { case SCHRO_FRAME_FORMAT_U8_444: strncpy (format_name, "U8 444", size); break; case SCHRO_FRAME_FORMAT_U8_422: strncpy (format_name, "U8 422", size); break; case SCHRO_FRAME_FORMAT_U8_420: strncpy (format_name, "U8 420", size); break; case SCHRO_FRAME_FORMAT_S16_444: strncpy (format_name, "S16 444", size); break; case SCHRO_FRAME_FORMAT_S16_422: strncpy (format_name, "S16 422", size); break; case SCHRO_FRAME_FORMAT_S16_420: strncpy (format_name, "S16 420", size); break; case SCHRO_FRAME_FORMAT_S32_444: strncpy (format_name, "S32 444", size); break; case SCHRO_FRAME_FORMAT_S32_422: strncpy (format_name, "S32 422", size); break; case SCHRO_FRAME_FORMAT_S32_420: strncpy (format_name, "S32 420", size); break; case SCHRO_FRAME_FORMAT_YUYV: strncpy (format_name, "YUYV", size); break; case SCHRO_FRAME_FORMAT_UYVY: strncpy (format_name, "UYVY", size); break; case SCHRO_FRAME_FORMAT_AYUV: strncpy (format_name, "AYUV", size); break; case SCHRO_FRAME_FORMAT_ARGB: strncpy (format_name, "ARGB", size); break; default: strncpy (format_name, "unknown", size); return FALSE; } return TRUE; } int opengl_filter_name (int filter, char *filter_name, int size) { switch (filter) { case SCHRO_WAVELET_DESLAURIES_DUBUC_9_7: strncpy (filter_name, "Deslauriers-Debuc (9,7)", size); break; case SCHRO_WAVELET_LE_GALL_5_3: strncpy (filter_name, "LeGall (5,3)", size); break; case SCHRO_WAVELET_DESLAURIES_DUBUC_13_7: strncpy (filter_name, "Deslauriers-Debuc (13,7)", size); break; case SCHRO_WAVELET_HAAR_0: strncpy (filter_name, "Haar 0", size); break; case SCHRO_WAVELET_HAAR_1: strncpy (filter_name, "Haar 1", size); break; case SCHRO_WAVELET_FIDELITY: strncpy (filter_name, "Fidelity", size); break; case SCHRO_WAVELET_DAUBECHIES_9_7: strncpy (filter_name, "Daubechies (9,7)", size); break; default: strncpy (filter_name, "unknown", size); return FALSE; } return TRUE; } static SchroFrameFormat opengl_format_as_u8 (SchroFrameFormat format) { switch (format) { case SCHRO_FRAME_FORMAT_U8_444: return SCHRO_FRAME_FORMAT_U8_444; case SCHRO_FRAME_FORMAT_U8_422: return SCHRO_FRAME_FORMAT_U8_422; case SCHRO_FRAME_FORMAT_U8_420: return SCHRO_FRAME_FORMAT_U8_420; case SCHRO_FRAME_FORMAT_S16_444: return SCHRO_FRAME_FORMAT_U8_444; case SCHRO_FRAME_FORMAT_S16_422: return SCHRO_FRAME_FORMAT_U8_422; case SCHRO_FRAME_FORMAT_S16_420: return SCHRO_FRAME_FORMAT_U8_420; case SCHRO_FRAME_FORMAT_S32_444: return SCHRO_FRAME_FORMAT_U8_444; case SCHRO_FRAME_FORMAT_S32_422: return SCHRO_FRAME_FORMAT_U8_422; case SCHRO_FRAME_FORMAT_S32_420: return SCHRO_FRAME_FORMAT_U8_420; case SCHRO_FRAME_FORMAT_YUYV: return SCHRO_FRAME_FORMAT_U8_422; case SCHRO_FRAME_FORMAT_UYVY: return SCHRO_FRAME_FORMAT_U8_422; case SCHRO_FRAME_FORMAT_AYUV: return SCHRO_FRAME_FORMAT_U8_444; case SCHRO_FRAME_FORMAT_ARGB: return SCHRO_FRAME_FORMAT_U8_444; } return SCHRO_FRAME_FORMAT_U8_444; } #define CUSTOM_PATTERN_CONST(_block_u8, _block_s16) { \ int i, j; \ uint8_t *data_u8; \ int16_t *data_s16; \ if (SCHRO_FRAME_FORMAT_DEPTH(frame_data->format) \ == SCHRO_FRAME_FORMAT_DEPTH_U8) { \ for (j = 0; j < frame_data->height; ++j) { \ data_u8 = SCHRO_FRAME_DATA_GET_LINE(frame_data, j); \ for (i = 0; i < frame_data->width; ++i) { \ _block_u8 \ } \ } \ } else { \ for (j = 0; j < frame_data->height; ++j) { \ data_s16 = SCHRO_FRAME_DATA_GET_LINE(frame_data, j); \ for (i = 0; i < frame_data->width; ++i) { \ _block_s16 \ } \ } \ } \ } static void opengl_custom_pattern_random (SchroFrameData *frame_data) { CUSTOM_PATTERN_CONST({ data_u8[i] = orc_rand_u8(); },{ data_s16[i] = orc_rand_s16(); /* FIXME: can't use full S16 range here, schro_frame_convert_u8_s16 doesn't support it, but I need to use schro_frame_convert_u8_s16 to get a ref frame to test the opengl convert against */ if (data_s16[i] > 32767 - 128) data_s16[i] = 32767 - 128; }) } static void opengl_custom_pattern_random_u8 (SchroFrameData *frame_data) { CUSTOM_PATTERN_CONST({ data_u8[i] = orc_rand_u8(); },{ data_s16[i] = orc_rand_u8(); }) } static void opengl_custom_pattern_random_s8 (SchroFrameData *frame_data) { CUSTOM_PATTERN_CONST({ data_u8[i] = orc_rand_u8(); },{ data_s16[i] = orc_rand_s8(); }) } static void opengl_custom_pattern_const_1 (SchroFrameData *frame_data) { CUSTOM_PATTERN_CONST({ data_u8[i] = 1; },{ data_s16[i] = 1; }) } static void opengl_custom_pattern_const_16 (SchroFrameData *frame_data) { CUSTOM_PATTERN_CONST({ data_u8[i] = 16; },{ data_s16[i] = 16; }) } static void opengl_custom_pattern_const_min (SchroFrameData *frame_data) { CUSTOM_PATTERN_CONST({ data_u8[i] = 0; },{ data_s16[i] = -32768; }) } static void opengl_custom_pattern_const_min_u8 (SchroFrameData *frame_data) { CUSTOM_PATTERN_CONST({ data_u8[i] = 0; },{ data_s16[i] = 0; }) } static void opengl_custom_pattern_const_min_s8 (SchroFrameData *frame_data) { CUSTOM_PATTERN_CONST({ data_u8[i] = -128; },{ data_s16[i] = -128; }) } static void opengl_custom_pattern_const_middle (SchroFrameData *frame_data) { CUSTOM_PATTERN_CONST({ data_u8[i] = 127; },{ data_s16[i] = 0; }) } static void opengl_custom_pattern_const_middle_u8 (SchroFrameData *frame_data) { CUSTOM_PATTERN_CONST({ data_u8[i] = 127; },{ data_s16[i] = 127; }) } static void opengl_custom_pattern_const_max (SchroFrameData *frame_data) { CUSTOM_PATTERN_CONST({ data_u8[i] = 255; },{ /* FIXME: can't use full S16 range here, schro_frame_convert_u8_s16 doesn't support it, but I need to use schro_frame_convert_u8_s16 to get a ref frame to test the opengl convert against */ data_s16[i] = 32767 - 128; }) } static void opengl_custom_pattern_const_max_u8 (SchroFrameData *frame_data) { CUSTOM_PATTERN_CONST({ data_u8[i] = 255; },{ data_s16[i] = 255; }) } void opengl_custom_pattern_generate (SchroFrame *cpu_frame, int pattern_type, int pattern_index, char* pattern_name) { SchroFrameFormat format_u8; SchroFrame* cpu_frame_u8 = NULL; SCHRO_ASSERT(cpu_frame != NULL); switch (pattern_type) { default: case OPENGL_CUSTOM_PATTERN_NONE: format_u8 = opengl_format_as_u8 (cpu_frame->format); cpu_frame_u8 = schro_frame_new_and_alloc (_cpu_domain, format_u8, cpu_frame->width, cpu_frame->height); test_pattern_generate (cpu_frame_u8->components + 0, pattern_name, pattern_index % _generators); test_pattern_generate (cpu_frame_u8->components + 1, pattern_name, pattern_index % _generators); test_pattern_generate (cpu_frame_u8->components + 2, pattern_name, pattern_index % _generators); schro_frame_convert (cpu_frame, cpu_frame_u8); schro_frame_unref (cpu_frame_u8); break; case OPENGL_CUSTOM_PATTERN_RANDOM: strcpy (pattern_name, "custom random"); opengl_custom_pattern_random (cpu_frame->components + 0); opengl_custom_pattern_random (cpu_frame->components + 1); opengl_custom_pattern_random (cpu_frame->components + 2); break; case OPENGL_CUSTOM_PATTERN_RANDOM_U8: strcpy (pattern_name, "custom random U8"); opengl_custom_pattern_random_u8 (cpu_frame->components + 0); opengl_custom_pattern_random_u8 (cpu_frame->components + 1); opengl_custom_pattern_random_u8 (cpu_frame->components + 2); break; case OPENGL_CUSTOM_PATTERN_RANDOM_S8: strcpy (pattern_name, "custom random S8"); opengl_custom_pattern_random_s8 (cpu_frame->components + 0); opengl_custom_pattern_random_s8 (cpu_frame->components + 1); opengl_custom_pattern_random_s8 (cpu_frame->components + 2); break; case OPENGL_CUSTOM_PATTERN_CONST_1: strcpy (pattern_name, "custom const 1"); opengl_custom_pattern_const_1 (cpu_frame->components + 0); opengl_custom_pattern_const_1 (cpu_frame->components + 1); opengl_custom_pattern_const_1 (cpu_frame->components + 2); break; case OPENGL_CUSTOM_PATTERN_CONST_16: strcpy (pattern_name, "custom const 16"); opengl_custom_pattern_const_16 (cpu_frame->components + 0); opengl_custom_pattern_const_16 (cpu_frame->components + 1); opengl_custom_pattern_const_16 (cpu_frame->components + 2); break; case OPENGL_CUSTOM_PATTERN_CONST_MIN: strcpy (pattern_name, "custom const min"); opengl_custom_pattern_const_min (cpu_frame->components + 0); opengl_custom_pattern_const_min (cpu_frame->components + 1); opengl_custom_pattern_const_min (cpu_frame->components + 2); break; case OPENGL_CUSTOM_PATTERN_CONST_MIN_U8: strcpy (pattern_name, "custom const min U8"); opengl_custom_pattern_const_min_u8 (cpu_frame->components + 0); opengl_custom_pattern_const_min_u8 (cpu_frame->components + 1); opengl_custom_pattern_const_min_u8 (cpu_frame->components + 2); break; case OPENGL_CUSTOM_PATTERN_CONST_MIN_S8: strcpy (pattern_name, "custom const min S8"); opengl_custom_pattern_const_min_s8 (cpu_frame->components + 0); opengl_custom_pattern_const_min_s8 (cpu_frame->components + 1); opengl_custom_pattern_const_min_s8 (cpu_frame->components + 2); break; case OPENGL_CUSTOM_PATTERN_CONST_MIDDLE: strcpy (pattern_name, "custom const middle"); opengl_custom_pattern_const_middle (cpu_frame->components + 0); opengl_custom_pattern_const_middle (cpu_frame->components + 1); opengl_custom_pattern_const_middle (cpu_frame->components + 2); break; case OPENGL_CUSTOM_PATTERN_CONST_MIDDLE_U8: strcpy (pattern_name, "custom const middle U8"); opengl_custom_pattern_const_middle_u8 (cpu_frame->components + 0); opengl_custom_pattern_const_middle_u8 (cpu_frame->components + 1); opengl_custom_pattern_const_middle_u8 (cpu_frame->components + 2); break; case OPENGL_CUSTOM_PATTERN_CONST_MAX: strcpy (pattern_name, "custom const max"); opengl_custom_pattern_const_max (cpu_frame->components + 0); opengl_custom_pattern_const_max (cpu_frame->components + 1); opengl_custom_pattern_const_max (cpu_frame->components + 2); break; case OPENGL_CUSTOM_PATTERN_CONST_MAX_U8: strcpy (pattern_name, "custom const max U8"); opengl_custom_pattern_const_max_u8 (cpu_frame->components + 0); opengl_custom_pattern_const_max_u8 (cpu_frame->components + 1); opengl_custom_pattern_const_max_u8 (cpu_frame->components + 2); break; } } schroedinger-1.0.11/testsuite/opengl/Makefile.am0000644000175000017500000000043511541755167016556 00000000000000 if HAVE_OPENGL noinst_PROGRAMS = opengl endif AM_CFLAGS = $(SCHRO_CFLAGS) $(ERROR_CFLAGS) $(ORC_CFLAGS) \ -DSCHRO_ENABLE_UNSTABLE_API -I$(srcdir)/.. LDADD = $(SCHRO_LIBS) ../libschrotest.la opengl_SOURCES = \ opengl.c \ opengl_combine.c \ opengl_pushpull.c \ opengl_util.c schroedinger-1.0.11/testsuite/opengl/Makefile.in0000664000175000017500000003732011707140262016560 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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@ @HAVE_OPENGL_TRUE@noinst_PROGRAMS = opengl$(EXEEXT) subdir = testsuite/opengl DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-auto-alt.m4 \ $(top_srcdir)/m4/as-compiler-flag.m4 \ $(top_srcdir)/m4/as-host-defines.m4 \ $(top_srcdir)/m4/as-version.m4 $(top_srcdir)/m4/gst-args.m4 \ $(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)/m4/pkg.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) am_opengl_OBJECTS = opengl.$(OBJEXT) opengl_combine.$(OBJEXT) \ opengl_pushpull.$(OBJEXT) opengl_util.$(OBJEXT) opengl_OBJECTS = $(am_opengl_OBJECTS) opengl_LDADD = $(LDADD) am__DEPENDENCIES_1 = opengl_DEPENDENCIES = $(am__DEPENDENCIES_1) ../libschrotest.la DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(opengl_SOURCES) DIST_SOURCES = $(opengl_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUDA_CFLAGS = @CUDA_CFLAGS@ CUDA_LIBS = @CUDA_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ GCOV = @GCOV@ GCOV_CFLAGS = @GCOV_CFLAGS@ GCOV_LIBS = @GCOV_LIBS@ GREP = @GREP@ GTHREAD_CFLAGS = @GTHREAD_CFLAGS@ GTHREAD_LIBS = @GTHREAD_LIBS@ GTKDOC_CHECK = @GTKDOC_CHECK@ 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@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ NVCC = @NVCC@ NVCCFLAGS = @NVCCFLAGS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENGL_CFLAGS = @OPENGL_CFLAGS@ OPENGL_LIBS = @OPENGL_LIBS@ ORCC = @ORCC@ ORC_CFLAGS = @ORC_CFLAGS@ ORC_LIBS = @ORC_LIBS@ 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@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SCHRO_CFLAGS = @SCHRO_CFLAGS@ SCHRO_LIBS = @SCHRO_LIBS@ SCHRO_LIBVERSION = @SCHRO_LIBVERSION@ SCHRO_MAJORMINOR = @SCHRO_MAJORMINOR@ SCHRO_PKG_DEPS = @SCHRO_PKG_DEPS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ THREAD_IMPL = @THREAD_IMPL@ VERSION = @VERSION@ 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_CXX = @ac_ct_CXX@ 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@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CFLAGS = $(SCHRO_CFLAGS) $(ERROR_CFLAGS) $(ORC_CFLAGS) \ -DSCHRO_ENABLE_UNSTABLE_API -I$(srcdir)/.. LDADD = $(SCHRO_LIBS) ../libschrotest.la opengl_SOURCES = \ opengl.c \ opengl_combine.c \ opengl_pushpull.c \ opengl_util.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(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) --foreign testsuite/opengl/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign testsuite/opengl/Makefile .PRECIOUS: 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-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list opengl$(EXEEXT): $(opengl_OBJECTS) $(opengl_DEPENDENCIES) @rm -f opengl$(EXEEXT) $(LINK) $(opengl_OBJECTS) $(opengl_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opengl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opengl_combine.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opengl_pushpull.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opengl_util.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 $(PROGRAMS) 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-noinstPROGRAMS \ 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 all all-am check check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS ctags 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 uninstall uninstall-am # 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: schroedinger-1.0.11/testsuite/unpack.c0000644000175000017500000001256611541755167014673 00000000000000 #include #include #include #include #include #include int fail; void dump_bits (SchroPack *pack, int n) { int i; for(i=0;ibuffer->data[(i>>3)] >> (7 - (i&7))) & 1); } printf("\n"); } void schro_unpack_dump (SchroUnpack *unpack) { printf("data[] = %02x %02x %02x %02x\n", unpack->data[0], unpack->data[1], unpack->data[2], unpack->data[3]); printf("n_bits_left = %d\n", unpack->n_bits_left); printf("n_bits_read = %d\n", unpack->n_bits_read); printf("shift_register = %08x\n", unpack->shift_register); printf("n_bits_in_shift_register = %d\n", unpack->n_bits_in_shift_register); printf("guard_bit = %d\n", unpack->guard_bit); printf("overrun = %d\n", unpack->overrun); exit(1); } int test1 (void) { SchroBuffer *buffer = schro_buffer_new_and_alloc (100); SchroPack *pack; SchroUnpack unpack; int i; int ref[800]; int x; int guard; for(i=0;i<800;i++){ ref[i] = rand()&1; } guard = rand()&1; pack = schro_pack_new (); schro_pack_encode_init (pack, buffer); for(i=0;i<800;i++){ schro_pack_encode_bit (pack, ref[i]); } schro_pack_flush(pack); schro_pack_free (pack); schro_unpack_init_with_data (&unpack, buffer->data, buffer->length, guard); for(i=0;i<800;i++){ x = schro_unpack_decode_bit (&unpack); if (x != ref[i]) { printf("test1 failed at bit %d\n", i); schro_unpack_dump(&unpack); return 0; } } for(i=0;i<100;i++){ x = schro_unpack_decode_bit (&unpack); if (x != guard) { printf("test1 failed at guard bit %d\n", i); schro_unpack_dump(&unpack); return 0; } } schro_buffer_unref (buffer); return 1; } int test2 (void) { SchroBuffer *buffer = schro_buffer_new_and_alloc (1000); SchroPack *pack; SchroUnpack unpack; int i; int ref[100]; int x; int n_bytes; memset (buffer->data, 0, 1000); for(i=0;i<100;i++){ ref[i] = rand()&0xff; } pack = schro_pack_new (); schro_pack_encode_init (pack, buffer); for(i=0;i<100;i++){ schro_pack_encode_uint (pack, ref[i]); } schro_pack_flush(pack); n_bytes = schro_pack_get_offset (pack); schro_pack_free (pack); schro_unpack_init_with_data (&unpack, buffer->data, n_bytes, 1); for(i=0;i<100;i++){ x = schro_unpack_decode_uint (&unpack); if (x != ref[i]) { printf("test2 failed at symbol %d (%d should be %d)\n", i, x, ref[i]); schro_unpack_dump(&unpack); return 0; } } schro_buffer_unref (buffer); return 1; } int test3 (void) { SchroBuffer *buffer = schro_buffer_new_and_alloc (1000); SchroPack *pack; SchroUnpack unpack; SchroUnpack unpack2; int i; int ref[100]; int x; int n_bytes; int n_bits = 0; int n_bits2 = 0; memset (buffer->data, 0, 1000); for(i=0;i<100;i++){ ref[i] = (rand()&0xff) - 128; } pack = schro_pack_new (); schro_pack_encode_init (pack, buffer); n_bits = 0; for(i=0;i<50;i++){ schro_pack_encode_sint (pack, ref[i]); n_bits += schro_pack_estimate_sint (ref[i]); } n_bits2 = 0; for(i=50;i<100;i++){ schro_pack_encode_sint (pack, ref[i]); n_bits2 += schro_pack_estimate_sint (ref[i]); } schro_pack_flush(pack); n_bytes = schro_pack_get_offset (pack); schro_pack_free (pack); schro_unpack_init_with_data (&unpack, buffer->data, n_bytes, 1); schro_unpack_copy (&unpack2, &unpack); schro_unpack_limit_bits_remaining (&unpack, n_bits); for(i=0;i<50;i++){ x = schro_unpack_decode_sint (&unpack); if (x != ref[i]) { SCHRO_ERROR("test3 failed at symbol %d (%d should be %d)", i, x, ref[i]); schro_unpack_dump(&unpack); return 0; } } for(i=0;i<10;i++){ x = schro_unpack_decode_sint (&unpack); if (x != 0) { SCHRO_ERROR("test3 failed at symbol %d (%d should be 0)", i, x); schro_unpack_dump(&unpack); return 0; } } schro_unpack_skip_bits (&unpack2, n_bits); schro_unpack_limit_bits_remaining (&unpack2, n_bits2); for(i=50;i<100;i++){ x = schro_unpack_decode_sint (&unpack2); if (x != ref[i]) { SCHRO_ERROR("test3 failed at symbol %d (%d should be %d)", i, x, ref[i]); schro_unpack_dump(&unpack2); return 0; } } for(i=0;i<10;i++){ x = schro_unpack_decode_sint (&unpack2); if (x != 0) { SCHRO_ERROR("test3 failed at symbol %d (%d should be 0)", i, x); schro_unpack_dump(&unpack2); return 0; } } schro_buffer_unref (buffer); return 1; } int test4 (void) { SchroBuffer *buffer = schro_buffer_new_and_alloc (100); SchroPack *pack; SchroUnpack unpack; int i; int16_t x; int ok = 1; for(i=-1000;i<1000;i++){ pack = schro_pack_new (); schro_pack_encode_init (pack, buffer); schro_pack_encode_sint (pack, i); schro_pack_flush(pack); schro_pack_free (pack); schro_unpack_init_with_data (&unpack, buffer->data, buffer->length, 1); schro_unpack_decode_sint_s16 (&x, &unpack, 1); if (i != x) { printf("%d %d %c\n", i, x, (i==x)?' ':'x'); ok = 0; } } schro_buffer_unref (buffer); return ok; } int main (int argc, char *argv[]) { int ok = 1; int i; schro_init(); srand(time(NULL)); for(i=0;i<100;i++){ ok &= test1(); } for(i=0;i<100;i++){ ok &= test2(); } for(i=0;i<100;i++){ ok &= test3(); } ok &= test4(); if (ok) exit(0); exit(1); } schroedinger-1.0.11/testsuite/bits2.c0000644000175000017500000000303611161526031014405 00000000000000 #include #include #include #include void dump_bits (SchroBits *bits, int n) { int i; for(i=0;ibuffer->data[(i>>3)] >> (7 - (i&7))) & 1); } printf("\n"); } #define N 100 int ref[N]; int main (int argc, char *argv[]) { int i; SchroBuffer *buffer = schro_buffer_new_and_alloc (300); SchroBits *bits; int value; int fail = 0; int n; schro_init(); srand(time(NULL)); bits = schro_bits_new(); printf("unsigned int\n"); schro_bits_encode_init (bits, buffer); for(i=0;i #include #include #include #include #include void create_pattern (SchroFrame *frame) { int i,j; uint8_t *data; for(j=0;jheight;j++){ data = OFFSET(frame->components[0].data, j*frame->components[0].stride); for(i=0;iwidth;i++){ data[i] = (((i>>4)&1) ^ ((j>>4)&1)) * 255; } } memset (frame->components[1].data, 0, frame->components[1].length); memset (frame->components[2].data, 0, frame->components[2].length); schro_frame_filter_lowpass2 (frame, 5.0); } void distort (SchroFrame *frame) { int i,j; uint8_t *data; for(j=0;jheight;j++){ data = OFFSET(frame->components[0].data, j*frame->components[0].stride); for(i=0;iwidth;i++){ data[i] &= 0xfc; } } } void test (void) { SchroFrame *frame1; SchroFrame *frame2; frame1 = schro_frame_new_and_alloc (NULL, SCHRO_FRAME_FORMAT_U8_420, 256, 256); frame2 = schro_frame_new_and_alloc (NULL, SCHRO_FRAME_FORMAT_U8_420, 256, 256); create_pattern (frame1); create_pattern (frame2); distort (frame2); schro_frame_ssim (frame1, frame2); schro_frame_unref (frame1); schro_frame_unref (frame2); } int main (int argc, char *argv[]) { schro_init(); test(); return 0; } schroedinger-1.0.11/testsuite/arith_encode.c0000644000175000017500000000260111161526031016003 00000000000000 #include "config.h" #include #include #include #include #define BUFFER_SIZE 10000 uint8_t input_buffer[BUFFER_SIZE]; uint8_t output_buffer[BUFFER_SIZE]; #if 0 int main (int argc, char *argv[]) { SchroArith *a; int i; int value; a = schro_arith_new(); a->data = buffer; for(i=0;i<1000;i++) { buffer[i] = rand(); } schro_arith_decode_init (a); for(i=0;i<10000;i++){ printf("hi=%d lo=%d code=%04x count0=%d count1=%d\n", a->high, a->low, a->code, a->contexts[0].count0, a->contexts[0].count1); value = schro_arith_binary_decode (a, 0); printf(" --> %d\n", value); } schro_arith_free(a); return 0; } #endif int main (int argc, char *argv[]) { SchroArith *a; int i; FILE *file; int n_bytes; int j; SchroBuffer *output_buffer; schro_init(); file = fopen("test_file","r"); n_bytes = fread (input_buffer, 1, BUFFER_SIZE, file); fclose(file); a = schro_arith_new(); output_buffer = schro_buffer_new_and_alloc (BUFFER_SIZE); schro_arith_encode_init (a, output_buffer); for(i=0;i>(7-j))&1); } } schro_arith_flush (a); file = fopen("test_file_arith.out","w"); n_bytes = fwrite (output_buffer, 1, a->offset, file); fclose(file); return 0; } schroedinger-1.0.11/tools/0000775000175000017500000000000011707140273012413 500000000000000schroedinger-1.0.11/tools/dirac_parse.c0000644000175000017500000002732211161526031014751 00000000000000 #include "dirac_parse.h" #include #define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0])) typedef struct _Unpack Unpack; struct _Unpack { unsigned char *data; int n_bits_left; int index; int guard_bit; }; static void schro_unpack_init_with_data (Unpack *unpack, unsigned char *data, int n_bytes, unsigned int guard_bit); static unsigned int schro_unpack_decode_bit (Unpack *unpack); static unsigned int schro_unpack_decode_uint (Unpack *unpack); void schro_video_format_set_std_video_format (DiracSequenceHeader *format, int index); void schro_video_format_set_std_frame_rate (DiracSequenceHeader *format, int index); void schro_video_format_set_std_aspect_ratio (DiracSequenceHeader *format, int index); void schro_video_format_set_std_signal_range (DiracSequenceHeader *format, int index); void schro_video_format_set_std_colour_spec (DiracSequenceHeader *format, int index); int dirac_sequence_header_parse (DiracSequenceHeader *header, unsigned char *data, int n_bytes) { int bit; int index; Unpack _unpack; Unpack *unpack = &_unpack; int major_version; int minor_version; int profile; int level; memset(header, 0, sizeof(*header)); schro_unpack_init_with_data (unpack, data, n_bytes, 1); /* parse parameters */ major_version = schro_unpack_decode_uint (unpack); minor_version = schro_unpack_decode_uint (unpack); profile = schro_unpack_decode_uint (unpack); level = schro_unpack_decode_uint (unpack); /* base video header */ index = schro_unpack_decode_uint (unpack); schro_video_format_set_std_video_format (header, index); header->major_version = major_version; header->minor_version = minor_version; header->profile = profile; header->level = level; /* source parameters */ /* frame dimensions */ bit = schro_unpack_decode_bit (unpack); if (bit) { header->width = schro_unpack_decode_uint (unpack); header->height = schro_unpack_decode_uint (unpack); } /* chroma header */ bit = schro_unpack_decode_bit (unpack); if (bit) { header->chroma_format = schro_unpack_decode_uint (unpack); } /* scan header */ bit = schro_unpack_decode_bit (unpack); if (bit) { header->interlaced = schro_unpack_decode_bit (unpack); if (header->interlaced) { header->top_field_first = schro_unpack_decode_bit (unpack); } } /* frame rate */ bit = schro_unpack_decode_bit (unpack); if (bit) { index = schro_unpack_decode_uint (unpack); if (index == 0) { header->frame_rate_numerator = schro_unpack_decode_uint (unpack); header->frame_rate_denominator = schro_unpack_decode_uint (unpack); } else { schro_video_format_set_std_frame_rate (header, index); } } /* aspect ratio */ bit = schro_unpack_decode_bit (unpack); if (bit) { index = schro_unpack_decode_uint (unpack); if (index == 0) { header->aspect_ratio_numerator = schro_unpack_decode_uint (unpack); header->aspect_ratio_denominator = schro_unpack_decode_uint (unpack); } else { schro_video_format_set_std_aspect_ratio (header, index); } } /* clean area */ bit = schro_unpack_decode_bit (unpack); if (bit) { header->clean_width = schro_unpack_decode_uint (unpack); header->clean_height = schro_unpack_decode_uint (unpack); header->left_offset = schro_unpack_decode_uint (unpack); header->top_offset = schro_unpack_decode_uint (unpack); } /* signal range */ bit = schro_unpack_decode_bit (unpack); if (bit) { index = schro_unpack_decode_uint (unpack); if (index == 0) { header->luma_offset = schro_unpack_decode_uint (unpack); header->luma_excursion = schro_unpack_decode_uint (unpack); header->chroma_offset = schro_unpack_decode_uint (unpack); header->chroma_excursion = schro_unpack_decode_uint (unpack); } else { schro_video_format_set_std_signal_range (header, index); } } /* colour spec */ bit = schro_unpack_decode_bit (unpack); if (bit) { index = schro_unpack_decode_uint (unpack); schro_video_format_set_std_colour_spec (header, index); if (index == 0) { /* colour primaries */ bit = schro_unpack_decode_bit (unpack); if (bit) { header->colour_primaries = schro_unpack_decode_uint (unpack); } /* colour matrix */ bit = schro_unpack_decode_bit (unpack); if (bit) { header->colour_matrix = schro_unpack_decode_uint (unpack); } /* transfer function */ bit = schro_unpack_decode_bit (unpack); if (bit) { header->transfer_function = schro_unpack_decode_uint (unpack); } } } header->interlaced_coding = schro_unpack_decode_uint (unpack); return 1; } /* standard stuff */ static DiracSequenceHeader schro_video_formats[] = { { 0, 0, 0, 0, 0, /* custom */ 640, 480, SCHRO_CHROMA_420, FALSE, FALSE, 24000, 1001, 1, 1, 640, 480, 0, 0, 0, 255, 128, 255, 0, 0, 0 }, { 0, 0, 0, 0, 1, /* QSIF525 */ 176, 120, SCHRO_CHROMA_420, FALSE, FALSE, 15000, 1001, 10, 11, 176, 120, 0, 0, 0, 255, 128, 255, 1, 1, 0 }, { 0, 0, 0, 0, 2, /* QCIF */ 176, 144, SCHRO_CHROMA_420, FALSE, TRUE, 25, 2, 12, 11, 176, 144, 0, 0, 0, 255, 128, 255, 2, 1, 0 }, { 0, 0, 0, 0, 3, /* SIF525 */ 352, 240, SCHRO_CHROMA_420, FALSE, FALSE, 15000, 1001, 10, 11, 352, 240, 0, 0, 0, 255, 128, 255, 1, 1, 0 }, { 0, 0, 0, 0, 4, /* CIF */ 352, 288, SCHRO_CHROMA_420, FALSE, TRUE, 25, 2, 12, 11, 352, 288, 0, 0, 0, 255, 128, 255, 2, 1, 0 }, { 0, 0, 0, 0, 5, /* 4SIF525 */ 704, 480, SCHRO_CHROMA_420, FALSE, FALSE, 15000, 1001, 10, 11, 704, 480, 0, 0, 0, 255, 128, 255, 1, 1, 0 }, { 0, 0, 0, 0, 6, /* 4CIF */ 704, 576, SCHRO_CHROMA_420, FALSE, TRUE, 25, 2, 12, 11, 704, 576, 0, 0, 0, 255, 128, 255, 2, 1, 0 }, { 0, 0, 0, 0, 7, /* SD480I-60 */ 720, 480, SCHRO_CHROMA_422, TRUE, FALSE, 30000, 1001, 10, 11, 704, 480, 8, 0, 64, 876, 512, 896, 1, 1, 0 }, { 0, 0, 0, 0, 8, /* SD576I-50 */ 720, 576, SCHRO_CHROMA_422, TRUE, TRUE, 25, 1, 12, 11, 704, 576, 8, 0, 64, 876, 512, 896, 2, 1, 0 }, { 0, 0, 0, 0, 9, /* HD720P-60 */ 1280, 720, SCHRO_CHROMA_422, FALSE, TRUE, 60000, 1001, 1, 1, 1280, 720, 0, 0, 64, 876, 512, 896, 0, 0, 0 }, { 0, 0, 0, 0, 10, /* HD720P-50 */ 1280, 720, SCHRO_CHROMA_422, FALSE, TRUE, 50, 1, 1, 1, 1280, 720, 0, 0, 64, 876, 512, 896, 0, 0, 0 }, { 0, 0, 0, 0, 11, /* HD1080I-60 */ 1920, 1080, SCHRO_CHROMA_422, TRUE, TRUE, 30000, 1001, 1, 1, 1920, 1080, 0, 0, 64, 876, 512, 896, 0, 0, 0 }, { 0, 0, 0, 0, 12, /* HD1080I-50 */ 1920, 1080, SCHRO_CHROMA_422, TRUE, TRUE, 25, 1, 1, 1, 1920, 1080, 0, 0, 64, 876, 512, 896, 0, 0, 0 }, { 0, 0, 0, 0, 13, /* HD1080P-60 */ 1920, 1080, SCHRO_CHROMA_422, FALSE, TRUE, 60000, 1001, 1, 1, 1920, 1080, 0, 0, 64, 876, 512, 896, 0, 0, 0 }, { 0, 0, 0, 0, 14, /* HD1080P-50 */ 1920, 1080, SCHRO_CHROMA_422, FALSE, TRUE, 50, 1, 1, 1, 1920, 1080, 0, 0, 64, 876, 512, 896, 0, 0, 0 }, { 0, 0, 0, 0, 15, /* DC2K */ 2048, 1080, SCHRO_CHROMA_444, FALSE, TRUE, 24, 1, 1, 1, 2048, 1080, 0, 0, 256, 3504, 2048, 3584, 3, 0, 0 }, { 0, 0, 0, 0, 16, /* DC4K */ 4096, 2160, SCHRO_CHROMA_444, FALSE, TRUE, 24, 1, 1, 1, 2048, 1536, 0, 0, 256, 3504, 2048, 3584, 3, 0, 0 }, }; void schro_video_format_set_std_video_format (DiracSequenceHeader *format, int index) { if (index < 0 || index >= ARRAY_SIZE(schro_video_formats)) { return; } memcpy (format, schro_video_formats + index, sizeof(DiracSequenceHeader)); } typedef struct _SchroFrameRate SchroFrameRate; struct _SchroFrameRate { int numerator; int denominator; }; static SchroFrameRate schro_frame_rates[] = { { 0, 0 }, { 24000, 1001 }, { 24, 1 }, { 25, 1 }, { 30000, 1001 }, { 30, 1 }, { 50, 1 }, { 60000, 1001 }, { 60, 1 }, { 15000, 1001 }, { 25, 2 } }; void schro_video_format_set_std_frame_rate (DiracSequenceHeader *format, int index) { if (index < 1 || index >= ARRAY_SIZE(schro_frame_rates)) { return; } format->frame_rate_numerator = schro_frame_rates[index].numerator; format->frame_rate_denominator = schro_frame_rates[index].denominator; } typedef struct _SchroPixelAspectRatio SchroPixelAspectRatio; struct _SchroPixelAspectRatio { int numerator; int denominator; }; static const SchroPixelAspectRatio schro_aspect_ratios[] = { { 0, 0 }, { 1, 1 }, { 10, 11 }, { 12, 11 }, { 40, 33 }, { 16, 11 }, { 4, 3 } }; void schro_video_format_set_std_aspect_ratio (DiracSequenceHeader *format, int index) { if (index < 1 || index >= ARRAY_SIZE(schro_aspect_ratios)) { return; } format->aspect_ratio_numerator = schro_aspect_ratios[index].numerator; format->aspect_ratio_denominator = schro_aspect_ratios[index].denominator; } typedef struct _SchroSignalRangeStruct SchroSignalRangeStruct; struct _SchroSignalRangeStruct { int luma_offset; int luma_excursion; int chroma_offset; int chroma_excursion; }; static const SchroSignalRangeStruct schro_signal_ranges[] = { { 0, 0, 0, 0 }, { 0, 255, 128, 255 }, { 16, 219, 128, 224 }, { 64, 876, 512, 896 }, { 256, 3504, 2048, 3584 } }; void schro_video_format_set_std_signal_range (DiracSequenceHeader *format, int i) { if (i < 1 || i >= ARRAY_SIZE(schro_signal_ranges)) { return; } format->luma_offset = schro_signal_ranges[i].luma_offset; format->luma_excursion = schro_signal_ranges[i].luma_excursion; format->chroma_offset = schro_signal_ranges[i].chroma_offset; format->chroma_excursion = schro_signal_ranges[i].chroma_excursion; } typedef struct _SchroColourSpecStruct SchroColourSpecStruct; struct _SchroColourSpecStruct { int colour_primaries; int colour_matrix; int transfer_function; }; static const SchroColourSpecStruct schro_colour_specs[] = { { /* Custom */ SCHRO_COLOUR_PRIMARY_HDTV, SCHRO_COLOUR_MATRIX_HDTV, SCHRO_TRANSFER_CHAR_TV_GAMMA }, { /* SDTV 525 */ SCHRO_COLOUR_PRIMARY_SDTV_525, SCHRO_COLOUR_MATRIX_SDTV, SCHRO_TRANSFER_CHAR_TV_GAMMA }, { /* SDTV 625 */ SCHRO_COLOUR_PRIMARY_SDTV_625, SCHRO_COLOUR_MATRIX_SDTV, SCHRO_TRANSFER_CHAR_TV_GAMMA }, { /* HDTV */ SCHRO_COLOUR_PRIMARY_HDTV, SCHRO_COLOUR_MATRIX_HDTV, SCHRO_TRANSFER_CHAR_TV_GAMMA }, { /* Cinema */ SCHRO_COLOUR_PRIMARY_CINEMA, SCHRO_COLOUR_MATRIX_HDTV, SCHRO_TRANSFER_CHAR_TV_GAMMA } }; void schro_video_format_set_std_colour_spec (DiracSequenceHeader *format, int i) { if (i < 0 || i >= ARRAY_SIZE(schro_colour_specs)) { return; } format->colour_primaries = schro_colour_specs[i].colour_primaries; format->colour_matrix = schro_colour_specs[i].colour_matrix; format->transfer_function = schro_colour_specs[i].transfer_function; } /* unpack */ static void schro_unpack_init_with_data (Unpack *unpack, unsigned char *data, int n_bytes, unsigned int guard_bit) { memset (unpack, 0, sizeof(Unpack)); unpack->data = data; unpack->n_bits_left = 8*n_bytes; unpack->guard_bit = guard_bit; } static unsigned int schro_unpack_decode_bit (Unpack *unpack) { int bit; if (unpack->n_bits_left < 1) { return unpack->guard_bit; } bit = (unpack->data[unpack->index>>3]>>(7 - (unpack->index & 7))) & 1; unpack->index++; unpack->n_bits_left--; return bit; } static unsigned int schro_unpack_decode_uint (Unpack *unpack) { int count; int value; count = 0; value = 0; while(!schro_unpack_decode_bit (unpack)) { count++; value <<= 1; value |= schro_unpack_decode_bit (unpack); } return (1< #endif #include "dirac_parse.h" #include #include #include #include #define READ_SIZE 4096 unsigned char data[READ_SIZE]; int parse_packet (FILE *file, unsigned char **p_data, int *p_size); int main (int argc, char *argv[]) { FILE *file; int ret; DiracSequenceHeader header = {0}; int size; unsigned char *packet; int n; int i; if (argc < 2) { fprintf(stderr, "parse_header infile.drc\n"); return 1; } file = fopen (argv[1], "r"); if (file == NULL) { printf("cannot open %s for reading: %s\n", argv[1], strerror(errno)); return 1; } n = fread (data, 1, 4096, file); if (n < 13) { printf("file too short\n"); exit(1); } for(i=0;i<=n - 13;i++){ packet = data + i; if (packet[0] == 'B' && packet[1] == 'B' && packet[2] == 'C' && packet[3] == 'D') { size = (packet[5]<<24) | (packet[6]<<16) | (packet[7]<<8) | (packet[8]); if (size == 0) { size = 13; } if (i + size > n) { continue; } if (SCHRO_PARSE_CODE_IS_SEQ_HEADER(packet[4])) { ret = dirac_sequence_header_parse (&header, packet + 13, size - 13); if (!ret) { printf("bad header\n"); exit(1); } #define PRINT(ack) printf( #ack ": %d\n", header. ack ); PRINT(major_version); PRINT(minor_version); PRINT(profile); PRINT(level); PRINT(index); PRINT(width); PRINT(height); PRINT(chroma_format); PRINT(interlaced); PRINT(top_field_first); PRINT(frame_rate_numerator); PRINT(frame_rate_denominator); PRINT(aspect_ratio_numerator); PRINT(aspect_ratio_denominator); PRINT(clean_width); PRINT(clean_height); PRINT(left_offset); PRINT(top_offset); PRINT(luma_offset); PRINT(luma_excursion); PRINT(chroma_offset); PRINT(chroma_excursion); PRINT(colour_primaries); PRINT(colour_matrix); PRINT(transfer_function); PRINT(interlaced_coding); return 0; } } } return 0; } int parse_packet (FILE *file, unsigned char **p_data, int *p_size) { unsigned char *packet; unsigned char header[13]; int n; int size; n = fread (header, 1, 13, file); if (n == 0) { *p_data = NULL; *p_size = 0; return 1; } if (n < 13) { printf("truncated header\n"); return 0; } if (header[0] != 'B' || header[1] != 'B' || header[2] != 'C' || header[3] != 'D') { return 0; } size = (header[5]<<24) | (header[6]<<16) | (header[7]<<8) | (header[8]); if (size == 0) { size = 13; } if (size < 13) { return 0; } if (size > 16*1024*1024) { printf("packet too large? (%d > 16777216)\n", size); return 0; } packet = malloc (size); memcpy (packet, header, 13); n = fread (packet + 13, 1, size - 13, file); if (n < size - 13) { free (packet); return 0; } *p_data = packet; *p_size = size; return 1; } schroedinger-1.0.11/tools/drc-cut.c0000644000175000017500000001055111541755167014052 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include int parse_packet (FILE *file, unsigned char **p_data, int *p_size); int write_packet (FILE *outfile, unsigned char *packet, int size); const char *fn = "output.drc"; int main (int argc, char *argv[]) { unsigned char *packet; unsigned char *seq_header_packet = NULL; int seq_header_size = 0; SchroPictureNumber start_picture; SchroPictureNumber end_picture; SchroPictureNumber pic_num; int size; FILE *file; FILE *outfile; int ret; int in_segment = FALSE; if (argc < 5) { fprintf(stderr, "dirac_cut infile.drc outfile.drc start_picture end_picture\n"); return 1; } file = fopen (argv[1], "r"); if (file == NULL) { printf("cannot open %s for reading: %s\n", argv[1], strerror(errno)); return 1; } outfile = fopen (argv[2], "w"); if (outfile == NULL) { printf("cannot open %s for writing: %s\n", argv[2], strerror(errno)); return 1; } start_picture = strtoul (argv[3], NULL, 0); end_picture = strtoul (argv[4], NULL, 0); while (1) { ret = parse_packet (file, &packet, &size); if (!ret) { exit(1); } if (seq_header_packet == NULL && SCHRO_PARSE_CODE_IS_SEQ_HEADER(packet[4])) { seq_header_packet = packet; seq_header_size = size; continue; } if (SCHRO_PARSE_CODE_IS_PICTURE(packet[4])) { pic_num = (packet[13] << 24) | (packet[14]<<16) | (packet[15]<<8) | packet[16]; printf("got picture %d\n", pic_num); } else { pic_num = 0; } if (in_segment) { if (SCHRO_PARSE_CODE_IS_PICTURE(packet[4]) && pic_num >= end_picture) { #if 0 unsigned char eos_packet[13]; in_segment = FALSE; eos_packet[0] = 'B' eos_packet[1] = 'B' eos_packet[2] = 'C' eos_packet[3] = 'D' eos_packet[4] = SCHRO_PARSE_CODE_EOS; write_packet (outfile, eos_packet, 13); #endif exit(0); } } else { if (SCHRO_PARSE_CODE_IS_PICTURE(packet[4])) { if (pic_num >= start_picture) { printf("pushing seq header\n"); write_packet (outfile, seq_header_packet, seq_header_size); in_segment = TRUE; } } } if (in_segment) { if (SCHRO_PARSE_CODE_IS_PICTURE(packet[4])) { printf("pushing picture %d (was %d)\n", pic_num - start_picture, pic_num); pic_num -= start_picture; packet[13] = (pic_num>>24)&0xff; packet[14] = (pic_num>>16)&0xff; packet[15] = (pic_num>>8)&0xff; packet[16] = (pic_num>>0)&0xff; } else { printf("pushing non-picture\n"); } write_packet (outfile, packet, size); } free(packet); } return 0; } unsigned int last_offset; int write_packet (FILE *outfile, unsigned char *packet, int size) { int ret; if (packet[4] == SCHRO_PARSE_CODE_END_OF_SEQUENCE) { packet[5] = 0; packet[6] = 0; packet[7] = 0; packet[8] = 0; } else { packet[5] = (size>>24)&0xff; packet[6] = (size>>16)&0xff; packet[7] = (size>>8)&0xff; packet[8] = (size>>0)&0xff; } packet[9] = (last_offset>>24)&0xff; packet[10] = (last_offset>>16)&0xff; packet[11] = (last_offset>>8)&0xff; packet[12] = (last_offset>>0)&0xff; last_offset = size; ret = fwrite (packet, 1, size, outfile); if (ret != size) return FALSE; return TRUE; } int parse_packet (FILE *file, unsigned char **p_data, int *p_size) { unsigned char *packet; unsigned char header[13]; int n; int size; n = fread (header, 1, 13, file); if (n == 0) { *p_data = NULL; *p_size = 0; return 1; } if (n < 13) { printf("truncated header\n"); return 0; } if (header[0] != 'B' || header[1] != 'B' || header[2] != 'C' || header[3] != 'D') { return 0; } size = (header[5]<<24) | (header[6]<<16) | (header[7]<<8) | (header[8]); if (size == 0) { size = 13; } if (size < 13) { return 0; } if (size > 16*1024*1024) { printf("packet too large? (%d > 16777216)\n", size); return 0; } packet = malloc (size); memcpy (packet, header, 13); n = fread (packet + 13, 1, size - 13, file); if (n < size - 13) { free (packet); return 0; } *p_data = packet; *p_size = size; return 1; } schroedinger-1.0.11/tools/dirac_parse.h0000644000175000017500000001142511161526031014753 00000000000000 #ifndef __DIRAC_PARSE_H__ #define __DIRAC_PARSE_H__ #ifdef __cplusplus extern "C" { #endif #ifndef TRUE #define TRUE 1 #endif #ifndef FALSE #define FALSE 0 #endif typedef enum _SchroParseCode { SCHRO_PARSE_CODE_SEQUENCE_HEADER = 0x00, SCHRO_PARSE_CODE_END_OF_SEQUENCE = 0x10, SCHRO_PARSE_CODE_AUXILIARY_DATA = 0x20, SCHRO_PARSE_CODE_PADDING = 0x30, SCHRO_PARSE_CODE_INTRA_REF = 0x0c, SCHRO_PARSE_CODE_INTRA_NON_REF = 0x08, SCHRO_PARSE_CODE_INTRA_REF_NOARITH = 0x4c, SCHRO_PARSE_CODE_INTRA_NON_REF_NOARITH = 0x48, SCHRO_PARSE_CODE_INTER_REF_1 = 0x0d, SCHRO_PARSE_CODE_INTER_REF_1_NOARITH = 0x4d, SCHRO_PARSE_CODE_INTER_REF_2 = 0x0e, SCHRO_PARSE_CODE_INTER_REF_2_NOARITH = 0x4e, SCHRO_PARSE_CODE_INTER_NON_REF_1 = 0x09, SCHRO_PARSE_CODE_INTER_NON_REF_1_NOARITH = 0x49, SCHRO_PARSE_CODE_INTER_NON_REF_2 = 0x0a, SCHRO_PARSE_CODE_INTER_NON_REF_2_NOARITH = 0x4a, SCHRO_PARSE_CODE_LD_INTRA_REF = 0xcc, SCHRO_PARSE_CODE_LD_INTRA_NON_REF = 0xc8 } SchroParseCode; #define SCHRO_PARSE_CODE_PICTURE(is_ref,n_refs,is_lowdelay,is_noarith) \ (8 | ((is_ref)<<2) | (n_refs) | ((is_lowdelay)<<7) | ((is_noarith)<<6)) #define SCHRO_PARSE_CODE_IS_SEQ_HEADER(x) ((x) == SCHRO_PARSE_CODE_SEQUENCE_HEADER) #define SCHRO_PARSE_CODE_IS_END_OF_SEQUENCE(x) ((x) == SCHRO_PARSE_CODE_END_OF_SEQUENCE) #define SCHRO_PARSE_CODE_IS_AUXILIARY_DATA(x) ((x) == SCHRO_PARSE_CODE_AUXILIARY_DATA) #define SCHRO_PARSE_CODE_IS_PADDING(x) ((x) == SCHRO_PARSE_CODE_PADDING) #define SCHRO_PARSE_CODE_IS_PICTURE(x) ((x) & 0x8) #define SCHRO_PARSE_CODE_IS_LOW_DELAY(x) (((x) & 0x88) == 0x88) #define SCHRO_PARSE_CODE_IS_CORE_SYNTAX(x) (((x) & 0x88) == 0x08) #define SCHRO_PARSE_CODE_USING_AC(x) (((x) & 0x48) == 0x08) #define SCHRO_PARSE_CODE_IS_REFERENCE(x) (((x) & 0xc) == 0x0c) #define SCHRO_PARSE_CODE_IS_NON_REFERENCE(x) (((x) & 0xc) == 0x08) #define SCHRO_PARSE_CODE_NUM_REFS(x) ((x) & 0x3) #define SCHRO_PARSE_CODE_IS_INTRA(x) (SCHRO_PARSE_CODE_IS_PICTURE(x) && SCHRO_PARSE_CODE_NUM_REFS(x) == 0) #define SCHRO_PARSE_CODE_IS_INTER(x) (SCHRO_PARSE_CODE_IS_PICTURE(x) && SCHRO_PARSE_CODE_NUM_REFS(x) > 0) #define SCHRO_PARSE_HEADER_SIZE (4+1+4+4) typedef enum _SchroVideoFormatEnum { SCHRO_VIDEO_FORMAT_CUSTOM = 0, SCHRO_VIDEO_FORMAT_QSIF, SCHRO_VIDEO_FORMAT_QCIF, SCHRO_VIDEO_FORMAT_SIF, SCHRO_VIDEO_FORMAT_CIF, SCHRO_VIDEO_FORMAT_4SIF, SCHRO_VIDEO_FORMAT_4CIF, SCHRO_VIDEO_FORMAT_SD480I_60, SCHRO_VIDEO_FORMAT_SD576I_50, SCHRO_VIDEO_FORMAT_HD720P_60, SCHRO_VIDEO_FORMAT_HD720P_50, SCHRO_VIDEO_FORMAT_HD1080I_60, SCHRO_VIDEO_FORMAT_HD1080I_50, SCHRO_VIDEO_FORMAT_HD1080P_60, SCHRO_VIDEO_FORMAT_HD1080P_50, SCHRO_VIDEO_FORMAT_DC2K_24, SCHRO_VIDEO_FORMAT_DC4K_24 } SchroVideoFormatEnum; typedef enum _SchroChromaFormat { SCHRO_CHROMA_444 = 0, SCHRO_CHROMA_422, SCHRO_CHROMA_420 } SchroChromaFormat; #define SCHRO_CHROMA_FORMAT_H_SHIFT(format) (((format) == SCHRO_CHROMA_444)?0:1) #define SCHRO_CHROMA_FORMAT_V_SHIFT(format) (((format) == SCHRO_CHROMA_420)?1:0) typedef enum _SchroSignalRange { SCHRO_SIGNAL_RANGE_CUSTOM = 0, SCHRO_SIGNAL_RANGE_8BIT_FULL = 1, SCHRO_SIGNAL_RANGE_8BIT_VIDEO = 2, SCHRO_SIGNAL_RANGE_10BIT_VIDEO = 3, SCHRO_SIGNAL_RANGE_12BIT_VIDEO = 4 } SchroSignalRange; typedef enum _SchroColourSpec { SCHRO_COLOUR_SPEC_CUSTOM = 0, SCHRO_COLOUR_SPEC_SDTV_525 = 1, SCHRO_COLOUR_SPEC_SDTV_625 = 2, SCHRO_COLOUR_SPEC_HDTV = 3, SCHRO_COLOUR_SPEC_CINEMA = 4 } SchroColourSpec; typedef enum _SchroColourPrimaries { SCHRO_COLOUR_PRIMARY_HDTV = 0, SCHRO_COLOUR_PRIMARY_SDTV_525 = 1, SCHRO_COLOUR_PRIMARY_SDTV_625 = 2, SCHRO_COLOUR_PRIMARY_CINEMA = 3 } SchroColourPrimaries; typedef enum _SchroColourMatrix { SCHRO_COLOUR_MATRIX_HDTV = 0, SCHRO_COLOUR_MATRIX_SDTV = 1, SCHRO_COLOUR_MATRIX_REVERSIBLE = 2 }SchroColourMatrix; typedef enum _SchroTransferFunction { SCHRO_TRANSFER_CHAR_TV_GAMMA = 0, SCHRO_TRANSFER_CHAR_EXTENDED_GAMUT = 1, SCHRO_TRANSFER_CHAR_LINEAR = 2, SCHRO_TRANSFER_CHAR_DCI_GAMMA = 3 } SchroTransferFunction; typedef struct _DiracSequenceHeader DiracSequenceHeader; struct _DiracSequenceHeader { int major_version; int minor_version; int profile; int level; int index; int width; int height; int chroma_format; int interlaced; int top_field_first; int frame_rate_numerator; int frame_rate_denominator; int aspect_ratio_numerator; int aspect_ratio_denominator; int clean_width; int clean_height; int left_offset; int top_offset; int luma_offset; int luma_excursion; int chroma_offset; int chroma_excursion; int colour_primaries; int colour_matrix; int transfer_function; int interlaced_coding; int unused0; int unused1; int unused2; }; int dirac_sequence_header_parse (DiracSequenceHeader *header, unsigned char *data, int length); #ifdef __cplusplus } #endif #endif schroedinger-1.0.11/tools/dump_packets.c0000644000175000017500000004352311541755167015175 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #if 0 /* Used for checking bitstream bugs */ #define MARKER() \ do { \ g_print(" marker: %d\n", schro_unpack_decode_uint(&unpack)); \ }while(0) #else #define MARKER() #endif static void handle_packet(unsigned char *data, int size); const char *fn = "output.drc"; int main (int argc, char *argv[]) { FILE *file; if (argc > 1) { fn = argv[1]; } file = fopen (fn, "r"); if (file == NULL) { printf("cannot open %s\n", fn); return 1; } while (1) { unsigned char *packet; unsigned char header[13]; int n; int size; n = fread (header, 1, 13, file); if (n == 0) { return 0; } if (n < 13) { printf("truncated header\n"); return 1; } if (header[0] != 'B' || header[1] != 'B' || header[2] != 'C' || header[3] != 'D') { printf("expected BBCD header\n"); return 1; } size = (header[5]<<24) | (header[6]<<16) | (header[7]<<8) | (header[8]); if (size == 0) { size = 13; } if (size < 13) { printf("packet too small (%d < 13)\n", size); return 1; } if (size > 16*1024*1024) { printf("packet too large? (%d > 16777216)\n", size); return 1; } packet = malloc (size); memcpy (packet, header, 13); n = fread (packet + 13, 1, size - 13, file); if (n < size - 13) { printf("truncated packet (%d < %d)\n", n, size-13); exit(1); } handle_packet (packet, size); free(packet); } return 0; } static void dump_hex (const unsigned char *data, int length, const char *prefix) { int i; for(i=0;i 0) { printf(" ref1_offset: %d\n", schro_unpack_decode_sint(&unpack)); } if (num_refs > 1) { printf(" ref2_offset: %d\n", schro_unpack_decode_sint(&unpack)); } if (SCHRO_PARSE_CODE_IS_REFERENCE(data[4])) { int r = schro_unpack_decode_sint(&unpack); if (r == 0) { printf(" retire: none\n"); } else { printf(" retire: %d\n", r); } } if (num_refs > 0) { int index; schro_unpack_byte_sync(&unpack); index = schro_unpack_decode_uint(&unpack); printf(" block parameters index: %d\n", index); if (index == 0) { printf(" luma block width: %d\n", schro_unpack_decode_uint(&unpack)); printf(" luma block height: %d\n", schro_unpack_decode_uint(&unpack)); printf(" horiz luma block sep: %d\n", schro_unpack_decode_uint(&unpack)); printf(" vert luma block sep: %d\n", schro_unpack_decode_uint(&unpack)); } MARKER(); printf(" motion vector precision bits: %d\n", schro_unpack_decode_uint(&unpack)); MARKER(); bit = schro_unpack_decode_bit(&unpack); printf(" using global motion flag: %s\n", bit ? "yes" : "no"); if (bit) { for(i=0;i1) { n = schro_unpack_decode_uint(&unpack); printf(" vector data (ref2,x) length: %d\n", n); schro_unpack_byte_sync (&unpack); schro_unpack_skip_bits (&unpack, n*8); n = schro_unpack_decode_uint(&unpack); printf(" vector data (ref2,y) length: %d\n", n); schro_unpack_byte_sync (&unpack); schro_unpack_skip_bits (&unpack, n*8); } n = schro_unpack_decode_uint(&unpack); printf(" DC data (y) length: %d\n", n); schro_unpack_byte_sync (&unpack); schro_unpack_skip_bits (&unpack, n*8); n = schro_unpack_decode_uint(&unpack); printf(" DC data (u) length: %d\n", n); schro_unpack_byte_sync (&unpack); schro_unpack_skip_bits (&unpack, n*8); n = schro_unpack_decode_uint(&unpack); printf(" DC data (v) length: %d\n", n); schro_unpack_byte_sync (&unpack); schro_unpack_skip_bits (&unpack, n*8); } schro_unpack_byte_sync (&unpack); if (num_refs == 0) { bit = 0; } else { bit = schro_unpack_decode_bit (&unpack); printf(" zero residual: %s\n", bit ? "yes" : "no"); } if (!bit) { int depth; int j; printf(" wavelet index: %d\n", schro_unpack_decode_uint(&unpack)); depth = schro_unpack_decode_uint(&unpack); printf(" transform depth: %d\n", depth); if (!lowdelay) { bit = schro_unpack_decode_bit (&unpack); printf(" spatial partition flag: %s\n", bit ? "yes" : "no"); if (bit) { for(i=0;i 0) { printf(" %4d %4d: %6d %3d\n", j, i, length, schro_unpack_decode_uint(&unpack)); schro_unpack_byte_sync(&unpack); schro_unpack_skip_bits (&unpack, length*8); } else { printf(" %4d %4d: %6d\n", j, i, length); schro_unpack_byte_sync(&unpack); } } } } else { int slice_x; int slice_y; int slice_bytes_numerator; int slice_bytes_denominator; slice_x = schro_unpack_decode_uint(&unpack); slice_y = schro_unpack_decode_uint(&unpack); slice_bytes_numerator = schro_unpack_decode_uint(&unpack); slice_bytes_denominator = schro_unpack_decode_uint(&unpack); printf(" n_horiz_slices: %d\n", slice_x); printf(" n_horiz_slices: %d\n", slice_y); printf(" slice_bytes_numerator: %d\n", slice_bytes_numerator); printf(" slice_bytes_denominator: %d\n", slice_bytes_denominator); bit = schro_unpack_decode_bit (&unpack); printf(" encode_quant_matrix: %s\n", bit ? "yes" : "no"); if (bit) { for(i=0;i<1+depth*3;i++){ printf(" %2d: %d\n", i, schro_unpack_decode_uint(&unpack)); } } schro_unpack_byte_sync (&unpack); } } } else if (data[4] == SCHRO_PARSE_CODE_AUXILIARY_DATA) { int length = next - 14; int code = data[13]; switch (code) { case 0: printf(" code: 0 (invalid)\n"); break; case 1: printf(" code: 1 (encoder implementation/version)\n"); printf(" string: %.*s\n", length, data + 14); break; case 2: printf(" code: 2 (SMPTE 12M timecode)\n"); break; case 3: { int i; printf(" code: 3 (MD5 checksum)\n"); printf(" checksum: "); for(i=0;i<16;i++){ printf("%02x", data[14+i]); } printf("\n"); } break; case 4: { int bitrate; printf(" code: %d (bitrate)\n", code); bitrate = (data[14]<<24); bitrate |= (data[15]<<16); bitrate |= (data[16]<<8); bitrate |= (data[17]<<0); printf(" bitrate: %d\n", bitrate); } break; default: printf(" code: %d (unknown)\n", code); dump_hex (data + 14, length, " "); break; } schro_unpack_skip_bits (&unpack, (1 + length)*8); } else if (data[4] == SCHRO_PARSE_CODE_PADDING) { int length = next - 13; schro_unpack_skip_bits (&unpack, length*8); } schro_unpack_byte_sync (&unpack); printf("offset %d\n", schro_unpack_get_bits_read (&unpack)/8); dump_hex (unpack.data, MIN(data + size - unpack.data, 100), " "); } schroedinger-1.0.11/tools/dump_gop.c0000644000175000017500000001262711702130171014306 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #if 0 /* Used for checking bitstream bugs */ #define MARKER() \ do { \ printf(" marker: %d\n", schro_unpack_decode_uint(&unpack)); \ }while(0) #else #define MARKER() #endif static void handle_packet(unsigned char *data, int size); const char *fn = "output.drc"; int main (int argc, char *argv[]) { FILE *file; if (argc > 1) { fn = argv[1]; } file = fopen (fn, "r"); if (file == NULL) { printf("cannot open %s\n", fn); return 1; } while (1) { unsigned char *packet; unsigned char header[13]; int n; int size; n = fread (header, 1, 13, file); if (n == 0) { return 0; } if (n < 13) { printf("truncated header\n"); return 1; } if (header[0] != 'B' || header[1] != 'B' || header[2] != 'C' || header[3] != 'D') { printf("expected BBCD header\n"); return 1; } size = (header[5]<<24) | (header[6]<<16) | (header[7]<<8) | (header[8]); if (size == 0) { size = 13; } if (size < 13) { printf("packet too small (%d < 13)\n", size); return 1; } if (size > 16*1024*1024) { printf("packet too large? (%d > 16777216)\n", size); return 1; } packet = malloc (size); memcpy (packet, header, 13); n = fread (packet + 13, 1, size - 13, file); if (n < size - 13) { printf("truncated packet (%d < %d)\n", n, size-13); exit(1); } handle_packet (packet, size); free(packet); } return 0; } static void dump_hex (const unsigned char *data, int length, const char *prefix) { int i; for(i=0;i 0) { printf("%6d ", pic_num + schro_unpack_decode_sint(&unpack)); } else { printf(" "); } if (num_refs > 1) { printf("%6d ", pic_num + schro_unpack_decode_sint(&unpack)); } else { printf(" "); } if (SCHRO_PARSE_CODE_IS_REFERENCE(data[4])) { int r = schro_unpack_decode_sint(&unpack); if (r == 0) { printf(" none "); } else { printf("%6d ", pic_num + r); } } else { printf(" "); } printf(" %8d\n", next); } else if (data[4] == SCHRO_PARSE_CODE_AUXILIARY_DATA) { } schro_unpack_byte_sync (&unpack); } schroedinger-1.0.11/tools/Makefile.am0000644000175000017500000000042711541755167014402 00000000000000 EXTRA_DIST = drc-to-png noinst_PROGRAMS = dump_packets dump_gop drc-cut parse_header AM_CFLAGS = $(SCHRO_CFLAGS) $(ERROR_CFLAGS) \ $(ORC_CFLAGS) \ -DSCHRO_ENABLE_UNSTABLE_API LDADD = $(SCHRO_LIBS) parse_header_SOURCES = \ dirac_parse.c \ dirac_parse.h \ parse_header.c schroedinger-1.0.11/tools/Makefile.in0000664000175000017500000004134011707140262014400 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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@ noinst_PROGRAMS = dump_packets$(EXEEXT) dump_gop$(EXEEXT) \ drc-cut$(EXEEXT) parse_header$(EXEEXT) subdir = tools DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-auto-alt.m4 \ $(top_srcdir)/m4/as-compiler-flag.m4 \ $(top_srcdir)/m4/as-host-defines.m4 \ $(top_srcdir)/m4/as-version.m4 $(top_srcdir)/m4/gst-args.m4 \ $(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)/m4/pkg.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) drc_cut_SOURCES = drc-cut.c drc_cut_OBJECTS = drc-cut.$(OBJEXT) drc_cut_LDADD = $(LDADD) am__DEPENDENCIES_1 = drc_cut_DEPENDENCIES = $(am__DEPENDENCIES_1) dump_gop_SOURCES = dump_gop.c dump_gop_OBJECTS = dump_gop.$(OBJEXT) dump_gop_LDADD = $(LDADD) dump_gop_DEPENDENCIES = $(am__DEPENDENCIES_1) dump_packets_SOURCES = dump_packets.c dump_packets_OBJECTS = dump_packets.$(OBJEXT) dump_packets_LDADD = $(LDADD) dump_packets_DEPENDENCIES = $(am__DEPENDENCIES_1) am_parse_header_OBJECTS = dirac_parse.$(OBJEXT) parse_header.$(OBJEXT) parse_header_OBJECTS = $(am_parse_header_OBJECTS) parse_header_LDADD = $(LDADD) parse_header_DEPENDENCIES = $(am__DEPENDENCIES_1) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = drc-cut.c dump_gop.c dump_packets.c $(parse_header_SOURCES) DIST_SOURCES = drc-cut.c dump_gop.c dump_packets.c \ $(parse_header_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUDA_CFLAGS = @CUDA_CFLAGS@ CUDA_LIBS = @CUDA_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ GCOV = @GCOV@ GCOV_CFLAGS = @GCOV_CFLAGS@ GCOV_LIBS = @GCOV_LIBS@ GREP = @GREP@ GTHREAD_CFLAGS = @GTHREAD_CFLAGS@ GTHREAD_LIBS = @GTHREAD_LIBS@ GTKDOC_CHECK = @GTKDOC_CHECK@ 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@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ NVCC = @NVCC@ NVCCFLAGS = @NVCCFLAGS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENGL_CFLAGS = @OPENGL_CFLAGS@ OPENGL_LIBS = @OPENGL_LIBS@ ORCC = @ORCC@ ORC_CFLAGS = @ORC_CFLAGS@ ORC_LIBS = @ORC_LIBS@ 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@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SCHRO_CFLAGS = @SCHRO_CFLAGS@ SCHRO_LIBS = @SCHRO_LIBS@ SCHRO_LIBVERSION = @SCHRO_LIBVERSION@ SCHRO_MAJORMINOR = @SCHRO_MAJORMINOR@ SCHRO_PKG_DEPS = @SCHRO_PKG_DEPS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ THREAD_IMPL = @THREAD_IMPL@ VERSION = @VERSION@ 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_CXX = @ac_ct_CXX@ 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@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = drc-to-png AM_CFLAGS = $(SCHRO_CFLAGS) $(ERROR_CFLAGS) \ $(ORC_CFLAGS) \ -DSCHRO_ENABLE_UNSTABLE_API LDADD = $(SCHRO_LIBS) parse_header_SOURCES = \ dirac_parse.c \ dirac_parse.h \ parse_header.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(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) --foreign tools/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign tools/Makefile .PRECIOUS: 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-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list drc-cut$(EXEEXT): $(drc_cut_OBJECTS) $(drc_cut_DEPENDENCIES) @rm -f drc-cut$(EXEEXT) $(LINK) $(drc_cut_OBJECTS) $(drc_cut_LDADD) $(LIBS) dump_gop$(EXEEXT): $(dump_gop_OBJECTS) $(dump_gop_DEPENDENCIES) @rm -f dump_gop$(EXEEXT) $(LINK) $(dump_gop_OBJECTS) $(dump_gop_LDADD) $(LIBS) dump_packets$(EXEEXT): $(dump_packets_OBJECTS) $(dump_packets_DEPENDENCIES) @rm -f dump_packets$(EXEEXT) $(LINK) $(dump_packets_OBJECTS) $(dump_packets_LDADD) $(LIBS) parse_header$(EXEEXT): $(parse_header_OBJECTS) $(parse_header_DEPENDENCIES) @rm -f parse_header$(EXEEXT) $(LINK) $(parse_header_OBJECTS) $(parse_header_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dirac_parse.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drc-cut.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dump_gop.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dump_packets.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_header.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 $(PROGRAMS) 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-noinstPROGRAMS \ 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 all all-am check check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS ctags 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 uninstall uninstall-am # 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: schroedinger-1.0.11/COPYING.LGPL0000644000175000017500000006026610735025462012775 00000000000000 GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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., 675 Mass Ave, Cambridge, MA 02139, USA. schroedinger-1.0.11/install-sh0000755000175000017500000003253711707122104013200 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2009-04-28.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then trap '(exit $?); exit' 1 2 13 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names starting with `-'. case $src in -*) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # Protect names starting with `-'. case $dst in -*) dst=./$dst;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/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-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; -*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test -z "$d" && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: schroedinger-1.0.11/m4/0000775000175000017500000000000011707140272011572 500000000000000schroedinger-1.0.11/m4/gtk-doc.m40000644000175000017500000000245411161525516013311 00000000000000dnl -*- mode: autoconf -*- # serial 1 dnl Usage: dnl GTK_DOC_CHECK([minimum-gtk-doc-version]) AC_DEFUN([GTK_DOC_CHECK], [ AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first 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 gtk-doc]))]) fi AC_MSG_CHECKING([whether to build gtk-doc documentation]) AC_MSG_RESULT($enable_gtk_doc) AC_PATH_PROGS(GTKDOC_CHECK,gtkdoc-check,) AM_CONDITIONAL([ENABLE_GTK_DOC], [test x$enable_gtk_doc = xyes]) AM_CONDITIONAL([GTK_DOC_USE_LIBTOOL], [test -n "$LIBTOOL"]) ]) schroedinger-1.0.11/m4/as-compiler-flag.m40000644000175000017500000000225711161526031015075 00000000000000dnl as-compiler-flag.m4 0.1.0 dnl autostars m4 macro for detection of compiler flags dnl David Schleef dnl $Id: as-compiler-flag.m4,v 1.1 2005/12/15 23:35:19 ds Exp $ 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_COMPILER_FLAGS(VAR, FLAGS) dnl Tries to compile with the given CFLAGS. AC_DEFUN([AS_COMPILER_FLAGS], [ list=$2 for each in $list do AC_MSG_CHECKING([to see if compiler understands $each]) save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $each" AC_TRY_COMPILE([ ], [], [flag_ok=yes], [flag_ok=no]) CFLAGS="$save_CFLAGS" if test "X$flag_ok" = Xyes ; then $1="$$1 $each" fi AC_MSG_RESULT([$flag_ok]) done ]) schroedinger-1.0.11/m4/as-host-defines.m40000644000175000017500000000170610735025462014752 00000000000000dnl as-host-defines.m4 0.1.0 dnl autostars m4 macro for generating defines for various host architectures dnl David Schleef dnl $Id: as-host-defines.m4,v 1.3 2007/08/22 20:55:24 uid2631 Exp $ dnl AS_HOST_DEFINES() AC_DEFUN([AS_HOST_DEFINES], [ case "x${host_cpu}" in xi?86 | k?) HAVE_I386=yes AC_DEFINE(HAVE_I386, 1, [Defined if host is i386]) ;; xx86_64|xamd64) HAVE_AMD64=yes AC_DEFINE(HAVE_AMD64, 1, [Defined if host is amd64]) ;; xpowerpc|xppc|xpowerpc64|xppc64) HAVE_POWERPC=yes AC_DEFINE(HAVE_POWERPC, 1, [Defined if host is powerpc]) ;; xarm) HAVE_ARM=yes AC_DEFINE(HAVE_ARM, 1, [Defined if host is arm]) ;; esac AM_CONDITIONAL(HAVE_I386, test "x$HAVE_I386" = "xyes") AM_CONDITIONAL(HAVE_AMD64, test "x$HAVE_AMD64" = "xyes") AM_CONDITIONAL(HAVE_POWERPC, test "x$HAVE_POWERPC" = "xyes") AM_CONDITIONAL(HAVE_ARM, test "x$HAVE_ARM" = "xyes") ]) schroedinger-1.0.11/m4/libtool.m40000644000175000017500000104622011707122077013426 00000000000000# 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 Free Software Foundation, # Inc. # Written by Gordon Matzigkeit, 1996 # # 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. m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010 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. # # 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. ]) # serial 57 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. 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-%%"` ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl 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 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 _LT_CC_BASENAME([$compiler]) # 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 _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# 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' ]) # _LT_PROG_LTMAIN # --------------- # 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, # 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" ])# _LT_PROG_LTMAIN ## ------------------------------------- ## ## Accumulate code for creating libtool. ## ## ------------------------------------- ## # 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' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) ## ------------------------ ## ## FIXME: Eliminate VARNAME ## ## ------------------------ ## # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _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 # 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"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # 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 ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # 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], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # 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 # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], 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=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # 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 # 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). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test $lt_write_fail = 0 && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ \`$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2010 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test $[#] != 0 do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try \`$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try \`$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # 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 && 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 exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _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 # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi 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 # 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. # _LT_COPYING _LT_LIBTOOL_TAGS # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _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 COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? 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" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) 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 # 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 # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _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' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; 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' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES # -------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _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\"`' 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" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; 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}" 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}" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. # Store the results from the different compilers for each TAGNAME. # 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 aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _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" fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # 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). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # 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*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- 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).], [], [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 #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) 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.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [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 # 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. 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" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. 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 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; sparc*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} : ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [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 # 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 lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$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" # 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 # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test x"[$]$2" = xyes; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no 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 # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # 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` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone 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` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$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 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"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF 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 x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) 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_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # 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_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [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"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; 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 _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # 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 # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl 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 # 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 $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a 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]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [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]) objdir=$lt_cv_objdir _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.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _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 # We can hardcode non-existent directories. if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && # 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 # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported 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 # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test "$GCC" = yes; then case $host_os in 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" ;; 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 *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # 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` 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 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; 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; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # 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'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux 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' ;; aix[[4-9]]*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 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 # 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 : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not 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 # 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 # 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 shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in 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}' ;; 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' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux 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' 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" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # 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'\''`~ 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' shlibpath_overrides_runpath=yes 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}' 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}' ;; 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}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` 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" 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'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; 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'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" 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' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux 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' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[123]]*) objformat=aout ;; *) objformat=elf ;; esac fi 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}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux 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' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; haiku*) version_type=linux 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' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes 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 sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes 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' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' 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' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux 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' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; 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}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; 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}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux 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' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # 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 # Append ld.so.conf contents 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" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux 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' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos 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' 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' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux 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 ;; *nto* | *qnx*) 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' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos 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 else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; 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}' 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" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux 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' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos 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 need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux 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) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux 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 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' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; 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' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux need_lib_prefix=no need_version=no 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 ;; uts4*) version_type=linux 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 ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; 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" 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" fi _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [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_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program which 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_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" test -z "$ac_dir" && ac_dir=. 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" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program which 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 if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl 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], [with_gnu_ld=no])dnl ac_prog=ld if test "$GCC" = yes; 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 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` 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" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; 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 for ac_dir in $PATH; do 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" # 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 &1 /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 # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) 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 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)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl 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" else 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 for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do 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 # Check to see if the nm accepts a BSD-compat flag. # 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'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi]) if test "$lt_cv_path_NM" != "no"; 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 *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' 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 case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # 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'" # 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'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # 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. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 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))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then 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 relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS 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 pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [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_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_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; 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 # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; 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'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | 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). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; 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' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | 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']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) 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_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # 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' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _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* | pgcpp*) # Portland Group 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)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; 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 # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; 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'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; 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). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; 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' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Xcompiler -fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; 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']) ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; 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' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # 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' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; 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' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ F* | *Sun*Fortran*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] 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". 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' 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' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # 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'. _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 # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # 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 with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # 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 case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty 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' # 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' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 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 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) 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_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _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' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _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(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _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' 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(link_all_deplibs, $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' # 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' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; 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 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' 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' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--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(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(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' if test "x$supports_anon_versioning" = xyes; 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' fi case $cc_basename in 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)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; 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' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _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' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _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' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _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 *** 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 *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # 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' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) 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' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # 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 # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test "$host_cpu" = ia64; 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="" 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". 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' 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' 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. 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 aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _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,' if test "$GCC" = yes; 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` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi _LT_TAGVAR(link_all_deplibs, $1)=no else # not using gcc if test "$host_cpu" = ia64; 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' else shared_flag='${wl}-bM:SRE' fi fi fi _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 # 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" else if test "$host_cpu" = ia64; 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" 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" # 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 # 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' 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' fi fi ;; amigaos*) 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_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. 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=' # 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 _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # 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' ;; *) # Assume MSVC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. 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. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; freebsd1*) _LT_TAGVAR(ld_shlibs, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; 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' 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' fi _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' ;; 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' 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' _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $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' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _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}+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' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (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)='$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']) ;; esac fi if test "$with_gnu_ld" = no; 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(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _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 ;; esac fi ;; 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' # 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" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo 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' fi 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' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _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 ;; 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 else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; 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_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd*) 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 _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' 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 fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _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' ;; 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' 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' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _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' 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_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' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; 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' _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' 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_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' ;; *) 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' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in 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 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' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; 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' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _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' 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' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT 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(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_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _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' 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' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _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 _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1], [[If ld is used when linking, flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]]) _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 DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [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 library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # 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'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report which 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 # 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 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 fi ;; esac AC_MSG_RESULT([$enable_shared]) 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 AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # 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'. 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 AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # 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 # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) 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 _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 # 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' _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}' # 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' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # 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 GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test "$host_cpu" = ia64; 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="" 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. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _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,' if test "$GXX" = yes; 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` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; 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' else shared_flag='${wl}-bM:SRE' fi fi fi _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 # 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" else if test "$host_cpu" = ia64; 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" 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" # 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 # 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' 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' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _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' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. 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=' # 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' ;; *) # 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(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' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd[[12]]*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; gnu*) ;; haiku*) _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_separator, $1)=: _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 # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _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' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # 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"' ;; *) 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' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; 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' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; 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' ;; 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}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # 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"' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; 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' ;; 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}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; 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' # 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' ;; 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' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _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' 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' 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_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # 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' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # 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"' _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. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # 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' ;; *) # 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' ;; 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' ;; 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`"' _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' _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' _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' ;; *) # 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' ;; 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' ;; 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' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # 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' ;; 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(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' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *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(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(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd2*) # C++ shared libraries are fairly broken _LT_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) 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' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # 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(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; 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)=' -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_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' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # 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"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; 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 $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_separator, $1)=: # 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 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # 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_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' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # 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' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; 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' # 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 $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_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' # 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 # 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_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' # 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 -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' 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' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _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 -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 # 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(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_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _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(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_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' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(GCC, $1)="$GXX" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD 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 AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf 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). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) 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}\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do 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 prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi 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 -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}" else _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 # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)="${prev}${p}" else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _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" else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _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 ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; 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!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # 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'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test "X$F77" = "Xno"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # 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 # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then 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 # 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 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 fi ;; esac AC_MSG_RESULT([$enable_shared]) 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 AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$G77" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" CFLAGS="$lt_save_CFLAGS" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # 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'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test "X$FC" = "Xno"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # 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 # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then 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 # 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 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 fi ;; esac AC_MSG_RESULT([$enable_shared]) 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 AC_MSG_RESULT([$enable_static]) _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 ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test "$_lt_disable_FC" != yes AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # 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'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # 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'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests 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" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [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" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # 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 cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $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 lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # 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 lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _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 # 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], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS schroedinger-1.0.11/m4/ltversion.m40000644000175000017500000000125611707122077014006 00000000000000# ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004 Free Software Foundation, Inc. # Written by Scott James Remnant, 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. # @configure_input@ # serial 3293 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4]) m4_define([LT_PACKAGE_REVISION], [1.3293]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4' macro_revision='1.3293' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) schroedinger-1.0.11/m4/ltoptions.m40000644000175000017500000002725611707122077014024 00000000000000# Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004, 2005, 2007, 2008, 2009 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 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [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 ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) 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 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_SET_OPTIONS ## --------------------------------- ## ## Macros to handle LT_INIT options. ## ## --------------------------------- ## # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_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.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _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.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _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'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [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], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _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'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [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], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _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'. 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], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [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], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_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.]) ]) 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.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_PIC([MODE]) # -------------------- # 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'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [pic_mode="$withval"], [pic_mode=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_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.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) ## ----------------- ## ## LTDL_INIT Options ## ## ----------------- ## m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) schroedinger-1.0.11/m4/ltsugar.m40000644000175000017500000001042411707122077013437 00000000000000# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2008 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 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # 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])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # 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 # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) schroedinger-1.0.11/m4/pkg.m40000644000175000017500000001214511161526031012531 00000000000000# 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 schroedinger-1.0.11/m4/as-version.m40000644000175000017500000000377111320237456014052 00000000000000dnl 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-NO-NANO, [ACTION-IF-NANO]) 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-NO-NANO or ACTION-IF-NANO 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` ifelse([$2], , :, [$2]) fi PACKAGE_VERSION_NANO=$NANO AC_SUBST(PACKAGE_VERSION_NANO) AC_SUBST(PACKAGE_VERSION_RELEASE) ]) schroedinger-1.0.11/m4/as-auto-alt.m40000644000175000017500000000300410735025462014101 00000000000000dnl 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]) ]) ]) schroedinger-1.0.11/m4/lt~obsolete.m40000644000175000017500000001375611707122077014343 00000000000000# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. # Written by Scott James Remnant, 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 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # 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. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # 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. # # 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 # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) schroedinger-1.0.11/m4/gst-args.m40000644000175000017500000002354711541755167013527 00000000000000dnl 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 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" 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_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="-O0" AC_SUBST(CFLAGS) CXXFLAGS="-O0" AC_SUBST(CXXFLAGS) FFLAGS="-O0" AC_SUBST(FFLAGS) 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="" AC_SUBST(GST_PLUGINS_ALL) AC_SUBST(GST_PLUGINS_SELECTED) ]) 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]) if [[ -z "$WITH_PLUGINS" ]] || echo " [$WITH_PLUGINS] " | tr , ' ' | grep -i " [$1] " > /dev/null; then GST_PLUGINS_SELECTED="$GST_PLUGINS_SELECTED [$1]" fi if echo " [$WITHOUT_PLUGINS] " | 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]) ]) ]) schroedinger-1.0.11/config.guess0000755000175000017500000012673011707122104013513 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011 Free Software Foundation, Inc. timestamp='2011-05-11' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception 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. # Originally written by Per Bothner. Please send patches (context # diff format) to and include a ChangeLog # entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # 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)` 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 ;; *) 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) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; 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}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. 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" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") 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'` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build 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 (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} 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 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) 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_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) case ${UNAME_MACHINE} in pc98) echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-gnu else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-gnueabi else echo ${UNAME_MACHINE}-unknown-linux-gnueabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit ;; i*86:Linux:*:*) LIBC=gnu eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo or32-unknown-linux-gnu exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-tilera-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in i386) eval $set_cc_for_build if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then UNAME_PROCESSOR="x86_64" fi fi ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "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 UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: schroedinger-1.0.11/config.sub0000755000175000017500000010460611707122104013154 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011 Free Software Foundation, Inc. timestamp='2011-03-23' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception 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. # Please send patches to . Submit a context # diff and a properly formatted GNU ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # 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 # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 \ | ns16k | ns32k \ | open8 \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; m6811 | m68hc11 | m6812 | m68hc12 | picochip) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile-* | tilegx-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze) basic_machine=microblaze-xilinx ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; # This must be matched before tile*. tilegx*) basic_machine=tilegx-unknown os=-linux-gnu ;; tile*) basic_machine=tile-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: schroedinger-1.0.11/AUTHORS0000644000175000017500000000021210735617671012247 00000000000000David Schleef -- Schrodinger library W.J. van der Laan -- CUDA GPU kernels and acceleration changes schroedinger-1.0.11/COPYING.GPL0000644000175000017500000003536310735025462012661 00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. schroedinger-1.0.11/schroedinger/0000775000175000017500000000000011707140273013727 500000000000000schroedinger-1.0.11/schroedinger/schrogpumotion.c0000644000175000017500000001435511541755167017113 00000000000000#ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include "cudawavelet.h" #include "cudaframe.h" #include "cudaupsample.h" #include "cudamotion.h" #include struct _SchroGPUMotion { CudaMotion *cm; CudaMotionData md; struct _MotionVector *vectors; }; static inline int ilog2 (unsigned int x) { int i; if (x == 0) return -1; for (i = 0; x > 1; i++) { x >>= 1; } return i; } SchroGPUMotion * schro_gpumotion_new (SchroCUDAStream stream) { SchroGPUMotion *ret; ret = schro_malloc (sizeof (SchroGPUMotion)); ret->cm = cuda_motion_init (stream); ret->vectors = NULL; return ret; } void schro_gpumotion_free (SchroGPUMotion * rv) { cuda_motion_free (rv->cm); schro_free (rv); } void schro_gpumotion_init (SchroGPUMotion * self, SchroMotion * motion) { /* Create texture */ self->vectors = cuda_motion_reserve (self->cm, motion->params->x_num_blocks, motion->params->y_num_blocks); } #define md self->md #define vectors self->vectors void schro_gpumotion_copy (SchroGPUMotion * self, SchroMotion * motion) { int i; int numv; int precision; SCHRO_ASSERT (vectors); SCHRO_DEBUG ("schro_gpuframe_copy_with_motion"); md.obmc.blocksx = motion->params->x_num_blocks; md.obmc.blocksy = motion->params->y_num_blocks; //printf("%i %i %i\n", md.obmc.blocksx, md.obmc.blocksy, md.obmc.blocksx*md.obmc.blocksy); md.obmc.weight1 = motion->params->picture_weight_1; md.obmc.weight2 = motion->params->picture_weight_2; //printf("%i %i %i\n", md.obmc.weight1, md.obmc.weight2, motion->params->picture_weight_bits); md.obmc.x_len = motion->params->xblen_luma; md.obmc.y_len = motion->params->yblen_luma; md.obmc.x_sep = motion->params->xbsep_luma; md.obmc.y_sep = motion->params->ybsep_luma; md.obmc.weight_shift = motion->params->picture_weight_bits; // Overlapped size md.obmc.x_ramp = md.obmc.x_len - md.obmc.x_sep; md.obmc.y_ramp = md.obmc.y_len - md.obmc.y_sep; // Non-overlapped size md.obmc.x_mid = md.obmc.x_sep - md.obmc.x_ramp; md.obmc.y_mid = md.obmc.y_sep - md.obmc.y_ramp; //md.obmc.shift = ilog2(md.obmc.x_ramp) + ilog2(md.obmc.y_ramp) + motion->params->picture_weight_bits; // Convert to powers of two, for fast arithmetic md.obmc.x_sep_log2 = ilog2 (md.obmc.x_sep); md.obmc.y_sep_log2 = ilog2 (md.obmc.y_sep); md.obmc.x_ramp_log2 = ilog2 (md.obmc.x_ramp); md.obmc.y_ramp_log2 = ilog2 (md.obmc.y_ramp); md.obmc.x_mid_log2 = ilog2 (md.obmc.x_mid); md.obmc.y_mid_log2 = ilog2 (md.obmc.y_mid); // Transfer vectors numv = md.obmc.blocksx * md.obmc.blocksy; // // make sure we always have 3 bits of precision #ifndef TESTMODE precision = (3 - motion->params->mv_precision); #endif md.obmc.mv_precision = motion->params->mv_precision; for (i = 0; i < numv; ++i) { #ifndef TESTMODE if (motion->motion_vectors[i].pred_mode == 0) { SchroMotionVectorDC *mvdc = (SchroMotionVectorDC *) & motion->motion_vectors[i]; // DC vectors[i].x1 = MOTION_NONE; vectors[i].x2 = MOTION_NONE; // YUV color code is encoded in these vectors[i].y1 = ((mvdc->dc[0] + 128) & 0xFF) | (((mvdc->dc[1] + 128) & 0xFF) << 8); vectors[i].y2 = (mvdc->dc[2] + 128) & 0xFF; } else { // Reference 1 if (motion->motion_vectors[i].pred_mode & 1) { vectors[i].x1 = motion->motion_vectors[i].dx[0] << precision; vectors[i].y1 = motion->motion_vectors[i].dy[0] << precision; } else { vectors[i].x1 = MOTION_NONE; vectors[i].y1 = MOTION_NONE; } // Reference 2 if (motion->motion_vectors[i].pred_mode & 2) { vectors[i].x2 = motion->motion_vectors[i].dx[1] << precision; vectors[i].y2 = motion->motion_vectors[i].dy[1] << precision; } else { vectors[i].x2 = MOTION_NONE; vectors[i].y2 = MOTION_NONE; } } //md.flags[i] = (motion->motion_vectors[i].using_global << 2) | motion->motion_vectors[i].pred_mode; #else { vectors[i].x1 = 0; vectors[i].y1 = 0; vectors[i].x2 = MOTION_NONE; vectors[i].y2 = MOTION_NONE; } #endif } //printf("%i blocks (%ix%i)\n", numv, md.obmc.blocksx, md.obmc.blocksy); } void schro_gpumotion_render (SchroGPUMotion * self, SchroMotion * motion, SchroFrame * gdest) { CudaMotion *cm = self->cm; SchroUpsampledFrame *ref1 = (SchroUpsampledFrame *) motion->src1; SchroUpsampledFrame *ref2 = (SchroUpsampledFrame *) motion->src2; int fwidth; int fheight; int hshift; int vshift; cuda_motion_begin (cm, &md); fwidth = motion->params->video_format->width; fheight = motion->params->video_format->height; hshift = SCHRO_CHROMA_FORMAT_H_SHIFT (motion->params->video_format->chroma_format); vshift = SCHRO_CHROMA_FORMAT_V_SHIFT (motion->params->video_format->chroma_format); SCHRO_ASSERT (schro_async_get_exec_domain () == SCHRO_EXEC_DOMAIN_CUDA); SCHRO_ASSERT (gdest->domain->flags == SCHRO_MEMORY_DOMAIN_CUDA); if (ref2) { cuda_motion_copy (cm, &md, (int16_t *) gdest->components[0].data, gdest->components[0].stride, fwidth, fheight, 0, 0, 0, ref1->components[0], ref2->components[0]); cuda_motion_copy (cm, &md, (int16_t *) gdest->components[1].data, gdest->components[1].stride, fwidth >> hshift, fheight >> vshift, 1, hshift, vshift, ref1->components[1], ref2->components[1]); cuda_motion_copy (cm, &md, (int16_t *) gdest->components[2].data, gdest->components[2].stride, fwidth >> hshift, fheight >> vshift, 2, hshift, vshift, ref1->components[2], ref2->components[2]); } else { cuda_motion_copy (cm, &md, (int16_t *) gdest->components[0].data, gdest->components[0].stride, fwidth, fheight, 0, 0, 0, ref1->components[0], NULL); cuda_motion_copy (cm, &md, (int16_t *) gdest->components[1].data, gdest->components[1].stride, fwidth >> hshift, fheight >> vshift, 1, hshift, vshift, ref1->components[1], NULL); cuda_motion_copy (cm, &md, (int16_t *) gdest->components[2].data, gdest->components[2].stride, fwidth >> hshift, fheight >> vshift, 2, hshift, vshift, ref1->components[2], NULL); } } #undef md #undef vectors schroedinger-1.0.11/schroedinger/schrofft.c0000644000175000017500000000501511541755167015642 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include void schro_fft_generate_tables_f32 (float *costable, float *sintable, int shift) { int i; int n = 1 << shift; double x = 2 * M_PI / n; for (i = 0; i < n; i++) { costable[i] = cos (x * i); sintable[i] = sin (x * i); } } #define COMPLEX_MULT_R(a,b,c,d) ((a)*(c) - (b)*(d)) #define COMPLEX_MULT_I(a,b,c,d) ((a)*(d) + (b)*(c)) static void fft_stage (float *d1, float *d2, const float *s1, const float *s2, const float *costable, const float *sintable, int i, int shift) { int j; int k; float x, y; int skip; int half_n; int offset; half_n = 1 << i; skip = 1 << (shift - i - 1); for (j = 0; j < skip; j++) { for (k = 0; k < half_n; k++) { offset = 2 * k * skip; x = COMPLEX_MULT_R (s1[offset + skip + j], s2[offset + skip + j], costable[k * skip], sintable[k * skip]); y = COMPLEX_MULT_I (s1[offset + skip + j], s2[offset + skip + j], costable[k * skip], sintable[k * skip]); d1[k * skip + j] = s1[offset + j] + x; d2[k * skip + j] = s2[offset + j] + y; d1[k * skip + half_n * skip + j] = s1[offset + j] - x; d2[k * skip + half_n * skip + j] = s2[offset + j] - y; } } } void schro_fft_fwd_f32 (float *d_real, float *d_imag, const float *s_real, const float *s_imag, const float *costable, const float *sintable, int shift) { int i; int n = 1 << shift; float *tmp; float *tmp1_1, *tmp1_2, *tmp2_1, *tmp2_2; tmp = schro_malloc (4 * sizeof (float) * n); tmp1_1 = tmp; tmp1_2 = tmp + n; tmp2_1 = tmp + 2 * n; tmp2_2 = tmp + 3 * n; i = 0; fft_stage (tmp1_1, tmp1_2, s_real, s_imag, costable, sintable, i, shift); for (i = 1; i < shift - 2; i += 2) { fft_stage (tmp2_1, tmp2_2, tmp1_1, tmp1_2, costable, sintable, i, shift); fft_stage (tmp1_1, tmp1_2, tmp2_1, tmp2_2, costable, sintable, i + 1, shift); } if (i < shift - 1) { fft_stage (tmp2_1, tmp2_2, tmp1_1, tmp1_2, costable, sintable, i, shift); fft_stage (d_real, d_imag, tmp2_1, tmp2_2, costable, sintable, i + 1, shift); } else { fft_stage (d_real, d_imag, tmp1_1, tmp1_2, costable, sintable, i, shift); } schro_free (tmp); } void schro_fft_rev_f32 (float *d_real, float *d_imag, const float *s_real, const float *s_imag, const float *costable, const float *sintable, int shift) { schro_fft_fwd_f32 (d_imag, d_real, s_imag, s_real, costable, sintable, shift); } schroedinger-1.0.11/schroedinger/schroasync-none.c0000644000175000017500000000414711541755167017142 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include struct _SchroAsync { int n_idle; volatile int n_completed; SchroAsyncTask task; SchroAsyncScheduleFunc schedule; void *schedule_closure; SchroAsyncCompleteFunc complete; }; struct _SchroThread { SchroAsync *async; int busy; int index; }; struct _SchroMutex { int ignore; }; void schro_async_init (void) { } SchroAsync * schro_async_new (int n_threads, SchroAsyncScheduleFunc schedule, SchroAsyncCompleteFunc complete, void *closure) { SchroAsync *async; async = schro_malloc0 (sizeof (SchroAsync)); async->schedule = schedule; async->schedule_closure = closure; async->complete = complete; return async; } void schro_async_free (SchroAsync * async) { schro_free (async); } void schro_async_start (SchroAsync * async) { } void schro_async_stop (SchroAsync * async) { } void schro_async_run_stage_locked (SchroAsync * async, SchroAsyncStage * stage) { SCHRO_ASSERT (async->task.task_func == NULL); async->task.task_func = stage->task_func; async->task.priv = stage; } int schro_async_wait_locked (SchroAsync * async) { async->schedule (async->schedule_closure, SCHRO_EXEC_DOMAIN_CPU); if (async->task.task_func) { async->task.task_func (async->task.priv); async->task.task_func = NULL; async->complete (async->task.priv); } return TRUE; } void schro_async_lock (SchroAsync * async) { } void schro_async_unlock (SchroAsync * async) { } void schro_async_signal_scheduler (SchroAsync * async) { } void schro_async_add_exec_domain (SchroAsync * async, SchroExecDomain exec_domain) { } SchroExecDomain schro_async_get_exec_domain (void) { return 0; } SchroMutex * schro_mutex_new (void) { SchroMutex *mutex; mutex = schro_malloc (sizeof (SchroMutex)); return mutex; } void schro_mutex_lock (SchroMutex * mutex) { } void schro_mutex_unlock (SchroMutex * mutex) { } void schro_mutex_free (SchroMutex * mutex) { schro_free (mutex); } schroedinger-1.0.11/schroedinger/schrobitstream.h0000644000175000017500000001173111556115124017051 00000000000000 #ifndef _SCHRO_BITSTREAM_H_ #define _SCHRO_BITSTREAM_H_ #include SCHRO_BEGIN_DECLS #define SCHRO_N_WAVELETS 7 typedef enum _SchroParseCode { SCHRO_PARSE_CODE_SEQUENCE_HEADER = 0x00, SCHRO_PARSE_CODE_END_OF_SEQUENCE = 0x10, SCHRO_PARSE_CODE_AUXILIARY_DATA = 0x20, SCHRO_PARSE_CODE_PADDING = 0x30, SCHRO_PARSE_CODE_INTRA_REF = 0x0c, SCHRO_PARSE_CODE_INTRA_NON_REF = 0x08, SCHRO_PARSE_CODE_INTRA_REF_NOARITH = 0x4c, SCHRO_PARSE_CODE_INTRA_NON_REF_NOARITH = 0x48, SCHRO_PARSE_CODE_INTER_REF_1 = 0x0d, SCHRO_PARSE_CODE_INTER_REF_1_NOARITH = 0x4d, SCHRO_PARSE_CODE_INTER_REF_2 = 0x0e, SCHRO_PARSE_CODE_INTER_REF_2_NOARITH = 0x4e, SCHRO_PARSE_CODE_INTER_NON_REF_1 = 0x09, SCHRO_PARSE_CODE_INTER_NON_REF_1_NOARITH = 0x49, SCHRO_PARSE_CODE_INTER_NON_REF_2 = 0x0a, SCHRO_PARSE_CODE_INTER_NON_REF_2_NOARITH = 0x4a, SCHRO_PARSE_CODE_LD_INTRA_REF = 0xcc, SCHRO_PARSE_CODE_LD_INTRA_NON_REF = 0xc8 } SchroParseCode; #define SCHRO_PARSE_CODE_PICTURE(is_ref,n_refs,is_lowdelay,is_noarith) \ (8 | ((is_ref)<<2) | (n_refs) | ((is_lowdelay)<<7) | ((is_noarith)<<6)) #define SCHRO_PARSE_CODE_IS_SEQ_HEADER(x) ((x) == SCHRO_PARSE_CODE_SEQUENCE_HEADER) #define SCHRO_PARSE_CODE_IS_END_OF_SEQUENCE(x) ((x) == SCHRO_PARSE_CODE_END_OF_SEQUENCE) #define SCHRO_PARSE_CODE_IS_AUXILIARY_DATA(x) ((x) == SCHRO_PARSE_CODE_AUXILIARY_DATA) #define SCHRO_PARSE_CODE_IS_PADDING(x) ((x) == SCHRO_PARSE_CODE_PADDING) #define SCHRO_PARSE_CODE_IS_PICTURE(x) ((x) & 0x8) #define SCHRO_PARSE_CODE_IS_LOW_DELAY(x) (((x) & 0x88) == 0x88) #define SCHRO_PARSE_CODE_IS_CORE_SYNTAX(x) (((x) & 0x88) == 0x08) #define SCHRO_PARSE_CODE_USING_AC(x) (((x) & 0x48) == 0x08) #define SCHRO_PARSE_CODE_IS_REFERENCE(x) (((x) & 0xc) == 0x0c) #define SCHRO_PARSE_CODE_IS_NON_REFERENCE(x) (((x) & 0xc) == 0x08) #define SCHRO_PARSE_CODE_NUM_REFS(x) ((x) & 0x3) #define SCHRO_PARSE_CODE_IS_INTRA(x) (SCHRO_PARSE_CODE_IS_PICTURE(x) && SCHRO_PARSE_CODE_NUM_REFS(x) == 0) #define SCHRO_PARSE_CODE_IS_INTER(x) (SCHRO_PARSE_CODE_IS_PICTURE(x) && SCHRO_PARSE_CODE_NUM_REFS(x) > 0) #define SCHRO_PARSE_HEADER_SIZE (4+1+4+4) typedef enum _SchroVideoFormatEnum { SCHRO_VIDEO_FORMAT_CUSTOM = 0, SCHRO_VIDEO_FORMAT_QSIF, SCHRO_VIDEO_FORMAT_QCIF, SCHRO_VIDEO_FORMAT_SIF, SCHRO_VIDEO_FORMAT_CIF, SCHRO_VIDEO_FORMAT_4SIF, SCHRO_VIDEO_FORMAT_4CIF, SCHRO_VIDEO_FORMAT_SD480I_60, SCHRO_VIDEO_FORMAT_SD576I_50, SCHRO_VIDEO_FORMAT_HD720P_60, SCHRO_VIDEO_FORMAT_HD720P_50, SCHRO_VIDEO_FORMAT_HD1080I_60, SCHRO_VIDEO_FORMAT_HD1080I_50, SCHRO_VIDEO_FORMAT_HD1080P_60, SCHRO_VIDEO_FORMAT_HD1080P_50, SCHRO_VIDEO_FORMAT_DC2K_24, SCHRO_VIDEO_FORMAT_DC4K_24, SCHRO_VIDEO_FORMAT_UHDTV_4K_60, SCHRO_VIDEO_FORMAT_UHDTV_4K_50, SCHRO_VIDEO_FORMAT_UHDTV_8K_60, SCHRO_VIDEO_FORMAT_UHDTV_8K_50 } SchroVideoFormatEnum; typedef enum _SchroChromaFormat { SCHRO_CHROMA_444 = 0, SCHRO_CHROMA_422, SCHRO_CHROMA_420 } SchroChromaFormat; #define SCHRO_CHROMA_FORMAT_H_SHIFT(format) (((format) == SCHRO_CHROMA_444)?0:1) #define SCHRO_CHROMA_FORMAT_V_SHIFT(format) (((format) == SCHRO_CHROMA_420)?1:0) typedef enum _SchroSignalRange { SCHRO_SIGNAL_RANGE_CUSTOM = 0, SCHRO_SIGNAL_RANGE_8BIT_FULL = 1, SCHRO_SIGNAL_RANGE_8BIT_VIDEO = 2, SCHRO_SIGNAL_RANGE_10BIT_VIDEO = 3, SCHRO_SIGNAL_RANGE_12BIT_VIDEO = 4 } SchroSignalRange; typedef enum _SchroColourSpec { SCHRO_COLOUR_SPEC_CUSTOM = 0, SCHRO_COLOUR_SPEC_SDTV_525 = 1, SCHRO_COLOUR_SPEC_SDTV_625 = 2, SCHRO_COLOUR_SPEC_HDTV = 3, SCHRO_COLOUR_SPEC_CINEMA = 4 } SchroColourSpec; typedef enum _SchroColourPrimaries { SCHRO_COLOUR_PRIMARY_HDTV = 0, SCHRO_COLOUR_PRIMARY_SDTV_525 = 1, SCHRO_COLOUR_PRIMARY_SDTV_625 = 2, SCHRO_COLOUR_PRIMARY_CINEMA = 3 } SchroColourPrimaries; typedef enum _SchroColourMatrix { SCHRO_COLOUR_MATRIX_HDTV = 0, SCHRO_COLOUR_MATRIX_SDTV = 1, SCHRO_COLOUR_MATRIX_REVERSIBLE = 2 }SchroColourMatrix; typedef enum _SchroTransferFunction { SCHRO_TRANSFER_CHAR_TV_GAMMA = 0, SCHRO_TRANSFER_CHAR_EXTENDED_GAMUT = 1, SCHRO_TRANSFER_CHAR_LINEAR = 2, SCHRO_TRANSFER_CHAR_DCI_GAMMA = 3 } SchroTransferFunction; typedef enum _SchroWaveletIndex { SCHRO_WAVELET_DESLAURIERS_DUBUC_9_7, SCHRO_WAVELET_LE_GALL_5_3, SCHRO_WAVELET_DESLAURIERS_DUBUC_13_7, SCHRO_WAVELET_HAAR_0, SCHRO_WAVELET_HAAR_1, SCHRO_WAVELET_FIDELITY, SCHRO_WAVELET_DAUBECHIES_9_7 } SchroWaveletIndex; #ifndef SCHRO_DISABLE_DEPRECATED /* misspellings in older versions */ #define SCHRO_WAVELET_DESLAURIES_DUBUC_9_7 SCHRO_WAVELET_DESLAURIERS_DUBUC_9_7 #define SCHRO_WAVELET_DESLAURIES_DUBUC_13_7 SCHRO_WAVELET_DESLAURIERS_DUBUC_13_7 #endif typedef enum _SchroAuxiliaryDataID { SCHRO_AUX_DATA_INVALID, SCHRO_AUX_DATA_ENCODER_STRING, SCHRO_AUX_DATA_SMPTE_12M_TIMECODE, SCHRO_AUX_DATA_MD5_CHECKSUM, SCHRO_AUX_DATA_BITRATE, SCHRO_AUX_DATA_USER = 0x80 }SchroAuxiliaryDataID; typedef enum _SchroProfile { SCHRO_PROFILE_LOW_DELAY = 0, SCHRO_PROFILE_SIMPLE = 1, SCHRO_PROFILE_MAIN_INTRA = 2, SCHRO_PROFILE_MAIN = 8 } SchroProfile; SCHRO_END_DECLS #endif schroedinger-1.0.11/schroedinger/schrohierbm.c0000644000175000017500000002564011541755167016337 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include /*** struct _SchroHierBm { int ref_count; int ref; int hierarchy_levels; SchroParams* params; SchroFrame** downsampled_src; SchroFrame** downsampled_ref; SchroMotionField** downsampled_mf; }; ***/ static int get_hier_levels (SchroHierBm * schro_hbm); static int schro_hbm_ref_number (SchroHierBm * schro_hbm); SchroHierBm * schro_hbm_new (SchroEncoderFrame * frame, int ref) { int i; SchroEncoderFrame *ref_frame = frame->ref_frame[ref]; SchroHierBm *schro_hbm; SCHRO_ASSERT (ref_frame); schro_hbm = schro_malloc0 (sizeof (struct _SchroHierBm)); schro_hbm->ref_count = 1; schro_hbm->hierarchy_levels = frame->encoder->downsample_levels; if (frame->encoder->enable_chroma_me) schro_hbm->use_chroma = TRUE; else schro_hbm->use_chroma = FALSE; schro_hbm->hierarchy_levels = frame->encoder->downsample_levels; schro_hbm->params = &frame->params; schro_hbm->ref = ref; schro_hbm->downsampled_src = schro_malloc0 (sizeof (SchroFrame *) * (schro_hbm->hierarchy_levels + 1)); schro_hbm->downsampled_ref = schro_malloc0 (sizeof (SchroFrame *) * (schro_hbm->hierarchy_levels + 1)); schro_hbm->downsampled_mf = schro_malloc0 (sizeof (SchroMotionField *) * (schro_hbm->hierarchy_levels + 1)); schro_hbm->downsampled_src[0] = schro_frame_ref (frame->filtered_frame); schro_hbm->downsampled_ref[0] = schro_frame_ref (ref_frame->filtered_frame); for (i = 0; schro_hbm->hierarchy_levels > i; ++i) { SCHRO_ASSERT (frame->downsampled_frames[i] && ref_frame->downsampled_frames[i]); schro_hbm->downsampled_src[i + 1] = schro_frame_ref (frame->downsampled_frames[i]); schro_hbm->downsampled_ref[i + 1] = schro_frame_ref (ref_frame->downsampled_frames[i]); } return schro_hbm; } SchroHierBm * schro_hbm_ref (SchroHierBm * src) { SCHRO_ASSERT (src && src->ref_count > 0); ++src->ref_count; return src; } static void schro_hbm_free (SchroHierBm * hbm) { int i; for (i = 0; hbm->hierarchy_levels + 1 > i; ++i) { if (hbm->downsampled_src[i]) { schro_frame_unref (hbm->downsampled_src[i]); } if (hbm->downsampled_ref[i]) { schro_frame_unref (hbm->downsampled_ref[i]); } if (hbm->downsampled_mf[i]) { schro_motion_field_free (hbm->downsampled_mf[i]); } } schro_free (hbm->downsampled_mf); schro_free (hbm->downsampled_ref); schro_free (hbm->downsampled_src); schro_free (hbm); } /* unreferences a SchroHierBm structure - if it is the last reference * it frees the structure and sets its pointer to NULL * if the pointer was already NULL it's a no-op */ void schro_hbm_unref (SchroHierBm * schro_hbm) { if (0 < --schro_hbm->ref_count) return; schro_hbm_free (schro_hbm); } static SchroFrame * schro_hbm_src_frame (SchroHierBm * hbm, int level) { SCHRO_ASSERT (hbm && 0 < hbm->ref_count && !(get_hier_levels (hbm) < level)); return hbm->downsampled_src[level]; } static SchroFrame * schro_hbm_ref_frame (SchroHierBm * hbm, int level) { SCHRO_ASSERT (hbm && 0 < hbm->ref_count && !(get_hier_levels (hbm) < level)); return hbm->downsampled_ref[level]; } /* Note: it doesn't check whether the requested mf is not NULL */ SchroMotionField * schro_hbm_motion_field (SchroHierBm * schro_hbm, int level) { SCHRO_ASSERT (schro_hbm && schro_hbm->ref_count > 0 && !(get_hier_levels (schro_hbm) < level)); return schro_hbm->downsampled_mf[level]; } static void schro_hbm_set_motion_field (SchroHierBm * hbm, SchroMotionField * mf, int level) { SCHRO_ASSERT (hbm && 0 < hbm->ref_count && !(get_hier_levels (hbm) < level)); hbm->downsampled_mf[level] = mf; } static SchroParams * schro_hbm_params (SchroHierBm * schro_hbm) { SCHRO_ASSERT (schro_hbm && 0 < schro_hbm->ref_count); return schro_hbm->params; } static int schro_hbm_ref_number (SchroHierBm * schro_hbm) { SCHRO_ASSERT (schro_hbm && schro_hbm->ref_count > 0); return schro_hbm->ref; } static int get_hier_levels (SchroHierBm * schro_hbm) { SCHRO_ASSERT (schro_hbm); return schro_hbm->hierarchy_levels; } void schro_hbm_scan (SchroHierBm * schro_hbm) { int i; int half_scan_range = 20; int n_levels = get_hier_levels (schro_hbm); SCHRO_ASSERT (n_levels > 0); schro_hierarchical_bm_scan_hint (schro_hbm, n_levels, half_scan_range); half_scan_range >>= 1; for (i = n_levels - 1; 1 <= i; --i, half_scan_range >>= 1) { schro_hierarchical_bm_scan_hint (schro_hbm, i, MAX (3, half_scan_range)); } } void schro_hierarchical_bm_scan_hint (SchroHierBm * schro_hbm, int shift, int h_range) { SchroMetricScan scan; SchroMotionVector *mv; SchroMotionField *mf, *hint_mf = NULL; SchroParams *params = schro_hbm_params (schro_hbm); SchroMotionVector zero_mv; SchroMetricInfo info; int xblen = params->xbsep_luma, yblen = params->ybsep_luma; int i; int j; int skip; int shift_w[3], shift_h[3]; int split = 1 < shift ? 0 : (1 == shift ? 1 : 2); #define LIST_LENGTH 9 SchroMotionVector *temp_hint_mv[LIST_LENGTH], *hint_mv[LIST_LENGTH]; unsigned int hint_mask; int ref = schro_hbm_ref_number (schro_hbm); int comp_w[3], comp_h[3]; /* sets up for block matching */ scan.frame = schro_hbm_src_frame (schro_hbm, shift); scan.ref_frame = schro_hbm_ref_frame (schro_hbm, shift); schro_metric_info_init (&info, schro_hbm_src_frame (schro_hbm, shift), schro_hbm_ref_frame (schro_hbm, shift), xblen, yblen); mf = schro_motion_field_new (params->x_num_blocks, params->y_num_blocks); schro_motion_field_set (mf, split, ref + 1); if (shift < get_hier_levels (schro_hbm)) { hint_mf = schro_hbm_motion_field (schro_hbm, shift + 1); } memset (&zero_mv, 0, sizeof (zero_mv)); zero_mv.pred_mode = ref + 1; zero_mv.split = split; hint_mask = ~((1 << (shift + 1)) - 1); skip = 1 << shift; shift_w[0] = shift_h[0] = shift; shift_w[1] = shift_w[2] = shift + SCHRO_FRAME_FORMAT_H_SHIFT (scan.frame->format); shift_h[1] = shift_h[2] = shift + SCHRO_FRAME_FORMAT_V_SHIFT (scan.frame->format); comp_w[0] = xblen; comp_h[0] = yblen; comp_w[1] = comp_w[2] = xblen >> SCHRO_FRAME_FORMAT_H_SHIFT (scan.frame->format); comp_h[1] = comp_h[2] = yblen >> SCHRO_FRAME_FORMAT_V_SHIFT (scan.frame->format); for (j = 0; j < params->y_num_blocks; j += skip) { for (i = 0; i < params->x_num_blocks; i += skip) { SchroFrameData orig[3]; int m = 0; int n = 0; int dx, dy; int min_m; int min_metric; int width[3], height[3]; int k; /* get source data, if possible */ if (!(scan.frame->width > (i * xblen) >> shift) || !(scan.frame->height > (j * yblen) >> shift)) { continue; } for (k = 0; 3 > k; ++k) { schro_frame_get_subdata (scan.frame, &orig[k], k, (i * xblen) >> shift_w[k], (j * yblen) >> shift_h[k]); width[k] = MIN (orig[k].width, comp_w[k]); height[k] = MIN (orig[k].height, comp_h[k]); if (0 == k) { SCHRO_ASSERT (0 < width[k] && 0 < height[k]); } } /* now check all candidates */ /* always test the zero vector */ temp_hint_mv[n] = &zero_mv; n++; /* inherit from nearby parents (star-like selection) */ if (NULL != hint_mf) { int l = i & hint_mask, k = j & hint_mask, ll, kk; int offset[5][2] = { {0, 0}, {-1, 0}, {1, 0}, {0, -1}, {0, 1} }; for (m = 0; m < 5; m++) { ll = l + offset[m][0] * skip * 2; kk = k + offset[m][1] * skip * 2; if (ll >= 0 && ll < params->x_num_blocks && kk >= 0 && kk < params->y_num_blocks) { mv = hint_mf->motion_vectors + kk * params->x_num_blocks + ll; temp_hint_mv[n] = mv; n++; } } } /* inherit from neighbours (only towards SE) */ if (i > 0) { mv = mf->motion_vectors + j * params->x_num_blocks + i - skip; temp_hint_mv[n] = mv; n++; } if (j > 0) { mv = mf->motion_vectors + (j - skip) * params->x_num_blocks + i; temp_hint_mv[n] = mv; n++; } if (i > 0 && j > 0) { mv = mf->motion_vectors + (j - skip) * params->x_num_blocks + i - skip; temp_hint_mv[n] = mv; n++; } SCHRO_ASSERT (n <= LIST_LENGTH); /* remove duplicates */ m = 0; if (1 < n) { int k, s; SchroMotionVector *mv1, *mv2; for (k = 0; n - 1 > k; ++k) { int skip = 0; mv1 = temp_hint_mv[k]; for (s = k + 1; n > s && !skip; ++s) { mv2 = temp_hint_mv[s]; if (mv1->u.vec.dx[ref] == mv2->u.vec.dx[ref] && mv1->u.vec.dy[ref] == mv2->u.vec.dy[ref]) { skip = 1; } } if (!skip) { hint_mv[m++] = mv1; } } hint_mv[m++] = temp_hint_mv[n - 1]; n = m; } else { hint_mv[0] = temp_hint_mv[0]; } min_m = -1; min_metric = INT_MAX; /* choose best candidate for refinement based on SAD only. */ for (m = 0; m < n; m++) { int metric = 0; dx = hint_mv[m]->u.vec.dx[ref]; dx >>= shift; dx = CLAMP (dx + ((i*xblen) >> shift), -width[0], (scan.ref_frame->components + 0)->width); dx -= ((i*xblen) >> shift); dy = hint_mv[m]->u.vec.dy[ref]; dy >>= shift; dy = CLAMP (dy + ((j*yblen) >> shift), -height[0], (scan.ref_frame->components + 0)->height); dy -= ((j*yblen) >> shift); metric = schro_metric_fast_block (&info, (i*xblen)>>shift, (j*yblen)>>shift, dx, dy); if (metric < min_metric) { min_metric = metric; min_m = m; } } SCHRO_ASSERT (-1 < min_m); /* finally do block-matching around chosen candidate MV */ dx = hint_mv[min_m]->u.vec.dx[ref] >> shift; dy = hint_mv[min_m]->u.vec.dy[ref] >> shift; scan.block_width = width[0]; scan.block_height = height[0]; scan.x = i * xblen >> shift; scan.y = j * yblen >> shift; dx = MAX (-width[0] - scan.x, MIN (scan.ref_frame->width - scan.x, dx)); dy = MAX (-height[0] - scan.y, MIN (scan.ref_frame->height - scan.y, dy)); scan.gravity_x = dx; scan.gravity_y = dy; schro_metric_scan_setup (&scan, dx, dy, h_range, schro_hbm->use_chroma); SCHRO_ASSERT (!(0 > scan.scan_width) && !(0 > scan.scan_height)); mv = mf->motion_vectors + j * params->x_num_blocks + i; schro_metric_scan_do_scan (&scan); mv->metric = schro_metric_scan_get_min (&scan, &dx, &dy, &mv->chroma_metric); dx <<= shift; dy <<= shift; mv->u.vec.dx[ref] = dx; mv->u.vec.dy[ref] = dy; mv->using_global = 0; mv->pred_mode = ref + 1; } } schro_hbm_set_motion_field (schro_hbm, mf, shift); #undef LIST_LENGTH } schroedinger-1.0.11/schroedinger/schroarith.h0000644000175000017500000002142011541755167016175 00000000000000 #ifndef _SCHRO_ARITH_H_ #define _SCHRO_ARITH_H_ #include #include SCHRO_BEGIN_DECLS #ifdef SCHRO_ENABLE_UNSTABLE_API enum { SCHRO_CTX_ZERO_CODEBLOCK = 0, SCHRO_CTX_QUANTISER_CONT, SCHRO_CTX_QUANTISER_VALUE, SCHRO_CTX_QUANTISER_SIGN, SCHRO_CTX_ZPZN_F1, SCHRO_CTX_ZPNN_F1, SCHRO_CTX_ZP_F2, SCHRO_CTX_ZP_F3, SCHRO_CTX_ZP_F4, SCHRO_CTX_ZP_F5, SCHRO_CTX_ZP_F6p, SCHRO_CTX_NPZN_F1, SCHRO_CTX_NPNN_F1, SCHRO_CTX_NP_F2, SCHRO_CTX_NP_F3, SCHRO_CTX_NP_F4, SCHRO_CTX_NP_F5, SCHRO_CTX_NP_F6p, SCHRO_CTX_SIGN_POS, SCHRO_CTX_SIGN_NEG, SCHRO_CTX_SIGN_ZERO, SCHRO_CTX_COEFF_DATA, SCHRO_CTX_SB_F1, SCHRO_CTX_SB_F2, SCHRO_CTX_SB_DATA, SCHRO_CTX_BLOCK_MODE_REF1, SCHRO_CTX_BLOCK_MODE_REF2, SCHRO_CTX_GLOBAL_BLOCK, SCHRO_CTX_LUMA_DC_CONT_BIN1, SCHRO_CTX_LUMA_DC_CONT_BIN2, SCHRO_CTX_LUMA_DC_VALUE, SCHRO_CTX_LUMA_DC_SIGN, SCHRO_CTX_CHROMA1_DC_CONT_BIN1, SCHRO_CTX_CHROMA1_DC_CONT_BIN2, SCHRO_CTX_CHROMA1_DC_VALUE, SCHRO_CTX_CHROMA1_DC_SIGN, SCHRO_CTX_CHROMA2_DC_CONT_BIN1, SCHRO_CTX_CHROMA2_DC_CONT_BIN2, SCHRO_CTX_CHROMA2_DC_VALUE, SCHRO_CTX_CHROMA2_DC_SIGN, SCHRO_CTX_MV_REF1_H_CONT_BIN1, SCHRO_CTX_MV_REF1_H_CONT_BIN2, SCHRO_CTX_MV_REF1_H_CONT_BIN3, SCHRO_CTX_MV_REF1_H_CONT_BIN4, SCHRO_CTX_MV_REF1_H_CONT_BIN5, SCHRO_CTX_MV_REF1_H_VALUE, SCHRO_CTX_MV_REF1_H_SIGN, SCHRO_CTX_MV_REF1_V_CONT_BIN1, SCHRO_CTX_MV_REF1_V_CONT_BIN2, SCHRO_CTX_MV_REF1_V_CONT_BIN3, SCHRO_CTX_MV_REF1_V_CONT_BIN4, SCHRO_CTX_MV_REF1_V_CONT_BIN5, SCHRO_CTX_MV_REF1_V_VALUE, SCHRO_CTX_MV_REF1_V_SIGN, SCHRO_CTX_MV_REF2_H_CONT_BIN1, SCHRO_CTX_MV_REF2_H_CONT_BIN2, SCHRO_CTX_MV_REF2_H_CONT_BIN3, SCHRO_CTX_MV_REF2_H_CONT_BIN4, SCHRO_CTX_MV_REF2_H_CONT_BIN5, SCHRO_CTX_MV_REF2_H_VALUE, SCHRO_CTX_MV_REF2_H_SIGN, SCHRO_CTX_MV_REF2_V_CONT_BIN1, SCHRO_CTX_MV_REF2_V_CONT_BIN2, SCHRO_CTX_MV_REF2_V_CONT_BIN3, SCHRO_CTX_MV_REF2_V_CONT_BIN4, SCHRO_CTX_MV_REF2_V_CONT_BIN5, SCHRO_CTX_MV_REF2_V_VALUE, SCHRO_CTX_MV_REF2_V_SIGN, SCHRO_CTX_LAST }; typedef struct _SchroArith SchroArith; typedef struct _SchroArithContext SchroArithContext; struct _SchroArithContext { unsigned int next; #ifdef unused int stat_range; int n_bits; int n_symbols; int ones; #endif }; struct _SchroArith { SchroBuffer *buffer; uint8_t *dataptr; uintptr_t offset; uint32_t range[2]; uint32_t code; uint32_t range_size; int cntr; int carry; uint16_t probabilities[SCHRO_CTX_LAST]; uint16_t lut[512]; SchroArithContext contexts[SCHRO_CTX_LAST]; }; SchroArith * schro_arith_new (void); void schro_arith_free (SchroArith *arith); void schro_arith_decode_init (SchroArith *arith, SchroBuffer *buffer); void schro_arith_encode_init (SchroArith *arith, SchroBuffer *buffer); void schro_arith_estimate_init (SchroArith *arith); void schro_arith_flush (SchroArith *arith); void schro_arith_decode_flush (SchroArith *arith); void schro_arith_encode_bit (SchroArith *arith, int context, int value); void schro_arith_encode_uint (SchroArith *arith, int cont_context, int value_context, int value); void schro_arith_encode_sint (SchroArith *arith, int cont_context, int value_context, int sign_context, int value); int schro_arith_decode_bit (SchroArith *arith, unsigned int context); int schro_arith_decode_uint (SchroArith *arith, unsigned int cont_context, unsigned int value_context); int schro_arith_decode_sint (SchroArith *arith, unsigned int cont_context, unsigned int value_context, unsigned int sign_context); int _schro_arith_decode_sint (SchroArith *arith, unsigned int cont_context, unsigned int value_context, unsigned int sign_context) SCHRO_INTERNAL; void schro_arith_estimate_bit (SchroArith *arith, int i, int value); void schro_arith_estimate_uint (SchroArith *arith, int cont_context, int value_context, int value); void schro_arith_estimate_sint (SchroArith *arith, int cont_context, int value_context, int sign_context, int value); #ifdef SCHRO_ARITH_DEFINE_INLINE static inline int _schro_arith_decode_bit (SchroArith *arith, unsigned int i) { unsigned int range_x_prob; unsigned int value; unsigned int lut_index; register unsigned int range = arith->range[1]; register unsigned int code_minus_low = arith->code; while (range <= 0x40000000) { range <<= 1; code_minus_low <<= 1; if (!--arith->cntr) { arith->offset++; if (arith->offset < arith->buffer->length) { code_minus_low |= arith->dataptr[arith->offset] << 8; } else { code_minus_low |= 0xff00; } arith->offset++; if (arith->offset < arith->buffer->length) { code_minus_low |= arith->dataptr[arith->offset]; } else { code_minus_low |= 0xff; } arith->cntr = 16; } } range_x_prob = ((range >> 16) * arith->probabilities[i]) & 0xFFFF0000; lut_index = arith->probabilities[i]>>7 & ~1; value = (code_minus_low >= range_x_prob); arith->probabilities[i] += arith->lut[lut_index | value]; if (value) { code_minus_low -= range_x_prob; range -= range_x_prob; } else { range = range_x_prob; } arith->range[1] = range; arith->code = code_minus_low; return value; } static inline int _schro_arith_decode_uint (SchroArith *arith, unsigned int cont_context, unsigned int value_context) { unsigned int bits=1; while(!_schro_arith_decode_bit (arith, cont_context)) { bits <<= 1; bits |= _schro_arith_decode_bit (arith, value_context); cont_context = arith->contexts[cont_context].next; } return bits - 1; } static inline void _schro_arith_encode_bit (SchroArith *arith, int i, int value) { unsigned int range; unsigned int probability0; unsigned int range_x_prob; probability0 = arith->probabilities[i]; range = arith->range[1]; range_x_prob = (range * probability0) >> 16; if (value) { arith->range[0] = arith->range[0] + range_x_prob; arith->range[1] -= range_x_prob; arith->probabilities[i] -= arith->lut[arith->probabilities[i]>>8]; } else { arith->range[1] = range_x_prob; arith->probabilities[i] += arith->lut[255-(arith->probabilities[i]>>8)]; } while (arith->range[1] <= 0x4000) { arith->range[0] <<= 1; arith->range[1] <<= 1; arith->cntr++; if (arith->cntr == 8) { if (arith->range[0] < (1<<24) && (arith->range[0] + arith->range[1]) >= (1<<24)) { arith->carry++; } else { if (arith->range[0] >= (1<<24)) { arith->dataptr[arith->offset-1]++; while (arith->carry) { arith->dataptr[arith->offset] = 0x00; arith->carry--; arith->offset++; } } else { while (arith->carry) { arith->dataptr[arith->offset] = 0xff; arith->carry--; arith->offset++; } } arith->dataptr[arith->offset] = arith->range[0] >> 16; arith->offset++; } arith->range[0] &= 0xffff; arith->cntr = 0; } } } static inline int maxbit (unsigned int x) { #if 0 int i; for(i=0;x;i++){ x >>= 1; } return i; #else int i = 0; if (x == 0) return 0; if (x > 0x00ff) { i += 8; x >>= 8; } if (x > 0x000f) { i += 4; x >>= 4; } if (x > 0x0003) { i += 2; x >>= 2; } if (x > 0x0001) { i += 1; x >>= 1; } if (x > 0x0000) { i += 1; } return i; #endif } static inline void _schro_arith_encode_uint (SchroArith *arith, int cont_context, int value_context, int value) { int i; int n_bits; value++; n_bits = maxbit(value); for(i=0;i>(n_bits - 2 - i))&1); cont_context = arith->contexts[cont_context].next; } _schro_arith_encode_bit (arith, cont_context, 1); } static inline void _schro_arith_encode_sint (SchroArith *arith, int cont_context, int value_context, int sign_context, int value) { int sign; if (value < 0) { sign = 1; value = -value; } else { sign = 0; } _schro_arith_encode_uint (arith, cont_context, value_context, value); if (value) { _schro_arith_encode_bit (arith, sign_context, sign); } } #else /* SCHRO_ARITH_DEFINE_INLINE */ int _schro_arith_decode_bit (SchroArith *arith, unsigned int context); int _schro_arith_decode_uint (SchroArith *arith, unsigned int cont_context, unsigned int value_context); void _schro_arith_encode_bit (SchroArith *arith, int context, int value) SCHRO_INTERNAL; void _schro_arith_encode_uint (SchroArith *arith, int cont_context, int value_context, int value) SCHRO_INTERNAL; void _schro_arith_encode_sint (SchroArith *arith, int cont_context, int value_context, int sign_context, int value) SCHRO_INTERNAL; #endif /* SCHRO_ARITH_DEFINE_INLINE */ #endif SCHRO_END_DECLS #endif schroedinger-1.0.11/schroedinger/schrovirtframe.c0000644000175000017500000014256111707115621017057 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #define SCHRO_ENABLE_UNSTABLE_API 1 #include "schrovirtframe.h" #include #include #include #include #include #include SchroFrame * schro_frame_new_virtual (SchroMemoryDomain * domain, SchroFrameFormat format, int width, int height) { SchroFrame *frame = schro_frame_new (); int bytes_pp; int h_shift, v_shift; int chroma_width; int chroma_height; int i; frame->format = format; frame->width = width; frame->height = height; frame->domain = domain; if (SCHRO_FRAME_IS_PACKED (format)) { frame->components[0].format = format; frame->components[0].width = width; frame->components[0].height = height; if (format == SCHRO_FRAME_FORMAT_AYUV) { frame->components[0].stride = width * 4; } else if (format == SCHRO_FRAME_FORMAT_v216) { frame->components[0].stride = ROUND_UP_POW2 (width, 1) * 4; } else if (format == SCHRO_FRAME_FORMAT_v210) { frame->components[0].stride = ((width + 47) / 48) * 128; } else { frame->components[0].stride = ROUND_UP_POW2 (width, 1) * 2; } frame->components[0].length = frame->components[0].stride * height; frame->components[0].data = frame->regions[0]; frame->components[0].v_shift = 0; frame->components[0].h_shift = 0; frame->regions[0] = malloc (frame->components[0].stride * SCHRO_FRAME_CACHE_SIZE); for (i = 0; i < SCHRO_FRAME_CACHE_SIZE; i++) { frame->cached_lines[0][i] = 0; } frame->is_virtual = TRUE; return frame; } switch (SCHRO_FRAME_FORMAT_DEPTH (format)) { case SCHRO_FRAME_FORMAT_DEPTH_U8: bytes_pp = 1; break; case SCHRO_FRAME_FORMAT_DEPTH_S16: bytes_pp = 2; break; case SCHRO_FRAME_FORMAT_DEPTH_S32: bytes_pp = 4; break; default: SCHRO_ASSERT (0); bytes_pp = 0; break; } h_shift = SCHRO_FRAME_FORMAT_H_SHIFT (format); v_shift = SCHRO_FRAME_FORMAT_V_SHIFT (format); chroma_width = ROUND_UP_SHIFT (width, h_shift); chroma_height = ROUND_UP_SHIFT (height, v_shift); frame->components[0].format = format; frame->components[0].width = width; frame->components[0].height = height; frame->components[0].stride = ROUND_UP_4 (width * bytes_pp); frame->components[0].length = frame->components[0].stride * frame->components[0].height; frame->components[0].v_shift = 0; frame->components[0].h_shift = 0; frame->components[1].format = format; frame->components[1].width = chroma_width; frame->components[1].height = chroma_height; frame->components[1].stride = ROUND_UP_4 (chroma_width * bytes_pp); frame->components[1].length = frame->components[1].stride * frame->components[1].height; frame->components[1].v_shift = v_shift; frame->components[1].h_shift = h_shift; frame->components[2].format = format; frame->components[2].width = chroma_width; frame->components[2].height = chroma_height; frame->components[2].stride = ROUND_UP_4 (chroma_width * bytes_pp); frame->components[2].length = frame->components[2].stride * frame->components[2].height; frame->components[2].v_shift = v_shift; frame->components[2].h_shift = h_shift; for (i = 0; i < 3; i++) { SchroFrameData *comp = &frame->components[i]; int j; frame->regions[i] = malloc (comp->stride * SCHRO_FRAME_CACHE_SIZE); for (j = 0; j < SCHRO_FRAME_CACHE_SIZE; j++) { frame->cached_lines[i][j] = 0; } } frame->is_virtual = TRUE; return frame; } static void schro_virt_frame_prep_cache_line (SchroFrame * frame, int component, int i) { int j; if (i < frame->cache_offset[component]) { SCHRO_ERROR ("cache failure: %d outside [%d,%d]", i, frame->cache_offset[component], frame->cache_offset[component] + SCHRO_FRAME_CACHE_SIZE - 1); frame->cache_offset[component] = i; for (j = 0; j < SCHRO_FRAME_CACHE_SIZE; j++) { frame->cached_lines[component][j] = 0; } } while (i >= frame->cache_offset[component] + SCHRO_FRAME_CACHE_SIZE) { j = frame->cache_offset[component] & (SCHRO_FRAME_CACHE_SIZE - 1); frame->cached_lines[component][j] = 0; frame->cache_offset[component]++; } } void * schro_virt_frame_get_line_unrendered (SchroFrame * frame, int component, int i) { SchroFrameData *comp = &frame->components[component]; int j; //SCHRO_ASSERT(i >= 0); //SCHRO_ASSERT(i < comp->height); if (!frame->is_virtual) { return SCHRO_FRAME_DATA_GET_LINE (&frame->components[component], i); } schro_virt_frame_prep_cache_line (frame, component, i); j = i & (SCHRO_FRAME_CACHE_SIZE - 1); return SCHRO_OFFSET (frame->regions[component], comp->stride * j); } void * schro_virt_frame_get_line (SchroFrame * frame, int component, int i) { SchroFrameData *comp = &frame->components[component]; int j; //SCHRO_ASSERT(i >= 0); //SCHRO_ASSERT(i < comp->height); if (!frame->is_virtual) { return SCHRO_FRAME_DATA_GET_LINE (&frame->components[component], i); } schro_virt_frame_prep_cache_line (frame, component, i); j = i & (SCHRO_FRAME_CACHE_SIZE - 1); if (!frame->cached_lines[component][j]) { schro_virt_frame_render_line (frame, SCHRO_OFFSET (frame->regions[component], comp->stride * j), component, i); frame->cached_lines[component][j] = 1; } return SCHRO_OFFSET (frame->regions[component], comp->stride * j); } void schro_virt_frame_set_line_rendered (SchroFrame * frame, int component, int i) { int j; //SCHRO_ASSERT(i >= 0); //SCHRO_ASSERT(i < comp->height); //SCHRO_ASSERT(frame->is_virtual); j = i & (SCHRO_FRAME_CACHE_SIZE - 1); frame->cached_lines[component][j] = 1; } void schro_virt_frame_render_line (SchroFrame * frame, void *dest, int component, int i) { frame->render_line (frame, dest, component, i); } static void copy (SchroFrame * frame, void *_dest, int component, int i) { uint8_t *dest = _dest; uint8_t *src; src = schro_virt_frame_get_line (frame, component, i); switch (SCHRO_FRAME_FORMAT_DEPTH (frame->format)) { case SCHRO_FRAME_FORMAT_DEPTH_U8: orc_memcpy (dest, src, frame->components[component].width); break; case SCHRO_FRAME_FORMAT_DEPTH_S16: orc_memcpy (dest, src, frame->components[component].width * sizeof(int16_t)); break; case SCHRO_FRAME_FORMAT_DEPTH_S32: orc_memcpy (dest, src, frame->components[component].width * sizeof(int32_t)); break; default: SCHRO_ASSERT (0); break; } } void schro_virt_frame_render (SchroFrame * frame, SchroFrame * dest) { int i, k; SCHRO_ASSERT (frame->width == dest->width); SCHRO_ASSERT (frame->height >= dest->height); if (frame->is_virtual) { for (k = 0; k < 3; k++) { SchroFrameData *comp = dest->components + k; for (i = 0; i < dest->components[k].height; i++) { schro_virt_frame_render_line (frame, SCHRO_FRAME_DATA_GET_LINE (comp, i), k, i); } } } else { for (k = 0; k < 3; k++) { SchroFrameData *comp = dest->components + k; for (i = 0; i < dest->components[k].height; i++) { copy (frame, SCHRO_FRAME_DATA_GET_LINE (comp, i), k, i); } } } } #ifdef unused void schro_virt_frame_render_downsample_horiz_cosite (SchroFrame * frame, void *_dest, int component, int i) { uint8_t *dest = _dest; uint8_t *src; int j; int n_src; src = schro_virt_frame_get_line (frame->virt_frame1, component, i); n_src = frame->virt_frame1->components[component].width; for (j = 0; j < frame->components[component].width; j++) { int x = 0; x += 1 * src[CLAMP (j * 2 - 1, 0, n_src - 1)]; x += 2 * src[CLAMP (j * 2 + 0, 0, n_src - 1)]; x += 1 * src[CLAMP (j * 2 + 1, 0, n_src - 1)]; dest[j] = CLAMP ((x + 2) >> 2, 0, 255); } } #endif #ifdef unused void schro_virt_frame_render_downsample_horiz_halfsite (SchroFrame * frame, void *_dest, int component, int i) { uint8_t *dest = _dest; uint8_t *src; int j; int n_src; int taps = 4; int k; src = schro_virt_frame_get_line (frame->virt_frame1, component, i); n_src = frame->virt_frame1->components[component].width; switch (taps) { case 4: for (j = 0; j < frame->components[component].width; j++) { int x = 0; x += 6 * src[CLAMP (j * 2 - 1, 0, n_src - 1)]; x += 26 * src[CLAMP (j * 2 + 0, 0, n_src - 1)]; x += 26 * src[CLAMP (j * 2 + 1, 0, n_src - 1)]; x += 6 * src[CLAMP (j * 2 + 2, 0, n_src - 1)]; dest[j] = CLAMP ((x + 32) >> 6, 0, 255); } break; case 6: for (j = 0; j < frame->components[component].width; j++) { int x = 0; x += -3 * src[CLAMP (j * 2 - 2, 0, n_src - 1)]; x += 8 * src[CLAMP (j * 2 - 1, 0, n_src - 1)]; x += 27 * src[CLAMP (j * 2 + 0, 0, n_src - 1)]; x += 27 * src[CLAMP (j * 2 + 1, 0, n_src - 1)]; x += 8 * src[CLAMP (j * 2 + 2, 0, n_src - 1)]; x += -3 * src[CLAMP (j * 2 + 3, 0, n_src - 1)]; dest[j] = CLAMP ((x + 32) >> 6, 0, 255); } case 8: for (j = 0; j < frame->components[component].width; j++) { int x = 0; const int taps8[8] = { -2, -4, 9, 29, 29, 9, -4, -2 }; for (k = 0; k < 8; k++) { x += taps8[k] * src[CLAMP (j * 2 - 3 + k, 0, n_src - 1)]; } dest[j] = CLAMP ((x + 32) >> 6, 0, 255); } break; case 10: for (j = 0; j < frame->components[component].width; j++) { int x = 0; const int taps10[10] = { 1, -2, -5, 9, 29, 29, 9, -5, -2, 1 }; for (k = 0; k < 10; k++) { x += taps10[k] * src[CLAMP (j * 2 - 4 + k, 0, n_src - 1)]; } dest[j] = CLAMP ((x + 32) >> 6, 0, 255); } break; default: break; } } #endif #ifdef unused SchroFrame * schro_virt_frame_new_horiz_downsample (SchroFrame * vf, int cosite) { SchroFrame *virt_frame; virt_frame = schro_frame_new_virtual (NULL, vf->format, vf->width / 2, vf->height); virt_frame->virt_frame1 = vf; if (cosite) { virt_frame->render_line = schro_virt_frame_render_downsample_horiz_cosite; } else { virt_frame->render_line = schro_virt_frame_render_downsample_horiz_halfsite; } return virt_frame; } #endif #ifdef unused void schro_virt_frame_render_downsample_vert_cosite (SchroFrame * frame, void *_dest, int component, int i) { uint8_t *dest = _dest; uint8_t *src1; uint8_t *src2; uint8_t *src3; int j; int n_src; n_src = frame->virt_frame1->components[component].height; src1 = schro_virt_frame_get_line (frame->virt_frame1, component, CLAMP (i * 2 - 1, 0, n_src - 1)); src2 = schro_virt_frame_get_line (frame->virt_frame1, component, CLAMP (i * 2 + 0, 0, n_src - 1)); src3 = schro_virt_frame_get_line (frame->virt_frame1, component, CLAMP (i * 2 + 1, 0, n_src - 1)); for (j = 0; j < frame->components[component].width; j++) { int x = 0; x += 1 * src1[j]; x += 2 * src2[j]; x += 1 * src3[j]; dest[j] = CLAMP ((x + 2) >> 2, 0, 255); } } #endif #ifdef unused void schro_virt_frame_render_downsample_vert_halfsite (SchroFrame * frame, void *_dest, int component, int i) { uint8_t *dest = _dest; uint8_t *src[10]; int j; int n_src; int taps = 4; int k; n_src = frame->virt_frame1->components[component].height; for (j = 0; j < taps; j++) { src[j] = schro_virt_frame_get_line (frame->virt_frame1, component, CLAMP (i * 2 - (taps - 2) / 2 + j, 0, n_src - 1)); } switch (taps) { case 4: for (j = 0; j < frame->components[component].width; j++) { int x = 0; x += 6 * src[0][j]; x += 26 * src[1][j]; x += 26 * src[2][j]; x += 6 * src[3][j]; dest[j] = CLAMP ((x + 32) >> 6, 0, 255); } break; case 6: for (j = 0; j < frame->components[component].width; j++) { int x = 0; x += -3 * src[0][j]; x += 8 * src[1][j]; x += 27 * src[2][j]; x += 27 * src[3][j]; x += 8 * src[4][j]; x += -3 * src[5][j]; dest[j] = CLAMP ((x + 32) >> 6, 0, 255); } break; case 8: for (j = 0; j < frame->components[component].width; j++) { int x = 0; const int taps8[8] = { -2, -4, 9, 29, 29, 9, -4, -2 }; for (k = 0; k < 8; k++) { x += taps8[k] * src[k][j]; } dest[j] = CLAMP ((x + 32) >> 6, 0, 255); } break; case 10: for (j = 0; j < frame->components[component].width; j++) { int x = 0; const int taps10[10] = { 1, -2, -5, 9, 29, 29, 9, -5, -2, 1 }; //const int taps10[10] = { -1, 1, 6, 11, 15, 15, 11, 6, 1, -1 }; for (k = 0; k < 10; k++) { x += taps10[k] * src[k][j]; } dest[j] = CLAMP ((x + 32) >> 6, 0, 255); } break; default: SCHRO_ASSERT (0); break; } } #endif #ifdef unused SchroFrame * schro_virt_frame_new_vert_downsample (SchroFrame * vf, int cosite) { SchroFrame *virt_frame; virt_frame = schro_frame_new_virtual (NULL, vf->format, vf->width, vf->height / 2); virt_frame->virt_frame1 = vf; if (cosite) { virt_frame->render_line = schro_virt_frame_render_downsample_vert_cosite; } else { virt_frame->render_line = schro_virt_frame_render_downsample_vert_halfsite; } return virt_frame; } #endif #ifdef unused void get_taps (double *taps, double x) { taps[3] = x * x * (x - 1); taps[2] = x * (-x * x + x + 1); x = 1 - x; taps[1] = x * (-x * x + x + 1); taps[0] = x * x * (x - 1); } #endif #ifdef unused void schro_virt_frame_render_resample_vert (SchroFrame * frame, void *_dest, int component, int i) { uint8_t *dest = _dest; uint8_t *src1; uint8_t *src2; uint8_t *src3; uint8_t *src4; int j; int n_src; double taps[4]; double *scale = (double *) frame->virt_priv; double x; int src_i; x = (*scale) * i; src_i = floor (x); get_taps (taps, x - floor (x)); n_src = frame->virt_frame1->components[component].height; src1 = schro_virt_frame_get_line (frame->virt_frame1, component, CLAMP (src_i - 1, 0, n_src - 1)); src2 = schro_virt_frame_get_line (frame->virt_frame1, component, CLAMP (src_i + 0, 0, n_src - 1)); src3 = schro_virt_frame_get_line (frame->virt_frame1, component, CLAMP (src_i + 1, 0, n_src - 1)); src4 = schro_virt_frame_get_line (frame->virt_frame1, component, CLAMP (src_i + 2, 0, n_src - 1)); for (j = 0; j < frame->components[component].width; j++) { double x = 0; x += taps[0] * src1[j]; x += taps[1] * src2[j]; x += taps[2] * src3[j]; x += taps[3] * src4[j]; dest[j] = CLAMP (rint (x), 0, 255); } } #endif #ifdef unused SchroFrame * schro_virt_frame_new_vert_resample (SchroFrame * vf, int height) { SchroFrame *virt_frame; double *scale; virt_frame = schro_frame_new_virtual (NULL, vf->format, vf->width, height); virt_frame->virt_frame1 = vf; virt_frame->render_line = schro_virt_frame_render_resample_vert; scale = malloc (sizeof (double)); virt_frame->virt_priv = scale; *scale = (double) vf->height / height; return virt_frame; } #endif #ifdef unused void schro_virt_frame_render_resample_horiz (SchroFrame * frame, void *_dest, int component, int i) { uint8_t *dest = _dest; uint8_t *src; int j; int n_src; double taps[4]; double *scale = (double *) frame->virt_priv; int src_i; n_src = frame->virt_frame1->components[component].width; src = schro_virt_frame_get_line (frame->virt_frame1, component, i); for (j = 0; j < frame->components[component].width; j++) { double x; double y = 0; x = (*scale) * j; src_i = floor (x); get_taps (taps, x - floor (x)); y = 0; y += taps[0] * src[CLAMP (src_i - 1, 0, n_src - 1)]; y += taps[1] * src[CLAMP (src_i + 0, 0, n_src - 1)]; y += taps[2] * src[CLAMP (src_i + 1, 0, n_src - 1)]; y += taps[3] * src[CLAMP (src_i + 2, 0, n_src - 1)]; dest[j] = CLAMP (rint (y), 0, 255); } } #endif #ifdef unused SchroFrame * schro_virt_frame_new_horiz_resample (SchroFrame * vf, int width) { SchroFrame *virt_frame; double *scale; virt_frame = schro_frame_new_virtual (NULL, vf->format, width, vf->height); virt_frame->virt_frame1 = vf; virt_frame->render_line = schro_virt_frame_render_resample_horiz; scale = malloc (sizeof (double)); virt_frame->virt_priv = scale; *scale = (double) vf->width / width; return virt_frame; } #endif static void unpack_yuyv (SchroFrame * frame, void *_dest, int component, int i) { uint8_t *dest = _dest; uint8_t *src; src = schro_virt_frame_get_line (frame->virt_frame1, 0, i); switch (component) { case 0: orc_unpack_yuyv_y (dest, (void *) src, frame->width); break; case 1: orc_unpack_yuyv_u (dest, (void *) src, frame->width / 2); break; case 2: orc_unpack_yuyv_v (dest, (void *) src, frame->width / 2); break; default: SCHRO_ASSERT (0); } } static void unpack_uyvy (SchroFrame * frame, void *_dest, int component, int i) { uint8_t *dest = _dest; uint8_t *src; src = schro_virt_frame_get_line (frame->virt_frame1, 0, i); switch (component) { case 0: orc_unpack_uyvy_y (dest, (void *) src, frame->width); break; case 1: orc_unpack_uyvy_u (dest, (void *) src, frame->width / 2); break; case 2: orc_unpack_uyvy_v (dest, (void *) src, frame->width / 2); break; default: SCHRO_ASSERT (0); } } static void unpack_ayuv (SchroFrame * frame, void *_dest, int component, int i) { uint8_t *dest = _dest; uint8_t *src; int j; src = schro_virt_frame_get_line (frame->virt_frame1, 0, i); switch (component) { case 0: for (j = 0; j < frame->width; j++) { dest[j] = src[j * 4 + 1]; } break; case 1: for (j = 0; j < frame->width; j++) { dest[j] = src[j * 4 + 2]; } break; case 2: for (j = 0; j < frame->width; j++) { dest[j] = src[j * 4 + 3]; } break; default: SCHRO_ASSERT (0); } } static void unpack_AY64 (SchroFrame * frame, void *_dest, int component, int i) { int32_t *dest = _dest; uint16_t *src; int j; src = schro_virt_frame_get_line (frame->virt_frame1, 0, i); switch (component) { case 0: for (j = 0; j < frame->width; j++) { dest[j] = src[j * 4 + 1] - 32768; } break; case 1: for (j = 0; j < frame->width; j++) { dest[j] = src[j * 4 + 2] - 32768; } break; case 2: for (j = 0; j < frame->width; j++) { dest[j] = src[j * 4 + 3] - 32768; } break; default: SCHRO_ASSERT (0); } } static void unpack_v210 (SchroFrame * frame, void *_dest, int component, int i) { int16_t *dest = _dest; uint8_t *src; int j; src = schro_virt_frame_get_line (frame->virt_frame1, 0, i); #define READ_UINT32_LE(a) (((uint8_t *)(a))[0] | (((uint8_t *)(a))[1]<<8) | \ (((uint8_t *)(a))[2]<<16) | (((uint8_t *)(a))[3]<<24)) switch (component) { case 0: for (j = 0; j < frame->width / 6; j++) { dest[j * 6 + 0] = ((READ_UINT32_LE (src + j * 16 + 0) >> 10) & 0x3ff) - 512; dest[j * 6 + 1] = ((READ_UINT32_LE (src + j * 16 + 4) >> 0) & 0x3ff) - 512; dest[j * 6 + 2] = ((READ_UINT32_LE (src + j * 16 + 4) >> 20) & 0x3ff) - 512; dest[j * 6 + 3] = ((READ_UINT32_LE (src + j * 16 + 8) >> 10) & 0x3ff) - 512; dest[j * 6 + 4] = ((READ_UINT32_LE (src + j * 16 + 12) >> 0) & 0x3ff) - 512; dest[j * 6 + 5] = ((READ_UINT32_LE (src + j * 16 + 12) >> 20) & 0x3ff) - 512; } if (j * 6 + 0 < frame->width) { dest[j * 6 + 0] = ((READ_UINT32_LE (src + j * 16 + 0) >> 10) & 0x3ff) - 512; } if (j * 6 + 1 < frame->width) { dest[j * 6 + 1] = ((READ_UINT32_LE (src + j * 16 + 4) >> 0) & 0x3ff) - 512; } if (j * 6 + 2 < frame->width) { dest[j * 6 + 2] = ((READ_UINT32_LE (src + j * 16 + 4) >> 20) & 0x3ff) - 512; } if (j * 6 + 3 < frame->width) { dest[j * 6 + 3] = ((READ_UINT32_LE (src + j * 16 + 8) >> 10) & 0x3ff) - 512; } if (j * 6 + 4 < frame->width) { dest[j * 6 + 4] = ((READ_UINT32_LE (src + j * 16 + 12) >> 0) & 0x3ff) - 512; } if (j * 6 + 5 < frame->width) { dest[j * 6 + 5] = ((READ_UINT32_LE (src + j * 16 + 12) >> 20) & 0x3ff) - 512; } break; case 1: for (j = 0; j < frame->width / 6; j++) { dest[j * 3 + 0] = ((READ_UINT32_LE (src + j * 16 + 0) >> 0) & 0x3ff) - 512; dest[j * 3 + 1] = ((READ_UINT32_LE (src + j * 16 + 4) >> 10) & 0x3ff) - 512; dest[j * 3 + 2] = ((READ_UINT32_LE (src + j * 16 + 8) >> 20) & 0x3ff) - 512; } if (j * 6 + 0 < frame->width) { dest[j * 3 + 0] = ((READ_UINT32_LE (src + j * 16 + 0) >> 0) & 0x3ff) - 512; } if (j * 6 + 2 < frame->width) { dest[j * 3 + 1] = ((READ_UINT32_LE (src + j * 16 + 4) >> 10) & 0x3ff) - 512; } if (j * 6 + 4 < frame->width) { dest[j * 3 + 2] = ((READ_UINT32_LE (src + j * 16 + 8) >> 20) & 0x3ff) - 512; } break; case 2: for (j = 0; j < frame->width / 6; j++) { dest[j * 3 + 0] = ((READ_UINT32_LE (src + j * 16 + 0) >> 20) & 0x3ff) - 512; dest[j * 3 + 1] = ((READ_UINT32_LE (src + j * 16 + 8) >> 0) & 0x3ff) - 512; dest[j * 3 + 2] = ((READ_UINT32_LE (src + j * 16 + 12) >> 10) & 0x3ff) - 512; } if (j * 6 + 0 < frame->width) { dest[j * 3 + 0] = ((READ_UINT32_LE (src + j * 16 + 0) >> 20) & 0x3ff) - 512; } if (j * 6 + 2 < frame->width) { dest[j * 3 + 1] = ((READ_UINT32_LE (src + j * 16 + 8) >> 0) & 0x3ff) - 512; } if (j * 6 + 4 < frame->width) { dest[j * 3 + 2] = ((READ_UINT32_LE (src + j * 16 + 12) >> 10) & 0x3ff) - 512; } break; default: SCHRO_ASSERT (0); } } static void unpack_v216 (SchroFrame * frame, void *_dest, int component, int i) { int16_t *dest = _dest; uint8_t *src; int j; src = schro_virt_frame_get_line (frame->virt_frame1, 0, i); switch (component) { case 0: for (j = 0; j < frame->width; j++) { dest[j] = src[j * 4 + 2 + 1]; } break; case 1: for (j = 0; j < frame->width / 2; j++) { dest[j] = src[j * 8 + 0 + 1]; } break; case 2: for (j = 0; j < frame->width / 2; j++) { dest[j] = src[j * 8 + 4 + 1]; } break; default: SCHRO_ASSERT (0); } } SchroFrame * schro_virt_frame_new_unpack (SchroFrame * vf) { SchroFrame *virt_frame; SchroFrameFormat format; SchroFrameRenderFunc render_line; switch (vf->format) { case SCHRO_FRAME_FORMAT_YUYV: format = SCHRO_FRAME_FORMAT_U8_422; render_line = unpack_yuyv; break; case SCHRO_FRAME_FORMAT_UYVY: format = SCHRO_FRAME_FORMAT_U8_422; render_line = unpack_uyvy; break; case SCHRO_FRAME_FORMAT_AYUV: format = SCHRO_FRAME_FORMAT_U8_444; render_line = unpack_ayuv; break; case SCHRO_FRAME_FORMAT_v210: format = SCHRO_FRAME_FORMAT_S16_422; render_line = unpack_v210; break; case SCHRO_FRAME_FORMAT_v216: format = SCHRO_FRAME_FORMAT_S16_422; render_line = unpack_v216; break; case SCHRO_FRAME_FORMAT_AY64: format = SCHRO_FRAME_FORMAT_S32_444; render_line = unpack_AY64; break; default: return vf; } virt_frame = schro_frame_new_virtual (NULL, format, vf->width, vf->height); virt_frame->virt_frame1 = vf; virt_frame->render_line = render_line; return virt_frame; } static void pack_yuyv (SchroFrame * frame, void *_dest, int component, int i) { uint32_t *dest = _dest; uint8_t *src_y; uint8_t *src_u; uint8_t *src_v; src_y = schro_virt_frame_get_line (frame->virt_frame1, 0, i); src_u = schro_virt_frame_get_line (frame->virt_frame1, 1, i); src_v = schro_virt_frame_get_line (frame->virt_frame1, 2, i); orc_packyuyv (dest, src_y, src_u, src_v, frame->width / 2); } SchroFrame * schro_virt_frame_new_pack_YUY2 (SchroFrame * vf) { SchroFrame *virt_frame; virt_frame = schro_frame_new_virtual (NULL, SCHRO_FRAME_FORMAT_YUYV, vf->width, vf->height); virt_frame->virt_frame1 = vf; virt_frame->render_line = pack_yuyv; return virt_frame; } static void pack_uyvy (SchroFrame * frame, void *_dest, int component, int i) { uint8_t *dest = _dest; uint8_t *src_y; uint8_t *src_u; uint8_t *src_v; int j; src_y = schro_virt_frame_get_line (frame->virt_frame1, 0, i); src_u = schro_virt_frame_get_line (frame->virt_frame1, 1, i); src_v = schro_virt_frame_get_line (frame->virt_frame1, 2, i); for (j = 0; j < frame->width / 2; j++) { dest[j * 4 + 1] = src_y[j * 2 + 0]; dest[j * 4 + 3] = src_y[j * 2 + 1]; dest[j * 4 + 0] = src_u[j]; dest[j * 4 + 2] = src_v[j]; } } SchroFrame * schro_virt_frame_new_pack_UYVY (SchroFrame * vf) { SchroFrame *virt_frame; virt_frame = schro_frame_new_virtual (NULL, SCHRO_FRAME_FORMAT_YUYV, vf->width, vf->height); virt_frame->virt_frame1 = vf; virt_frame->render_line = pack_uyvy; return virt_frame; } static void pack_v216 (SchroFrame * frame, void *_dest, int component, int i) { uint8_t *dest = _dest; uint8_t *src_y; uint8_t *src_u; uint8_t *src_v; int j; src_y = schro_virt_frame_get_line (frame->virt_frame1, 0, i); src_u = schro_virt_frame_get_line (frame->virt_frame1, 1, i); src_v = schro_virt_frame_get_line (frame->virt_frame1, 2, i); for (j = 0; j < frame->width / 2; j++) { dest[j * 8 + 0] = src_u[j]; dest[j * 8 + 1] = src_u[j]; dest[j * 8 + 2] = src_y[j * 2 + 0]; dest[j * 8 + 3] = src_y[j * 2 + 0]; dest[j * 8 + 4] = src_v[j]; dest[j * 8 + 5] = src_v[j]; dest[j * 8 + 6] = src_y[j * 2 + 1]; dest[j * 8 + 7] = src_y[j * 2 + 1]; } } SchroFrame * schro_virt_frame_new_pack_v216 (SchroFrame * vf) { SchroFrame *virt_frame; virt_frame = schro_frame_new_virtual (NULL, SCHRO_FRAME_FORMAT_v216, vf->width, vf->height); virt_frame->virt_frame1 = vf; virt_frame->render_line = pack_v216; return virt_frame; } static void pack_v210_s16 (SchroFrame * frame, void *_dest, int component, int i) { uint8_t *dest = _dest; int16_t *src_y; int16_t *src_u; int16_t *src_v; int j; uint32_t val; src_y = schro_virt_frame_get_line (frame->virt_frame1, 0, i); src_u = schro_virt_frame_get_line (frame->virt_frame1, 1, i); src_v = schro_virt_frame_get_line (frame->virt_frame1, 2, i); #define TO_10(x) (CLAMP(((x) + 512), 0, 1023)) #define WRITE_UINT32_LE(a,b) do { \ ((uint8_t *)(a))[0] = (b)&0xff; \ ((uint8_t *)(a))[1] = ((b)>>8)&0xff; \ ((uint8_t *)(a))[2] = ((b)>>16)&0xff; \ ((uint8_t *)(a))[3] = ((b)>>24)&0xff; \ } while(0) for (j = 0; j < frame->width / 6; j++) { int y0, y1, y2, y3, y4, y5; int cr0, cr1, cr2; int cb0, cb1, cb2; y0 = TO_10 (src_y[j * 6 + 0]); y1 = TO_10 (src_y[j * 6 + 1]); y2 = TO_10 (src_y[j * 6 + 2]); y3 = TO_10 (src_y[j * 6 + 3]); y4 = TO_10 (src_y[j * 6 + 4]); y5 = TO_10 (src_y[j * 6 + 5]); cb0 = TO_10 (src_u[j * 3 + 0]); cb1 = TO_10 (src_u[j * 3 + 1]); cb2 = TO_10 (src_u[j * 3 + 2]); cr0 = TO_10 (src_v[j * 3 + 0]); cr1 = TO_10 (src_v[j * 3 + 1]); cr2 = TO_10 (src_v[j * 3 + 2]); val = (cr0 << 20) | (y0 << 10) | (cb0); WRITE_UINT32_LE (dest + j * 16 + 0, val); val = (y2 << 20) | (cb1 << 10) | (y1); WRITE_UINT32_LE (dest + j * 16 + 4, val); val = (cb2 << 20) | (y3 << 10) | (cr1); WRITE_UINT32_LE (dest + j * 16 + 8, val); val = (y5 << 20) | (cr2 << 10) | (y4); WRITE_UINT32_LE (dest + j * 16 + 12, val); } if (j * 6 < frame->width) { int y0, y1, y2, y3, y4, y5; int cr0, cr1, cr2; int cb0, cb1, cb2; y0 = ((j * 6 + 0) < frame->width) ? TO_10 (src_y[j * 6 + 0]) : 0; y1 = ((j * 6 + 1) < frame->width) ? TO_10 (src_y[j * 6 + 1]) : 0; y2 = ((j * 6 + 2) < frame->width) ? TO_10 (src_y[j * 6 + 2]) : 0; y3 = ((j * 6 + 3) < frame->width) ? TO_10 (src_y[j * 6 + 3]) : 0; y4 = ((j * 6 + 4) < frame->width) ? TO_10 (src_y[j * 6 + 4]) : 0; y5 = ((j * 6 + 5) < frame->width) ? TO_10 (src_y[j * 6 + 5]) : 0; cb0 = ((j * 6 + 0) < frame->width) ? TO_10 (src_u[j * 3 + 0]) : 0; cb1 = ((j * 6 + 2) < frame->width) ? TO_10 (src_u[j * 3 + 1]) : 0; cb2 = ((j * 6 + 4) < frame->width) ? TO_10 (src_u[j * 3 + 2]) : 0; cr0 = ((j * 6 + 0) < frame->width) ? TO_10 (src_v[j * 3 + 0]) : 0; cr1 = ((j * 6 + 2) < frame->width) ? TO_10 (src_v[j * 3 + 1]) : 0; cr2 = ((j * 6 + 4) < frame->width) ? TO_10 (src_v[j * 3 + 2]) : 0; val = (cr0 << 20) | (y0 << 10) | (cb0); WRITE_UINT32_LE (dest + j * 16 + 0, val); val = (y2 << 20) | (cb1 << 10) | (y1); WRITE_UINT32_LE (dest + j * 16 + 4, val); val = (cb2 << 20) | (y3 << 10) | (cr1); WRITE_UINT32_LE (dest + j * 16 + 8, val); val = (y5 << 20) | (cr2 << 10) | (y4); WRITE_UINT32_LE (dest + j * 16 + 12, val); } #undef TO_10 } static void pack_v210 (SchroFrame * frame, void *_dest, int component, int i) { uint8_t *dest = _dest; uint8_t *src_y; uint8_t *src_u; uint8_t *src_v; int j; uint32_t val; src_y = schro_virt_frame_get_line (frame->virt_frame1, 0, i); src_u = schro_virt_frame_get_line (frame->virt_frame1, 1, i); src_v = schro_virt_frame_get_line (frame->virt_frame1, 2, i); #define TO_10(x) (((x)<<2) | ((x)>>6)) #define WRITE_UINT32_LE(a,b) do { \ ((uint8_t *)(a))[0] = (b)&0xff; \ ((uint8_t *)(a))[1] = ((b)>>8)&0xff; \ ((uint8_t *)(a))[2] = ((b)>>16)&0xff; \ ((uint8_t *)(a))[3] = ((b)>>24)&0xff; \ } while(0) for (j = 0; j < frame->width / 6; j++) { int y0, y1, y2, y3, y4, y5; int cr0, cr1, cr2; int cb0, cb1, cb2; y0 = TO_10 (src_y[j * 6 + 0]); y1 = TO_10 (src_y[j * 6 + 1]); y2 = TO_10 (src_y[j * 6 + 2]); y3 = TO_10 (src_y[j * 6 + 3]); y4 = TO_10 (src_y[j * 6 + 4]); y5 = TO_10 (src_y[j * 6 + 5]); cb0 = TO_10 (src_u[j * 3 + 0]); cb1 = TO_10 (src_u[j * 3 + 1]); cb2 = TO_10 (src_u[j * 3 + 2]); cr0 = TO_10 (src_v[j * 3 + 0]); cr1 = TO_10 (src_v[j * 3 + 1]); cr2 = TO_10 (src_v[j * 3 + 2]); val = (cr0 << 20) | (y0 << 10) | (cb0); WRITE_UINT32_LE (dest + j * 16 + 0, val); val = (y2 << 20) | (cb1 << 10) | (y1); WRITE_UINT32_LE (dest + j * 16 + 4, val); val = (cb2 << 20) | (y3 << 10) | (cr1); WRITE_UINT32_LE (dest + j * 16 + 8, val); val = (y5 << 20) | (cr2 << 10) | (y4); WRITE_UINT32_LE (dest + j * 16 + 12, val); } if (j * 6 < frame->width) { int y0, y1, y2, y3, y4, y5; int cr0, cr1, cr2; int cb0, cb1, cb2; y0 = ((j * 6 + 0) < frame->width) ? TO_10 (src_y[j * 6 + 0]) : 0; y1 = ((j * 6 + 1) < frame->width) ? TO_10 (src_y[j * 6 + 1]) : 0; y2 = ((j * 6 + 2) < frame->width) ? TO_10 (src_y[j * 6 + 2]) : 0; y3 = ((j * 6 + 3) < frame->width) ? TO_10 (src_y[j * 6 + 3]) : 0; y4 = ((j * 6 + 4) < frame->width) ? TO_10 (src_y[j * 6 + 4]) : 0; y5 = ((j * 6 + 5) < frame->width) ? TO_10 (src_y[j * 6 + 5]) : 0; cb0 = ((j * 6 + 0) < frame->width) ? TO_10 (src_u[j * 3 + 0]) : 0; cb1 = ((j * 6 + 2) < frame->width) ? TO_10 (src_u[j * 3 + 1]) : 0; cb2 = ((j * 6 + 4) < frame->width) ? TO_10 (src_u[j * 3 + 2]) : 0; cr0 = ((j * 6 + 0) < frame->width) ? TO_10 (src_v[j * 3 + 0]) : 0; cr1 = ((j * 6 + 2) < frame->width) ? TO_10 (src_v[j * 3 + 1]) : 0; cr2 = ((j * 6 + 4) < frame->width) ? TO_10 (src_v[j * 3 + 2]) : 0; val = (cr0 << 20) | (y0 << 10) | (cb0); WRITE_UINT32_LE (dest + j * 16 + 0, val); val = (y2 << 20) | (cb1 << 10) | (y1); WRITE_UINT32_LE (dest + j * 16 + 4, val); val = (cb2 << 20) | (y3 << 10) | (cr1); WRITE_UINT32_LE (dest + j * 16 + 8, val); val = (y5 << 20) | (cr2 << 10) | (y4); WRITE_UINT32_LE (dest + j * 16 + 12, val); } } SchroFrame * schro_virt_frame_new_pack_v210 (SchroFrame * vf) { SchroFrame *virt_frame; virt_frame = schro_frame_new_virtual (NULL, SCHRO_FRAME_FORMAT_v210, vf->width, vf->height); virt_frame->virt_frame1 = vf; if (vf->format == SCHRO_FRAME_FORMAT_S16_422) { virt_frame->render_line = pack_v210_s16; } else { virt_frame->render_line = pack_v210; } return virt_frame; } static void pack_ayuv (SchroFrame * frame, void *_dest, int component, int i) { uint8_t *dest = _dest; uint8_t *src_y; uint8_t *src_u; uint8_t *src_v; int j; src_y = schro_virt_frame_get_line (frame->virt_frame1, 0, i); src_u = schro_virt_frame_get_line (frame->virt_frame1, 1, i); src_v = schro_virt_frame_get_line (frame->virt_frame1, 2, i); for (j = 0; j < frame->width; j++) { dest[j * 4 + 0] = 0xff; dest[j * 4 + 1] = src_y[j]; dest[j * 4 + 2] = src_u[j]; dest[j * 4 + 3] = src_v[j]; } } SchroFrame * schro_virt_frame_new_pack_AYUV (SchroFrame * vf) { SchroFrame *virt_frame; virt_frame = schro_frame_new_virtual (NULL, SCHRO_FRAME_FORMAT_AYUV, vf->width, vf->height); virt_frame->virt_frame1 = vf; virt_frame->render_line = pack_ayuv; return virt_frame; } static void pack_ayuv64 (SchroFrame * frame, void *_dest, int component, int i) { uint16_t *dest = _dest; int32_t *src_y; int32_t *src_u; int32_t *src_v; int j; src_y = schro_virt_frame_get_line (frame->virt_frame1, 0, i); src_u = schro_virt_frame_get_line (frame->virt_frame1, 1, i); src_v = schro_virt_frame_get_line (frame->virt_frame1, 2, i); for (j = 0; j < frame->width; j++) { dest[j * 4 + 0] = 0xffff; dest[j * 4 + 1] = CLAMP(src_y[j] + 0x8000, 0, 0xffff); dest[j * 4 + 2] = CLAMP(src_u[j] + 0x8000, 0, 0xffff); dest[j * 4 + 3] = CLAMP(src_v[j] + 0x8000, 0, 0xffff); } } SchroFrame * schro_virt_frame_new_pack_AY64 (SchroFrame * vf) { SchroFrame *virt_frame; virt_frame = schro_frame_new_virtual (NULL, SCHRO_FRAME_FORMAT_AY64, vf->width, vf->height); virt_frame->virt_frame1 = vf; virt_frame->render_line = pack_ayuv64; return virt_frame; } #ifdef unused static void pack_rgb (SchroFrame * frame, void *_dest, int component, int i) { uint8_t *dest = _dest; uint8_t *src_y; uint8_t *src_u; uint8_t *src_v; int j; src_y = schro_virt_frame_get_line (frame->virt_frame1, 0, i); src_u = schro_virt_frame_get_line (frame->virt_frame1, 1, i); src_v = schro_virt_frame_get_line (frame->virt_frame1, 2, i); for (j = 0; j < frame->width; j++) { dest[j * 3 + 0] = src_y[j]; dest[j * 3 + 1] = src_u[j]; dest[j * 3 + 2] = src_v[j]; } } #endif #ifdef unused SchroFrame * schro_virt_frame_new_pack_RGB (SchroFrame * vf) { SchroFrame *virt_frame; virt_frame = schro_frame_new_virtual (NULL, SCHRO_FRAME_FORMAT_RGB, vf->width, vf->height); virt_frame->virt_frame1 = vf; virt_frame->render_line = pack_rgb; return virt_frame; } #endif #ifdef unused static void color_matrix (SchroFrame * frame, void *_dest, int component, int i) { uint8_t *dest = _dest; uint8_t *src1; uint8_t *src2; uint8_t *src3; double m1, m2, m3; double offset; int j; src1 = schro_virt_frame_get_line (frame->virt_frame1, 0, i); src2 = schro_virt_frame_get_line (frame->virt_frame1, 1, i); src3 = schro_virt_frame_get_line (frame->virt_frame1, 2, i); switch (component) { case 0: m1 = 0.25679; m2 = 0.50413; m3 = 0.097906; offset = 16; break; case 1: m1 = -0.14822; m2 = -0.29099; m3 = 0.43922; offset = 128; break; case 2: m1 = 0.43922; m2 = -0.36779; m3 = -0.071427; offset = 128; break; default: m1 = 0.0; m2 = 0.0; m3 = 0.0; offset = 0; break; } for (j = 0; j < frame->width; j++) { dest[j] = floor (src1[j] * m1 + src2[j] * m2 + src3[j] * m3 + offset + 0.5); } } #endif #ifdef unused SchroFrame * schro_virt_frame_new_color_matrix (SchroFrame * vf) { SchroFrame *virt_frame; virt_frame = schro_frame_new_virtual (NULL, SCHRO_FRAME_FORMAT_U8_444, vf->width, vf->height); virt_frame->virt_frame1 = vf; virt_frame->render_line = color_matrix; return virt_frame; } #endif static void convert_444_422 (SchroFrame * frame, void *_dest, int component, int i) { uint8_t *dest = _dest; uint8_t *src; int j; src = schro_virt_frame_get_line (frame->virt_frame1, component, i); if (component == 0) { orc_memcpy (dest, src, frame->width); } else { for (j = 0; j < frame->components[component].width; j++) { dest[j] = src[j * 2]; } } } static void convert_444_420 (SchroFrame * frame, void *_dest, int component, int i) { uint8_t *dest = _dest; uint8_t *src; int j; if (component == 0) { src = schro_virt_frame_get_line (frame->virt_frame1, component, i); orc_memcpy (dest, src, frame->components[component].width); } else { src = schro_virt_frame_get_line (frame->virt_frame1, component, i * 2); for (j = 0; j < frame->components[component].width; j++) { dest[j] = src[j * 2]; } } } static void convert_422_420 (SchroFrame * frame, void *_dest, int component, int i) { uint8_t *dest = _dest; uint8_t *src; if (component == 0) { src = schro_virt_frame_get_line (frame->virt_frame1, component, i); } else { src = schro_virt_frame_get_line (frame->virt_frame1, component, i * 2); } orc_memcpy (dest, src, frame->components[component].width); } /* up */ static void convert_422_444 (SchroFrame * frame, void *_dest, int component, int i) { uint8_t *dest = _dest; uint8_t *src; int j; src = schro_virt_frame_get_line (frame->virt_frame1, component, i); if (component == 0) { orc_memcpy (dest, src, frame->width); } else { for (j = 0; j < frame->components[component].width; j++) { dest[j] = src[j >> 1]; } } } static void convert_420_444 (SchroFrame * frame, void *_dest, int component, int i) { uint8_t *dest = _dest; uint8_t *src; int j; if (component == 0) { src = schro_virt_frame_get_line (frame->virt_frame1, component, i); orc_memcpy (dest, src, frame->components[component].width); } else { src = schro_virt_frame_get_line (frame->virt_frame1, component, i >> 1); for (j = 0; j < frame->components[component].width; j++) { dest[j] = src[j >> 1]; } } } static void convert_420_422 (SchroFrame * frame, void *_dest, int component, int i) { uint8_t *dest = _dest; uint8_t *src; if (component == 0) { src = schro_virt_frame_get_line (frame->virt_frame1, component, i); } else { src = schro_virt_frame_get_line (frame->virt_frame1, component, i >> 1); } orc_memcpy (dest, src, frame->components[component].width); } SchroFrame * schro_virt_frame_new_subsample (SchroFrame * vf, SchroFrameFormat format) { SchroFrame *virt_frame; SchroFrameRenderFunc render_line; if (vf->format == format) { return vf; } if (vf->format == SCHRO_FRAME_FORMAT_U8_422 && format == SCHRO_FRAME_FORMAT_U8_420) { render_line = convert_422_420; } else if (vf->format == SCHRO_FRAME_FORMAT_U8_444 && format == SCHRO_FRAME_FORMAT_U8_420) { render_line = convert_444_420; } else if (vf->format == SCHRO_FRAME_FORMAT_U8_444 && format == SCHRO_FRAME_FORMAT_U8_422) { render_line = convert_444_422; } else if (vf->format == SCHRO_FRAME_FORMAT_U8_420 && format == SCHRO_FRAME_FORMAT_U8_422) { render_line = convert_420_422; } else if (vf->format == SCHRO_FRAME_FORMAT_U8_420 && format == SCHRO_FRAME_FORMAT_U8_444) { render_line = convert_420_444; } else if (vf->format == SCHRO_FRAME_FORMAT_U8_422 && format == SCHRO_FRAME_FORMAT_U8_444) { render_line = convert_422_444; } else { SCHRO_ASSERT (0); return NULL; } virt_frame = schro_frame_new_virtual (NULL, format, vf->width, vf->height); virt_frame->virt_frame1 = vf; virt_frame->render_line = render_line; return virt_frame; } #if 0 SchroFrame * schro_virt_frame_new_horiz_downsample_take (SchroFrame * vf, int cosite) { SchroFrame *virt_frame; virt_frame = schro_virt_frame_new_horiz_downsample (vf, cosite); schro_frame_unref (vf); return virt_frame; } SchroFrame * schro_virt_frame_new_vert_downsample_take (SchroFrame * vf, int cosite) { SchroFrame *virt_frame; virt_frame = schro_virt_frame_new_vert_downsample (vf, cosite); schro_frame_unref (vf); return virt_frame; } SchroFrame * schro_virt_frame_new_vert_resample_take (SchroFrame * vf, int height) { SchroFrame *virt_frame; virt_frame = schro_virt_frame_new_vert_resample (vf, height); schro_frame_unref (vf); return virt_frame; } SchroFrame * schro_virt_frame_new_horiz_resample_take (SchroFrame * vf, int width) { SchroFrame *virt_frame; virt_frame = schro_virt_frame_new_horiz_resample (vf, width); schro_frame_unref (vf); return virt_frame; } SchroFrame * schro_virt_frame_new_unpack_take (SchroFrame * vf) { SchroFrame *virt_frame; virt_frame = schro_virt_frame_new_unpack (vf); schro_frame_unref (vf); return virt_frame; } SchroFrame * schro_virt_frame_new_pack_YUY2_take (SchroFrame * vf) { SchroFrame *virt_frame; virt_frame = schro_virt_frame_new_pack_YUY2 (vf); schro_frame_unref (vf); return virt_frame; } SchroFrame * schro_virt_frame_new_pack_UYVY_take (SchroFrame * vf) { SchroFrame *virt_frame; virt_frame = schro_virt_frame_new_pack_UYVY (vf); schro_frame_unref (vf); return virt_frame; } SchroFrame * schro_virt_frame_new_pack_v216_take (SchroFrame * vf) { SchroFrame *virt_frame; virt_frame = schro_virt_frame_new_pack_v216 (vf); schro_frame_unref (vf); return virt_frame; } SchroFrame * schro_virt_frame_new_pack_v210_take (SchroFrame * vf) { SchroFrame *virt_frame; virt_frame = schro_virt_frame_new_pack_v210 (vf); schro_frame_unref (vf); return virt_frame; } SchroFrame * schro_virt_frame_new_pack_AYUV_take (SchroFrame * vf) { SchroFrame *virt_frame; virt_frame = schro_virt_frame_new_pack_AYUV (vf); schro_frame_unref (vf); return virt_frame; } SchroFrame * schro_virt_frame_new_pack_RGB_take (SchroFrame * vf) { SchroFrame *virt_frame; virt_frame = schro_virt_frame_new_pack_RGB (vf); schro_frame_unref (vf); return virt_frame; } SchroFrame * schro_virt_frame_new_subsample_take (SchroFrame * vf, SchroFrameFormat format) { SchroFrame *virt_frame; virt_frame = schro_virt_frame_new_subsample (vf, format); schro_frame_unref (vf); return virt_frame; } #endif static void convert_u8_s16 (SchroFrame * frame, void *_dest, int component, int i) { uint8_t *dest = _dest; int16_t *src; src = schro_virt_frame_get_line (frame->virt_frame1, component, i); orc_offsetconvert_u8_s16 (dest, src, frame->components[component].width); } SchroFrame * schro_virt_frame_new_convert_u8 (SchroFrame * vf) { SchroFrame *virt_frame; SchroFrameFormat format; format = (vf->format & 3) | SCHRO_FRAME_FORMAT_U8_444; virt_frame = schro_frame_new_virtual (NULL, format, vf->width, vf->height); virt_frame->virt_frame1 = vf; virt_frame->render_line = convert_u8_s16; virt_frame->virt_priv = schro_malloc (sizeof (int16_t) * vf->width); return virt_frame; } static void convert_u8_s32 (SchroFrame * frame, void *_dest, int component, int i) { uint8_t *dest = _dest; int32_t *src; src = schro_virt_frame_get_line (frame->virt_frame1, component, i); orc_offsetconvert_u8_s32 (dest, src, frame->components[component].width); } SchroFrame * schro_virt_frame_new_convert_u8_s32 (SchroFrame * vf) { SchroFrame *virt_frame; SchroFrameFormat format; format = (vf->format & 3) | SCHRO_FRAME_FORMAT_U8_444; virt_frame = schro_frame_new_virtual (NULL, format, vf->width, vf->height); virt_frame->virt_frame1 = vf; virt_frame->render_line = convert_u8_s32; virt_frame->virt_priv = schro_malloc (sizeof (int32_t) * vf->width); return virt_frame; } static void convert_s16_u8 (SchroFrame * frame, void *_dest, int component, int i) { int16_t *dest = _dest; uint8_t *src; src = schro_virt_frame_get_line (frame->virt_frame1, component, i); orc_offsetconvert_s16_u8 (dest, src, frame->components[component].width); } static void convert_s16_s32 (SchroFrame * frame, void *_dest, int component, int i) { int16_t *dest = _dest; int32_t *src; src = schro_virt_frame_get_line (frame->virt_frame1, component, i); orc_convert_s16_s32 (dest, src, frame->components[component].width); } SchroFrame * schro_virt_frame_new_convert_s16 (SchroFrame * vf) { SchroFrame *virt_frame; SchroFrameFormat format; format = (vf->format & 3) | SCHRO_FRAME_FORMAT_S16_444; virt_frame = schro_frame_new_virtual (NULL, format, vf->width, vf->height); virt_frame->virt_frame1 = vf; if (SCHRO_FRAME_FORMAT_DEPTH (vf->format) == SCHRO_FRAME_FORMAT_DEPTH_S32) { virt_frame->render_line = convert_s16_s32; } else { virt_frame->render_line = convert_s16_u8; } return virt_frame; } static void convert_s32_u8 (SchroFrame * frame, void *_dest, int component, int i) { int32_t *dest = _dest; uint8_t *src; src = schro_virt_frame_get_line (frame->virt_frame1, component, i); orc_offsetconvert_s32_u8 (dest, src, frame->components[component].width); } static void convert_s32_s16 (SchroFrame * frame, void *_dest, int component, int i) { int32_t *dest = _dest; int16_t *src; src = schro_virt_frame_get_line (frame->virt_frame1, component, i); orc_convert_s32_s16 (dest, src, frame->components[component].width); } SchroFrame * schro_virt_frame_new_convert_s32 (SchroFrame * vf) { SchroFrame *virt_frame; SchroFrameFormat format; format = (vf->format & 3) | SCHRO_FRAME_FORMAT_S32_444; virt_frame = schro_frame_new_virtual (NULL, format, vf->width, vf->height); virt_frame->virt_frame1 = vf; if (SCHRO_FRAME_FORMAT_DEPTH (vf->format) == SCHRO_FRAME_FORMAT_DEPTH_S16) { virt_frame->render_line = convert_s32_s16; } else { virt_frame->render_line = convert_s32_u8; } return virt_frame; } static void crop_u8 (SchroFrame * frame, void *_dest, int component, int i) { uint8_t *dest = _dest; uint8_t *src; src = schro_virt_frame_get_line (frame->virt_frame1, component, i); orc_memcpy (dest, src, frame->components[component].width); } static void crop_s16 (SchroFrame * frame, void *_dest, int component, int i) { int16_t *dest = _dest; int16_t *src; src = schro_virt_frame_get_line (frame->virt_frame1, component, i); orc_memcpy (dest, src, frame->components[component].width * sizeof (int16_t)); } static void crop_s32 (SchroFrame * frame, void *_dest, int component, int i) { int16_t *dest = _dest; int16_t *src; src = schro_virt_frame_get_line (frame->virt_frame1, component, i); orc_memcpy (dest, src, frame->components[component].width * sizeof (int32_t)); } SchroFrame * schro_virt_frame_new_crop (SchroFrame * vf, int width, int height) { SchroFrame *virt_frame; if (width == vf->width && height == vf->height) return vf; SCHRO_ASSERT (width <= vf->width); SCHRO_ASSERT (height <= vf->height); virt_frame = schro_frame_new_virtual (NULL, vf->format, width, height); virt_frame->virt_frame1 = vf; switch (SCHRO_FRAME_FORMAT_DEPTH (vf->format)) { case SCHRO_FRAME_FORMAT_DEPTH_U8: virt_frame->render_line = crop_u8; break; case SCHRO_FRAME_FORMAT_DEPTH_S16: virt_frame->render_line = crop_s16; break; default: virt_frame->render_line = crop_s32; break; } return virt_frame; } static void edge_extend_u8 (SchroFrame * frame, void *_dest, int component, int i) { uint8_t *dest = _dest; uint8_t *src; SchroFrame *srcframe = frame->virt_frame1; src = schro_virt_frame_get_line (frame->virt_frame1, component, MIN (i, srcframe->components[component].height - 1)); orc_memcpy (dest, src, srcframe->components[component].width); orc_splat_u8_ns (dest + srcframe->components[component].width, dest[srcframe->components[component].width - 1], frame->components[component].width - srcframe->components[component].width); } static void edge_extend_s16 (SchroFrame * frame, void *_dest, int component, int i) { int16_t *dest = _dest; int16_t *src; SchroFrame *srcframe = frame->virt_frame1; src = schro_virt_frame_get_line (frame->virt_frame1, component, MIN (i, srcframe->components[component].height - 1)); orc_memcpy (dest, src, srcframe->components[component].width * sizeof (int16_t)); orc_splat_s16_ns (dest + srcframe->components[component].width, dest[srcframe->components[component].width - 1], frame->components[component].width - srcframe->components[component].width); } static void edge_extend_s32 (SchroFrame * frame, void *_dest, int component, int i) { int32_t *dest = _dest; int32_t *src; SchroFrame *srcframe = frame->virt_frame1; src = schro_virt_frame_get_line (frame->virt_frame1, component, MIN (i, srcframe->components[component].height - 1)); orc_memcpy (dest, src, srcframe->components[component].width * sizeof (int32_t)); orc_splat_s32_ns (dest + srcframe->components[component].width, dest[srcframe->components[component].width - 1], frame->components[component].width - srcframe->components[component].width); } SchroFrame * schro_virt_frame_new_edgeextend (SchroFrame * vf, int width, int height) { SchroFrame *virt_frame; if (width == vf->width && height == vf->height) return vf; SCHRO_ASSERT (width >= vf->width); SCHRO_ASSERT (height >= vf->height); virt_frame = schro_frame_new_virtual (NULL, vf->format, width, height); virt_frame->virt_frame1 = vf; switch (SCHRO_FRAME_FORMAT_DEPTH (vf->format)) { case SCHRO_FRAME_FORMAT_DEPTH_U8: virt_frame->render_line = edge_extend_u8; break; case SCHRO_FRAME_FORMAT_DEPTH_S16: virt_frame->render_line = edge_extend_s16; break; case SCHRO_FRAME_FORMAT_DEPTH_S32: virt_frame->render_line = edge_extend_s32; break; default: SCHRO_ASSERT (0); break; } return virt_frame; } schroedinger-1.0.11/schroedinger/schromotionest.c0000644000175000017500000025562111702127517017105 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #define DC_BIAS 50 #define DC_METRIC 50 #define BIDIR_LIMIT (10*8*8) #define SCHRO_METRIC_INVALID_2 0x7fffffff #define motion_field_get(mf,x,y) \ ((mf)->motion_vectors + (y)*(mf)->x_num_blocks + (x)) void schro_encoder_bigblock_estimation (SchroMotionEst * me); static SchroFrame *get_downsampled (SchroEncoderFrame * frame, int i); SchroMotionEst * schro_motionest_new (SchroEncoderFrame * frame) { SchroMotionEst *me; me = schro_malloc0 (sizeof (SchroMotionEst)); me->encoder_frame = frame; me->params = &frame->params; me->downsampled_src0[0] = frame->ref_frame[0]->filtered_frame; me->downsampled_src0[1] = frame->ref_frame[0]->downsampled_frames[0]; me->downsampled_src0[2] = frame->ref_frame[0]->downsampled_frames[1]; me->downsampled_src0[3] = frame->ref_frame[0]->downsampled_frames[2]; me->downsampled_src0[4] = frame->ref_frame[0]->downsampled_frames[3]; if (me->params->num_refs > 1) { me->downsampled_src1[0] = frame->ref_frame[1]->filtered_frame; me->downsampled_src1[1] = frame->ref_frame[1]->downsampled_frames[0]; me->downsampled_src1[2] = frame->ref_frame[1]->downsampled_frames[1]; me->downsampled_src1[3] = frame->ref_frame[1]->downsampled_frames[2]; me->downsampled_src1[4] = frame->ref_frame[1]->downsampled_frames[3]; } me->scan_distance = frame->encoder->magic_scan_distance; return me; } void schro_motionest_free (SchroMotionEst * me) { schro_free (me); } void schro_encoder_motion_predict_rough (SchroEncoderFrame * frame) { SchroParams *params = &frame->params; SchroEncoder *encoder = frame->encoder; int ref; SCHRO_ASSERT (params->x_num_blocks != 0); SCHRO_ASSERT (params->y_num_blocks != 0); SCHRO_ASSERT (params->num_refs > 0); if (encoder->enable_hierarchical_estimation) { for (ref = 0; ref < params->num_refs; ref++) { if (encoder->enable_bigblock_estimation) { frame->rme[ref] = schro_rough_me_new (frame, frame->ref_frame[ref]); schro_rough_me_heirarchical_scan (frame->rme[ref]); } else if (encoder->enable_deep_estimation) { frame->hier_bm[ref] = schro_hbm_new (frame, ref); schro_hbm_scan (frame->hier_bm[ref]); } if (encoder->enable_phasecorr_estimation) { frame->phasecorr[ref] = schro_phasecorr_new (frame, frame->ref_frame[ref]); schro_encoder_phasecorr_estimation (frame->phasecorr[ref]); } } if (encoder->enable_global_motion) { schro_encoder_global_estimation (frame); } } if (encoder->enable_bigblock_estimation) { frame->me = schro_motionest_new (frame); } else if (encoder->enable_deep_estimation) { frame->deep_me = schro_me_new (frame); } frame->motion = schro_motion_new (params, NULL, NULL); if (encoder->enable_bigblock_estimation) { frame->me->motion = frame->motion; } } void schro_encoder_motion_predict_pel (SchroEncoderFrame * frame) { SchroParams *params = &frame->params; int ref; SCHRO_ASSERT (params->x_num_blocks != 0); SCHRO_ASSERT (params->y_num_blocks != 0); SCHRO_ASSERT (params->num_refs > 0); if (frame->encoder->enable_bigblock_estimation) { schro_encoder_bigblock_estimation (frame->me); schro_motion_calculate_stats (frame->motion, frame); frame->estimated_mc_bits = schro_motion_estimate_entropy (frame->motion); frame->badblock_ratio = (double) frame->me->badblocks / (params->x_num_blocks * params->y_num_blocks / 16); } else if (frame->encoder->enable_deep_estimation) { for (ref = 0; params->num_refs > ref; ++ref) { SCHRO_ASSERT (frame->hier_bm[ref]); schro_hierarchical_bm_scan_hint (frame->hier_bm[ref], 0, 3); } } else SCHRO_ASSERT (0); } static void schro_encoder_motion_refine_block_subpel (SchroEncoderFrame * frame, SchroBlock * block, int i, int j) { SchroParams *params = &frame->params; int skip; int ii, jj; skip = 4 >> block->mv[0][0].split; for (jj = 0; jj < 4; jj += skip) { for (ii = 0; ii < 4; ii += skip) { if (block->mv[jj][ii].pred_mode & 1) { block->mv[jj][ii].u.vec.dx[0] <<= params->mv_precision; block->mv[jj][ii].u.vec.dy[0] <<= params->mv_precision; } if (block->mv[jj][ii].pred_mode & 2) { block->mv[jj][ii].u.vec.dx[1] <<= params->mv_precision; block->mv[jj][ii].u.vec.dy[1] <<= params->mv_precision; } } } if (block->mv[0][0].split < 3) { for (jj = 0; jj < 4; jj += skip) { for (ii = 0; ii < 4; ii += skip) { if (SCHRO_METRIC_INVALID == block->mv[jj][ii].metric) { continue; } if (block->mv[jj][ii].pred_mode == 1 || block->mv[jj][ii].pred_mode == 2) { SchroUpsampledFrame *ref_upframe; SchroFrameData orig; SchroFrameData ref_fd; int dx, dy; int x, y; int metric = SCHRO_METRIC_INVALID_2; int width, height; int min_metric; int min_dx, min_dy; int ref; ref = block->mv[jj][ii].pred_mode - 1; ref_upframe = frame->ref_frame[ref]->upsampled_original_frame; x = MAX ((i + ii) * frame->params.xbsep_luma, 0); y = MAX ((j + jj) * frame->params.ybsep_luma, 0); schro_frame_get_subdata (get_downsampled (frame, 0), &orig, 0, x, y); width = MIN (skip * frame->params.xbsep_luma, orig.width); height = MIN (skip * frame->params.ybsep_luma, orig.height); min_metric = 0x7fffffff; min_dx = 0; min_dy = 0; for (dx = -1; dx <= 1; dx++) { for (dy = -1; dy <= 1; dy++) { schro_upsampled_frame_get_subdata_prec1 (ref_upframe, 0, 2 * x + block->mv[jj][ii].u.vec.dx[ref] + dx, 2 * y + block->mv[jj][ii].u.vec.dy[ref] + dy, &ref_fd); metric = schro_metric_get (&orig, &ref_fd, width, height); if (metric < min_metric) { min_dx = dx; min_dy = dy; min_metric = metric; } } } if (SCHRO_METRIC_INVALID > min_metric) { block->mv[ii][ii].u.vec.dx[ref] += min_dx; block->mv[jj][ii].u.vec.dy[ref] += min_dy; block->mv[jj][ii].metric = min_metric; } } } } } } void schro_encoder_motion_predict_subpel (SchroEncoderFrame * frame) { SchroParams *params = &frame->params; int i; int j; SCHRO_ASSERT (frame->upsampled_original_frame); SCHRO_ASSERT (frame->ref_frame[0]->upsampled_original_frame); if (frame->ref_frame[1]) { SCHRO_ASSERT (frame->ref_frame[1]->upsampled_original_frame); } for (j = 0; j < params->y_num_blocks; j += 4) { for (i = 0; i < params->x_num_blocks; i += 4) { SchroBlock block = { 0 }; schro_motion_copy_from (frame->me->motion, i, j, &block); schro_encoder_motion_refine_block_subpel (frame, &block, i, j); schro_block_fixup (&block); schro_motion_copy_to (frame->me->motion, i, j, &block); } } } typedef struct { int dx; int dy; } MatchPos; void schro_encoder_motion_predict_subpel_deep (SchroMe * me) { SchroParams *params = schro_me_params (me); double lambda = schro_me_lambda (me); int mvprec = 0, ref; int xblen = params->xbsep_luma, yblen = params->ybsep_luma; int i, j; int x_min, x_max, y_min, y_max; SchroMotionField *mf = NULL; SchroMotionVector *mv; SchroFrameData fd; SchroFrame *orig_frame = schro_me_src (me); const MatchPos sp_matches[] = { {-1, -1}, {0, -1}, {1, -1} , {-1, 0}, {1, 0} , {-1, 1}, {0, 1}, {1, 1} }; x_min = y_min = -orig_frame->extension; if (1 < params->mv_precision) { fd.data = schro_malloc (xblen * yblen * sizeof (uint8_t)); fd.stride = xblen; fd.height = yblen; fd.width = xblen; fd.format = SCHRO_FRAME_FORMAT_U8_420; } while (!(params->mv_precision < ++mvprec)) { x_max = (orig_frame->width << mvprec) + orig_frame->extension; y_max = (orig_frame->height << mvprec) + orig_frame->extension; for (ref = 0; ref < params->num_refs; ++ref) { SchroUpsampledFrame *upframe = schro_me_ref (me, ref); mf = schro_me_subpel_mf (me, ref); for (j = 0; params->y_num_blocks > j; ++j) { for (i = 0; params->x_num_blocks > i; ++i) { int error, entropy, min_error = INT_MAX, m = -1; double score, min_score = HUGE_VAL; int x, y, k; int dx, dy; int pred_x, pred_y; SchroFrameData orig, ref_data; int width, height; mv = &mf->motion_vectors[j * params->x_num_blocks + i]; /* fetch source data (only process valid MVs) */ if (!schro_frame_get_data (orig_frame, &orig, 0, i * xblen, j * yblen)) { continue; } width = MIN (xblen, orig.width); height = MIN (yblen, orig.height); /* adjust MV precision */ mv->u.vec.dx[ref] <<= 1; mv->u.vec.dy[ref] <<= 1; /* calculate score for current MV */ schro_mf_vector_prediction (mf, i, j, &pred_x, &pred_y, ref + 1); entropy = schro_pack_estimate_sint (mv->u.vec.dx[ref] - pred_x); entropy += schro_pack_estimate_sint (mv->u.vec.dy[ref] - pred_y); min_score = entropy + lambda * mv->metric; x = i * (xblen << mvprec) + mv->u.vec.dx[ref]; y = j * (yblen << mvprec) + mv->u.vec.dy[ref]; /* check what matches are valid */ for (k = 0; sizeof (sp_matches) / sizeof (sp_matches[0]) > k; ++k) { dx = x + sp_matches[k].dx; dy = y + sp_matches[k].dy; if (!(x_min < dx) || !(x_max > dx + xblen - 1) || !(y_min < dy) || !(y_max > dy + yblen - 1)) { continue; } fd.width = width; fd.height = height; schro_upsampled_frame_get_block_fast_precN (upframe, 0, dx, dy, mvprec, &ref_data, &fd); error = schro_metric_absdiff_u8 (orig.data, orig.stride, ref_data.data, ref_data.stride, width, height); /* calculate score */ entropy = schro_pack_estimate_sint (mv->u.vec.dx[ref] + sp_matches[k].dx - pred_x); entropy += schro_pack_estimate_sint (mv->u.vec.dy[ref] + sp_matches[k].dy - pred_y); score = entropy + lambda * error; if (min_score > score) { min_score = score; min_error = error; m = k; } } if (-1 != m) { mv->u.vec.dx[ref] += sp_matches[m].dx; mv->u.vec.dy[ref] += sp_matches[m].dy; mv->metric = min_error; } } } } } if (1 < params->mv_precision) { schro_free (fd.data); } } void schro_motion_calculate_stats (SchroMotion * motion, SchroEncoderFrame * frame) { int i, j; SchroMotionVector *mv; int ref1 = 0; int ref2 = 0; int bidir = 0; frame->stats_dc = 0; frame->stats_global = 0; frame->stats_motion = 0; for (j = 0; j < motion->params->y_num_blocks; j++) { for (i = 0; i < motion->params->x_num_blocks; i++) { mv = SCHRO_MOTION_GET_BLOCK (motion, i, j); if (mv->pred_mode == 0) { frame->stats_dc++; } else { if (mv->using_global) { frame->stats_global++; } else { frame->stats_motion++; } if (mv->pred_mode == 1) { ref1++; } else if (mv->pred_mode == 2) { ref2++; } else { bidir++; } } } } SCHRO_DEBUG ("dc %d global %d motion %d ref1 %d ref2 %d bidir %d", frame->stats_dc, frame->stats_global, frame->stats_motion, ref1, ref2, bidir); } SchroMotionField * schro_motion_field_new (int x_num_blocks, int y_num_blocks) { SchroMotionField *mf; mf = schro_malloc0 (sizeof (SchroMotionField)); mf->x_num_blocks = x_num_blocks; mf->y_num_blocks = y_num_blocks; mf->motion_vectors = schro_malloc0 (sizeof (SchroMotionVector) * x_num_blocks * y_num_blocks); return mf; } void schro_motion_field_free (SchroMotionField * field) { schro_free (field->motion_vectors); schro_free (field); } void schro_motion_field_set (SchroMotionField * field, int split, int pred_mode) { SchroMotionVector *mv; int i; int j; for (j = 0; j < field->y_num_blocks; j++) { for (i = 0; i < field->x_num_blocks; i++) { mv = field->motion_vectors + j * field->x_num_blocks + i; memset (mv, 0, sizeof (*mv)); mv->split = split; mv->pred_mode = pred_mode; mv->metric = 0; } } } void schro_motion_field_copy (SchroMotionField * field, SchroMotionField * parent) { SchroMotionVector *mv; SchroMotionVector *pv; int i; int j; for (j = 0; j < field->y_num_blocks; j++) { for (i = 0; i < field->x_num_blocks; i++) { mv = field->motion_vectors + j * field->x_num_blocks + i; pv = parent->motion_vectors + (j >> 1) * parent->x_num_blocks + (i >> 1); *mv = *pv; } } } #if 0 void schro_motion_field_dump (SchroMotionField * field) { SchroMotionVector *mv; int i; int j; for (j = 0; j < field->y_num_blocks; j++) { for (i = 0; i < field->x_num_blocks; i++) { mv = field->motion_vectors + j * field->x_num_blocks + i; printf ("%d %d %d %d\n", i, j, mv->u.vec.dx[0], mv->u.vec.dy[0]); } } exit (0); } #endif static SchroFrame * get_downsampled (SchroEncoderFrame * frame, int i) { SCHRO_ASSERT (frame->have_downsampling); if (i == 0) { return frame->filtered_frame; } return frame->downsampled_frames[i - 1]; } static int schro_block_average (int16_t * dest, SchroFrameData * comp, int x, int y, int w, int h) { int xmax = MIN (x + w, comp->width); int ymax = MIN (y + h, comp->height); int i, j; int n = 0; int sum = 0; int ave; if (x >= comp->width || y >= comp->height) return SCHRO_METRIC_INVALID_2; for (j = y; j < ymax; j++) { for (i = x; i < xmax; i++) { sum += SCHRO_GET (comp->data, j * comp->stride + i, uint8_t); } n += xmax - x; } if (n == 0) { return SCHRO_METRIC_INVALID_2; } ave = (sum + n / 2) / n; sum = 0; for (j = y; j < ymax; j++) { for (i = x; i < xmax; i++) { sum += abs (ave - SCHRO_GET (comp->data, j * comp->stride + i, uint8_t)); } } *dest = ave - 128; return sum; } static void schro_motionest_superblock_scan_one (SchroMotionEst * me, int ref, int distance, SchroBlock * block, int i, int j) { SchroParams *params = me->params; SchroMotionVector *mv; SchroMetricScan scan; SchroMotionField *hint_mf; SchroMotionVector *hint_mv; int dx, dy; uint32_t dummy; scan.frame = get_downsampled (me->encoder_frame, 0); scan.ref_frame = get_downsampled (me->encoder_frame->ref_frame[ref], 0); //hint_mf = me->downsampled_mf[ref][2]; hint_mf = me->encoder_frame->rme[ref]->motion_fields[2]; scan.x = i * params->xbsep_luma; scan.y = j * params->ybsep_luma; scan.block_width = MIN (4 * params->xbsep_luma, scan.frame->width - scan.x); scan.block_height = MIN (4 * params->ybsep_luma, scan.frame->height - scan.y); scan.gravity_scale = 0; scan.gravity_x = 0; scan.gravity_y = 0; mv = &block->mv[0][0]; hint_mv = motion_field_get (hint_mf, i, j); dx = hint_mv->u.vec.dx[ref]; dy = hint_mv->u.vec.dy[ref]; scan.gravity_x = dx; scan.gravity_y = dy; schro_metric_scan_setup (&scan, dx, dy, distance, FALSE); if (scan.scan_width <= 0 || scan.scan_height <= 0) { mv->u.vec.dx[ref] = 0; mv->u.vec.dy[ref] = 0; mv->metric = SCHRO_METRIC_INVALID; block->valid = FALSE; return; } schro_metric_scan_do_scan (&scan); block->error = schro_metric_scan_get_min (&scan, &dx, &dy, &dummy); mv->metric = block->error / 16; mv->split = 0; mv->pred_mode = 1 << ref; mv->using_global = 0; mv->u.vec.dx[ref] = dx; mv->u.vec.dy[ref] = dy; schro_block_fixup (block); block->entropy = schro_motion_superblock_try_estimate_entropy (me->motion, i, j, block); block->valid = TRUE; } static void schro_motionest_superblock_predicted (SchroMotionEst * me, int ref, SchroBlock * block, int i, int j) { SchroMotionVector *mv; int pred_x, pred_y; schro_motion_vector_prediction (me->motion, i, j, &pred_x, &pred_y, (1 << ref)); mv = &block->mv[0][0]; mv->split = 0; mv->pred_mode = 1 << ref; mv->using_global = 0; mv->u.vec.dx[ref] = pred_x; mv->u.vec.dy[ref] = pred_y; block->error = schro_motionest_superblock_get_metric (me, block, i, j); block->entropy = 0; schro_block_fixup (block); block->valid = (block->error != SCHRO_METRIC_INVALID_2); } static void schro_motionest_superblock_biref_zero (SchroMotionEst * me, SchroBlock * block, int i, int j) { SchroMotionVector *mv; mv = &block->mv[0][0]; mv->split = 0; mv->pred_mode = 3; mv->using_global = 0; mv->u.vec.dx[0] = 0; mv->u.vec.dy[0] = 0; mv->u.vec.dx[1] = 0; mv->u.vec.dy[1] = 0; block->error = schro_motionest_superblock_get_metric (me, block, i, j); schro_block_fixup (block); block->entropy = schro_motion_superblock_try_estimate_entropy (me->motion, i, j, block); block->valid = (block->error != SCHRO_METRIC_INVALID_2); } static void schro_motionest_superblock_dc (SchroMotionEst * me, SchroBlock * block, int i, int j) { SchroParams *params = me->params; SchroMotionVector *mv; int chroma_w, chroma_h; SchroFrame *frame; int metric; frame = get_downsampled (me->encoder_frame, 0); mv = &block->mv[0][0]; mv->split = 0; mv->pred_mode = 0; metric = schro_block_average (&mv->u.dc.dc[0], frame->components + 0, i * params->xbsep_luma, j * params->ybsep_luma, 4 * params->xbsep_luma, 4 * params->ybsep_luma); if (metric == SCHRO_METRIC_INVALID_2) { block->valid = FALSE; return; } chroma_w = params->xbsep_luma >> SCHRO_CHROMA_FORMAT_H_SHIFT (params-> video_format->chroma_format); chroma_h = params->ybsep_luma >> SCHRO_CHROMA_FORMAT_V_SHIFT (params-> video_format->chroma_format); schro_block_average (&mv->u.dc.dc[1], frame->components + 1, i * chroma_w, j * chroma_h, 4 * chroma_w, 4 * chroma_h); schro_block_average (&mv->u.dc.dc[2], frame->components + 2, i * chroma_w, j * chroma_h, 4 * chroma_w, 4 * chroma_h); mv->metric = metric; block->error = metric; block->error += 4 * 2 * me->params->xbsep_luma * me->encoder_frame->encoder->magic_dc_metric_offset; schro_block_fixup (block); block->entropy = schro_motion_superblock_try_estimate_entropy (me->motion, i, j, block); block->valid = TRUE; } static void schro_motionest_superblock_dc_predicted (SchroMotionEst * me, SchroBlock * block, int i, int j) { SchroMotionVector *mv; int pred[3]; schro_motion_dc_prediction (me->motion, i, j, pred); mv = &block->mv[0][0]; mv->split = 0; mv->pred_mode = 0; mv->u.dc.dc[0] = pred[0]; mv->u.dc.dc[1] = pred[1]; mv->u.dc.dc[2] = pred[2]; block->error = schro_motionest_superblock_get_metric (me, block, i, j); mv->metric = block->error; block->error += 4 * 2 * me->params->xbsep_luma * me->encoder_frame->encoder->magic_dc_metric_offset; schro_block_fixup (block); block->entropy = 0; block->valid = TRUE; } #ifdef unused static void schro_motion_splat_4x4 (SchroMotion * motion, int i, int j) { SchroMotionVector *mv; mv = SCHRO_MOTION_GET_BLOCK (motion, i, j); mv[1] = mv[0]; mv[2] = mv[0]; mv[3] = mv[0]; memcpy (SCHRO_MOTION_GET_BLOCK (motion, i, j + 1), mv, 4 * sizeof (*mv)); memcpy (SCHRO_MOTION_GET_BLOCK (motion, i, j + 2), mv, 4 * sizeof (*mv)); memcpy (SCHRO_MOTION_GET_BLOCK (motion, i, j + 3), mv, 4 * sizeof (*mv)); } #endif #ifdef unused static void motion_field_splat_4x4 (SchroMotionField * mf, int i, int j) { SchroMotionVector *mv; mv = motion_field_get (mf, i, j); mv[1] = mv[0]; mv[2] = mv[0]; mv[3] = mv[0]; memcpy (motion_field_get (mf, i, j + 1), mv, 4 * sizeof (*mv)); memcpy (motion_field_get (mf, i, j + 2), mv, 4 * sizeof (*mv)); memcpy (motion_field_get (mf, i, j + 3), mv, 4 * sizeof (*mv)); } #endif #ifdef unused static void schro_motionest_block_scan_one (SchroMotionEst * me, int ref, int distance, SchroBlock * block, int i, int j) { SchroParams *params = me->params; SchroMotionVector *mv; SchroMetricScan scan; SchroMotionField *hint_mf; SchroMotionVector *hint_mv; int dx, dy; int ii, jj; scan.frame = get_downsampled (me->encoder_frame, 0); scan.ref_frame = get_downsampled (me->encoder_frame->ref_frame[ref], 0); hint_mf = me->encoder_frame->rme[ref]->motion_fields[1]; scan.block_width = params->xbsep_luma; scan.block_height = params->ybsep_luma; scan.gravity_scale = 0; scan.gravity_x = 0; scan.gravity_y = 0; block->error = 0; block->valid = TRUE; for (jj = 0; jj < 4; jj++) { for (ii = 0; ii < 4; ii++) { mv = &block->mv[jj][ii]; hint_mv = motion_field_get (hint_mf, i + (ii & 2), j + (jj & 2)); dx = hint_mv->u.vec.dx[ref]; dy = hint_mv->u.vec.dy[ref]; scan.gravity_x = dx; scan.gravity_y = dy; scan.x = (i + ii) * params->xbsep_luma; scan.y = (j + jj) * params->ybsep_luma; schro_metric_scan_setup (&scan, dx, dy, distance, FALSE); if (scan.scan_width <= 0 || scan.scan_height <= 0) { mv->u.vec.dx[ref] = 0; mv->u.vec.dy[ref] = 0; mv->metric = SCHRO_METRIC_INVALID; block->error += mv->metric; block->valid = FALSE; continue; } schro_metric_scan_do_scan (&scan); uint32_t dummy; mv->metric = schro_metric_scan_get_min (&scan, &dx, &dy, &dummy); block->error += mv->metric; block->valid &= (mv->metric != SCHRO_METRIC_INVALID); mv->split = 2; mv->pred_mode = 1 << ref; mv->using_global = 0; mv->u.vec.dx[ref] = dx; mv->u.vec.dy[ref] = dy; } } schro_block_fixup (block); block->entropy = schro_motion_superblock_try_estimate_entropy (me->motion, i, j, block); } #endif #define MAGIC_SUPERBLOCK_METRIC 5 #define MAGIC_BLOCK_METRIC 50 #define TRYBLOCK \ score = tryblock.entropy + me->lambda * tryblock.error; \ if (tryblock.valid && score < min_score) { \ memcpy (&block, &tryblock, sizeof(block)); \ min_score = score; \ } static void schro_motionest_block_scan (SchroMotionEst * me, int ref, int distance, SchroBlock * block, int i, int j, int ii, int jj) { SchroParams *params = me->params; SchroMotionVector *mv; SchroMetricScan scan; SchroMotionField *hint_mf; SchroMotionVector *hint_mv; int dx, dy; uint32_t dummy; scan.frame = get_downsampled (me->encoder_frame, 0); scan.ref_frame = get_downsampled (me->encoder_frame->ref_frame[ref], 0); hint_mf = me->encoder_frame->rme[ref]->motion_fields[1]; scan.block_width = params->xbsep_luma; scan.block_height = params->ybsep_luma; scan.gravity_scale = 0; scan.gravity_x = 0; scan.gravity_y = 0; mv = &block->mv[jj][ii]; hint_mv = motion_field_get (hint_mf, i + (ii & 2), j + (jj & 2)); dx = hint_mv->u.vec.dx[ref]; dy = hint_mv->u.vec.dy[ref]; scan.gravity_x = dx; scan.gravity_y = dy; scan.x = (i + ii) * params->xbsep_luma; scan.y = (j + jj) * params->ybsep_luma; if (!(scan.x < scan.frame->width) || !(scan.y < scan.frame->height)) { mv->u.vec.dx[ref] = 0; mv->u.vec.dy[ref] = 0; mv->metric = SCHRO_METRIC_INVALID; block->error += mv->metric; block->valid = FALSE; return; } scan.block_width = MIN (params->xbsep_luma, scan.frame->width - scan.x); scan.block_height = MIN (params->ybsep_luma, scan.frame->height - scan.y); schro_metric_scan_setup (&scan, dx, dy, distance, FALSE); if (scan.scan_width <= 0 || scan.scan_height <= 0) { mv->u.vec.dx[ref] = 0; mv->u.vec.dy[ref] = 0; mv->metric = SCHRO_METRIC_INVALID; block->error += mv->metric; block->valid = FALSE; return; } schro_metric_scan_do_scan (&scan); mv->metric = schro_metric_scan_get_min (&scan, &dx, &dy, &dummy); block->error = mv->metric; block->valid = (mv->metric != SCHRO_METRIC_INVALID); mv->split = 2; mv->pred_mode = 1 << ref; mv->using_global = 0; mv->u.vec.dx[ref] = dx; mv->u.vec.dy[ref] = dy; schro_block_fixup (block); mv = SCHRO_MOTION_GET_BLOCK (me->motion, i + ii, j + jj); *mv = block->mv[jj][ii]; block->entropy = schro_motion_block_estimate_entropy (me->motion, i + ii, j + jj); } static void schro_motionest_block_dc (SchroMotionEst * me, SchroBlock * block, int i, int j, int ii, int jj) { SchroParams *params = me->params; SchroMotionVector *mv; int chroma_w, chroma_h; SchroFrame *frame; int metric; frame = get_downsampled (me->encoder_frame, 0); mv = &(block->mv[jj][ii]); mv->split = 2; mv->pred_mode = 0; metric = schro_block_average (&mv->u.dc.dc[0], frame->components + 0, (i + ii) * params->xbsep_luma, (j + jj) * params->ybsep_luma, params->xbsep_luma, params->ybsep_luma); if (metric == SCHRO_METRIC_INVALID_2) { block->valid = FALSE; return; } chroma_w = params->xbsep_luma >> SCHRO_CHROMA_FORMAT_H_SHIFT (params-> video_format->chroma_format); chroma_h = params->ybsep_luma >> SCHRO_CHROMA_FORMAT_V_SHIFT (params-> video_format->chroma_format); schro_block_average (&mv->u.dc.dc[1], frame->components + 1, (i + ii) * chroma_w, (j + jj) * chroma_h, chroma_w, chroma_h); schro_block_average (&mv->u.dc.dc[2], frame->components + 2, (i + ii) * chroma_w, (j + jj) * chroma_h, chroma_w, chroma_h); mv->metric = metric; block->error = metric; block->error += 4 * 2 * me->params->xbsep_luma * me->encoder_frame->encoder->magic_dc_metric_offset; block->entropy = schro_motion_block_estimate_entropy (me->motion, i + ii, j + jj); block->valid = TRUE; } static void schro_motionest_superblock_block (SchroMotionEst * me, SchroBlock * p_block, int i, int j) { SchroParams *params = me->params; int ii, jj; SchroBlock block = { 0 }; int total_error = 0; for (jj = 0; jj < 4; jj++) { for (ii = 0; ii < 4; ii++) { block.mv[jj][ii].split = 2; block.mv[jj][ii].pred_mode = 1; block.mv[jj][ii].u.vec.dx[0] = 0; block.mv[jj][ii].u.vec.dy[0] = 0; } } schro_motion_copy_to (me->motion, i, j, &block); for (jj = 0; jj < 4; jj++) { for (ii = 0; ii < 4; ii++) { SchroBlock tryblock = { 0 }; double score; double min_score; /* FIXME use better default than DC */ schro_motionest_block_dc (me, &tryblock, i, j, ii, jj); min_score = block.entropy + me->lambda * block.error; if (me->encoder_frame->encoder->enable_hierarchical_estimation) { memcpy (&tryblock, &block, sizeof (block)); schro_motionest_block_scan (me, 0, me->scan_distance, &block, i, j, ii, jj); min_score = block.entropy + me->lambda * block.error; if (params->num_refs > 1) { memcpy (&tryblock, &block, sizeof (block)); schro_motionest_block_scan (me, 1, me->scan_distance, &tryblock, i, j, ii, jj); TRYBLOCK} } memcpy (&tryblock, &block, sizeof (block)); schro_motionest_block_dc (me, &tryblock, i, j, ii, jj); TRYBLOCK total_error += block.error; } } block.entropy = schro_motion_superblock_try_estimate_entropy (me->motion, i, j, &block); block.error = total_error; memcpy (p_block, &block, sizeof (block)); } static void schro_motionest_subsuperblock_scan (SchroMotionEst * me, int ref, int distance, SchroBlock * block, int i, int j, int ii, int jj) { SchroParams *params = me->params; SchroMotionVector *mv; SchroMetricScan scan; SchroMotionField *hint_mf; SchroMotionVector *hint_mv; int dx, dy; uint32_t dummy; scan.frame = get_downsampled (me->encoder_frame, 0); scan.ref_frame = get_downsampled (me->encoder_frame->ref_frame[ref], 0); hint_mf = me->encoder_frame->rme[ref]->motion_fields[1]; scan.block_width = 2 * params->xbsep_luma; scan.block_height = 2 * params->ybsep_luma; scan.gravity_scale = 0; scan.gravity_x = 0; scan.gravity_y = 0; mv = &block->mv[jj][ii]; hint_mv = motion_field_get (hint_mf, i + (ii & 2), j + (jj & 2)); dx = hint_mv->u.vec.dx[ref]; dy = hint_mv->u.vec.dy[ref]; scan.gravity_x = dx; scan.gravity_y = dy; scan.x = (i + ii) * params->xbsep_luma; scan.y = (j + jj) * params->ybsep_luma; if (!(scan.x < scan.frame->width) || !(scan.y < scan.frame->height)) { mv->u.vec.dx[ref] = mv->u.vec.dy[ref] = 0; mv->metric = SCHRO_METRIC_INVALID; block->error += mv->metric; block->valid = FALSE; return; } scan.block_width = MIN (2 * params->xbsep_luma, scan.frame->width - scan.x); scan.block_height = MIN (2 * params->ybsep_luma, scan.frame->height - scan.y); schro_metric_scan_setup (&scan, dx, dy, distance, FALSE); if (scan.scan_width <= 0 || scan.scan_height <= 0) { mv->u.vec.dx[ref] = 0; mv->u.vec.dy[ref] = 0; mv->metric = SCHRO_METRIC_INVALID; block->error += mv->metric; block->valid = FALSE; return; } schro_metric_scan_do_scan (&scan); mv->metric = schro_metric_scan_get_min (&scan, &dx, &dy, &dummy); block->error = mv->metric; block->valid = (mv->metric != SCHRO_METRIC_INVALID); mv->split = 1; mv->pred_mode = 1 << ref; mv->using_global = 0; mv->u.vec.dx[ref] = dx; mv->u.vec.dy[ref] = dy; schro_block_fixup (block); mv = SCHRO_MOTION_GET_BLOCK (me->motion, i + ii, j + jj); *mv = block->mv[jj][ii]; block->entropy = schro_motion_block_estimate_entropy (me->motion, i + ii, j + jj); } static void schro_motionest_subsuperblock_dc (SchroMotionEst * me, SchroBlock * block, int i, int j, int ii, int jj) { SchroParams *params = me->params; SchroMotionVector *mv; int chroma_w, chroma_h; SchroFrame *frame; int metric; frame = get_downsampled (me->encoder_frame, 0); mv = (SchroMotionVector *) & block->mv[jj][ii]; mv->split = 1; mv->pred_mode = 0; metric = schro_block_average (&mv->u.dc.dc[0], frame->components + 0, (i + ii) * params->xbsep_luma, (j + jj) * params->ybsep_luma, 2 * params->xbsep_luma, 2 * params->ybsep_luma); if (metric == SCHRO_METRIC_INVALID_2) { block->valid = FALSE; return; } chroma_w = params->xbsep_luma >> SCHRO_CHROMA_FORMAT_H_SHIFT (params-> video_format->chroma_format); chroma_h = params->ybsep_luma >> SCHRO_CHROMA_FORMAT_V_SHIFT (params-> video_format->chroma_format); schro_block_average (&mv->u.dc.dc[1], frame->components + 1, (i + ii) * chroma_w, (j + jj) * chroma_h, 2 * chroma_w, 2 * chroma_h); schro_block_average (&mv->u.dc.dc[2], frame->components + 2, (i + ii) * chroma_w, (j + jj) * chroma_h, 2 * chroma_w, 2 * chroma_h); mv->metric = metric; block->error = metric; block->error += 4 * 2 * me->params->xbsep_luma * me->encoder_frame->encoder->magic_dc_metric_offset; block->entropy = schro_motion_block_estimate_entropy (me->motion, i + ii, j + jj); block->valid = TRUE; } static void schro_motionest_superblock_subsuperblock (SchroMotionEst * me, SchroBlock * p_block, int i, int j) { SchroParams *params = me->params; int ii, jj; SchroBlock block = { 0 }; int total_error = 0; for (jj = 0; jj < 4; jj++) { for (ii = 0; ii < 4; ii++) { block.mv[jj][ii].split = 1; block.mv[jj][ii].pred_mode = 1; block.mv[jj][ii].u.vec.dx[0] = 0; block.mv[jj][ii].u.vec.dy[0] = 0; } } schro_motion_copy_to (me->motion, i, j, &block); for (jj = 0; jj < 4; jj += 2) { for (ii = 0; ii < 4; ii += 2) { SchroBlock tryblock = { 0 }; double score; double min_score; /* FIXME use better default than DC */ schro_motionest_subsuperblock_dc (me, &block, i, j, ii, jj); min_score = block.entropy + me->lambda * block.error; if (me->encoder_frame->encoder->enable_hierarchical_estimation) { memcpy (&tryblock, &block, sizeof (block)); schro_motionest_subsuperblock_scan (me, 0, me->scan_distance, &tryblock, i, j, ii, jj); TRYBLOCK if (params->num_refs > 1) { memcpy (&tryblock, &block, sizeof (block)); schro_motionest_subsuperblock_scan (me, 1, me->scan_distance, &tryblock, i, j, ii, jj); TRYBLOCK #if 0 memcpy (&tryblock, &block, sizeof (block)); schro_motionest_block_biref_zero (me, 1, &tryblock, i, j, ii, jj); TRYBLOCK #endif } } memcpy (&tryblock, &block, sizeof (block)); schro_motionest_subsuperblock_dc (me, &tryblock, i, j, ii, jj); TRYBLOCK total_error += block.error; } } block.entropy = schro_motion_superblock_try_estimate_entropy (me->motion, i, j, &block); block.error = total_error; memcpy (p_block, &block, sizeof (block)); } void schro_encoder_bigblock_estimation (SchroMotionEst * me) { SchroParams *params = me->params; int i, j; double total_error = 0; int block_size; int block_threshold; me->lambda = me->encoder_frame->frame_me_lambda; block_size = 16 * params->xbsep_luma * params->ybsep_luma; block_threshold = params->xbsep_luma * params->ybsep_luma * me->encoder_frame->encoder->magic_block_search_threshold; for (j = 0; j < params->y_num_blocks; j += 4) { for (i = 0; i < params->x_num_blocks; i += 4) { SchroBlock block = { 0 }; SchroBlock tryblock = { 0 }; double score; double min_score; /* base 119 s */ schro_motionest_superblock_predicted (me, 0, &block, i, j); min_score = block.entropy + me->lambda * block.error; if (params->num_refs > 1) { schro_motionest_superblock_predicted (me, 1, &tryblock, i, j); TRYBLOCK} if (me->encoder_frame->encoder->enable_hierarchical_estimation) { /* 16 s */ schro_motionest_superblock_scan_one (me, 0, me->scan_distance, &tryblock, i, j); TRYBLOCK if (params->num_refs > 1) { schro_motionest_superblock_scan_one (me, 1, me->scan_distance, &tryblock, i, j); TRYBLOCK} } /* 2.5 s */ schro_motionest_superblock_dc_predicted (me, &tryblock, i, j); TRYBLOCK schro_motionest_superblock_dc (me, &tryblock, i, j); TRYBLOCK /* 3.0 s */ if (params->num_refs > 1) { schro_motionest_superblock_biref_zero (me, &tryblock, i, j); TRYBLOCK} if (min_score > block_threshold || block.mv[0][0].pred_mode == 0) { schro_motionest_superblock_subsuperblock (me, &tryblock, i, j); TRYBLOCK schro_motionest_superblock_block (me, &tryblock, i, j); TRYBLOCK} if (me->encoder_frame->encoder->enable_phasecorr_estimation) { schro_motionest_superblock_phasecorr1 (me, 0, &tryblock, i, j); TRYBLOCK if (params->num_refs > 1) { schro_motionest_superblock_phasecorr1 (me, 1, &tryblock, i, j); TRYBLOCK} } if (me->encoder_frame->encoder->enable_global_motion) { schro_motionest_superblock_global (me, 0, &tryblock, i, j); TRYBLOCK if (params->num_refs > 1) { schro_motionest_superblock_global (me, 1, &tryblock, i, j); TRYBLOCK} } if (block.error > 10 * block_size) { me->badblocks++; } schro_block_fixup (&block); schro_motion_copy_to (me->motion, i, j, &block); total_error += (double) block.error * block.error / (double) (block_size * block_size); } } me->encoder_frame->mc_error = total_error / (240.0 * 240.0) / (params->x_num_blocks * params->y_num_blocks / 16); /* magic parameter */ me->encoder_frame->mc_error *= 2.5; } int schro_motion_block_estimate_entropy (SchroMotion * motion, int i, int j) { SchroMotionVector *mv; int entropy = 0; mv = SCHRO_MOTION_GET_BLOCK (motion, i, j); if (mv->split == 0 && (i & 3 || j & 3)) return 0; if (mv->split == 1 && (i & 1 || j & 1)) return 0; if (mv->pred_mode == 0) { int pred[3]; schro_motion_dc_prediction (motion, i, j, pred); entropy += schro_pack_estimate_sint (mv->u.dc.dc[0] - pred[0]); entropy += schro_pack_estimate_sint (mv->u.dc.dc[1] - pred[1]); entropy += schro_pack_estimate_sint (mv->u.dc.dc[2] - pred[2]); return entropy; } if (mv->using_global) return 0; if (mv->pred_mode & 1) { int pred_x, pred_y; schro_motion_vector_prediction (motion, i, j, &pred_x, &pred_y, 1); entropy += schro_pack_estimate_sint (mv->u.vec.dx[0] - pred_x); entropy += schro_pack_estimate_sint (mv->u.vec.dy[0] - pred_y); } if (mv->pred_mode & 2) { int pred_x, pred_y; schro_motion_vector_prediction (motion, i, j, &pred_x, &pred_y, 2); entropy += schro_pack_estimate_sint (mv->u.vec.dx[1] - pred_x); entropy += schro_pack_estimate_sint (mv->u.vec.dy[1] - pred_y); } return entropy; } int schro_motion_estimate_entropy (SchroMotion * motion) { SchroParams *params = motion->params; int i, j; int entropy = 0; for (j = 0; j < params->y_num_blocks; j++) { for (i = 0; i < params->x_num_blocks; i++) { entropy += schro_motion_block_estimate_entropy (motion, i, j); } } return entropy; } #ifdef unused int schro_motion_superblock_estimate_entropy (SchroMotion * motion, int i, int j) { int ii, jj; int entropy = 0; for (jj = j; jj < j + 4; jj++) { for (ii = i; ii < i + 4; ii++) { entropy += schro_motion_block_estimate_entropy (motion, ii, jj); } } return entropy; } #endif int schro_motion_superblock_try_estimate_entropy (SchroMotion * motion, int i, int j, SchroBlock * block) { int ii, jj; int entropy = 0; SchroBlock save_block; schro_motion_copy_from (motion, i, j, &save_block); schro_motion_copy_to (motion, i, j, block); for (jj = 0; jj < 4; jj++) { for (ii = 0; ii < 4; ii++) { entropy += schro_motion_block_estimate_entropy (motion, i + ii, j + jj); } } schro_motion_copy_to (motion, i, j, &save_block); return entropy; } int schro_motionest_superblock_get_metric (SchroMotionEst * me, SchroBlock * block, int i, int j) { SchroMotionVector *mv; SchroFrameData orig; int width, height; int xmin, ymin; int xmax, ymax; xmin = MAX (i * me->params->xbsep_luma, 0); ymin = MAX (j * me->params->ybsep_luma, 0); xmax = MIN ((i + 4) * me->params->xbsep_luma, me->encoder_frame->filtered_frame->width); ymax = MIN ((j + 4) * me->params->ybsep_luma, me->encoder_frame->filtered_frame->height); schro_frame_get_subdata (get_downsampled (me->encoder_frame, 0), &orig, 0, xmin, ymin); width = xmax - xmin; height = ymax - ymin; mv = &block->mv[0][0]; if (mv->pred_mode == 0) { return schro_metric_get_dc (&orig, mv->u.dc.dc[0], width, height); } if (mv->pred_mode == 1 || mv->pred_mode == 2) { SchroFrame *ref_frame; SchroFrameData ref_data; int ref; ref = mv->pred_mode - 1; ref_frame = get_downsampled (me->encoder_frame->ref_frame[ref], 0); if (xmin + mv->u.vec.dx[ref] < -ref_frame->extension || ymin + mv->u.vec.dy[ref] < -ref_frame->extension || xmax + mv->u.vec.dx[ref] > me->encoder_frame->filtered_frame->width + ref_frame->extension || ymax + mv->u.vec.dy[ref] > me->encoder_frame->filtered_frame->height + ref_frame->extension) { /* bailing because it's "hard" */ return SCHRO_METRIC_INVALID_2; } schro_frame_get_subdata (ref_frame, &ref_data, 0, xmin + mv->u.vec.dx[ref], ymin + mv->u.vec.dy[ref]); return schro_metric_get (&orig, &ref_data, width, height); } if (mv->pred_mode == 3) { SchroFrame *ref0_frame; SchroFrame *ref1_frame; SchroFrameData ref0_data; SchroFrameData ref1_data; ref0_frame = get_downsampled (me->encoder_frame->ref_frame[0], 0); ref1_frame = get_downsampled (me->encoder_frame->ref_frame[1], 0); if (xmin + mv->u.vec.dx[0] < -ref0_frame->extension || ymin + mv->u.vec.dy[0] < -ref0_frame->extension || xmax + mv->u.vec.dx[0] > me->encoder_frame->filtered_frame->width + ref0_frame->extension || ymax + mv->u.vec.dy[0] > me->encoder_frame->filtered_frame->height + ref0_frame->extension || xmin + mv->u.vec.dx[1] < -ref1_frame->extension || ymin + mv->u.vec.dy[1] < -ref1_frame->extension || xmax + mv->u.vec.dx[1] > me->encoder_frame->filtered_frame->width + ref1_frame->extension || ymax + mv->u.vec.dy[1] > me->encoder_frame->filtered_frame->height + ref1_frame->extension) { /* bailing because it's "hard" */ return SCHRO_METRIC_INVALID_2; } schro_frame_get_subdata (ref0_frame, &ref0_data, 0, xmin + mv->u.vec.dx[0], ymin + mv->u.vec.dy[0]); schro_frame_get_subdata (ref1_frame, &ref1_data, 0, xmin + mv->u.vec.dx[1], ymin + mv->u.vec.dy[1]); return schro_metric_get_biref (&orig, &ref0_data, 1, &ref1_data, 1, 1, width, height); } SCHRO_ASSERT (0); return SCHRO_METRIC_INVALID_2; } #ifdef unused int schro_block_check (SchroBlock * block) { SchroMotionVector *sbmv; SchroMotionVector *bmv; SchroMotionVector *mv; int i, j; sbmv = &block->mv[0][0]; for (j = 0; j < 4; j++) { for (i = 0; i < 4; i++) { mv = &block->mv[j][i]; switch (sbmv->split) { case 0: if (!schro_motion_vector_is_equal (mv, sbmv)) { SCHRO_ERROR ("mv(%d,%d) not equal to superblock mv", i, j); return 0; } break; case 1: bmv = &block->mv[(j & ~1)][(i & ~1)]; if (!schro_motion_vector_is_equal (mv, bmv)) { SCHRO_ERROR ("mv(%d,%d) not equal to 2-block mv", i, j); return 0; } break; case 2: break; default: SCHRO_ERROR ("mv(%d,%d) has bad split", i, j); return 0; break; } } } return 1; } #endif void schro_block_fixup (SchroBlock * block) { SchroMotionVector *mv; mv = &block->mv[0][0]; if (mv->split == 0) { mv[1] = mv[0]; mv[2] = mv[0]; mv[3] = mv[0]; memcpy (mv + 4, mv, 4 * sizeof (*mv)); memcpy (mv + 8, mv, 4 * sizeof (*mv)); memcpy (mv + 12, mv, 4 * sizeof (*mv)); } if (mv->split == 1) { mv[1] = mv[0]; mv[3] = mv[2]; memcpy (mv + 4, mv, 4 * sizeof (*mv)); mv[9] = mv[8]; mv[11] = mv[10]; memcpy (mv + 12, mv + 8, 4 * sizeof (*mv)); } } void schro_motion_copy_from (SchroMotion * motion, int i, int j, SchroBlock * block) { SchroMotionVector *mv; int ii, jj; for (jj = 0; jj < 4; jj++) { for (ii = 0; ii < 4; ii++) { mv = SCHRO_MOTION_GET_BLOCK (motion, i + ii, j + jj); block->mv[jj][ii] = *mv; } } } void schro_motion_copy_to (SchroMotion * motion, int i, int j, SchroBlock * block) { SchroMotionVector *mv; int ii, jj; for (jj = 0; jj < 4; jj++) { for (ii = 0; ii < 4; ii++) { mv = SCHRO_MOTION_GET_BLOCK (motion, i + ii, j + jj); *mv = block->mv[jj][ii]; } } } /* performs single position block matching for split2 * to calculate SAD */ static void schro_get_split2_metric (SchroMe * me, int ref, int i, int j, SchroMotionVector * mv, int *metric, SchroFrameData * fd) { SchroParams *params = schro_me_params (me); SchroFrameData orig[2], ref_data[2]; SchroFrame *frame = schro_me_src (me); SchroUpsampledFrame *upframe; int mv_prec = params->mv_precision; int fd_width, fd_height; int width[3], height[3], dx, dy; int k; int tmp_x, tmp_y; int block_x[3], block_y[3]; /* calculates split2 block sizes for all components */ block_x[0] = params->xbsep_luma; block_y[0] = params->ybsep_luma; block_x[1] = block_x[2] = block_x[0] >> SCHRO_CHROMA_FORMAT_H_SHIFT (params-> video_format->chroma_format); block_y[1] = block_y[2] = block_y[0] >> SCHRO_CHROMA_FORMAT_V_SHIFT (params-> video_format->chroma_format); /* get source data if possible */ for (k = 1; 3 > k; ++k) { if (!schro_frame_get_data (frame, &orig[k - 1], k, i * block_x[k], j * block_y[k])) { *metric = INT_MAX; return; } width[k] = MIN (block_x[k], orig[k - 1].width); height[k] = MIN (block_y[k], orig[k - 1].height); } upframe = schro_me_ref (me, ref); *metric = 0; for (k = 1; 3 > k; ++k) { /* get ref data, if possible */ tmp_x = (i * block_x[k]) << mv_prec; tmp_y = (j * block_y[k]) << mv_prec; dx = mv->u.vec.dx[ref]; dx >>= SCHRO_CHROMA_FORMAT_H_SHIFT (params->video_format->chroma_format); dx += tmp_x; dy = mv->u.vec.dy[ref]; dy >>= SCHRO_CHROMA_FORMAT_V_SHIFT (params->video_format->chroma_format); dy += tmp_y; if (INT_MAX == mv->metric) { *metric = INT_MAX; return; } /* I need to save the original value of fd width and height */ fd_width = fd->width; fd_height = fd->height; fd->width = width[k]; fd->height = height[k]; schro_upsampled_frame_get_block_fast_precN (upframe, k, dx, dy, mv_prec, &ref_data[k - 1], fd); fd->width = fd_width; fd->height = fd_height; *metric += schro_metric_absdiff_u8 (orig[k - 1].data, orig[k - 1].stride, ref_data[k - 1].data, ref_data[k - 1].stride, width[k], height[k]); } mv->chroma_metric = *metric; *metric += mv->metric; return; } /* performs mode decision for a superblock, split level 2 * Note that a SchroMotion object is required to estimate * the cost of the different prediction modes. */ static void schro_do_split2 (SchroMe * me, int i, int j, SchroBlock * block, SchroFrameData * fd) { int total_entropy = 0, total_error = 0, ii, jj, ref; double lambda = schro_me_lambda (me); /* frame->frame_me_lambda; */ int comp_w[3], comp_h[3]; SchroParams *params = schro_me_params (me); SchroMotion *motion = schro_me_motion (me); int mvprec = params->mv_precision; int xnum_blocks = params->x_num_blocks; int fd_width, fd_height, biref; int xblen = params->xbsep_luma, yblen = params->ybsep_luma; SchroFrame *orig_frame = schro_me_src (me); SchroFrameData ref_data[3][2], orig[3]; SchroUpsampledFrame *upframe[2]; SchroMotionField *mf; int xmin, ymin, xmax, ymax; xmin = ymin = -orig_frame->extension; xmax = (orig_frame->width << mvprec) + orig_frame->extension; ymax = (orig_frame->height << mvprec) + orig_frame->extension; comp_w[0] = xblen; comp_h[0] = yblen; comp_w[1] = comp_w[2] = xblen >> SCHRO_CHROMA_FORMAT_H_SHIFT (params->video_format->chroma_format); comp_h[1] = comp_h[2] = yblen >> SCHRO_CHROMA_FORMAT_V_SHIFT (params->video_format->chroma_format); for (jj = 0; 4 > jj; ++jj) { for (ii = 0; 4 > ii; ++ii) { double score, min_score = HUGE_VAL; int entropy[2], error; int width[3], height[3]; int dx[2], dy[2]; int k; int best_entropy = INT_MAX, best_error = INT_MAX; SchroMotionVector *mv, *mv_ref[2], best_mv = { 0 }; best_mv.split = 2; best_mv.pred_mode = 1; mv_ref[0] = mv_ref[1] = NULL; memset (entropy, 0, sizeof (entropy)); memset (width, 0, sizeof (width)); memset (height, 0, sizeof (height)); mv = motion->motion_vectors + (j + jj) * xnum_blocks + i + ii; /* check that the block lies whitin the frame */ if (!(orig_frame->width > (i + ii) * xblen) || !(orig_frame->height > (j + jj) * yblen)) { /* Note: blocks outside frame are encoded pred_mode 1, zero MVs */ int pred_x, pred_y; *mv = best_mv; mv->pred_mode = schro_motion_get_mode_prediction (motion, i + ii, j + jj); if (mv->pred_mode != 1 && mv->pred_mode != 2) mv->pred_mode = 1; schro_motion_vector_prediction (motion, i + ii, j + jj, &pred_x, &pred_y, 1); mv->u.vec.dx[mv->pred_mode - 1] = pred_x; mv->u.vec.dy[mv->pred_mode - 1] = pred_y; block->mv[jj][ii] = best_mv; total_entropy += 2; continue; } mv->metric = INT_MAX; /* do the 2 references, if available */ for (ref = 0; params->num_refs > ref; ++ref) { mf = schro_me_split2_mf (me, ref); SCHRO_ASSERT (mf); mv_ref[ref] = mf->motion_vectors + (j + jj) * xnum_blocks + i + ii; *mv = *mv_ref[ref]; mv->split = 2; mv->pred_mode = ref + 1; mv->using_global = 0; entropy[ref] = schro_motion_block_estimate_entropy (motion, i + ii, j + jj); schro_get_split2_metric (me, ref, i + ii, j + jj, mv, &error, fd); score = entropy[ref] + error * lambda; if (min_score > score) { min_score = score; best_mv = *mv; best_entropy = entropy[ref]; best_error = mv->metric; } } /* do biref, if available */ if (1 < params->num_refs) { /* Note: I need to calculate the cost of biref prediction */ biref = TRUE; /* flag - either or both MVs could be outside frame+ext */ mv->u.vec.dx[0] = mv_ref[0]->u.vec.dx[0]; mv->u.vec.dy[0] = mv_ref[0]->u.vec.dy[0]; mv->u.vec.dx[1] = mv_ref[1]->u.vec.dx[1]; mv->u.vec.dy[1] = mv_ref[1]->u.vec.dy[1]; mv->pred_mode = 3; mv->using_global = 0; for (k = 0; 3 > k; ++k) { int tmp_x; int tmp_y; /* fetch dource data for all components */ schro_frame_get_data (orig_frame, &orig[k], k, (i + ii) * comp_w[k], (j + jj) * comp_h[k]); width[k] = MIN (comp_w[k], orig[k].width); height[k] = MIN (comp_h[k], orig[k].height); tmp_x = (i + ii) * (comp_w[k] << mvprec); tmp_y = (j + jj) * (comp_h[k] << mvprec); for (ref = 0; params->num_refs > ref; ++ref) { dx[ref] = mv->u.vec.dx[ref]; dx[ref] >>= 0 == k ? 0 : SCHRO_CHROMA_FORMAT_H_SHIFT (params-> video_format->chroma_format); dx[ref] += tmp_x; dy[ref] = mv->u.vec.dy[ref]; dy[ref] >>= 0 == k ? 0 : SCHRO_CHROMA_FORMAT_V_SHIFT (params-> video_format->chroma_format); dy[ref] += tmp_y; if (0 == k && biref && (xmin > dx[ref] || ymin > dy[ref] || !(xmax > dx[ref] + width[k] - 1) || !(ymax > dy[ref] + height[k] - 1))) { biref = FALSE; break; } /* I need to save the original value of fd width and height */ fd_width = fd[ref].width; fd_height = fd[ref].height; fd[ref].width = width[k]; fd[ref].height = height[k]; upframe[ref] = schro_me_ref (me, ref); schro_upsampled_frame_get_block_fast_precN (upframe[ref], k, dx[ref] , dy[ref], mvprec, &ref_data[k][ref], &fd[ref]); fd[ref].width = fd_width; fd[ref].height = fd_height; } } if (biref) { mv->metric = schro_metric_get_biref (&orig[0], &ref_data[0][0], 1, &ref_data[0][1], 1, 1, width[0], height[0]); mv->chroma_metric = 0; for (k = 1; 3 > k; ++k) { mv->chroma_metric += schro_metric_get_biref (&orig[k], &ref_data[k][0], 1, &ref_data[k][1], 1, 1, width[k], height[k]); } score = entropy[0] + entropy[1] + (mv->metric + mv->chroma_metric) * lambda; if (min_score > score) { best_error = mv->metric + mv->chroma_metric; best_entropy = entropy[0] + entropy[1]; best_mv = *mv; min_score = score; } } } /* FIXME: magic used for considering DC prediction */ if (4 * (width[0] * height[0] + 2 * width[1] * height[1]) < best_error) { /* let's consider DC prediction */ SchroMotionVector *mvdc; int k; int ok = TRUE; mvdc = (SchroMotionVector *) mv; mvdc->pred_mode = 0; mvdc->split = 2; mvdc->using_global = 0; error = 0; for (k = 0; 3 > k; ++k) { int tmp = schro_block_average (&mvdc->u.dc.dc[k], orig_frame->components + k, (i + ii) * comp_w[k], (j + jj) * comp_h[k], comp_w[k], comp_h[k]); if (SCHRO_METRIC_INVALID_2 == tmp) { SCHRO_DEBUG ("Invalid DC metric"); mvdc->metric = INT_MAX; ok = FALSE; } else { error += tmp; } } if (ok) { mvdc->metric = error; /* FIXME: we're assuming that the block doesn't have any predictor */ entropy[0] = schro_pack_estimate_sint (mvdc->u.dc.dc[0]); entropy[0] += schro_pack_estimate_sint (mvdc->u.dc.dc[1]); entropy[0] += schro_pack_estimate_sint (mvdc->u.dc.dc[2]); if (error < best_error) { best_mv = *(SchroMotionVector *) mvdc; best_error = mvdc->metric; best_entropy = entropy[0]; } } } *mv = best_mv; total_error += best_error; total_entropy += best_entropy; block->mv[jj][ii] = best_mv; } } block->valid = TRUE; block->error = total_error; block->entropy = total_entropy; block->score = total_entropy + lambda * total_error; } static void set_split1_motion (SchroMotion * motion, int i, int j) { SchroParams *params = motion->params; int xnum_blocks = params->x_num_blocks; SchroMotionVector *mv = motion->motion_vectors + j * xnum_blocks + i; *(mv + 1) = *mv; *(mv + xnum_blocks) = *mv; *(mv + xnum_blocks + 1) = *mv; } static int mv_already_in_list (SchroMotionVector * hint_list[], int len, SchroMotionVector * candidate_mv, int ref, int shift) { int i; for (i = 0; len > i; ++i) { if ((candidate_mv->u.vec.dx[ref] << shift) == hint_list[i]->u.vec.dx[ref] && (candidate_mv->u.vec.dy[ref] << shift) == hint_list[i]->u.vec.dy[ref]) { return TRUE; } } return FALSE; } /* select a MV for a split1 block based on 5 seeds the four split 2 MVs and the MV from rough ME, level 1. The selection of the MV is based on actual cost, not just SAD */ static void schro_get_best_mv_split1 (SchroMe * me, int ref, int i, int j, SchroMotionVector * mv_ref, int *error, int *entropy, SchroFrameData * fd) { SchroMotionVector *hint_mv[6], *mv_motion; SchroMotionVector *mv, temp_mv = { 0 }; SchroMotionField *mf; SchroParams *params = schro_me_params (me); SchroFrameData orig[3], ref_data[3]; SchroFrame *frame = schro_me_src (me); SchroUpsampledFrame *upframe; SchroMotion *motion = schro_me_motion (me); int n = 0, ii, jj, m = 0, min_m, metric, ent; int mv_prec = params->mv_precision; int fd_width, fd_height; double score, min_score, lambda = schro_me_lambda (me); int xblen, yblen, width[3], height[3], dx, dy; int comp_w[3], comp_h[3]; int k; int xmin, xmax, ymin, ymax, tmp_x, tmp_y; int best_error = INT_MAX, best_entropy = INT_MAX; int best_chroma_error = INT_MAX; int block_x[3], block_y[3]; SchroHierBm *hbm; xblen = params->xbsep_luma << 1; yblen = params->ybsep_luma << 1; xmin = ymin = -frame->extension; xmax = (frame->width << mv_prec) + frame->extension; ymax = (frame->height << mv_prec) + frame->extension; /* calculate split1 block sizes for all components */ comp_w[0] = xblen; comp_h[0] = yblen; comp_w[1] = comp_w[2] = xblen >> SCHRO_CHROMA_FORMAT_H_SHIFT (params->video_format->chroma_format); comp_h[1] = comp_h[2] = yblen >> SCHRO_CHROMA_FORMAT_V_SHIFT (params->video_format->chroma_format); /* calculates split2 block sizes for all components */ block_x[0] = params->xbsep_luma; block_y[0] = params->ybsep_luma; block_x[1] = block_x[2] = block_x[0] >> SCHRO_CHROMA_FORMAT_H_SHIFT (params-> video_format->chroma_format); block_y[1] = block_y[2] = block_y[0] >> SCHRO_CHROMA_FORMAT_V_SHIFT (params-> video_format->chroma_format); SCHRO_ASSERT (motion); mv_motion = motion->motion_vectors + j * params->x_num_blocks + i; for (k = 0; 3 > k; ++k) { /* get source data if possible */ if (!schro_frame_get_data (frame, &orig[k], k, i * block_x[k], j * block_y[k])) { *mv_ref = temp_mv; mv_ref->metric = INT_MAX; mv_ref->pred_mode = ref + 1; *error = INT_MAX; *mv_motion = *mv_ref; *entropy = schro_motion_block_estimate_entropy (motion, i, j); return; } width[k] = MIN (comp_w[k], orig[k].width); height[k] = MIN (comp_h[k], orig[k].height); } /* inherit from split 2 level MV */ mf = schro_me_subpel_mf (me, ref); SCHRO_ASSERT (mf); for (jj = 0; 2 > jj; ++jj) { for (ii = 0; 2 > ii; ++ii) { mv = mf->motion_vectors + (j + jj) * mf->x_num_blocks + i + ii; if (SCHRO_METRIC_INVALID != mv->metric) { if ((0 < n && !mv_already_in_list (hint_mv, n, mv, ref, mv_prec)) || 0 == n) { hint_mv[n++] = mv; } } } } /* inherit from stage 1 of hier. BM */ hbm = schro_me_hbm (me, ref); SCHRO_ASSERT (hbm); mf = schro_hbm_motion_field (hbm, 1); SCHRO_ASSERT (mf); mv = mf->motion_vectors + j * mf->x_num_blocks + i; if (INT_MAX != mv->metric) { if ((0 < n && !mv_already_in_list (hint_mv, n, mv, ref, mv_prec)) || 0 == n) { temp_mv = *mv; temp_mv.u.vec.dx[ref] <<= mv_prec; temp_mv.u.vec.dy[ref] <<= mv_prec; hint_mv[n++] = &temp_mv; } } /* now pick the best candidate */ min_m = -1; min_score = HUGE_VAL; upframe = schro_me_ref (me, ref); for (m = 0; n > m; ++m) { int chroma_metric = 0; int ok = TRUE; metric = 0; for (k = 0; 3 > k; ++k) { tmp_x = (i * block_x[k]) << mv_prec; tmp_y = (j * block_y[k]) << mv_prec; dx = hint_mv[m]->u.vec.dx[ref]; dx >>= 0 == k ? 0 : SCHRO_CHROMA_FORMAT_H_SHIFT (params->video_format->chroma_format); dx += tmp_x; dy = hint_mv[m]->u.vec.dy[ref]; dy >>= 0 == k ? 0 : SCHRO_CHROMA_FORMAT_V_SHIFT (params->video_format->chroma_format); dy += tmp_y; if (0 == k && (xmin > dx || ymin > dy || !(xmax > dx + width[k] - 1) || !(ymax > dy + height[k] - 1))) { k = 3; ok = FALSE; continue; } /* I need to save the original value of fd width and height */ fd_width = fd->width; fd_height = fd->height; fd->width = width[k]; fd->height = height[k]; schro_upsampled_frame_get_block_fast_precN (upframe, k, dx, dy, mv_prec, &ref_data[k], fd); fd->width = fd_width; fd->height = fd_height; if (0 == k) { metric = schro_metric_absdiff_u8 (orig[0].data, orig[0].stride, ref_data[0].data, ref_data[0].stride, width[0], height[0]); } else { chroma_metric += schro_metric_absdiff_u8 (orig[k].data, orig[k].stride, ref_data[k].data, ref_data[k].stride, width[k], height[k]); } } if (ok) { *mv_motion = *hint_mv[m]; mv_motion->split = 1; mv_motion->pred_mode = ref + 1; ent = schro_motion_block_estimate_entropy (motion, i, j); score = ent + (metric + chroma_metric) * lambda; if (min_score > score) { min_score = score; min_m = m; best_entropy = ent; best_error = metric; best_chroma_error = chroma_metric; } } } if (-1 < min_m) { *error = best_error + best_chroma_error; *entropy = best_entropy; *mv_ref = *hint_mv[min_m]; mv_ref->metric = best_error >> 2; mv_ref->chroma_metric = best_chroma_error >> 2; mv_ref->split = 1; mv_ref->pred_mode = ref + 1; } else mv_ref->metric = INT_MAX; } /* performs mode decision for a superblock, split level 1 */ static void schro_do_split1 (SchroMe * me, int i, int j, SchroBlock * block, SchroFrameData * fd) { SchroParams *params = schro_me_params (me); SchroMotion *motion = schro_me_motion (me); SchroFrame *orig_frame = schro_me_src (me); SchroFrameData ref_data[3][2], orig[3]; SchroUpsampledFrame *upframe[2]; SchroMotionField *mf; double lambda = schro_me_lambda (me); int ii, jj, ref, biref, k; int total_entropy = 0, total_error = 0; int mvprec = params->mv_precision; int xblen = params->xbsep_luma * 2, yblen = params->ybsep_luma * 2; int width[3], height[3], dx[2], dy[2], tmp_x, tmp_y; int fd_width, fd_height; int xmin, xmax, ymin, ymax; int comp_h[3], comp_w[3]; int block_x[3], block_y[3]; xmin = ymin = -orig_frame->extension; xmax = (orig_frame->width << mvprec) + orig_frame->extension; ymax = (orig_frame->height << mvprec) + orig_frame->extension; comp_w[0] = xblen; comp_h[0] = yblen; comp_w[1] = comp_w[2] = xblen >> SCHRO_CHROMA_FORMAT_H_SHIFT (params->video_format->chroma_format); comp_h[1] = comp_h[2] = yblen >> SCHRO_CHROMA_FORMAT_V_SHIFT (params->video_format->chroma_format); block_x[0] = params->xbsep_luma; block_y[0] = params->ybsep_luma; block_x[1] = block_x[2] = block_x[0] >> SCHRO_CHROMA_FORMAT_H_SHIFT (params-> video_format->chroma_format); block_y[1] = block_y[2] = block_y[0] >> SCHRO_CHROMA_FORMAT_V_SHIFT (params-> video_format->chroma_format); block->valid = TRUE; for (jj = 0; 4 > jj; jj += 2) { for (ii = 0; 4 > ii; ii += 2) { double score, min_score = HUGE_VAL; int entropy[2], error = INT_MAX; int best_entropy = INT_MAX, best_chroma_error = INT_MAX, best_error = INT_MAX; /* Note that the metric for the split 1 block will be stored in best_mv * but divided by 4 */ SchroMotionVector *mv, best_mv = { 0 }, mv_ref[2], *mv_split1; best_mv.split = 1; best_mv.pred_mode = 1; mv = motion->motion_vectors + (j + jj) * params->x_num_blocks + i + ii; /* check that the block lies within the frame */ if (!(orig_frame->width > (i + ii) * params->xbsep_luma) || !(orig_frame->height > (j + jj) * params->ybsep_luma)) { /* the block lies outside the frame, set both block and motion * to a zero mv, split 1, forward predicted */ int pred_x, pred_y; *mv = best_mv; mv->pred_mode = schro_motion_get_mode_prediction (motion, i + ii, j + jj); if (mv->pred_mode != 1 && mv->pred_mode != 2) mv->pred_mode = 1; schro_motion_vector_prediction (motion, i + ii, j + jj, &pred_x, &pred_y, 1); mv->u.vec.dx[mv->pred_mode - 1] = pred_x; mv->u.vec.dy[mv->pred_mode - 1] = pred_y; block->mv[jj][ii] = *mv; set_split1_motion (motion, i + ii, j + jj); total_entropy += 2; mf = schro_me_split1_mf (me, 0); SCHRO_ASSERT (mf); mv_split1 = mf->motion_vectors + (j + jj) * params->x_num_blocks + i + ii; *mv_split1 = best_mv; if (1 < params->num_refs) { mf = schro_me_split1_mf (me, 1); SCHRO_ASSERT (mf); mv_split1 = mf->motion_vectors + (j + jj) * params->x_num_blocks + i + ii; *mv_split1 = best_mv; mv_split1->pred_mode = 2; } continue; } mv->metric = INT_MAX; mv->chroma_metric = INT_MAX; best_mv.metric = INT_MAX; best_mv.chroma_metric = INT_MAX; /* do the 2 references, if available */ for (ref = 0; params->num_refs > ref; ++ref) { mf = schro_me_split1_mf (me, ref); SCHRO_ASSERT (mf); mv_split1 = mf->motion_vectors + (j + jj) * params->x_num_blocks + i + ii; schro_get_best_mv_split1 (me, ref, i + ii, j + jj, &mv_ref[ref] , &error, &entropy[ref], fd); *mv_split1 = mv_ref[ref]; if (INT_MAX != mv_ref[ref].metric) { score = entropy[ref] + lambda * error; if (min_score > score) { min_score = score; best_mv = mv_ref[ref]; best_entropy = entropy[ref]; best_error = error; } } } /* do biref if available */ if (1 < params->num_refs && SCHRO_METRIC_INVALID != mv_ref[0].metric && SCHRO_METRIC_INVALID != mv_ref[1].metric) { /* I'm going to use the two best MVs from previous steps * Note: I need to calculate the cost and entropy of biref */ mv_ref[0].u.vec.dx[1] = mv_ref[1].u.vec.dx[1]; mv_ref[0].u.vec.dy[1] = mv_ref[1].u.vec.dy[1]; mv_ref[0].pred_mode = 3; biref = TRUE; for (k = 0; 3 > k; ++k) { schro_frame_get_data (orig_frame, &orig[k], k, (i + ii) * block_x[k], (j + jj) * block_y[k]); width[k] = MIN (comp_w[k], orig[k].width); height[k] = MIN (comp_h[k], orig[k].height); tmp_x = (i + ii) * (block_x[k] << mvprec); tmp_y = (j + jj) * (block_y[k] << mvprec); for (ref = 0; params->num_refs > ref; ++ref) { dx[ref] = mv_ref[0].u.vec.dx[ref]; dx[ref] >>= 0 == k ? 0 : SCHRO_CHROMA_FORMAT_H_SHIFT (params-> video_format->chroma_format); dx[ref] += tmp_x; dy[ref] = mv_ref[0].u.vec.dy[ref]; dy[ref] >>= 0 == k ? 0 : SCHRO_CHROMA_FORMAT_V_SHIFT (params-> video_format->chroma_format); dy[ref] += tmp_y; /* check whether we can extract reference blocks */ if (0 == k && biref && (xmin > dx[ref] || ymin > dy[ref] || !(xmax > dx[ref] + width[k] - 1) || !(ymax > dy[ref] + height[k] - 1))) { biref = FALSE; k = 3; break; } /* I need to save the original value of fd width and height */ fd_width = fd[ref].width; fd_height = fd[ref].height; fd[ref].width = width[k]; fd[ref].height = height[k]; upframe[ref] = schro_me_ref (me, ref); schro_upsampled_frame_get_block_fast_precN (upframe[ref], k, dx[ref], dy[ref], mvprec, &ref_data[k][ref], &fd[ref]); fd[ref].width = fd_width; fd[ref].height = fd_height; } } if (biref) { int chroma_error = 0; error = 0; error = schro_metric_get_biref (&orig[0], &ref_data[0][0], 1, &ref_data[0][1], 1, 1, width[0], height[0]); for (k = 1; 3 > k; ++k) { chroma_error += schro_metric_get_biref (&orig[k], &ref_data[k][0], 1, &ref_data[k][1], 1, 1, width[k], height[k]); } score = entropy[0] + entropy[1] + lambda * (error + chroma_error); mv_ref[0].metric = error >> 2; mv_ref[0].chroma_metric = chroma_error >> 2; if (min_score > score) { best_error = error; best_chroma_error = chroma_error; best_entropy = entropy[0] + entropy[1]; best_mv = mv_ref[0]; min_score = score; } } } if (SCHRO_METRIC_INVALID == best_mv.metric) { block->valid = FALSE; } else { *mv = best_mv; total_error += best_error + best_chroma_error; total_entropy += best_entropy; block->mv[jj][ii] = best_mv; set_split1_motion (motion, i + ii, j + jj); } } } block->error = total_error; block->entropy = total_entropy; block->score = total_entropy + lambda * total_error; } static void schro_get_best_split0_mv (SchroMe * me, int ref, int i, int j, SchroMotionVector * mv_ref, int *error, int *entropy, SchroFrameData * fd) { SchroMotionVector *hint_mv[6], *mv_motion; SchroMotionVector *mv, temp_mv = { 0 }; SchroMotionField *mf; SchroParams *params = schro_me_params (me); SchroFrameData orig[3], ref_data[3]; SchroFrame *frame = schro_me_src (me); SchroUpsampledFrame *upframe; SchroHierBm *hbm; SchroMotion *motion = schro_me_motion (me); int n = 0, m = 0, min_m = -1, metric = 0, ent; int mv_prec = params->mv_precision; int fd_width, fd_height, jj, ii; int k; double score, min_score = HUGE_VAL, lambda = schro_me_lambda (me); int width[3], height[3], dx, dy, xmin, xmax, ymin, ymax, tmp_x, tmp_y; int best_error = INT_MAX, best_chroma_error = INT_MAX, best_entropy = INT_MAX; int comp_w[3], comp_h[3]; /* split2 block sizes for all components */ int block_x[3], block_y[3]; block_x[0] = params->xbsep_luma; block_y[0] = params->ybsep_luma; block_x[1] = block_x[2] = block_x[0] >> SCHRO_CHROMA_FORMAT_H_SHIFT (params-> video_format->chroma_format); block_y[1] = block_y[2] = block_y[0] >> SCHRO_CHROMA_FORMAT_V_SHIFT (params-> video_format->chroma_format); /* split0 block sizes for all components */ comp_w[0] = block_x[0] << 2; comp_h[0] = block_y[0] << 2; comp_w[1] = comp_w[2] = comp_w[0] >> SCHRO_CHROMA_FORMAT_H_SHIFT (params-> video_format->chroma_format); comp_h[1] = comp_h[2] = comp_h[0] >> SCHRO_CHROMA_FORMAT_V_SHIFT (params-> video_format->chroma_format); xmin = -frame->extension; ymin = -frame->extension; xmax = (frame->width << mv_prec) + frame->extension; ymax = (frame->height << mv_prec) + frame->extension; /* get source data if possible */ for (k = 0; 3 > k; ++k) { if (!schro_frame_get_data (frame, &orig[k], k, i * block_x[k], j * block_y[k])) { /* this should never happen */ SCHRO_ASSERT (0); } width[k] = MIN (comp_w[k], orig[k].width); height[k] = MIN (comp_h[k], orig[k].height); } mv_motion = motion->motion_vectors + j * params->x_num_blocks + i; /* inherit from split 1 level MV */ mf = schro_me_split1_mf (me, ref); SCHRO_ASSERT (mf); for (jj = 0; 4 > jj; jj += 2) { for (ii = 0; 4 > ii; ii += 2) { mv = mf->motion_vectors + (j + jj) * mf->x_num_blocks + i + ii; if (INT_MAX != mv->metric) { if ((0 < n && !mv_already_in_list (hint_mv, n, mv, ref, 0)) || 0 == n) { hint_mv[n++] = mv; } } } } /* inherit from stage 2 of hier. BM */ hbm = schro_me_hbm (me, ref); SCHRO_ASSERT (hbm); mf = schro_hbm_motion_field (hbm, 2); mv = mf->motion_vectors + j * mf->x_num_blocks + i; if (INT_MAX != mv->metric) { if ((0 < n && !mv_already_in_list (hint_mv, n, mv, ref, mv_prec)) || 0 == n) { temp_mv = *mv; temp_mv.u.vec.dx[ref] <<= mv_prec; temp_mv.u.vec.dy[ref] <<= mv_prec; hint_mv[n++] = &temp_mv; } } /* now pick the best candidate */ tmp_x = (i * params->xbsep_luma) << mv_prec; tmp_y = (j * params->ybsep_luma) << mv_prec; upframe = schro_me_ref (me, ref); for (m = 0; n > m; ++m) { int ok = TRUE; int chroma_metric = 0; for (k = 0; 3 > k; ++k) { tmp_x = (i * block_x[k]) << mv_prec; tmp_y = (j * block_y[k]) << mv_prec; dx = hint_mv[m]->u.vec.dx[ref]; dx >>= 0 == k ? 0 : SCHRO_CHROMA_FORMAT_H_SHIFT (params->video_format->chroma_format); dx += tmp_x; dy = hint_mv[m]->u.vec.dy[ref]; dy >>= 0 == k ? 0 : SCHRO_CHROMA_FORMAT_V_SHIFT (params->video_format->chroma_format); dy += tmp_y; if (0 == k && (xmin > dx || ymin > dy || !(xmax > dx + width[k] - 1) || !(ymax > dy + height[k] - 1))) { ok = FALSE; k = 3; continue; } if (ok) { /* I need to save the original values of fd width and height */ fd_width = fd->width; fd_height = fd->height; fd->width = width[k]; fd->height = height[k]; schro_upsampled_frame_get_block_fast_precN (upframe, k, dx, dy, mv_prec, &ref_data[k], fd); fd->width = fd_width; fd->height = fd_height; if (0 == k) { metric = schro_metric_absdiff_u8 (orig[0].data, orig[0].stride, ref_data[0].data, ref_data[0].stride, width[0], height[0]); } else { chroma_metric += schro_metric_absdiff_u8 (orig[k].data, orig[k].stride, ref_data[k].data, ref_data[k].stride, width[k], height[k]); } } } if (ok) { *mv_motion = *hint_mv[m]; mv_motion->split = 0; mv_motion->pred_mode = ref + 1; ent = schro_motion_block_estimate_entropy (motion, i, j); score = ent + lambda * (metric + chroma_metric); if (min_score > score) { min_score = score; min_m = m; best_entropy = ent; best_error = metric; best_chroma_error = chroma_metric; } } } if (-1 < min_m) { *error = best_error + best_chroma_error; *entropy = best_entropy; *mv_ref = *hint_mv[min_m]; mv_ref->metric = best_error >> 4; mv_ref->chroma_metric = best_chroma_error >> 4; mv_ref->split = 0; mv_ref->pred_mode = ref + 1; } else mv_ref->metric = INT_MAX; } static void schro_do_split0_biref (SchroMe * me, int i, int j, SchroBlock * block, SchroFrameData * fd) { SchroParams *params = schro_me_params (me); int entropy = 0; SchroMotion *motion = schro_me_motion (me); SchroMotionVector *mv_motion; SchroFrame *orig_frame = schro_me_src (me); SchroFrameData ref_data[3][2], orig[3]; SchroUpsampledFrame *upframe[2]; double lambda = schro_me_lambda (me); int mv_prec = params->mv_precision; int width[3], height[3], dx[2], dy[2], tmp_x, tmp_y; int ref, error = INT_MAX; int xmin = -orig_frame->extension; int ymin = -orig_frame->extension; int xmax = (orig_frame->width << mv_prec) + orig_frame->extension; int ymax = (orig_frame->height << mv_prec) + orig_frame->extension; int biref, fd_width, fd_height; int k; /* split2 block sizes for all components */ int block_x[3], block_y[3]; int comp_w[3], comp_h[3]; SchroMotionVector *mv; block->valid = FALSE; mv_motion = motion->motion_vectors + j * params->x_num_blocks + i; mv = &block->mv[0][0]; mv->split = 0; mv->pred_mode = 3; mv->using_global = 0; *mv_motion = *mv; entropy = schro_motion_block_estimate_entropy (motion, i, j); block_x[0] = params->xbsep_luma; block_y[0] = params->ybsep_luma; block_x[1] = block_x[2] = block_x[0] >> SCHRO_CHROMA_FORMAT_H_SHIFT (params-> video_format->chroma_format); block_y[1] = block_y[2] = block_y[0] >> SCHRO_CHROMA_FORMAT_V_SHIFT (params-> video_format->chroma_format); /* split0 block sizes for all components */ comp_w[0] = block_x[0] << 2; comp_h[0] = block_y[0] << 2; comp_w[1] = comp_w[2] = comp_w[0] >> SCHRO_CHROMA_FORMAT_H_SHIFT (params-> video_format->chroma_format); comp_h[1] = comp_h[2] = comp_h[0] >> SCHRO_CHROMA_FORMAT_V_SHIFT (params-> video_format->chroma_format); /* do biref, if available */ biref = TRUE; /* fetch source data */ for (k = 0; 3 > k; ++k) { if (schro_frame_get_data (orig_frame, &orig[k], k, i * block_x[k], j * block_y[k])) { width[k] = MIN (orig[k].width, comp_w[k]); height[k] = MIN (orig[k].height, comp_h[k]); } else { biref = FALSE; break; } } if (biref) { /* fetch reference data, if possible */ for (ref = 0; params->num_refs > ref; ++ref) { for (k = 0; 3 > k && biref; ++k) { tmp_x = (i * block_x[k]) << mv_prec; tmp_y = (j * block_y[k]) << mv_prec; dx[ref] = mv->u.vec.dx[ref]; dx[ref] >>= 0 == k ? 0 : SCHRO_CHROMA_FORMAT_H_SHIFT (params->video_format->chroma_format); dx[ref] += tmp_x; dy[ref] = mv->u.vec.dy[ref]; dy[ref] >>= 0 == k ? 0 : SCHRO_CHROMA_FORMAT_V_SHIFT (params->video_format->chroma_format); dy[ref] += tmp_y; /* check whether we can extract reference blocks */ if (0 == k && (xmin > dx[ref] || ymin > dy[ref] || !(xmax > dx[ref] + width[k] - 1) || !(ymax > dy[ref] + height[k] - 1))) { biref = FALSE; break; } else { fd_width = fd[ref].width; fd_height = fd[ref].height; fd[ref].width = width[k]; fd[ref].height = height[k]; upframe[ref] = schro_me_ref (me, ref); schro_upsampled_frame_get_block_fast_precN (upframe[ref], k, dx[ref], dy[ref], mv_prec, &ref_data[k][ref], &fd[ref]); fd[ref].width = fd_width; fd[ref].height = fd_height; } } } if (biref) { int chroma_error = 0; error = schro_metric_get_biref (&orig[0], &ref_data[0][0], 1, &ref_data[0][1], 1, 1, width[0], height[0]); for (k = 1; 3 > k; ++k) { chroma_error += schro_metric_get_biref (&orig[k], &ref_data[k][0], 1, &ref_data[k][1], 1, 1, width[k], height[k]); } mv->metric = error >> 4; mv->chroma_metric = chroma_error >> 4; block->entropy = entropy; block->error = error + chroma_error; block->score = block->entropy + lambda * block->error; block->valid = TRUE; } } } static void schro_do_split0_biref_zero (SchroMe * me, int i, int j, SchroBlock * block, SchroFrameData * fd) { SchroParams *params = schro_me_params (me); SchroMotionVector *mv; SCHRO_ASSERT (1 < params->num_refs); mv = &block->mv[0][0]; mv->split = 0; mv->pred_mode = 3; mv->using_global = 0; mv->u.vec.dx[0] = 0; mv->u.vec.dy[0] = 0; mv->u.vec.dx[1] = 0; mv->u.vec.dy[1] = 0; schro_do_split0_biref (me, i, j, block, fd); } /* performs mode decision for a superblock, split level 0 */ static void schro_do_split0 (SchroMe * me, int i, int j, SchroBlock * block, SchroFrameData * fd) { SchroParams *params = schro_me_params (me); SchroMotionField *mf; SchroMotionVector mv_ref[2], best_mv = { 0 }, *mv_split0; double lambda = schro_me_lambda (me); int ref; int error = INT_MAX; int entropy[2]; int best_error = INT_MAX; int best_entropy = INT_MAX; double score, min_score = HUGE_VAL; best_mv.metric = INT_MAX; block->valid = FALSE; /* do the 2 references, if available */ for (ref = 0; params->num_refs > ref; ++ref) { mf = schro_me_split0_mf (me, ref); SCHRO_ASSERT (mf); mv_split0 = mf->motion_vectors + j * params->x_num_blocks + i; schro_get_best_split0_mv (me, ref, i, j, &mv_ref[ref], &error, &entropy[ref], fd); *mv_split0 = mv_ref[ref]; if (INT_MAX != mv_ref[ref].metric) { score = entropy[ref] + lambda * error; if (min_score > score) { min_score = score; best_mv = mv_ref[ref]; best_entropy = entropy[ref]; best_error = error; } } } /* do biref, if available */ if (1 < params->num_refs && INT_MAX != mv_ref[0].metric && INT_MAX != mv_ref[1].metric) { SchroBlock biref_block = { 0 }; SchroMotionVector *mv; mv = &biref_block.mv[0][0]; mv->split = 0; mv->pred_mode = 3; mv->using_global = 0; mv->u.vec.dx[0] = mv_ref[0].u.vec.dx[0]; mv->u.vec.dy[0] = mv_ref[0].u.vec.dy[0]; mv->u.vec.dx[1] = mv_ref[1].u.vec.dx[1]; mv->u.vec.dy[1] = mv_ref[1].u.vec.dy[1]; mv->metric = INT_MAX; schro_do_split0_biref (me, i, j, &biref_block, fd); if (biref_block.valid && min_score > biref_block.score) { min_score = biref_block.score; best_mv = biref_block.mv[0][0]; best_error = biref_block.error; best_entropy = biref_block.entropy; } } if (INT_MAX == best_mv.metric) { block->valid = FALSE; } else { block->valid = TRUE; block->error = best_error; block->entropy = best_entropy; block->score = best_entropy + lambda * best_error; block->mv[0][0] = best_mv; } } /* performs mode decision and block/superblock splitting */ void schro_mode_decision (SchroMe * me) { SchroParams *params = schro_me_params (me); SchroFrameData fd[2]; SchroMotion *motion = schro_me_motion (me); int i, j, ref; double total_error = 0.0; int block_size; int badblocks = 0, dcblocks = 0; double min_score; int k, l; block_size = 16 * params->xbsep_luma * params->ybsep_luma; fd[0].data = fd[1].data = NULL; if (1 < params->mv_precision) { for (ref = 0; params->num_refs > ref; ++ref) { fd[ref].data = schro_malloc (block_size * sizeof (uint8_t)); fd[ref].stride = fd[ref].width = params->xbsep_luma << 2; fd[ref].height = params->ybsep_luma << 2; fd[ref].length = block_size * sizeof (uint8_t); fd[ref].h_shift = fd[ref].v_shift = 0; fd[ref].format = SCHRO_FRAME_FORMAT_U8_420; } } /* we're now using chroma info for MS, increase block size accordingly */ block_size = block_size * 2 / 3; /* loop over all superblocks. The indices are set to the value of the * top-left block in the SB, just like in Dave's bigblock estimation. * We'll start considering split 2 first, then split 1 and finally split 0 */ for (j = 0; params->y_num_blocks > j; j += 4) { for (i = 0; params->x_num_blocks > i; i += 4) { SchroBlock block = { 0 } , tryblock = { 0}; schro_do_split2 (me, i, j, &block, fd); min_score = block.score; /* note: do_split1 writes to motion */ schro_do_split1 (me, i, j, &tryblock, fd); if (tryblock.valid) { if (min_score > tryblock.score) { memcpy (&block, &tryblock, sizeof (block)); schro_block_fixup (&block); /* I need to overwrite motion because it's needed to estimate * entropy at split 0 */ schro_motion_copy_to (motion, i, j, &block); min_score = block.score; /* Note: only do split0 if split1 better than split2 */ schro_do_split0 (me, i, j, &tryblock, fd); if (tryblock.valid) { if (min_score > tryblock.score) { memcpy (&block, &tryblock, sizeof (block)); schro_block_fixup (&block); } } } } if (1 < params->num_refs) { schro_do_split0_biref_zero (me, i, j, &tryblock, fd); if (tryblock.valid) { if (min_score > tryblock.score) { memcpy (&block, &tryblock, sizeof (block)); schro_block_fixup (&block); } } } schro_motion_copy_to (motion, i, j, &block); if (block.error > 10 * block_size) { ++badblocks; } for (k = 0; 4 > k; ++k) { for (l = 0; 4 > l; ++l) { if (0 == block.mv[k][l].pred_mode) { ++dcblocks; } } } total_error += (double) block.error * block.error / (double) (block_size * block_size); } } schro_me_set_mc_error (me, total_error / (240.0 * 240.0) / params->x_num_blocks * params->y_num_blocks / 16); schro_me_set_badblock_ratio (me, ((double) badblocks) / (params->x_num_blocks * params->y_num_blocks / 16)); schro_me_set_dcblock_ratio (me, ((double) dcblocks) / (params->x_num_blocks * params->y_num_blocks)); if (1 < params->mv_precision) { for (ref = 0; params->num_refs > ref; ++ref) { schro_free (fd[ref].data); } } } struct SchroMeElement { SchroUpsampledFrame *ref; SchroMotionField *subpel_mf; SchroMotionField *split2_mf; SchroMotionField *split1_mf; SchroMotionField *split0_mf; SchroHierBm *hbm; }; typedef struct SchroMeElement *SchroMeElement; /* supports motion estimation */ struct _SchroMe { SchroFrame *src; SchroParams *params; double lambda; SchroMotion *motion; double mc_error; double badblocks_ratio; double dcblock_ratio; SchroMeElement meElement[2]; }; static SchroMeElement schro_me_element_new (SchroEncoderFrame * frame, int ref_number) { SchroMeElement me; me = schro_malloc0 (sizeof (struct SchroMeElement)); SCHRO_ASSERT (frame && (0 == ref_number || 1 == ref_number)); SCHRO_ASSERT (me); me->ref = frame->ref_frame[ref_number]->upsampled_original_frame; me->hbm = schro_hbm_ref (frame->hier_bm[ref_number]); return me; } static void schro_me_element_free (SchroMeElement * pme) { SchroMeElement me = *pme; if (me) { if (me->hbm) schro_hbm_unref (me->hbm); if (me->subpel_mf) schro_motion_field_free (me->subpel_mf); if (me->split2_mf) schro_motion_field_free (me->split2_mf); if (me->split1_mf) schro_motion_field_free (me->split1_mf); if (me->split0_mf) schro_motion_field_free (me->split0_mf); schro_free (me); *pme = NULL; } } SchroMe * schro_me_new (SchroEncoderFrame * frame) { int ref; SchroMe *me = schro_malloc0 (sizeof (struct _SchroMe)); SCHRO_ASSERT (me); me->src = frame->filtered_frame; me->params = &frame->params; me->motion = frame->motion; me->lambda = frame->frame_me_lambda; for (ref = 0; me->params->num_refs > ref; ++ref) { me->meElement[ref] = schro_me_element_new (frame, ref); } return me; } void schro_me_free (SchroMe * me) { int ref; if (me) { for (ref = 0; me->params->num_refs > ref; ++ref) { schro_me_element_free (&me->meElement[ref]); } } schro_free (me); } SchroFrame * schro_me_src (SchroMe * me) { SCHRO_ASSERT (me); return me->src; } SchroUpsampledFrame * schro_me_ref (SchroMe * me, int ref_number) { SCHRO_ASSERT (me && (0 == ref_number || 1 == ref_number)); return me->meElement[ref_number]->ref; } SchroMotionField * schro_me_subpel_mf (SchroMe * me, int ref_number) { SCHRO_ASSERT (me && (0 == ref_number || 1 == ref_number)); return me->meElement[ref_number]->subpel_mf; } void schro_me_set_subpel_mf (SchroMe * me, SchroMotionField * mf, int ref_number) { SCHRO_ASSERT (me && (0 == ref_number || 1 == ref_number)); me->meElement[ref_number]->subpel_mf = mf; } SchroMotionField * schro_me_split2_mf (SchroMe * me, int ref_number) { SCHRO_ASSERT (me && (0 == ref_number || 1 == ref_number)); return me->meElement[ref_number]->split2_mf; } void schro_me_set_split2_mf (SchroMe * me, SchroMotionField * mf, int ref_number) { SCHRO_ASSERT (me && (0 == ref_number || 1 == ref_number)); me->meElement[ref_number]->split2_mf = mf; } SchroMotionField * schro_me_split1_mf (SchroMe * me, int ref_number) { SCHRO_ASSERT (me && (0 == ref_number || 1 == ref_number)); return me->meElement[ref_number]->split1_mf; } void schro_me_set_split1_mf (SchroMe * me, SchroMotionField * mf, int ref_number) { SCHRO_ASSERT (me && (0 == ref_number || 1 == ref_number)); me->meElement[ref_number]->split1_mf = mf; } SchroMotionField * schro_me_split0_mf (SchroMe * me, int ref_number) { SCHRO_ASSERT (me && (0 == ref_number || 1 == ref_number)); return me->meElement[ref_number]->split0_mf; } void schro_me_set_split0_mf (SchroMe * me, SchroMotionField * mf, int ref_number) { SCHRO_ASSERT (me && (0 == ref_number || 1 == ref_number)); me->meElement[ref_number]->split0_mf = mf; } SchroHierBm * schro_me_hbm (SchroMe * me, int ref_number) { SCHRO_ASSERT (me && (0 == ref_number || 1 == ref_number)); return me->meElement[ref_number]->hbm; } void schro_me_set_lambda (SchroMe * me, double lambda) { SCHRO_ASSERT (me); me->lambda = lambda; } double schro_me_lambda (SchroMe * me) { SCHRO_ASSERT (me); return me->lambda; } SchroParams * schro_me_params (SchroMe * me) { SCHRO_ASSERT (me); return me->params; } SchroMotion * schro_me_motion (SchroMe * me) { SCHRO_ASSERT (me); return me->motion; } void schro_me_set_motion (SchroMe * me, SchroMotion * motion) { SCHRO_ASSERT (me); me->motion = motion; } void schro_me_set_mc_error (SchroMe * me, double mc_error) { SCHRO_ASSERT (me); me->mc_error = mc_error; } double schro_me_mc_error (SchroMe * me) { SCHRO_ASSERT (me); return me->mc_error; } void schro_me_set_badblock_ratio (SchroMe * me, double badblocks_ratio) { SCHRO_ASSERT (me); me->badblocks_ratio = badblocks_ratio; } double schro_me_badblocks_ratio (SchroMe * me) { SCHRO_ASSERT (me); return me->badblocks_ratio; } void schro_me_set_dcblock_ratio (SchroMe * me, double dcblock_ratio) { SCHRO_ASSERT (me); me->dcblock_ratio = dcblock_ratio; } double schro_me_dcblock_ratio (SchroMe * me) { SCHRO_ASSERT (me); return me->dcblock_ratio; } schroedinger-1.0.11/schroedinger/schroutils.h0000644000175000017500000001013011704374071016212 00000000000000 #ifndef __SCHRO_UTILS_H__ #define __SCHRO_UTILS_H__ #if defined(_MSC_VER) #ifndef SCHRO_NO_STDINT_TYPEDEFS typedef __int8 int8_t; typedef __int16 int16_t; typedef __int32 int32_t; typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #else #include #endif #ifndef TRUE #define TRUE 1 #endif #ifndef FALSE #define FALSE 0 #endif typedef uint32_t SchroPictureNumber; typedef unsigned int schro_bool; /* This must match the CUDA stream type, as we don't want to include the CUDA includes in any of the Schroedinger include files. */ typedef int SchroCUDAStream; #ifdef SCHRO_ENABLE_UNSTABLE_API #if defined(_MSC_VER) #define inline __inline #endif #define SCHRO_PICTURE_NUMBER_INVALID (-1) #define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0])) #define DIVIDE_ROUND_UP(a,b) (((a) + (b) - 1)/(b)) #ifndef MIN #define MIN(a,b) ((a)<(b) ? (a) : (b)) #endif #ifndef MAX #define MAX(a,b) ((a)>(b) ? (a) : (b)) #endif #ifndef CLAMP #define CLAMP(x,a,b) ((x)<(a) ? (a) : ((x)>(b) ? (b) : (x))) #endif #define NEED_CLAMP(x,y,a,b) ((x) < (a) || (y) > (b)) #define ROUND_UP_SHIFT(x,y) (((x) + (1<<(y)) - 1)>>(y)) #define ROUND_UP_POW2(x,y) (((x) + (1<<(y)) - 1)&((~0)<<(y))) #define ROUND_UP_2(x) ROUND_UP_POW2(x,1) #define ROUND_UP_4(x) ROUND_UP_POW2(x,2) #define ROUND_UP_8(x) ROUND_UP_POW2(x,3) #define ROUND_UP_16(x) ROUND_UP_POW2(x,4) #define ROUND_UP_64(x) ROUND_UP_POW2(x,6) #define OFFSET(ptr,offset) ((void *)(((uint8_t *)(ptr)) + (offset))) #define ROUND_SHIFT(x,y) (((x) + (1<<((y)-1)))>>(y)) #define schro_divide(a,b) (((a)<0)?(((a) - (b) + 1)/(b)):((a)/(b))) #define schro_divide3(a) (((a)*21845 + 10922)>>16) #endif #define SCHRO_OFFSET(ptr,offset) ((void *)(((uint8_t *)(ptr)) + (offset))) #define SCHRO_GET(ptr, offset, type) (*(type *)((uint8_t *)(ptr) + (offset)) ) #if defined(__GNUC__) && defined(__GNUC_MINOR__) #define SCHRO_GNUC_PREREQ(maj, min) \ ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) #else #define SCHRO_GNUC_PREREQ(maj, min) 0 #endif #if SCHRO_GNUC_PREREQ(3,3) && defined(__ELF__) #define SCHRO_INTERNAL __attribute__ ((visibility ("internal"))) #else #define SCHRO_INTERNAL #endif #if SCHRO_GNUC_PREREQ(3,3) #define SCHRO_DEPRECATED __attribute__ ((deprecated)) #else #define SCHRO_DEPRECATED #endif #if SCHRO_GNUC_PREREQ(3,3) #define SCHRO_UNUSED __attribute__ ((unused)) #else #define SCHRO_UNUSED #endif #ifdef __cplusplus #define SCHRO_BEGIN_DECLS extern "C" { #define SCHRO_END_DECLS } #else #define SCHRO_BEGIN_DECLS #define SCHRO_END_DECLS #endif #if SCHRO_GNUC_PREREQ(3,0) && defined(__OPTIMIZE__) #define SCHRO_LIKELY(expr) (__builtin_expect ((expr), 1)) #define SCHRO_UNLIKELY(expr) (__builtin_expect ((expr), 0)) #else #define SCHRO_LIKELY(expr) (expr) #define SCHRO_UNLIKELY(expr) (expr) #endif #ifndef M_PI #define M_PI 3.14159265358979323846 #endif #ifndef M_LN10 #define M_LN10 2.30258509299404568402 #endif #if defined(_MSC_VER) #define rint(x) (floor((x) + 0.5)) #endif SCHRO_BEGIN_DECLS #ifdef SCHRO_ENABLE_UNSTABLE_API void * schro_malloc (int size); void * schro_malloc0 (int size); void * schro_realloc (void *ptr, int size); void schro_free (void *ptr); int muldiv64 (int a, int b, int c); int schro_utils_multiplier_to_quant_index (double x); int schro_dequantise (int q, int quant_factor, int quant_offset); int schro_quantise (int value, int quant_factor, int quant_offset); void schro_quantise_s16 (int16_t *dest, int16_t *src, int quant_factor, int quant_offset, int n); void schro_quantise_s32 (int32_t *dest, int32_t *src, int quant_factor, int quant_offset, int n); void schro_quantise_s16_table (int16_t *dest, int16_t *src, int quant_index, schro_bool is_intra, int n); void schro_dequantise_s16 (int16_t *dest, int16_t *src, int quant_factor, int quant_offset, int n); void schro_dequantise_s16_table (int16_t *dest, int16_t *src, int quant_index, schro_bool is_intra, int n); double schro_utils_probability_to_entropy (double x); double schro_utils_entropy (double a, double total); void schro_utils_reduce_fraction (int *n, int *d); double schro_utils_get_time (void); #endif SCHRO_END_DECLS #endif schroedinger-1.0.11/schroedinger/schroparams.c0000644000175000017500000003261311556115124016337 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include void schro_params_init (SchroParams * params, int video_format) { int i; params->transform_depth = 4; if (params->num_refs == 0) { if (video_format < 11) { params->wavelet_filter_index = SCHRO_WAVELET_DESLAURIERS_DUBUC_9_7; } else { params->wavelet_filter_index = SCHRO_WAVELET_FIDELITY; } } else { if (video_format < 11) { params->wavelet_filter_index = SCHRO_WAVELET_LE_GALL_5_3; } else { params->wavelet_filter_index = SCHRO_WAVELET_DESLAURIERS_DUBUC_9_7; } } switch (video_format) { case SCHRO_VIDEO_FORMAT_QCIF: case SCHRO_VIDEO_FORMAT_QSIF: params->xblen_luma = 8; params->yblen_luma = 8; params->xbsep_luma = 4; params->ybsep_luma = 4; break; default: case SCHRO_VIDEO_FORMAT_CUSTOM: case SCHRO_VIDEO_FORMAT_SIF: case SCHRO_VIDEO_FORMAT_CIF: case SCHRO_VIDEO_FORMAT_4SIF: case SCHRO_VIDEO_FORMAT_4CIF: case SCHRO_VIDEO_FORMAT_SD480I_60: case SCHRO_VIDEO_FORMAT_SD576I_50: params->xblen_luma = 12; params->yblen_luma = 12; params->xbsep_luma = 8; params->ybsep_luma = 8; break; case SCHRO_VIDEO_FORMAT_HD720P_60: case SCHRO_VIDEO_FORMAT_HD720P_50: params->xblen_luma = 16; params->yblen_luma = 16; params->xbsep_luma = 12; params->ybsep_luma = 12; break; case SCHRO_VIDEO_FORMAT_HD1080I_60: case SCHRO_VIDEO_FORMAT_HD1080I_50: case SCHRO_VIDEO_FORMAT_HD1080P_60: case SCHRO_VIDEO_FORMAT_HD1080P_50: case SCHRO_VIDEO_FORMAT_DC2K_24: case SCHRO_VIDEO_FORMAT_DC4K_24: case SCHRO_VIDEO_FORMAT_UHDTV_4K_60: case SCHRO_VIDEO_FORMAT_UHDTV_4K_50: case SCHRO_VIDEO_FORMAT_UHDTV_8K_60: case SCHRO_VIDEO_FORMAT_UHDTV_8K_50: params->xblen_luma = 24; params->yblen_luma = 24; params->xbsep_luma = 16; params->ybsep_luma = 16; break; } SCHRO_DEBUG ("schro_params_init %i %i %i %i", params->xblen_luma, params->yblen_luma, params->xbsep_luma, params->ybsep_luma); params->mv_precision = 2; params->picture_weight_1 = 1; params->picture_weight_2 = 1; params->picture_weight_bits = 1; if (params->num_refs == 0) { for (i = 0; i < 3; i++) { params->horiz_codeblocks[i] = 1; params->vert_codeblocks[i] = 1; } for (i = 3; i < SCHRO_LIMIT_TRANSFORM_DEPTH + 1; i++) { params->horiz_codeblocks[i] = 4; params->vert_codeblocks[i] = 3; } } else { for (i = 0; i < 2; i++) { params->horiz_codeblocks[i] = 1; params->vert_codeblocks[i] = 1; } params->horiz_codeblocks[2] = 8; params->vert_codeblocks[2] = 6; for (i = 3; i < SCHRO_LIMIT_TRANSFORM_DEPTH + 1; i++) { params->horiz_codeblocks[i] = 12; params->vert_codeblocks[i] = 8; } } /* other initializations */ params->codeblock_mode_index = 1; params->have_global_motion = FALSE; params->picture_pred_mode = 0; } /** * schro_params_calculate_iwt_sizes: * @params: pointer to @SchroParams structure * * Calculates the size of the array used for wavelet transformation * using the current video format and transformation depth in the * @params structure. The @params structure is updated with the new * values. * * The structure fields changed are: iwt_chroma_width, iwt_chroma_height, * iwt_luma_width, iwt_luma_height. */ void schro_params_calculate_iwt_sizes (SchroParams * params) { SchroVideoFormat *video_format = params->video_format; int picture_luma_width, picture_luma_height; int picture_chroma_width, picture_chroma_height; schro_video_format_get_picture_luma_size (video_format, &picture_luma_width, &picture_luma_height); params->iwt_luma_width = ROUND_UP_POW2 (picture_luma_width, params->transform_depth); params->iwt_luma_height = ROUND_UP_POW2 (picture_luma_height, params->transform_depth); schro_video_format_get_picture_chroma_size (video_format, &picture_chroma_width, &picture_chroma_height); params->iwt_chroma_width = ROUND_UP_POW2 (picture_chroma_width, params->transform_depth); params->iwt_chroma_height = ROUND_UP_POW2 (picture_chroma_height, params->transform_depth); SCHRO_DEBUG ("iwt chroma size %d x %d", params->iwt_chroma_width, params->iwt_chroma_height); SCHRO_DEBUG ("iwt luma size %d x %d", params->iwt_luma_width, params->iwt_luma_height); } /** * schro_params_calculate_mc_sizes: * @params: pointer to @SchroParams structure * * Calculates the size of the array used for motion compensation * using the current video format and motion compensation paramters * in the @params structure. The @params structure is updated with * the new values. * * The structure fields changed are: x_num_blocks, y_num_blocks, * mc_luma_width, mc_luma_height, mc_chroma_width, mc_chroma_height, * x_offset, y_offset. */ void schro_params_calculate_mc_sizes (SchroParams * params) { SchroVideoFormat *video_format = params->video_format; int width, height; schro_video_format_get_picture_luma_size (video_format, &width, &height); params->x_num_blocks = 4 * DIVIDE_ROUND_UP (width, 4 * params->xbsep_luma); params->y_num_blocks = 4 * DIVIDE_ROUND_UP (height, 4 * params->ybsep_luma); SCHRO_DEBUG ("picture %dx%d, num_blocks %dx%d", width, height, params->x_num_blocks, params->y_num_blocks); params->x_offset = (params->xblen_luma - params->xbsep_luma) / 2; params->y_offset = (params->yblen_luma - params->ybsep_luma) / 2; } typedef struct _SchroBlockParams SchroBlockParams; struct _SchroBlockParams { int xblen_luma; int yblen_luma; int xbsep_luma; int ybsep_luma; }; static SchroBlockParams schro_block_params[] = { {0, 0, 0, 0}, {8, 8, 4, 4}, {12, 12, 8, 8}, {16, 16, 12, 12}, {24, 24, 16, 16} }; /** * schro_params_set_block_params: * @params: pointer to SchroParams structure * @index: index to standard block parameters * * Sets the block parameters for motion compensation in the parameters * structure pointed to by @params to the * standard block parameters given by @index. */ int schro_params_set_block_params (SchroParams * params, int index) { if (index < 1 || index >= ARRAY_SIZE (schro_block_params)) { SCHRO_ERROR ("illegal block params index"); return FALSE; } params->xblen_luma = schro_block_params[index].xblen_luma; params->yblen_luma = schro_block_params[index].yblen_luma; params->xbsep_luma = schro_block_params[index].xbsep_luma; params->ybsep_luma = schro_block_params[index].ybsep_luma; return TRUE; } int schro_params_get_block_params (SchroParams * params) { int i; for (i = 1; i < ARRAY_SIZE (schro_block_params); i++) { if (schro_block_params[i].xblen_luma == params->xblen_luma && schro_block_params[i].xbsep_luma == params->xbsep_luma && schro_block_params[i].yblen_luma == params->yblen_luma && schro_block_params[i].ybsep_luma == params->ybsep_luma) { return i; } } return 0; } int schro_params_verify_block_params (SchroParams * params) { if (params->xblen_luma < 0) return FALSE; if (params->yblen_luma < 0) return FALSE; if (params->xbsep_luma < 0) return FALSE; if (params->ybsep_luma < 0) return FALSE; if (params->xblen_luma > SCHRO_LIMIT_BLOCK_SIZE) return FALSE; if (params->yblen_luma > SCHRO_LIMIT_BLOCK_SIZE) return FALSE; if ((params->xblen_luma & 3) != 0) return FALSE; if ((params->xbsep_luma & 3) != 0) return FALSE; if ((params->yblen_luma & 3) != 0) return FALSE; if ((params->ybsep_luma & 3) != 0) return FALSE; if (params->xblen_luma < params->xbsep_luma) return FALSE; if (params->yblen_luma < params->ybsep_luma) return FALSE; if (params->xblen_luma > 2 * params->xbsep_luma) return FALSE; if (params->yblen_luma > 2 * params->ybsep_luma) return FALSE; return TRUE; } #ifdef unused /** * schro_params_set_default_codeblock: * @params: pointer to SchroParams structure * * Sets the codeblock parameters in the parameters structure pointed to * by @params to the defaults. */ void schro_params_set_default_codeblock (SchroParams * params) { int i; for (i = 0; i < SCHRO_LIMIT_TRANSFORM_DEPTH + 1; i++) { params->horiz_codeblocks[i] = 1; params->vert_codeblocks[i] = 1; } /* FIXME default in Dirac is 0 */ params->codeblock_mode_index = 1; } #endif /** * schro_params_is_default_codeblock: * @params: pointer to SchroParams structure * * Returns: True if the codeblocks in @params are the default codeblocks. */ schro_bool schro_params_is_default_codeblock (SchroParams * params) { int i; for (i = 0; i < params->transform_depth + 1; i++) { if (params->horiz_codeblocks[i] != 1 || params->vert_codeblocks[i] != 1) { return FALSE; } } if (params->codeblock_mode_index != 0) return FALSE; return TRUE; } void schro_subband_get_frame_data (SchroFrameData * fd, SchroFrame * frame, int component, int position, SchroParams * params) { int shift; SchroFrameData *comp = &frame->components[component]; shift = params->transform_depth - SCHRO_SUBBAND_SHIFT (position); fd->format = frame->format; fd->h_shift = comp->h_shift + shift; fd->v_shift = comp->v_shift + shift; fd->stride = comp->stride << shift; if (component == 0) { fd->width = params->iwt_luma_width >> shift; fd->height = params->iwt_luma_height >> shift; } else { fd->width = params->iwt_chroma_width >> shift; fd->height = params->iwt_chroma_height >> shift; } fd->data = comp->data; if (position & 2) { fd->data = OFFSET (fd->data, fd->stride >> 1); } if (position & 1) { if (SCHRO_FRAME_FORMAT_DEPTH(fd->format) == SCHRO_FRAME_FORMAT_DEPTH_S32) { fd->data = OFFSET (fd->data, fd->width * sizeof (int32_t)); } else { fd->data = OFFSET (fd->data, fd->width * sizeof (int16_t)); } } } int schro_subband_get_position (int index) { const int subband_position[] = { 0, 1, 2, 3, 5, 6, 7, 9, 10, 11, 13, 14, 15, 17, 18, 19, 21, 22, 23, 25, 26, 27 }; return subband_position[index]; } int schro_params_get_frame_format (int depth, SchroChromaFormat chroma_format) { if (depth == 8) { switch (chroma_format) { case SCHRO_CHROMA_444: return SCHRO_FRAME_FORMAT_U8_444; case SCHRO_CHROMA_422: return SCHRO_FRAME_FORMAT_U8_422; case SCHRO_CHROMA_420: return SCHRO_FRAME_FORMAT_U8_420; default: SCHRO_ASSERT (0); } } else if (depth == 16) { switch (chroma_format) { case SCHRO_CHROMA_444: return SCHRO_FRAME_FORMAT_S16_444; case SCHRO_CHROMA_422: return SCHRO_FRAME_FORMAT_S16_422; case SCHRO_CHROMA_420: return SCHRO_FRAME_FORMAT_S16_420; default: SCHRO_ASSERT (0); } } else if (depth == 32) { switch (chroma_format) { case SCHRO_CHROMA_444: return SCHRO_FRAME_FORMAT_S32_444; case SCHRO_CHROMA_422: return SCHRO_FRAME_FORMAT_S32_422; case SCHRO_CHROMA_420: return SCHRO_FRAME_FORMAT_S32_420; default: SCHRO_ASSERT (0); } } SCHRO_ASSERT (0); } const int schro_tables_lowdelay_quants[7][4][9] = { { /* wavelet 0 */ {5, 3, 0}, {5, 3, 0, 4, 1}, {5, 3, 0, 4, 1, 5, 2}, {5, 3, 0, 4, 1, 5, 2, 6, 3}, }, { /* wavelet 1 */ {4, 2, 0}, {4, 2, 0, 4, 2}, {4, 2, 0, 4, 2, 5, 3}, {4, 2, 0, 4, 2, 5, 3, 7, 5}, }, { /* wavelet 2 */ {5, 3, 0}, {5, 3, 0, 4, 1}, {5, 3, 0, 4, 1, 5, 2}, {5, 3, 0, 4, 1, 5, 2, 6, 3}, }, { /* wavelet 3 */ {8, 4, 0}, {12, 8, 4, 4, 0}, {16, 12, 8, 8, 4, 4, 0}, {20, 16, 12, 12, 8, 8, 4, 4, 0}, }, { /* wavelet 4 */ {8, 4, 0}, {8, 4, 0, 4, 0}, {8, 4, 0, 4, 0, 4, 0}, {8, 4, 0, 4, 0, 4, 0, 4, 0}, }, { /* wavelet 5 */ {0, 4, 8}, {0, 4, 8, 8, 10}, {0, 4, 8, 8, 12, 13, 17}, {0, 4, 8, 8, 12, 13, 17, 17, 21}, }, { /* wavelet 6 */ {3, 1, 0}, {3, 1, 0, 4, 2}, {3, 1, 0, 4, 2, 6, 5}, {3, 1, 0, 4, 2, 6, 5, 9, 7}, }, }; void schro_params_set_default_quant_matrix (SchroParams * params) { int i; const int *table; table = schro_tables_lowdelay_quants[params->wavelet_filter_index] [MAX (0, params->transform_depth - 1)]; params->quant_matrix[0] = table[0]; for (i = 0; i < params->transform_depth; i++) { params->quant_matrix[1 + 3 * i + 0] = table[1 + 2 * i + 0]; params->quant_matrix[1 + 3 * i + 1] = table[1 + 2 * i + 0]; params->quant_matrix[1 + 3 * i + 2] = table[1 + 2 * i + 1]; } } schro_bool schro_params_is_default_quant_matrix (SchroParams * params) { int i; const int *table; if (params->transform_depth < 1 || params->transform_depth > 4) return FALSE; table = schro_tables_lowdelay_quants[params->wavelet_filter_index] [params->transform_depth - 1]; if (params->quant_matrix[0] != table[0]) return FALSE; for (i = 0; i < params->transform_depth; i++) { if (params->quant_matrix[1 + 3 * i + 0] != table[1 + 2 * i + 0] || params->quant_matrix[1 + 3 * i + 1] != table[1 + 2 * i + 0] || params->quant_matrix[1 + 3 * i + 2] != table[1 + 2 * i + 1]) { return FALSE; } } return TRUE; } schroedinger-1.0.11/schroedinger/schroquantiser.c0000664000175000017500000007500211707114332017066 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include //#define DUMP_SUBBAND_CURVES void schro_encoder_choose_quantisers_simple (SchroEncoderFrame * frame); void schro_encoder_choose_quantisers_rdo_bit_allocation (SchroEncoderFrame * frame); void schro_encoder_choose_quantisers_lossless (SchroEncoderFrame * frame); void schro_encoder_choose_quantisers_lowdelay (SchroEncoderFrame * frame); void schro_encoder_choose_quantisers_rdo_lambda (SchroEncoderFrame * frame); void schro_encoder_choose_quantisers_rdo_cbr (SchroEncoderFrame * frame); void schro_encoder_choose_quantisers_constant_error (SchroEncoderFrame * frame); double schro_encoder_entropy_to_lambda (SchroEncoderFrame * frame, double entropy); static double schro_encoder_lambda_to_entropy (SchroEncoderFrame * frame, double lambda); static void schro_encoder_generate_subband_histograms (SchroEncoderFrame * frame); static int schro_subband_pick_quant (SchroEncoderFrame * frame, int component, int i, double lambda); #define CURVE_SIZE 128 double schro_encoder_perceptual_weight_moo (double cpd) { /* I pretty much pulled this out of my ass (ppd = pixels per degree) */ if (cpd < 4) return 1; return 0.68 * cpd * exp (-0.25 * cpd); } double schro_encoder_perceptual_weight_constant (double cpd) { return 1; } double schro_encoder_perceptual_weight_ccir959 (double cpd) { double w; w = 0.255 * pow (1 + 0.2561 * cpd * cpd, -0.75); /* return normalized value */ return w / 0.255; } double schro_encoder_perceptual_weight_manos_sakrison (double cpd) { double w; if (cpd < 4) return 1; w = 2.6 * (0.0192 + 0.114 * cpd) * exp (-pow (0.114 * cpd, 1.1)); /* return normalized value */ return w / 0.980779694777866; } static double weighted_sum (const float *h1, const float *v1, double *weight) { int i, j; double sum; double rowsum; sum = 0; for (j = 0; j < CURVE_SIZE; j++) { rowsum = 0; for (i = 0; i < CURVE_SIZE; i++) { rowsum += h1[i] * v1[j] * weight[CURVE_SIZE * j + i]; } sum += rowsum; } return sum; } static double dot_product (const float *h1, const float *v1, const float *h2, const float *v2, double *weight) { int i, j; double sum; double rowsum; sum = 0; for (j = 0; j < CURVE_SIZE; j++) { rowsum = 0; for (i = 0; i < CURVE_SIZE; i++) { rowsum += h1[i] * v1[j] * h2[i] * v2[j] * weight[CURVE_SIZE * j + i] * weight[CURVE_SIZE * j + i]; } sum += rowsum; } return sum; } static void solve (double *matrix, double *column, int n) { int i; int j; int k; double x; for (i = 0; i < n; i++) { x = 1 / matrix[i * n + i]; for (k = i; k < n; k++) { matrix[i * n + k] *= x; } column[i] *= x; for (j = i + 1; j < n; j++) { x = matrix[j * n + i]; for (k = i; k < n; k++) { matrix[j * n + k] -= matrix[i * n + k] * x; } column[j] -= column[i] * x; } } for (i = n - 1; i > 0; i--) { for (j = i - 1; j >= 0; j--) { column[j] -= matrix[j * n + i] * column[i]; matrix[j * n + i] = 0; } } } #ifdef unused void schro_encoder_set_default_subband_weights (SchroEncoder * encoder) { schro_encoder_calculate_subband_weights (encoder, schro_encoder_perceptual_weight_constant); } #endif void schro_encoder_calculate_subband_weights (SchroEncoder * encoder, double (*perceptual_weight) (double)) { int wavelet; int n_levels; double *matrix_intra; double *matrix_inter; int n; int i, j; double column_intra[SCHRO_LIMIT_SUBBANDS]; double column_inter[SCHRO_LIMIT_SUBBANDS]; double *weight_intra; double *weight_inter; matrix_intra = schro_malloc (sizeof (double) * SCHRO_LIMIT_SUBBANDS * SCHRO_LIMIT_SUBBANDS); matrix_inter = schro_malloc (sizeof (double) * SCHRO_LIMIT_SUBBANDS * SCHRO_LIMIT_SUBBANDS); weight_intra = schro_malloc (sizeof (double) * CURVE_SIZE * CURVE_SIZE); weight_inter = schro_malloc (sizeof (double) * CURVE_SIZE * CURVE_SIZE); for (j = 0; j < CURVE_SIZE; j++) { for (i = 0; i < CURVE_SIZE; i++) { double fv_intra = j * encoder->cycles_per_degree_vert * (1.0 / CURVE_SIZE); double fh_intra = i * encoder->cycles_per_degree_horiz * (1.0 / CURVE_SIZE); double fv_inter = j * encoder->cycles_per_degree_vert * (1.0 / CURVE_SIZE) * encoder->magic_inter_cpd_scale; double fh_inter = i * encoder->cycles_per_degree_horiz * (1.0 / CURVE_SIZE) * encoder->magic_inter_cpd_scale; weight_intra[j * CURVE_SIZE + i] = perceptual_weight (sqrt (fv_intra * fv_intra + fh_intra * fh_intra)); weight_inter[j * CURVE_SIZE + i] = perceptual_weight (sqrt (fv_intra * fv_inter + fh_inter * fh_inter)); } } for (wavelet = 0; wavelet < SCHRO_N_WAVELETS; wavelet++) { for (n_levels = 1; n_levels <= SCHRO_LIMIT_ENCODER_TRANSFORM_DEPTH; n_levels++) { const float *h_curve[SCHRO_LIMIT_SUBBANDS]; const float *v_curve[SCHRO_LIMIT_SUBBANDS]; int hi[SCHRO_LIMIT_SUBBANDS]; int vi[SCHRO_LIMIT_SUBBANDS]; n = 3 * n_levels + 1; for (i = 0; i < n; i++) { int position = schro_subband_get_position (i); int n_transforms; n_transforms = n_levels - SCHRO_SUBBAND_SHIFT (position); if (position & 1) { hi[i] = (n_transforms - 1) * 2; } else { hi[i] = (n_transforms - 1) * 2 + 1; } if (position & 2) { vi[i] = (n_transforms - 1) * 2; } else { vi[i] = (n_transforms - 1) * 2 + 1; } h_curve[i] = schro_tables_wavelet_noise_curve[wavelet][hi[i]]; v_curve[i] = schro_tables_wavelet_noise_curve[wavelet][vi[i]]; } if (0) { for (i = 0; i < n; i++) { column_intra[i] = weighted_sum (h_curve[i], v_curve[i], weight_intra); column_inter[i] = weighted_sum (h_curve[i], v_curve[i], weight_inter); matrix_intra[i * n + i] = dot_product (h_curve[i], v_curve[i], h_curve[i], v_curve[i], weight_intra); matrix_inter[i * n + i] = dot_product (h_curve[i], v_curve[i], h_curve[i], v_curve[i], weight_inter); for (j = i + 1; j < n; j++) { matrix_intra[i * n + j] = dot_product (h_curve[i], v_curve[i], h_curve[j], v_curve[j], weight_intra); matrix_intra[j * n + i] = matrix_intra[i * n + j]; matrix_inter[i * n + j] = dot_product (h_curve[i], v_curve[i], h_curve[j], v_curve[j], weight_inter); matrix_inter[j * n + i] = matrix_inter[i * n + j]; } } solve (matrix_intra, column_intra, n); solve (matrix_inter, column_inter, n); for (i = 0; i < n; i++) { if (column_intra[i] < 0 || column_inter[i] < 0) { SCHRO_ERROR ("BROKEN wavelet %d n_levels %d", wavelet, n_levels); break; } } SCHRO_DEBUG ("wavelet %d n_levels %d", wavelet, n_levels); for (i = 0; i < n; i++) { SCHRO_DEBUG ("%g", 1.0 / sqrt (column_intra[i])); SCHRO_DEBUG ("%g", 1.0 / sqrt (column_inter[i])); encoder->intra_subband_weights[wavelet][n_levels - 1][i] = sqrt (column_intra[i]); encoder->inter_subband_weights[wavelet][n_levels - 1][i] = sqrt (column_inter[i]); } } else { for (i = 0; i < n; i++) { int position = schro_subband_get_position (i); int n_transforms; double size; n_transforms = n_levels - SCHRO_SUBBAND_SHIFT (position); size = (1.0 / CURVE_SIZE) * (1 << n_transforms); encoder->intra_subband_weights[wavelet][n_levels - 1][i] = 1.0 / (size * sqrt (weighted_sum (h_curve[i], v_curve[i], weight_intra))); encoder->inter_subband_weights[wavelet][n_levels - 1][i] = 1.0 / (size * sqrt (weighted_sum (h_curve[i], v_curve[i], weight_inter))); } } } } schro_free (weight_intra); schro_free (matrix_intra); schro_free (weight_inter); schro_free (matrix_inter); } void schro_encoder_choose_quantisers (SchroEncoderFrame * frame) { switch (frame->encoder->quantiser_engine) { case SCHRO_QUANTISER_ENGINE_SIMPLE: schro_encoder_choose_quantisers_simple (frame); break; case SCHRO_QUANTISER_ENGINE_RDO_BIT_ALLOCATION: schro_encoder_choose_quantisers_rdo_bit_allocation (frame); break; case SCHRO_QUANTISER_ENGINE_CBR: schro_encoder_choose_quantisers_rdo_cbr (frame); break; case SCHRO_QUANTISER_ENGINE_LOSSLESS: schro_encoder_choose_quantisers_lossless (frame); break; case SCHRO_QUANTISER_ENGINE_LOWDELAY: schro_encoder_choose_quantisers_lowdelay (frame); break; case SCHRO_QUANTISER_ENGINE_RDO_LAMBDA: schro_encoder_choose_quantisers_rdo_lambda (frame); break; case SCHRO_QUANTISER_ENGINE_CONSTANT_ERROR: schro_encoder_choose_quantisers_constant_error (frame); break; default: SCHRO_ASSERT (0); } } void schro_encoder_choose_quantisers_lossless (SchroEncoderFrame * frame) { int i; int component; for (component = 0; component < 3; component++) { for (i = 0; i < 1 + 3 * frame->params.transform_depth; i++) { schro_encoder_frame_set_quant_index (frame, component, i, -1, -1, 0); } } } void schro_encoder_choose_quantisers_simple (SchroEncoderFrame * frame) { SchroParams *params = &frame->params; int i; int component; double noise_amplitude; double a; double max; double *table; double range; /* FIXME this should really be based directly on excursion */ range = (1<encoder->bit_depth) - 1.0; noise_amplitude = range * pow (0.1, frame->encoder->noise_threshold * 0.05); SCHRO_DEBUG ("noise %g", noise_amplitude); if (frame->num_refs == 0) { table = frame->encoder->intra_subband_weights[params->wavelet_filter_index] [MAX (0, params->transform_depth - 1)]; } else { table = frame->encoder->inter_subband_weights[params->wavelet_filter_index] [MAX (0, params->transform_depth - 1)]; } for (component = 0; component < 3; component++) { for (i = 0; i < 1 + 3 * params->transform_depth; i++) { a = noise_amplitude * table[i]; schro_encoder_frame_set_quant_index (frame, component, i, -1, -1, schro_utils_multiplier_to_quant_index (a)); } } max = 1.0; for (i = 0; i < 1 + 3 * params->transform_depth; i++) { params->quant_matrix[i] = schro_utils_multiplier_to_quant_index (max / table[i]); SCHRO_DEBUG ("%g %g %d", table[i], max / table[i], params->quant_matrix[i]); } } void schro_encoder_choose_quantisers_lowdelay (SchroEncoderFrame * frame) { SchroParams *params = &frame->params; int i; int component; int base; const int *table; /* completely made up */ base = 12 + (30 - frame->encoder->noise_threshold) / 2; table = schro_tables_lowdelay_quants[params->wavelet_filter_index] [MAX (0, params->transform_depth - 1)]; for (component = 0; component < 3; component++) { schro_encoder_frame_set_quant_index (frame, component, 0, -1, -1, base - table[0]); for (i = 0; i < params->transform_depth; i++) { schro_encoder_frame_set_quant_index (frame, component, 1 + 3 * i + 0, -1, -1, base - table[1 + 2 * i + 0]); schro_encoder_frame_set_quant_index (frame, component, 1 + 3 * i + 1, -1, -1, base - table[1 + 2 * i + 0]); schro_encoder_frame_set_quant_index (frame, component, 1 + 3 * i + 2, -1, -1, base - table[1 + 2 * i + 1]); } } } #ifdef DUMP_SUBBAND_CURVES static double pow2 (double x) { return x * x; } #endif #ifdef DUMP_SUBBAND_CURVES static double measure_error_subband (SchroEncoderFrame * frame, int component, int index, int quant_index) { int i; int j; int16_t *line; int skip = 1; double error = 0; int q; int quant_factor; int quant_offset; int value; int position; SchroFrameData fd; position = schro_subband_get_position (index); schro_subband_get_frame_data (&fd, frame->iwt_frame, component, position, &frame->params); quant_factor = schro_table_quant[quant_index]; if (frame->params.num_refs > 0) { quant_offset = schro_table_offset_3_8[quant_index]; } else { quant_offset = schro_table_offset_1_2[quant_index]; } error = 0; if (index == 0) { for (j = 0; j < fd.height; j += skip) { line = SCHRO_FRAME_DATA_GET_LINE (&fd, j); for (i = 1; i < fd.width; i += skip) { q = schro_quantise (abs (line[i] - line[i - 1]), quant_factor, quant_offset); value = schro_dequantise (q, quant_factor, quant_offset); error += pow2 (value - abs (line[i] - line[i - 1])); } } } else { for (j = 0; j < fd.height; j += skip) { line = SCHRO_FRAME_DATA_GET_LINE (&fd, j); for (i = 0; i < fd.width; i += skip) { q = schro_quantise (line[i], quant_factor, quant_offset); value = schro_dequantise (q, quant_factor, quant_offset); error += pow2 (value - line[i]); } } } error *= skip * skip; return error; } #endif typedef struct _ErrorFuncInfo ErrorFuncInfo; struct _ErrorFuncInfo { int quant_factor; int quant_offset; double power; }; static double error_pow (int x, void *priv) { ErrorFuncInfo *efi = priv; int q; int value; int y; q = schro_quantise (x, efi->quant_factor, efi->quant_offset); value = schro_dequantise (q, efi->quant_factor, efi->quant_offset); y = abs (value - x); return pow (y, efi->power); } void schro_encoder_init_error_tables (SchroEncoder * encoder) { int i; for (i = 0; i < 60; i++) { ErrorFuncInfo efi; efi.quant_factor = schro_table_quant[i]; efi.quant_offset = schro_table_offset_1_2[i]; efi.power = encoder->magic_error_power; schro_histogram_table_generate (encoder->intra_hist_tables + i, error_pow, &efi); } } #ifdef unused static double schro_histogram_estimate_error (SchroHistogram * hist, int quant_index, int num_refs) { SchroHistogramTable *table; if (num_refs == 0) { table = (SchroHistogramTable *) (schro_table_error_hist_shift3_1_2[quant_index]); } else { /* FIXME the 3/8 table doesn't exist yet */ //table = (SchroHistogramTable *)(schro_table_error_hist_shift3_3_8[quant_index]); table = (SchroHistogramTable *) (schro_table_error_hist_shift3_1_2[quant_index]); } return schro_histogram_apply_table (hist, table); } #endif #ifdef DUMP_SUBBAND_CURVES static double schro_encoder_estimate_subband_arith (SchroEncoderFrame * frame, int component, int index, int quant_index) { int i; int j; int16_t *line; int q; int quant_factor; int quant_offset; int estimated_entropy; SchroArith *arith; int position; SchroFrameData fd; arith = schro_arith_new (); schro_arith_estimate_init (arith); position = schro_subband_get_position (index); schro_subband_get_frame_data (&fd, frame->iwt_frame, component, position, &frame->params); quant_factor = schro_table_quant[quant_index]; quant_offset = schro_table_offset_1_2[quant_index]; if (index == 0) { for (j = 0; j < fd.height; j++) { line = SCHRO_FRAME_DATA_GET_LINE (&fd, j); schro_arith_estimate_sint (arith, SCHRO_CTX_ZPZN_F1, SCHRO_CTX_COEFF_DATA, SCHRO_CTX_SIGN_ZERO, 0); for (i = 1; i < fd.width; i++) { q = schro_quantise (line[i] - line[i - 1], quant_factor, quant_offset); schro_arith_estimate_sint (arith, SCHRO_CTX_ZPZN_F1, SCHRO_CTX_COEFF_DATA, SCHRO_CTX_SIGN_ZERO, q); } } } else { for (j = 0; j < fd.height; j++) { line = SCHRO_FRAME_DATA_GET_LINE (&fd, j); for (i = 0; i < fd.width; i++) { q = schro_quantise (line[i], quant_factor, quant_offset); schro_arith_estimate_sint (arith, SCHRO_CTX_ZPZN_F1, SCHRO_CTX_COEFF_DATA, SCHRO_CTX_SIGN_ZERO, q); } } } estimated_entropy = 0; estimated_entropy += arith->contexts[SCHRO_CTX_ZPZN_F1].n_bits; estimated_entropy += arith->contexts[SCHRO_CTX_ZP_F2].n_bits; estimated_entropy += arith->contexts[SCHRO_CTX_ZP_F3].n_bits; estimated_entropy += arith->contexts[SCHRO_CTX_ZP_F4].n_bits; estimated_entropy += arith->contexts[SCHRO_CTX_ZP_F5].n_bits; estimated_entropy += arith->contexts[SCHRO_CTX_ZP_F6p].n_bits; estimated_entropy += arith->contexts[SCHRO_CTX_COEFF_DATA].n_bits; estimated_entropy += arith->contexts[SCHRO_CTX_SIGN_ZERO].n_bits; schro_arith_free (arith); return estimated_entropy; } #endif static void schro_encoder_generate_subband_histogram (SchroEncoderFrame * frame, int component, int index, SchroHistogram * hist, int skip) { int position; SchroFrameData fd; position = schro_subband_get_position (index); schro_subband_get_frame_data (&fd, frame->iwt_frame, component, position, &frame->params); if (index == 0 && frame->num_refs == 0) { schro_frame_data_generate_histogram_dc_predict (&fd, hist, skip, 0, 0); } else { schro_frame_data_generate_histogram (&fd, hist, skip); } } static void schro_encoder_generate_subband_histograms (SchroEncoderFrame * frame) { SchroParams *params = &frame->params; int i; int component; int pos; int skip; for (component = 0; component < 3; component++) { for (i = 0; i < 1 + 3 * params->transform_depth; i++) { pos = schro_subband_get_position (i); skip = 1 << MAX (0, SCHRO_SUBBAND_SHIFT (pos) - 1); schro_encoder_generate_subband_histogram (frame, component, i, &frame->subband_hists[component][i], skip); } } frame->have_histograms = TRUE; } #ifdef DUMP_SUBBAND_CURVES static void schro_encoder_dump_subband_curves (SchroEncoderFrame * frame) { SchroParams *params = &frame->params; int i; int component; int position; SCHRO_ASSERT (frame->have_histograms); for (component = 0; component < 3; component++) { for (i = 0; i < 1 + 3 * params->transform_depth; i++) { int vol; SchroFrameData fd; int j; SchroHistogram *hist; position = schro_subband_get_position (i); schro_subband_get_frame_data (&fd, frame->iwt_frame, component, position, &frame->params); vol = fd.width * fd.height; hist = &frame->subband_hists[component][i]; for (j = 0; j < 60; j++) { double est_entropy; double error; double est_error; double arith_entropy; error = measure_error_subband (frame, component, i, j); est_entropy = schro_histogram_estimate_entropy (&frame->subband_hists[component] [i], j, params->is_noarith); est_error = schro_histogram_apply_table (hist, &frame->encoder->intra_hist_tables[j]); arith_entropy = schro_encoder_estimate_subband_arith (frame, component, i, j); schro_dump (SCHRO_DUMP_SUBBAND_CURVE, "%d %d %d %g %g %g %g\n", component, i, j, est_entropy / vol, arith_entropy / vol, est_error / vol, error / vol); } } } } #endif static void schro_encoder_calc_estimates (SchroEncoderFrame * frame) { SchroParams *params = &frame->params; int i; int j; int component; double *arith_context_ratios; SCHRO_ASSERT (frame->have_histograms); #ifdef DUMP_SUBBAND_CURVES schro_encoder_dump_subband_curves (frame); #endif for (component = 0; component < 3; component++) { if (frame->num_refs == 0) { arith_context_ratios = frame->encoder->average_arith_context_ratios_intra[component]; } else { arith_context_ratios = frame->encoder->average_arith_context_ratios_inter[component]; } for (i = 0; i < 1 + 3 * params->transform_depth; i++) { for (j = 0; j < 60; j++) { int position; SchroHistogram *hist; SchroFrameData fd; position = schro_subband_get_position (i); schro_subband_get_frame_data (&fd, frame->iwt_frame, component, position, &frame->params); hist = &frame->subband_hists[component][i]; frame->est_entropy[component][i][j] = schro_histogram_estimate_entropy (hist, j, params->is_noarith); frame->est_entropy[component][i][j] *= arith_context_ratios[i]; frame->est_error[component][i][j] = schro_histogram_apply_table (hist, &frame->encoder->intra_hist_tables[j]); } } } frame->have_estimate_tables = TRUE; } /* * Quantiser engine which picks the best RDO quantisers to fit in * a frame bit allocation. */ void schro_encoder_choose_quantisers_rdo_bit_allocation (SchroEncoderFrame * frame) { double frame_lambda; int bits; schro_encoder_generate_subband_histograms (frame); schro_encoder_calc_estimates (frame); SCHRO_ASSERT (frame->have_estimate_tables); bits = frame->allocated_residual_bits; frame_lambda = schro_encoder_entropy_to_lambda (frame, bits); frame->frame_lambda = frame_lambda; SCHRO_DEBUG ("LAMBDA: %d %g %d", frame->frame_number, frame_lambda, bits); schro_encoder_lambda_to_entropy (frame, frame_lambda); } void schro_encoder_choose_quantisers_rdo_lambda (SchroEncoderFrame * frame) { SCHRO_DEBUG ("Using rdo_lambda quant selection on frame %d with lambda %g", frame->frame_number, frame->frame_lambda); schro_encoder_generate_subband_histograms (frame); schro_encoder_calc_estimates (frame); SCHRO_ASSERT (frame->have_estimate_tables); schro_encoder_lambda_to_entropy (frame, frame->frame_lambda); } void schro_encoder_choose_quantisers_rdo_cbr (SchroEncoderFrame * frame) { schro_encoder_generate_subband_histograms (frame); schro_encoder_calc_estimates (frame); SCHRO_ASSERT (frame->have_estimate_tables); schro_encoder_lambda_to_entropy (frame, frame->frame_lambda); } void schro_encoder_estimate_entropy (SchroEncoderFrame * frame) { SchroParams *params = &frame->params; int i; int component; int n = 0; for (component = 0; component < 3; component++) { for (i = 0; i < 1 + 3 * params->transform_depth; i++) { n += frame-> est_entropy[component][i][frame->quant_indices[component][i][0]]; } } frame->estimated_residual_bits = n; if (frame->allocated_residual_bits > 0 && frame->estimated_residual_bits > 2 * frame->encoder->bits_per_picture + frame->allocated_residual_bits) { SCHRO_WARNING ("%d: estimated entropy too big (%d vs %d)", frame->frame_number, frame->estimated_residual_bits, frame->allocated_residual_bits); } } static int schro_subband_pick_quant (SchroEncoderFrame * frame, int component, int i, double lambda) { double x; double min; int j; int j_min; double entropy; double error; SCHRO_ASSERT (frame->have_estimate_tables); j_min = -1; min = 0; for (j = 0; j < 60; j++) { entropy = frame->est_entropy[component][i][j]; error = frame->est_error[component][i][j]; x = entropy + lambda * error; if (j == 0 || x < min) { j_min = j; min = x; } } return j_min; } static double schro_encoder_lambda_to_entropy (SchroEncoderFrame * frame, double frame_lambda) { SchroParams *params = &frame->params; int i; int component; double entropy = 0; double *table; if (frame->num_refs == 0) { table = frame->encoder->intra_subband_weights[params->wavelet_filter_index] [MAX (0, params->transform_depth - 1)]; } else { table = frame->encoder->inter_subband_weights[params->wavelet_filter_index] [MAX (0, params->transform_depth - 1)]; } for (component = 0; component < 3; component++) { for (i = 0; i < 1 + 3 * params->transform_depth; i++) { double lambda; double weight; int quant_index; int position = schro_subband_get_position (i); lambda = frame_lambda; if (i == 0) { lambda *= frame->encoder->magic_subband0_lambda_scale; } if (component > 0) { lambda *= frame->encoder->magic_chroma_lambda_scale; } if (SCHRO_SUBBAND_IS_DIAGONALLY_ORIENTED (position)) { lambda *= frame->encoder->magic_diagonal_lambda_scale; } weight = table[i]; lambda /= weight * weight; quant_index = schro_subband_pick_quant (frame, component, i, lambda); entropy += frame->est_entropy[component][i][quant_index]; schro_encoder_frame_set_quant_index (frame, component, i, -1, -1, quant_index); } } return entropy; } double schro_encoder_entropy_to_lambda (SchroEncoderFrame * frame, double entropy) { int j; double lambda_hi, lambda_lo, lambda_mid; double entropy_hi, entropy_lo, entropy_mid; lambda_hi = 1; entropy_hi = schro_encoder_lambda_to_entropy (frame, lambda_hi); SCHRO_DEBUG ("start target=%g lambda=%g entropy=%g", entropy, lambda_hi, entropy_hi); if (entropy_hi < entropy) { entropy_lo = entropy_hi; lambda_lo = lambda_hi; for (j = 0; j < 5; j++) { lambda_hi = lambda_lo * 100; entropy_hi = schro_encoder_lambda_to_entropy (frame, lambda_hi); SCHRO_DEBUG ("have: lambda=[%g,%g] entropy=[%g,%g] target=%g", lambda_lo, lambda_hi, entropy_lo, entropy_hi, entropy); if (entropy_hi > entropy) break; SCHRO_DEBUG ("--> step up"); entropy_lo = entropy_hi; lambda_lo = lambda_hi; } SCHRO_DEBUG ("--> stopping"); } else { for (j = 0; j < 5; j++) { lambda_lo = lambda_hi * 0.01; entropy_lo = schro_encoder_lambda_to_entropy (frame, lambda_lo); SCHRO_DEBUG ("have: lambda=[%g,%g] entropy=[%g,%g] target=%g", lambda_lo, lambda_hi, entropy_lo, entropy_hi, entropy); SCHRO_DEBUG ("--> step down"); if (entropy_lo < entropy) break; entropy_hi = entropy_lo; lambda_hi = lambda_lo; } SCHRO_DEBUG ("--> stopping"); } if (entropy_lo == entropy_hi) { return sqrt (lambda_lo * lambda_hi); } if (entropy_lo > entropy || entropy_hi < entropy) { SCHRO_ERROR ("entropy not bracketed"); } for (j = 0; j < 7; j++) { if (entropy_hi == entropy_lo) break; SCHRO_DEBUG ("have: lambda=[%g,%g] entropy=[%g,%g] target=%g", lambda_lo, lambda_hi, entropy_lo, entropy_hi, entropy); lambda_mid = sqrt (lambda_lo * lambda_hi); entropy_mid = schro_encoder_lambda_to_entropy (frame, lambda_mid); SCHRO_DEBUG ("picking lambda_mid=%g entropy=%g", lambda_mid, entropy_mid); if (entropy_mid > entropy) { lambda_hi = lambda_mid; entropy_hi = entropy_mid; SCHRO_DEBUG ("--> focus up"); } else { lambda_lo = lambda_mid; entropy_lo = entropy_mid; SCHRO_DEBUG ("--> focus down"); } } lambda_mid = sqrt (lambda_hi * lambda_lo); SCHRO_DEBUG ("done %g", lambda_mid); return lambda_mid; } static double schro_encoder_lambda_to_error (SchroEncoderFrame * frame, double frame_lambda) { SchroParams *params = &frame->params; int i; int component; double error = 0; double *table; if (frame->num_refs == 0) { table = frame->encoder->intra_subband_weights[params->wavelet_filter_index] [MAX (0, params->transform_depth - 1)]; } else { table = frame->encoder->inter_subband_weights[params->wavelet_filter_index] [MAX (0, params->transform_depth - 1)]; } for (component = 0; component < 3; component++) { for (i = 0; i < 1 + 3 * params->transform_depth; i++) { double lambda; double weight; int quant_index; lambda = frame_lambda; if (i == 0) { lambda *= frame->encoder->magic_subband0_lambda_scale; } if (component > 0) { lambda *= frame->encoder->magic_chroma_lambda_scale; } weight = table[i]; lambda /= weight * weight; quant_index = schro_subband_pick_quant (frame, component, i, lambda); error += frame->est_error[component][i][quant_index]; schro_encoder_frame_set_quant_index (frame, component, i, -1, -1, quant_index); } } return error; } static double schro_encoder_error_to_lambda (SchroEncoderFrame * frame, double error) { int j; double lambda_hi, lambda_lo, lambda_mid; double error_hi, error_lo, error_mid; lambda_lo = 1; error_lo = schro_encoder_lambda_to_error (frame, lambda_lo); SCHRO_DEBUG ("start target=%g lambda=%g error=%g", error, lambda_lo, error_lo, lambda_lo, error); if (error < error_lo) { error_hi = error_lo; lambda_hi = lambda_lo; for (j = 0; j < 5; j++) { lambda_lo = lambda_hi * 100; error_lo = schro_encoder_lambda_to_error (frame, lambda_lo); SCHRO_DEBUG ("have: lambda=[%g,%g] error=[%g,%g] target=%g", lambda_lo, lambda_hi, error_lo, error_hi, error); if (error > error_lo) break; SCHRO_DEBUG ("--> step up"); error_hi = error_lo; lambda_hi = lambda_lo; } SCHRO_DEBUG ("--> stopping"); } else { for (j = 0; j < 5; j++) { lambda_hi = lambda_lo * 0.01; error_hi = schro_encoder_lambda_to_error (frame, lambda_hi); SCHRO_DEBUG ("have: lambda=[%g,%g] error=[%g,%g] target=%g", lambda_lo, lambda_hi, error_lo, error_hi, error); SCHRO_DEBUG ("--> step down"); if (error < error_hi) break; error_lo = error_hi; lambda_lo = lambda_hi; } SCHRO_DEBUG ("--> stopping"); } if (error_lo == error_hi) { return sqrt (lambda_lo * lambda_hi); } if (error_lo > error || error_hi < error) { SCHRO_DEBUG ("error not bracketed"); } for (j = 0; j < 14; j++) { if (error_hi == error_lo) break; SCHRO_DEBUG ("have: lambda=[%g,%g] error=[%g,%g] target=%g", lambda_lo, lambda_hi, error_lo, error_hi, error); lambda_mid = sqrt (lambda_lo * lambda_hi); error_mid = schro_encoder_lambda_to_error (frame, lambda_mid); SCHRO_DEBUG ("picking lambda_mid=%g error=%g", lambda_mid, error_mid); if (error_mid > error) { lambda_hi = lambda_mid; error_hi = error_mid; SCHRO_DEBUG ("--> focus up"); } else { lambda_lo = lambda_mid; error_lo = error_mid; SCHRO_DEBUG ("--> focus down"); } } lambda_mid = sqrt (lambda_hi * lambda_lo); SCHRO_DEBUG ("done %g", lambda_mid); return lambda_mid; } void schro_encoder_choose_quantisers_constant_error (SchroEncoderFrame * frame) { double frame_lambda; double error; schro_encoder_generate_subband_histograms (frame); schro_encoder_calc_estimates (frame); SCHRO_ASSERT (frame->have_estimate_tables); error = 255.0 * pow (0.1, frame->encoder->noise_threshold * 0.05); error *= frame->params.video_format->width * frame->params.video_format->height; frame_lambda = schro_encoder_error_to_lambda (frame, error); frame->frame_lambda = frame_lambda; SCHRO_DEBUG ("LAMBDA: %d %g", frame->frame_number, frame_lambda); } schroedinger-1.0.11/schroedinger/schrocuda.h0000644000175000017500000000064111320237456015773 00000000000000 #ifndef __SCHRO_CUDA_H__ #define __SCHRO_CUDA_H__ SCHRO_BEGIN_DECLS #ifdef SCHRO_ENABLE_UNSTABLE_API void schro_cuda_init (void); SchroMemoryDomain *schro_memory_domain_new_cuda (void); void schro_motion_render_cuda (SchroMotion *motion, SchroFrame *dest); void schro_frame_inverse_iwt_transform_cuda (SchroFrame *frame, SchroFrame *transform_frame, SchroParams *params); #endif SCHRO_END_DECLS #endif schroedinger-1.0.11/schroedinger/schrossim.h0000644000175000017500000000035111046356150016026 00000000000000 #ifndef __SCHRO_SSIM_H__ #define __SCHRO_SSIM_H__ #include SCHRO_BEGIN_DECLS #ifdef SCHRO_ENABLE_UNSTABLE_API double schro_frame_ssim (SchroFrame *a, SchroFrame *b); #endif SCHRO_END_DECLS #endif schroedinger-1.0.11/schroedinger/schrometric.c0000644000175000017500000003017111702127430016330 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "schroorc.h" #include int schro_metric_absdiff_u8 (uint8_t * a, int a_stride, uint8_t * b, int b_stride, int width, int height) { uint32_t metric = 0; if (height == 8 && width == 8) { orc_sad_8x8_u8 (&metric, a, a_stride, b, b_stride); } else if (height == 12 && width == 12) { orc_sad_12x12_u8 (&metric, a, a_stride, b, b_stride); } else if (width == 16) { orc_sad_16xn_u8 (&metric, a, a_stride, b, b_stride, height); } else if (width == 32) { orc_sad_32xn_u8 (&metric, a, a_stride, b, b_stride, height); } else { orc_sad_nxm_u8 (&metric, a, a_stride, b, b_stride, width, height); } return metric; } void schro_metric_scan_do_scan (SchroMetricScan * scan) { SchroFrameData *fd; SchroFrameData *fd_ref; int i, j; SCHRO_ASSERT (scan->ref_x + scan->block_width + scan->scan_width - 1 <= scan->frame->width + scan->frame->extension); SCHRO_ASSERT (scan->ref_y + scan->block_height + scan->scan_height - 1 <= scan->frame->height + scan->frame->extension); SCHRO_ASSERT (scan->ref_x >= -scan->frame->extension); SCHRO_ASSERT (scan->ref_y >= -scan->frame->extension); SCHRO_ASSERT (scan->scan_width > 0); SCHRO_ASSERT (scan->scan_height > 0); /* do luma first */ fd = scan->frame->components + 0; fd_ref = scan->ref_frame->components + 0; if (scan->block_width == 8 && scan->block_height == 8) { for (j = 0; j < scan->scan_height; j++) { for (i = 0; i < scan->scan_width; i++) { orc_sad_8x8_u8 (scan->metrics + i * scan->scan_height + j, SCHRO_FRAME_DATA_GET_PIXEL_U8 (fd, scan->x, scan->y), fd->stride, SCHRO_FRAME_DATA_GET_PIXEL_U8 (fd_ref, scan->ref_x + i, scan->ref_y + j), fd_ref->stride); } } } else { for (i = 0; i < scan->scan_width; i++) { for (j = 0; j < scan->scan_height; j++) { scan->metrics[i * scan->scan_height + j] = schro_metric_absdiff_u8 (SCHRO_FRAME_DATA_GET_PIXEL_U8 (fd, scan->x, scan->y), fd->stride, SCHRO_FRAME_DATA_GET_PIXEL_U8 (fd_ref, scan->ref_x + i, scan->ref_y + j), fd_ref->stride, scan->block_width, scan->block_height); } } } memset (scan->chroma_metrics, 0, sizeof (scan->chroma_metrics)); if (scan->use_chroma) { /* now do chroma ME */ int skip_h = 1 << SCHRO_FRAME_FORMAT_H_SHIFT (scan->frame->format) , skip_v = 1 << SCHRO_FRAME_FORMAT_V_SHIFT (scan->frame->format); int x = scan->x / skip_h, y = scan->y / skip_v, ref_x = scan->ref_x / skip_h, ref_y = scan->ref_y / skip_v; int block_width = scan->block_width / skip_h, block_height = scan->block_height / skip_v; int scan_width = (scan->scan_width / skip_h) + (scan->scan_width % skip_h) , scan_height = (scan->scan_height / skip_v) + (scan->scan_height % skip_v); uint32_t metrics[SCHRO_LIMIT_METRIC_SCAN * SCHRO_LIMIT_METRIC_SCAN]; int k; for (k = 1; 3 > k; ++k) { fd = scan->frame->components + k; fd_ref = scan->ref_frame->components + k; for (i = 0; i < scan_width; ++i) { for (j = 0; j < scan_height; ++j) { metrics[i * 2 * scan->scan_height + j * 2] = schro_metric_absdiff_u8 (SCHRO_FRAME_DATA_GET_PIXEL_U8 (fd, x, y), fd->stride, SCHRO_FRAME_DATA_GET_PIXEL_U8 (fd_ref, ref_x + i, ref_y + j) , fd_ref->stride, block_width, block_height); if (skip_v > 1) { metrics[i * 2 * scan->scan_height + 1 + j * 2] = metrics[i * 2 * scan->scan_height + j * 2]; } } if (skip_h > 1) { for (j = 0; j < scan->scan_height; ++j) { metrics[(i * 2 + 1) * scan->scan_height + j] = metrics[i * 2 * scan->scan_height + j]; } } } for (j = 0; j < scan->scan_height; ++j) { for (i = 0; i < scan->scan_width; ++i) { scan->chroma_metrics[i * scan->scan_height + j] += metrics[i * scan->scan_height + j]; } } } } } /* note that gravity_x and gravity_y should contain the seed MV * we use to bias our search */ int schro_metric_scan_get_min (SchroMetricScan * scan, int *dx, int *dy, uint32_t * chroma_error) { int i, j; uint32_t min_metric; uint32_t metric; uint32_t chroma_metric; uint32_t min_chroma_metric = 0; uint32_t min_total_metric = 0; uint32_t tmp; int x, y; SCHRO_ASSERT (scan->scan_width > 0); SCHRO_ASSERT (scan->scan_height > 0); i = scan->gravity_x + scan->x - scan->ref_x; j = scan->gravity_y + scan->y - scan->ref_y; min_metric = scan->metrics[j + i * scan->scan_height]; if (scan->use_chroma) { min_chroma_metric = scan->chroma_metrics[j + i * scan->scan_height]; min_total_metric = min_metric + min_chroma_metric; } for (i = 0; i < scan->scan_width; i++) { for (j = 0; j < scan->scan_height; j++) { metric = scan->metrics[i * scan->scan_height + j]; chroma_metric = scan->chroma_metrics[i * scan->scan_height + j]; x = scan->ref_x + i - scan->x; y = scan->ref_y + j - scan->y; if (scan->use_chroma) { tmp = metric + chroma_metric; if (tmp < min_total_metric) { min_total_metric = tmp; min_metric = metric; min_chroma_metric = chroma_metric; *dx = x; *dy = y; } } else { if (metric < min_metric) { min_metric = metric; *dx = x; *dy = y; } } } } *chroma_error = min_chroma_metric; return min_metric; } void schro_metric_scan_setup (SchroMetricScan * scan, int dx, int dy, int dist, int use_chroma) { int xmin; int xmax; int ymin; int ymax; int xrange; int yrange; SCHRO_ASSERT (scan && scan->frame && scan->ref_frame && dist > 0); xmin = MAX (-scan->block_width, scan->x + dx - dist); xmax = MIN (scan->frame->width, scan->x + dx + dist); ymin = MAX (-scan->block_height, scan->y + dy - dist); ymax = MIN (scan->frame->height, scan->y + dy + dist); xmin = MAX (xmin, -scan->frame->extension); ymin = MAX (ymin, -scan->frame->extension); xmax = MIN (xmax, scan->frame->width - scan->block_width + scan->frame->extension); ymax = MIN (ymax, scan->frame->height - scan->block_height + scan->frame->extension); xrange = xmax - xmin; yrange = ymax - ymin; /* sets ref_x and ref_y */ scan->ref_x = xmin; scan->ref_y = ymin; scan->scan_width = xrange + 1; scan->scan_height = yrange + 1; scan->use_chroma = use_chroma; SCHRO_ASSERT (scan->scan_width <= SCHRO_LIMIT_METRIC_SCAN); SCHRO_ASSERT (scan->scan_height <= SCHRO_LIMIT_METRIC_SCAN); } int schro_metric_get (SchroFrameData * src1, SchroFrameData * src2, int width, int height) { uint32_t metric = 0; #if 0 SCHRO_ASSERT (src1->width >= width); SCHRO_ASSERT (src1->height >= height); SCHRO_ASSERT (src2->width >= width); SCHRO_ASSERT (src2->height >= height); #endif if (height == 8 && width == 8) { orc_sad_8x8_u8 (&metric, src1->data, src1->stride, src2->data, src2->stride); } else if (height == 12 && width == 12) { orc_sad_12x12_u8 (&metric, src1->data, src1->stride, src2->data, src2->stride); } else if (width == 16) { orc_sad_16xn_u8 (&metric, src1->data, src1->stride, src2->data, src2->stride, height); #if 0 } else if (width == 32) { orc_sad_32xn_u8 (&metric, src1->data, src1->stride, src2->data, src2->stride, height); #endif } else { orc_sad_nxm_u8 (&metric, src1->data, src1->stride, src2->data, src2->stride, width, height); } return metric; } int schro_metric_get_dc (SchroFrameData * src, int value, int width, int height) { int i, j; int metric = 0; uint8_t *line; SCHRO_ASSERT (src->width >= width); SCHRO_ASSERT (src->height >= height); for (j = 0; j < height; j++) { line = SCHRO_FRAME_DATA_GET_LINE (src, j); for (i = 0; i < width; i++) { metric += abs (value - line[i]); } } return metric; } int schro_metric_get_biref (SchroFrameData * fd, SchroFrameData * src1, int weight1, SchroFrameData * src2, int weight2, int shift, int width, int height) { int i, j; int metric = 0; uint8_t *line; uint8_t *src1_line; uint8_t *src2_line; int offset = (1 << (shift - 1)); int x; #if 0 SCHRO_ASSERT (fd->width >= width); SCHRO_ASSERT (fd->height >= height); SCHRO_ASSERT (src1->width >= width); SCHRO_ASSERT (src1->height >= height); SCHRO_ASSERT (src2->width >= width); SCHRO_ASSERT (src2->height >= height); #endif for (j = 0; j < height; j++) { line = SCHRO_FRAME_DATA_GET_LINE (fd, j); src1_line = SCHRO_FRAME_DATA_GET_LINE (src1, j); src2_line = SCHRO_FRAME_DATA_GET_LINE (src2, j); for (i = 0; i < width; i++) { x = (src1_line[i] * weight1 + src2_line[i] * weight2 + offset) >> shift; metric += abs (line[i] - x); } } return metric; } static int schro_frame_block_is_valid (SchroFrame *frame, int x, int y, int sx, int sy) { #if 0 SCHRO_ERROR("block %d %d %d %d, frame %d %d %d %d", x, y, x + sx, y + sy, -frame->extension, -frame->extension, frame->width + frame->extension, frame->height + frame->extension); #endif if (x < -frame->extension || y < -frame->extension || x + sx > frame->width + frame->extension || y + sy > frame->height + frame->extension) { SCHRO_ERROR("block %d %d %d %d, frame %d %d %d %d", x, y, x + sx, y + sy, -frame->extension, -frame->extension, frame->width + frame->extension, frame->height + frame->extension); return FALSE; } return TRUE; } static int schro_metric_block_sad_slow (SchroMetricInfo *info, int x, int y, int dx, int dy) { int i,j; int k; SchroFrameData fd; SchroFrameData fd_ref; int metric = 0; #if 0 SCHRO_ASSERT (schro_frame_block_is_valid (info->frame, x, y, info->block_width, info->block_height)); SCHRO_ASSERT (schro_frame_block_is_valid (info->ref_frame, x + dx, y + dy, info->block_width, info->block_height)); #endif if (!schro_frame_block_is_valid (info->frame, x, y, info->block_width[0], info->block_height[0])) return INT_MAX; if (!schro_frame_block_is_valid (info->ref_frame, x + dx, y + dy, info->block_width[0], info->block_height[0])) return INT_MAX; for(k=0;k<3;k++){ int width, height; schro_frame_get_subdata (info->frame, &fd, k, x>>info->h_shift[k], y>>info->v_shift[k]); schro_frame_get_subdata (info->ref_frame, &fd_ref, k, (x + dx)>>info->h_shift[k], (y + dy)>>info->v_shift[k]); width = MIN(fd.width, info->block_width[k]); height = MIN(fd.height, info->block_height[k]); for(j=0;jframe = frame; info->ref_frame = ref_frame; info->block_width[0] = block_width; info->block_height[0] = block_height; info->h_shift[0] = 0; info->v_shift[0] = 0; info->h_shift[1] = SCHRO_FRAME_FORMAT_H_SHIFT (frame->format); info->v_shift[1] = SCHRO_FRAME_FORMAT_V_SHIFT (frame->format); info->block_width[1] = block_width >> SCHRO_FRAME_FORMAT_H_SHIFT (frame->format); info->block_height[1] = block_height >> SCHRO_FRAME_FORMAT_V_SHIFT (frame->format); info->h_shift[2] = SCHRO_FRAME_FORMAT_H_SHIFT (frame->format); info->v_shift[2] = SCHRO_FRAME_FORMAT_V_SHIFT (frame->format); info->block_width[2] = info->block_width[1]; info->block_height[2] = info->block_height[1]; info->metric = schro_metric_block_sad_slow; info->metric_right = schro_metric_block_sad_slow; info->metric_bottom = schro_metric_block_sad_slow; info->metric_corner = schro_metric_block_sad_slow; } int schro_metric_fast_block (SchroMetricInfo *info, int x, int y, int dx, int dy) { return info->metric (info, x, y, dx, dy); } schroedinger-1.0.11/schroedinger/schromotionref.c0000644000175000017500000002113311541755167017064 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include int _schro_motion_ref = FALSE; static int get_pixel (SchroMotion * motion, int k, SchroUpsampledFrame * upframe, int x, int y, int dx, int dy); int schro_motion_pixel_predict_block (SchroMotion * motion, int x, int y, int k, int i, int j); static void schro_motion_get_global_vector (SchroMotion * motion, int ref, int x, int y, int *dx, int *dy) { SchroParams *params = motion->params; SchroGlobalMotion *gm = params->global_motion + ref; int alpha, beta; int scale; alpha = gm->a_exp; beta = gm->c_exp; scale = (1 << beta) - (gm->c0 * x + gm->c1 * y); *dx = scale * (gm->a00 * x + gm->a01 * y + (1 << alpha) * gm->b0); *dy = scale * (gm->a10 * x + gm->a11 * y + (1 << alpha) * gm->b1); *dx >>= (alpha + beta); *dy >>= (alpha + beta); } static int schro_motion_pixel_predict (SchroMotion * motion, int x, int y, int k) { int i, j; int value; i = (x + motion->xoffset) / motion->xbsep - 1; j = (y + motion->yoffset) / motion->ybsep - 1; value = schro_motion_pixel_predict_block (motion, x, y, k, i, j); value += schro_motion_pixel_predict_block (motion, x, y, k, i + 1, j); value += schro_motion_pixel_predict_block (motion, x, y, k, i, j + 1); value += schro_motion_pixel_predict_block (motion, x, y, k, i + 1, j + 1); return ROUND_SHIFT (value, 6); } static int get_dc_pixel (SchroMotion * motion, int i, int j, int k, int x, int y) { SchroParams *params = motion->params; SchroMotionVector *mv; mv = &motion->motion_vectors[j * params->x_num_blocks + i]; return mv->u.dc.dc[k] + 128; } static int get_ref1_pixel (SchroMotion * motion, int i, int j, int k, int x, int y) { SchroParams *params = motion->params; SchroMotionVector *mv; int value; int dx, dy; mv = &motion->motion_vectors[j * params->x_num_blocks + i]; if (mv->using_global) { schro_motion_get_global_vector (motion, 0, x, y, &dx, &dy); } else { dx = mv->u.vec.dx[0]; dy = mv->u.vec.dy[0]; } value = (motion->ref1_weight + motion->ref2_weight) * get_pixel (motion, k, motion->src1, x, y, dx, dy); return ROUND_SHIFT (value, motion->ref_weight_precision); } static int get_ref2_pixel (SchroMotion * motion, int i, int j, int k, int x, int y) { SchroParams *params = motion->params; SchroMotionVector *mv; int value; int dx, dy; mv = &motion->motion_vectors[j * params->x_num_blocks + i]; if (mv->using_global) { schro_motion_get_global_vector (motion, 1, x, y, &dx, &dy); } else { dx = mv->u.vec.dx[1]; dy = mv->u.vec.dy[1]; } value = (motion->ref1_weight + motion->ref2_weight) * get_pixel (motion, k, motion->src2, x, y, dx, dy); return ROUND_SHIFT (value, motion->ref_weight_precision); } static int get_biref_pixel (SchroMotion * motion, int i, int j, int k, int x, int y) { SchroParams *params = motion->params; SchroMotionVector *mv; int value; int dx0, dx1, dy0, dy1; mv = &motion->motion_vectors[j * params->x_num_blocks + i]; if (mv->using_global) { schro_motion_get_global_vector (motion, 0, x, y, &dx0, &dy0); schro_motion_get_global_vector (motion, 1, x, y, &dx1, &dy1); } else { dx0 = mv->u.vec.dx[0]; dy0 = mv->u.vec.dy[0]; dx1 = mv->u.vec.dx[1]; dy1 = mv->u.vec.dy[1]; } value = motion->ref1_weight * get_pixel (motion, k, motion->src1, x, y, dx0, dy0); value += motion->ref2_weight * get_pixel (motion, k, motion->src2, x, y, dx1, dy1); return ROUND_SHIFT (value, motion->ref_weight_precision); } static int get_pixel (SchroMotion * motion, int k, SchroUpsampledFrame * upframe, int x, int y, int dx, int dy) { int px, py; if (k > 0) { dx >>= SCHRO_CHROMA_FORMAT_H_SHIFT (motion->params-> video_format->chroma_format); dy >>= SCHRO_CHROMA_FORMAT_V_SHIFT (motion->params-> video_format->chroma_format); } px = (x << motion->mv_precision) + dx; py = (y << motion->mv_precision) + dy; return schro_upsampled_frame_get_pixel_precN (upframe, k, px, py, motion->mv_precision); } static int get_ramp (int x, int offset) { if (offset == 1) { if (x == 0) return 3; return 5; } return 1 + (6 * x + offset - 1) / (2 * offset - 1); } int schro_motion_pixel_predict_block (SchroMotion * motion, int x, int y, int k, int i, int j) { SchroParams *params = motion->params; SchroMotionVector *mv; int xmin, xmax, ymin, ymax; int wx, wy; int value; int width, height; if (i < 0 || j < 0) return 0; if (i >= params->x_num_blocks || j >= params->y_num_blocks) return 0; width = motion->xbsep * params->x_num_blocks; height = motion->ybsep * params->y_num_blocks; xmin = i * motion->xbsep - motion->xoffset; ymin = j * motion->ybsep - motion->yoffset; xmax = (i + 1) * motion->xbsep + motion->xoffset; ymax = (j + 1) * motion->ybsep + motion->yoffset; if (x < xmin || y < ymin || x >= xmax || y >= ymax) return 0; if (motion->xoffset == 0) { wx = 8; } else if (x < motion->xoffset || x >= width - motion->xoffset) { wx = 8; } else if (x - xmin < 2 * motion->xoffset) { wx = get_ramp (x - xmin, motion->xoffset); } else if (xmax - 1 - x < 2 * motion->xoffset) { wx = get_ramp (xmax - 1 - x, motion->xoffset); } else { wx = 8; } if (motion->yoffset == 0) { wy = 8; } else if (y < motion->yoffset || y >= height - motion->yoffset) { wy = 8; } else if (y - ymin < 2 * motion->yoffset) { wy = get_ramp (y - ymin, motion->yoffset); } else if (ymax - 1 - y < 2 * motion->yoffset) { wy = get_ramp (ymax - 1 - y, motion->yoffset); } else { wy = 8; } mv = &motion->motion_vectors[j * params->x_num_blocks + i]; switch (mv->pred_mode) { case 0: value = get_dc_pixel (motion, i, j, k, x, y); break; case 1: value = get_ref1_pixel (motion, i, j, k, x, y); break; case 2: value = get_ref2_pixel (motion, i, j, k, x, y); break; case 3: value = get_biref_pixel (motion, i, j, k, x, y); break; default: value = 0; break; } return value * wx * wy; } void schro_motion_render_ref (SchroMotion * motion, SchroFrame * dest, SchroFrame * addframe, int add, SchroFrame * output_frame) { SchroParams *params = motion->params; int k; int x, y; int16_t *line; int16_t *addline; uint8_t *oline; if (params->num_refs == 1) { SCHRO_ASSERT (params->picture_weight_2 == 1); } motion->ref_weight_precision = params->picture_weight_bits; motion->ref1_weight = params->picture_weight_1; motion->ref2_weight = params->picture_weight_2; motion->mv_precision = params->mv_precision; for (k = 0; k < 3; k++) { SchroFrameData *comp = dest->components + k; if (k == 0) { motion->xbsep = params->xbsep_luma; motion->ybsep = params->ybsep_luma; motion->xblen = params->xblen_luma; motion->yblen = params->yblen_luma; } else { motion->xbsep = params->xbsep_luma >> SCHRO_CHROMA_FORMAT_H_SHIFT (motion->params-> video_format->chroma_format); motion->ybsep = params->ybsep_luma >> SCHRO_CHROMA_FORMAT_V_SHIFT (motion-> params->video_format->chroma_format); motion->xblen = params->xblen_luma >> SCHRO_CHROMA_FORMAT_H_SHIFT (motion-> params->video_format->chroma_format); motion->yblen = params->yblen_luma >> SCHRO_CHROMA_FORMAT_V_SHIFT (motion-> params->video_format->chroma_format); } motion->xoffset = (motion->xblen - motion->xbsep) / 2; motion->yoffset = (motion->yblen - motion->ybsep) / 2; for (y = 0; y < comp->height; y++) { line = SCHRO_FRAME_DATA_GET_LINE (comp, y); for (x = 0; x < comp->width; x++) { line[x] = CLAMP (schro_motion_pixel_predict (motion, x, y, k), 0, 255); /* Note: the 128 offset converts the 0-255 range of the reference * pictures into the bipolar range used for Dirac signal processing */ line[x] -= 128; } } if (add) { for (y = 0; y < comp->height; y++) { line = SCHRO_FRAME_DATA_GET_LINE (comp, y); addline = SCHRO_FRAME_DATA_GET_LINE (addframe->components + k, y); oline = SCHRO_FRAME_DATA_GET_LINE (output_frame->components + k, y); for (x = 0; x < comp->width; x++) { oline[x] = CLAMP (addline[x] + line[x] + 128, 0, 255); } } } else { for (y = 0; y < comp->height; y++) { line = SCHRO_FRAME_DATA_GET_LINE (comp, y); addline = SCHRO_FRAME_DATA_GET_LINE (addframe->components + k, y); for (x = 0; x < comp->width; x++) { addline[x] -= line[x]; } } } } } schroedinger-1.0.11/schroedinger/schroversion.h.in0000644000175000017500000000075311320237456017155 00000000000000 #ifndef __SCHRO_VERSION_H__ #define __SCHRO_VERSION_H__ #define SCHRO_VERSION_MAJOR (@PACKAGE_VERSION_MAJOR@) #define SCHRO_VERSION_MINOR (@PACKAGE_VERSION_MINOR@) #define SCHRO_VERSION_MICRO (@PACKAGE_VERSION_MICRO@) #define SCHRO_CHECK_VERSION(major,minor,micro) \ (SCHRO_VERSION_MAJOR > (major) || \ (SCHRO_VERSION_MAJOR == (major) && SCHRO_VERSION_MINOR > (minor)) || \ (SCHRO_VERSION_MAJOR == (major) && SCHRO_VERSION_MINOR == (minor) && \ SCHRO_VERSION_MICRO >= (micro))) #endif schroedinger-1.0.11/schroedinger/schrounpack.c0000644000175000017500000002122611556115124016333 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include static void _schro_unpack_shift_in (SchroUnpack * unpack); static unsigned int _schro_unpack_shift_out (SchroUnpack * unpack, int n); void schro_unpack_init_with_data (SchroUnpack * unpack, uint8_t * data, int n_bytes, unsigned int guard_bit) { memset (unpack, 0, sizeof (SchroUnpack)); unpack->data = data; unpack->n_bits_left = 8 * n_bytes; unpack->guard_bit = guard_bit; } void schro_unpack_copy (SchroUnpack * dest, SchroUnpack * src) { memcpy (dest, src, sizeof (SchroUnpack)); } int schro_unpack_get_bits_read (SchroUnpack * unpack) { return unpack->n_bits_read; } #ifdef unused int schro_unpack_get_bits_remaining (SchroUnpack * unpack) { if (unpack->overrun) { return 0; } return unpack->n_bits_left + unpack->n_bits_in_shift_register; } #endif void schro_unpack_limit_bits_remaining (SchroUnpack * unpack, int n_bits) { if (n_bits <= unpack->n_bits_in_shift_register) { unpack->n_bits_in_shift_register = n_bits; unpack->shift_register &= ~(0xffffffff >> n_bits); unpack->n_bits_left = 0; return; } unpack->n_bits_left = n_bits - unpack->n_bits_in_shift_register; } #if 0 void schro_unpack_dumpbits (SchroUnpack * unpack) { } #endif static void _schro_unpack_shift_in (SchroUnpack * unpack) { if (unpack->n_bits_left >= 32) { /* the fast path */ if (unpack->n_bits_in_shift_register == 0) { unpack->shift_register = (unpack->data[0] << 24) | (unpack-> data[1] << 16) | (unpack->data[2] << 8) | (unpack->data[3]); unpack->data += 4; unpack->n_bits_left -= 32; unpack->n_bits_in_shift_register = 32; } else { while (unpack->n_bits_in_shift_register <= 24) { unpack->shift_register |= unpack->data[0] << (24 - unpack->n_bits_in_shift_register); unpack->data++; unpack->n_bits_left -= 8; unpack->n_bits_in_shift_register += 8; } } return; } if (unpack->n_bits_left == 0) { unsigned int value = (unpack->guard_bit) ? 0xffffffff : 0; unpack->overrun += 32 - unpack->n_bits_in_shift_register; unpack->shift_register |= (value >> unpack->n_bits_in_shift_register); unpack->n_bits_in_shift_register = 32; return; } while (unpack->n_bits_left >= 8 && unpack->n_bits_in_shift_register <= 24) { unpack->shift_register |= unpack->data[0] << (24 - unpack->n_bits_in_shift_register); unpack->data++; unpack->n_bits_left -= 8; unpack->n_bits_in_shift_register += 8; } if (unpack->n_bits_left > 0 && unpack->n_bits_in_shift_register + unpack->n_bits_left <= 32) { unsigned int value; value = unpack->data[0] >> (8 - unpack->n_bits_left); unpack->shift_register |= value << (32 - unpack->n_bits_in_shift_register - unpack->n_bits_left); unpack->data++; unpack->n_bits_in_shift_register += unpack->n_bits_left; unpack->n_bits_left = 0; } } static unsigned int _schro_unpack_shift_out (SchroUnpack * unpack, int n) { unsigned int value; if (n == 0) return 0; value = unpack->shift_register >> (32 - n); unpack->shift_register <<= n; unpack->n_bits_in_shift_register -= n; unpack->n_bits_read += n; return value; } void schro_unpack_skip_bits (SchroUnpack * unpack, int n_bits) { int n_bytes; if (n_bits <= unpack->n_bits_in_shift_register) { _schro_unpack_shift_out (unpack, n_bits); return; } n_bits -= unpack->n_bits_in_shift_register; _schro_unpack_shift_out (unpack, unpack->n_bits_in_shift_register); n_bytes = MIN (n_bits >> 3, unpack->n_bits_left >> 3); unpack->data += n_bytes; unpack->n_bits_read += n_bytes * 8; unpack->n_bits_left -= n_bytes * 8; n_bits -= n_bytes * 8; if (n_bits == 0) return; _schro_unpack_shift_in (unpack); if (n_bits <= unpack->n_bits_in_shift_register) { _schro_unpack_shift_out (unpack, n_bits); return; } unpack->n_bits_in_shift_register = 0; unpack->shift_register = 0; unpack->overrun += n_bits; unpack->n_bits_read += n_bits; } void schro_unpack_byte_sync (SchroUnpack * unpack) { if (unpack->n_bits_read & 7) { schro_unpack_skip_bits (unpack, 8 - (unpack->n_bits_read & 7)); } } unsigned int schro_unpack_decode_bit (SchroUnpack * unpack) { if (unpack->n_bits_in_shift_register < 1) { _schro_unpack_shift_in (unpack); } return _schro_unpack_shift_out (unpack, 1); } unsigned int schro_unpack_decode_bits (SchroUnpack * unpack, int n) { unsigned int value; int m; m = MIN (n, unpack->n_bits_in_shift_register); value = _schro_unpack_shift_out (unpack, m) << (n - m); n -= m; while (n > 0) { _schro_unpack_shift_in (unpack); m = MIN (n, unpack->n_bits_in_shift_register); value |= _schro_unpack_shift_out (unpack, m) << (n - m); n -= m; } return value; } unsigned int schro_unpack_decode_uint (SchroUnpack * unpack) { int count; int value; count = 0; value = 0; while (!schro_unpack_decode_bit (unpack)) { count++; value <<= 1; value |= schro_unpack_decode_bit (unpack); } return (1 << count) - 1 + value; } int schro_unpack_decode_sint_slow (SchroUnpack * unpack) { int value; value = schro_unpack_decode_uint (unpack); if (value) { if (schro_unpack_decode_bit (unpack)) { value = -value; } } return value; } int schro_unpack_decode_sint (SchroUnpack * unpack) { int value; int i; const int16_t *table_entry; int x; if (unpack->n_bits_in_shift_register < SCHRO_UNPACK_TABLE_SHIFT) { _schro_unpack_shift_in (unpack); } if (unpack->n_bits_in_shift_register >= SCHRO_UNPACK_TABLE_SHIFT) { i = unpack->shift_register >> (32 - SCHRO_UNPACK_TABLE_SHIFT); table_entry = schro_table_unpack_sint[i]; x = table_entry[0]; if (x & 0xf) { value = x >> 4; _schro_unpack_shift_out (unpack, x & 0xf); return value; } } return schro_unpack_decode_sint_slow (unpack); } typedef const int16_t SchroUnpackTableEntry[10]; void schro_unpack_decode_sint_s16 (int16_t * dest, SchroUnpack * unpack, int n) { int i; int j; const int16_t *table_entry; int x; int z; SchroUnpackTableEntry *table = schro_table_unpack_sint; while (n > 0) { while (unpack->n_bits_in_shift_register < 8 + SCHRO_UNPACK_TABLE_SHIFT) { _schro_unpack_shift_in (unpack); } i = unpack->shift_register >> (32 - SCHRO_UNPACK_TABLE_SHIFT); table_entry = table[i]; x = table_entry[0]; if ((x & 0xf) == 0) { int y = x >> 4; i = (unpack->shift_register & 0xffffff) >> (24 - SCHRO_UNPACK_TABLE_SHIFT); table_entry = table[i]; x = table_entry[0]; if ((x & 0xf) == 0) { dest[0] = schro_unpack_decode_sint_slow (unpack); dest++; n--; } else { int bits = ((x & 0xf) >> 1) - 1; z = x >> 4; if (z > 0) { dest[0] = z + (y << bits); } else { dest[0] = z - (y << bits); } _schro_unpack_shift_out (unpack, (x & 0xf) + 8); dest++; n--; } } else { j = 0; do { dest[j] = x >> 4; j++; n--; x = table_entry[j]; } while (n > 0 && x & 0xf); x = table_entry[j - 1]; _schro_unpack_shift_out (unpack, x & 0xf); dest += j; } } } void schro_unpack_decode_sint_s32 (int32_t * dest, SchroUnpack * unpack, int n) { int i; int j; const int16_t *table_entry; int x; int z; SchroUnpackTableEntry *table = schro_table_unpack_sint; while (n > 0) { while (unpack->n_bits_in_shift_register < 8 + SCHRO_UNPACK_TABLE_SHIFT) { _schro_unpack_shift_in (unpack); } i = unpack->shift_register >> (32 - SCHRO_UNPACK_TABLE_SHIFT); table_entry = table[i]; x = table_entry[0]; if ((x & 0xf) == 0) { int y = x >> 4; i = (unpack->shift_register & 0xffffff) >> (24 - SCHRO_UNPACK_TABLE_SHIFT); table_entry = table[i]; x = table_entry[0]; if ((x & 0xf) == 0) { dest[0] = schro_unpack_decode_sint_slow (unpack); dest++; n--; } else { int bits = ((x & 0xf) >> 1) - 1; z = x >> 4; if (z > 0) { dest[0] = z + (y << bits); } else { dest[0] = z - (y << bits); } _schro_unpack_shift_out (unpack, (x & 0xf) + 8); dest++; n--; } } else { j = 0; do { dest[j] = x >> 4; j++; n--; x = table_entry[j]; } while (n > 0 && x & 0xf); x = table_entry[j - 1]; _schro_unpack_shift_out (unpack, x & 0xf); dest += j; } } } schroedinger-1.0.11/schroedinger/schromotion8.c0000644000175000017500000007660011556115124016455 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include /* runtime orc code generation */ static SchroMotionFuncs motion_funcs[32]; static void schro_motion_init_functions (SchroMotion * motion) { if (motion_funcs[motion->xblen >> 1].block_accumulate == NULL) { OrcProgram *p; OrcCompileResult result; p = orc_program_new (); orc_program_set_constant_n (p, motion->xblen); orc_program_set_2d (p); orc_program_set_name (p, "block_acc_Xxn"); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_temporary (p, 2, "t1"); orc_program_append (p, "convubw", ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_D1); orc_program_append (p, "mullw", ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_S1); orc_program_append (p, "addw", ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1); result = orc_program_compile (p); if (!ORC_COMPILE_RESULT_IS_SUCCESSFUL (result)) { SCHRO_ERROR ("compile failed"); } motion_funcs[motion->xblen / 2].block_accumulate = p; } if (motion_funcs[motion->xblen >> 1].block_accumulate_scaled == NULL) { OrcProgram *p; OrcCompileResult result; p = orc_program_new (); orc_program_set_constant_n (p, motion->xblen); orc_program_set_2d (p); orc_program_set_name (p, "block_acc_scaled_Xxn"); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_constant (p, 2, 32, "c1"); orc_program_add_constant (p, 2, 6, "c2"); orc_program_add_temporary (p, 2, "t1"); orc_program_append (p, "convubw", ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_D1); orc_program_append (p, "mullw", ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P1); orc_program_append (p, "addw", ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1); orc_program_append (p, "shrsw", ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C2); orc_program_append (p, "mullw", ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_S1); orc_program_append (p, "addw", ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1); result = orc_program_compile (p); if (!ORC_COMPILE_RESULT_IS_SUCCESSFUL (result)) { SCHRO_ERROR ("compile failed"); } motion_funcs[motion->xblen / 2].block_accumulate_scaled = p; } if (motion_funcs[motion->xblen >> 1].block_accumulate_dc == NULL) { OrcProgram *p; OrcCompileResult result; p = orc_program_new (); orc_program_set_constant_n (p, motion->xblen); orc_program_set_2d (p); orc_program_set_name (p, "block_acc_dc_Xxn"); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_temporary (p, 2, "t1"); orc_program_append (p, "mullw", ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_P1); orc_program_append (p, "addw", ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1); result = orc_program_compile (p); if (!ORC_COMPILE_RESULT_IS_SUCCESSFUL (result)) { SCHRO_ERROR ("compile failed"); } motion_funcs[motion->xblen / 2].block_accumulate_dc = p; } if (motion_funcs[motion->xblen >> 1].block_accumulate_avg == NULL) { OrcProgram *p; OrcCompileResult result; p = orc_program_new (); orc_program_set_constant_n (p, motion->xblen); orc_program_set_2d (p); orc_program_set_name (p, "block_acc_avg_Xxn"); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_source (p, 1, "s3"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 1, "t2"); orc_program_append (p, "avgub", ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_S3); orc_program_append (p, "convubw", ORC_VAR_T1, ORC_VAR_T2, 0); orc_program_append (p, "mullw", ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_S1); orc_program_append (p, "addw", ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1); result = orc_program_compile (p); if (!ORC_COMPILE_RESULT_IS_SUCCESSFUL (result)) { SCHRO_ERROR ("compile failed"); } motion_funcs[motion->xblen / 2].block_accumulate_avg = p; } if (motion_funcs[motion->xblen >> 1].block_accumulate_biref == NULL) { OrcProgram *p; OrcCompileResult result; p = orc_program_new (); orc_program_set_constant_n (p, motion->xblen); orc_program_set_2d (p); orc_program_set_name (p, "block_acc_biref_Xxn"); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_source (p, 1, "s3"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_constant (p, 2, 32, "c1"); orc_program_add_constant (p, 2, 6, "c2"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append (p, "convubw", ORC_VAR_T1, ORC_VAR_S2, 0); orc_program_append (p, "mullw", ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P1); orc_program_append (p, "convubw", ORC_VAR_T2, ORC_VAR_S3, 0); orc_program_append (p, "mullw", ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P2); orc_program_append (p, "addw", ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2); orc_program_append (p, "addw", ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1); orc_program_append (p, "shrsw", ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C2); orc_program_append (p, "mullw", ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_S1); orc_program_append (p, "addw", ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1); result = orc_program_compile (p); if (!ORC_COMPILE_RESULT_IS_SUCCESSFUL (result)) { SCHRO_ERROR ("compile failed"); } motion_funcs[motion->xblen / 2].block_accumulate_biref = p; } } static void orc_multiply_and_acc_Xxn_s16_u8 (int16_t * d1, int d1_stride, const int16_t * s1, int s1_stride, const uint8_t * s2, int s2_stride, int n, int m) { OrcExecutor _ex, *ex = &_ex; OrcProgram *p = 0; void (*func) (OrcExecutor *); p = motion_funcs[n >> 1].block_accumulate; ex->program = p; ex->n = n; ORC_EXECUTOR_M (ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *) s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *) s2; ex->params[ORC_VAR_S2] = s2_stride; func = p->code_exec; func (ex); } static void orc_multiply_and_acc_scaled_Xxn_s16_u8 (int16_t * d1, int d1_stride, const int16_t * s1, int s1_stride, const uint8_t * s2, int s2_stride, int p1, int n, int m) { OrcExecutor _ex, *ex = &_ex; OrcProgram *p = 0; void (*func) (OrcExecutor *); p = motion_funcs[n >> 1].block_accumulate_scaled; ex->program = p; ex->n = n; ORC_EXECUTOR_M (ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *) s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *) s2; ex->params[ORC_VAR_S2] = s2_stride; ex->params[ORC_VAR_P1] = p1; func = p->code_exec; func (ex); } static void orc_multiply_and_acc_dc_Xxn_s16_u8 (int16_t * d1, int d1_stride, const int16_t * s1, int s1_stride, int p1, int n, int m) { OrcExecutor _ex, *ex = &_ex; OrcProgram *p = 0; void (*func) (OrcExecutor *); p = motion_funcs[n >> 1].block_accumulate_dc; ex->program = p; ex->n = n; ORC_EXECUTOR_M (ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *) s1; ex->params[ORC_VAR_S1] = s1_stride; ex->params[ORC_VAR_P1] = p1; func = p->code_exec; func (ex); } static void orc_multiply_and_acc_avg_Xxn_s16_u8 (int16_t * d1, int d1_stride, const int16_t * s1, int s1_stride, const uint8_t * s2, int s2_stride, const uint8_t * s3, int s3_stride, int n, int m) { OrcExecutor _ex, *ex = &_ex; OrcProgram *p; void (*func) (OrcExecutor *); p = motion_funcs[n >> 1].block_accumulate_avg; ex->program = p; ex->n = n; ORC_EXECUTOR_M (ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *) s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *) s2; ex->params[ORC_VAR_S2] = s2_stride; ex->arrays[ORC_VAR_S3] = (void *) s3; ex->params[ORC_VAR_S3] = s3_stride; func = p->code_exec; func (ex); } static void orc_multiply_and_acc_biref_Xxn_s16_u8 (int16_t * d1, int d1_stride, const int16_t * s1, int s1_stride, const uint8_t * s2, int s2_stride, const uint8_t * s3, int s3_stride, int p1, int p2, int n, int m) { OrcExecutor _ex, *ex = &_ex; OrcProgram *p; void (*func) (OrcExecutor *); p = motion_funcs[n >> 1].block_accumulate_biref; ex->program = p; ex->n = n; ORC_EXECUTOR_M (ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *) s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *) s2; ex->params[ORC_VAR_S2] = s2_stride; ex->arrays[ORC_VAR_S3] = (void *) s3; ex->params[ORC_VAR_S3] = s3_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = p->code_exec; func (ex); } /* motion render (faster) */ static void get_block (SchroMotion * motion, int k, int ref, int i, int j, int dx, int dy) { int px, py; int x, y; SchroUpsampledFrame *upframe; int exp; if (k > 0) { dx >>= SCHRO_CHROMA_FORMAT_H_SHIFT (motion->params-> video_format->chroma_format); dy >>= SCHRO_CHROMA_FORMAT_V_SHIFT (motion->params-> video_format->chroma_format); } if (ref) { upframe = motion->src2; } else { upframe = motion->src1; } x = motion->xbsep * i - motion->xoffset; y = motion->ybsep * j - motion->yoffset; px = (x << motion->mv_precision) + dx; py = (y << motion->mv_precision) + dy; exp = 32 << motion->mv_precision; px = CLAMP (px, -exp, motion->max_fast_x + exp - 1); py = CLAMP (py, -exp, motion->max_fast_y + exp - 1); schro_upsampled_frame_get_block_fast_precN (upframe, k, px, py, motion->mv_precision, &motion->block_ref[ref], &motion->alloc_block_ref[ref]); } static void get_dc_block (SchroMotion * motion, int i, int j, int k, int x, int y) { SchroParams *params = motion->params; SchroMotionVector *mv; int value; int ii, jj; mv = &motion->motion_vectors[j * params->x_num_blocks + i]; memcpy (&motion->block, &motion->alloc_block, sizeof (SchroFrameData)); value = mv->u.dc.dc[k]; for (jj = 0; jj < motion->yblen; jj++) { uint8_t *data = SCHRO_FRAME_DATA_GET_LINE (&motion->block, jj); /* FIXME splat */ for (ii = 0; ii < motion->xblen; ii++) { data[ii] = value + 128; } } } static void get_ref1_block_simple (SchroMotion * motion, int i, int j, int k, int x, int y) { SchroParams *params = motion->params; SchroMotionVector *mv; mv = &motion->motion_vectors[j * params->x_num_blocks + i]; SCHRO_ASSERT (mv->using_global == FALSE); get_block (motion, k, 0, i, j, mv->u.vec.dx[0], mv->u.vec.dy[0]); } static void get_ref1_block (SchroMotion * motion, int i, int j, int k, int x, int y) { SchroParams *params = motion->params; SchroMotionVector *mv; int ii, jj; int weight; int shift; mv = &motion->motion_vectors[j * params->x_num_blocks + i]; SCHRO_ASSERT (mv->using_global == FALSE); get_block (motion, k, 0, i, j, mv->u.vec.dx[0], mv->u.vec.dy[0]); weight = motion->ref1_weight + motion->ref2_weight; shift = motion->ref_weight_precision; if (motion->oneref_noscale) { memcpy (&motion->block, &motion->block_ref[0], sizeof (SchroFrameData)); } else { memcpy (&motion->block, &motion->alloc_block, sizeof (SchroFrameData)); for (jj = 0; jj < motion->yblen; jj++) { uint8_t *d = SCHRO_FRAME_DATA_GET_LINE (&motion->block, jj); uint8_t *s = SCHRO_FRAME_DATA_GET_LINE (&motion->block_ref[0], jj); for (ii = 0; ii < motion->xblen; ii++) { d[ii] = ROUND_SHIFT (s[ii] * weight, shift); } } } } static void get_ref2_block_simple (SchroMotion * motion, int i, int j, int k, int x, int y) { SchroParams *params = motion->params; SchroMotionVector *mv; mv = &motion->motion_vectors[j * params->x_num_blocks + i]; SCHRO_ASSERT (mv->using_global == FALSE); get_block (motion, k, 1, i, j, mv->u.vec.dx[1], mv->u.vec.dy[1]); } static void get_ref2_block (SchroMotion * motion, int i, int j, int k, int x, int y) { SchroParams *params = motion->params; SchroMotionVector *mv; int ii, jj; int weight; int shift; mv = &motion->motion_vectors[j * params->x_num_blocks + i]; SCHRO_ASSERT (mv->using_global == FALSE); get_block (motion, k, 1, i, j, mv->u.vec.dx[1], mv->u.vec.dy[1]); weight = motion->ref1_weight + motion->ref2_weight; shift = motion->ref_weight_precision; if (motion->oneref_noscale) { memcpy (&motion->block, &motion->block_ref[1], sizeof (SchroFrameData)); } else { memcpy (&motion->block, &motion->alloc_block, sizeof (SchroFrameData)); for (jj = 0; jj < motion->yblen; jj++) { uint8_t *d = SCHRO_FRAME_DATA_GET_LINE (&motion->block, jj); uint8_t *s = SCHRO_FRAME_DATA_GET_LINE (&motion->block_ref[1], jj); for (ii = 0; ii < motion->xblen; ii++) { d[ii] = ROUND_SHIFT (s[ii] * weight, shift); } } } } static void get_biref_block_simple (SchroMotion * motion, int i, int j, int k, int x, int y) { SchroParams *params = motion->params; SchroMotionVector *mv; mv = &motion->motion_vectors[j * params->x_num_blocks + i]; SCHRO_ASSERT (mv->using_global == FALSE); get_block (motion, k, 0, i, j, mv->u.vec.dx[0], mv->u.vec.dy[0]); get_block (motion, k, 1, i, j, mv->u.vec.dx[1], mv->u.vec.dy[1]); } static void get_biref_block (SchroMotion * motion, int i, int j, int k, int x, int y) { SchroParams *params = motion->params; SchroMotionVector *mv; int weight0, weight1; int shift; mv = &motion->motion_vectors[j * params->x_num_blocks + i]; SCHRO_ASSERT (mv->using_global == FALSE); get_block (motion, k, 0, i, j, mv->u.vec.dx[0], mv->u.vec.dy[0]); get_block (motion, k, 1, i, j, mv->u.vec.dx[1], mv->u.vec.dy[1]); weight0 = motion->ref1_weight; weight1 = motion->ref2_weight; shift = motion->ref_weight_precision; memcpy (&motion->block, &motion->alloc_block, sizeof (SchroFrameData)); if (motion->simple_weight) { switch (motion->xblen) { case 8: orc_avg2_8xn_u8 (motion->block.data, motion->block.stride, motion->block_ref[0].data, motion->block_ref[0].stride, motion->block_ref[1].data, motion->block_ref[1].stride, motion->yblen); break; case 12: orc_avg2_12xn_u8 (motion->block.data, motion->block.stride, motion->block_ref[0].data, motion->block_ref[0].stride, motion->block_ref[1].data, motion->block_ref[1].stride, motion->yblen); break; case 16: orc_avg2_16xn_u8 (motion->block.data, motion->block.stride, motion->block_ref[0].data, motion->block_ref[0].stride, motion->block_ref[1].data, motion->block_ref[1].stride, motion->yblen); break; case 32: orc_avg2_32xn_u8 (motion->block.data, motion->block.stride, motion->block_ref[0].data, motion->block_ref[0].stride, motion->block_ref[1].data, motion->block_ref[1].stride, motion->yblen); break; default: orc_avg2_nxm_u8 (motion->block.data, motion->block.stride, motion->block_ref[0].data, motion->block_ref[0].stride, motion->block_ref[1].data, motion->block_ref[1].stride, motion->xblen, motion->yblen); break; } } else { switch (motion->xblen) { #if 0 case 8: orc_combine2_8xn_u8 (motion->block.data, motion->block.stride, motion->block_ref[0].data, motion->block_ref[0].stride, motion->block_ref[1].data, motion->block_ref[1].stride, weight0, weight1, (1 << shift) >> 1, shift, motion->yblen); break; case 12: orc_combine2_12xn_u8 (motion->block.data, motion->block.stride, motion->block_ref[0].data, motion->block_ref[0].stride, motion->block_ref[1].data, motion->block_ref[1].stride, weight0, weight1, (1 << shift) >> 1, shift, motion->yblen); break; case 16: orc_combine2_16xn_u8 (motion->block.data, motion->block.stride, motion->block_ref[0].data, motion->block_ref[0].stride, motion->block_ref[1].data, motion->block_ref[1].stride, weight0, weight1, (1 << shift) >> 1, shift, motion->yblen); break; #endif default: orc_combine2_nxm_u8 (motion->block.data, motion->block.stride, motion->block_ref[0].data, motion->block_ref[0].stride, motion->block_ref[1].data, motion->block_ref[1].stride, weight0, weight1, (1 << shift) >> 1, shift, motion->xblen, motion->yblen); break; } } } static void schro_motion_block_predict_block (SchroMotion * motion, int x, int y, int k, int i, int j) { SchroParams *params = motion->params; SchroMotionVector *mv; mv = &motion->motion_vectors[j * params->x_num_blocks + i]; switch (mv->pred_mode) { case 0: get_dc_block (motion, i, j, k, x, y); break; case 1: get_ref1_block (motion, i, j, k, x, y); break; case 2: get_ref2_block (motion, i, j, k, x, y); break; case 3: get_biref_block (motion, i, j, k, x, y); break; default: SCHRO_ASSERT (0); break; } } static void schro_motion_block_predict_and_acc (SchroMotion * motion, int x, int y, int k, int i, int j, SchroFrameData * comp) { SchroParams *params = motion->params; SchroMotionVector *mv; mv = &motion->motion_vectors[j * params->x_num_blocks + i]; if (motion->simple_weight) { switch (mv->pred_mode) { case 0: orc_multiply_and_acc_dc_Xxn_s16_u8 (SCHRO_FRAME_DATA_GET_PIXEL_S16 (comp, x, y), comp->stride, motion->obmc_weight.data, motion->obmc_weight.stride, mv->u.dc.dc[k] + 128, motion->xblen, motion->yblen); break; case 1: get_ref1_block_simple (motion, i, j, k, x, y); orc_multiply_and_acc_Xxn_s16_u8 (SCHRO_FRAME_DATA_GET_PIXEL_S16 (comp, x, y), comp->stride, motion->obmc_weight.data, motion->obmc_weight.stride, motion->block_ref[0].data, motion->block_ref[0].stride, motion->xblen, motion->yblen); break; case 2: get_ref2_block_simple (motion, i, j, k, x, y); orc_multiply_and_acc_Xxn_s16_u8 (SCHRO_FRAME_DATA_GET_PIXEL_S16 (comp, x, y), comp->stride, motion->obmc_weight.data, motion->obmc_weight.stride, motion->block_ref[1].data, motion->block_ref[1].stride, motion->xblen, motion->yblen); break; case 3: get_biref_block_simple (motion, i, j, k, x, y); orc_multiply_and_acc_avg_Xxn_s16_u8 (SCHRO_FRAME_DATA_GET_PIXEL_S16 (comp, x, y), comp->stride, motion->obmc_weight.data, motion->obmc_weight.stride, motion->block_ref[0].data, motion->block_ref[0].stride, motion->block_ref[1].data, motion->block_ref[1].stride, motion->xblen, motion->yblen); break; default: SCHRO_ASSERT (0); break; } } else { int weight0, weight1, shift; weight0 = motion->ref1_weight; weight1 = motion->ref2_weight; shift = motion->ref_weight_precision; switch (mv->pred_mode) { case 0: orc_multiply_and_acc_dc_Xxn_s16_u8 (SCHRO_FRAME_DATA_GET_PIXEL_S16 (comp, x, y), comp->stride, motion->obmc_weight.data, motion->obmc_weight.stride, mv->u.dc.dc[k] + 128, motion->xblen, motion->yblen); break; case 1: get_ref1_block_simple (motion, i, j, k, x, y); orc_multiply_and_acc_scaled_Xxn_s16_u8 (SCHRO_FRAME_DATA_GET_PIXEL_S16 (comp, x, y), comp->stride, motion->obmc_weight.data, motion->obmc_weight.stride, motion->block_ref[0].data, motion->block_ref[0].stride, (weight0 + weight1) << (6 - shift), motion->xblen, motion->yblen); break; case 2: get_ref2_block_simple (motion, i, j, k, x, y); orc_multiply_and_acc_scaled_Xxn_s16_u8 (SCHRO_FRAME_DATA_GET_PIXEL_S16 (comp, x, y), comp->stride, motion->obmc_weight.data, motion->obmc_weight.stride, motion->block_ref[1].data, motion->block_ref[1].stride, (weight0 + weight1) << (6 - shift), motion->xblen, motion->yblen); break; case 3: get_biref_block_simple (motion, i, j, k, x, y); orc_multiply_and_acc_biref_Xxn_s16_u8 (SCHRO_FRAME_DATA_GET_PIXEL_S16 (comp, x, y), comp->stride, motion->obmc_weight.data, motion->obmc_weight.stride, motion->block_ref[0].data, motion->block_ref[0].stride, motion->block_ref[1].data, motion->block_ref[1].stride, weight0 << (6 - shift), weight1 << (6 - shift), motion->xblen, motion->yblen); break; default: SCHRO_ASSERT (0); break; } } } static void schro_motion_block_accumulate_slow (SchroMotion * motion, SchroFrameData * comp, int x, int y) { int i, j; int w_x, w_y; for (j = 0; j < motion->yblen; j++) { int16_t *d = SCHRO_FRAME_DATA_GET_PIXEL_S16 (comp, x, y + j); uint8_t *s = SCHRO_FRAME_DATA_GET_LINE (&motion->block, j); if (y + j < 0 || y + j >= comp->height) continue; w_y = motion->weight_y[j]; if (y + j < motion->yoffset) { w_y += motion->weight_y[2 * motion->yoffset - j - 1]; } if (y + j >= motion->params->y_num_blocks * motion->ybsep - motion->yoffset) { w_y += motion->weight_y[2 * (motion->yblen - motion->yoffset) - j - 1]; } for (i = 0; i < motion->xblen; i++) { if (x + i < 0 || x + i >= comp->width) continue; w_x = motion->weight_x[i]; if (x + i < motion->xoffset) { w_x += motion->weight_x[2 * motion->xoffset - i - 1]; } if (x + i >= motion->params->x_num_blocks * motion->xbsep - motion->xoffset) { w_x += motion->weight_x[2 * (motion->xblen - motion->xoffset) - i - 1]; } d[i] += s[i] * w_x * w_y; } } } void schro_motion_render_u8 (SchroMotion * motion, SchroFrame * dest, SchroFrame * addframe, int add, SchroFrame * output_frame) { int i, j; int x, y; int k; SchroParams *params = motion->params; int max_x_blocks; int max_y_blocks; if (params->num_refs == 1) { SCHRO_ASSERT (params->picture_weight_2 == 1); } motion->ref_weight_precision = params->picture_weight_bits; motion->ref1_weight = params->picture_weight_1; motion->ref2_weight = params->picture_weight_2; motion->mv_precision = params->mv_precision; for (k = 0; k < 3; k++) { SchroFrameData *comp = dest->components + k; SchroFrameData *acomp = addframe->components + k; SchroFrameData *ocomp = NULL; if (output_frame) { ocomp = output_frame->components + k; } if (k == 0) { motion->xbsep = params->xbsep_luma; motion->ybsep = params->ybsep_luma; motion->xblen = params->xblen_luma; motion->yblen = params->yblen_luma; motion->width = comp->width; motion->height = comp->height; } else { motion->xbsep = params->xbsep_luma >> SCHRO_CHROMA_FORMAT_H_SHIFT (motion->params-> video_format->chroma_format); motion->ybsep = params->ybsep_luma >> SCHRO_CHROMA_FORMAT_V_SHIFT (motion-> params->video_format->chroma_format); motion->xblen = params->xblen_luma >> SCHRO_CHROMA_FORMAT_H_SHIFT (motion-> params->video_format->chroma_format); motion->yblen = params->yblen_luma >> SCHRO_CHROMA_FORMAT_V_SHIFT (motion-> params->video_format->chroma_format); motion->width = comp->width; motion->height = comp->height; } motion->xoffset = (motion->xblen - motion->xbsep) / 2; motion->yoffset = (motion->yblen - motion->ybsep) / 2; motion->max_fast_x = (motion->width - motion->xblen) << motion->mv_precision; motion->max_fast_y = (motion->height - motion->yblen) << motion->mv_precision; motion->alloc_block.data = schro_malloc (motion->xblen * motion->yblen * sizeof (uint8_t)); motion->alloc_block.stride = motion->xblen * sizeof (uint8_t); motion->alloc_block.width = motion->xblen; motion->alloc_block.height = motion->yblen; motion->obmc_weight.data = schro_malloc (motion->xblen * motion->yblen * sizeof (int16_t)); motion->obmc_weight.stride = motion->xblen * sizeof (int16_t); motion->obmc_weight.width = motion->xblen; motion->obmc_weight.height = motion->yblen; motion->alloc_block_ref[0].data = schro_malloc (motion->xblen * motion->yblen * sizeof (uint8_t)); motion->alloc_block_ref[0].stride = motion->xblen * sizeof (uint8_t); motion->alloc_block_ref[0].width = motion->xblen; motion->alloc_block_ref[0].height = motion->yblen; motion->alloc_block_ref[1].data = schro_malloc (motion->xblen * motion->yblen * sizeof (uint8_t)); motion->alloc_block_ref[1].stride = motion->xblen * sizeof (uint8_t); motion->alloc_block_ref[1].width = motion->xblen; motion->alloc_block_ref[1].height = motion->yblen; if (motion->ref1_weight == 1 && motion->ref2_weight == 1 && motion->ref_weight_precision == 1) { motion->simple_weight = TRUE; } if (motion->ref1_weight + motion->ref2_weight == (1 << motion->ref_weight_precision)) { motion->oneref_noscale = TRUE; } schro_motion_init_obmc_weight (motion); schro_motion_init_functions (motion); //schro_motion_set_block_accumulate (motion); max_x_blocks = MIN (params->x_num_blocks - 1, (motion->width - motion->xoffset) / motion->xbsep); max_y_blocks = MIN (params->y_num_blocks - 1, (motion->height - motion->yoffset) / motion->ybsep); j = 0; orc_splat_s16_2d (SCHRO_FRAME_DATA_GET_LINE (comp, 0), comp->stride, 0, comp->width, motion->ybsep + motion->yoffset); for (i = 0; i < params->x_num_blocks; i++) { x = motion->xbsep * i - motion->xoffset; y = motion->ybsep * j - motion->yoffset; schro_motion_block_predict_block (motion, x, y, k, i, j); schro_motion_block_accumulate_slow (motion, comp, x, y); } if (add) { if (SCHRO_FRAME_FORMAT_DEPTH (addframe->format) == SCHRO_FRAME_FORMAT_DEPTH_S16) { orc_rrshift6_add_s16_2d (SCHRO_FRAME_DATA_GET_LINE (ocomp, 0), ocomp->stride, SCHRO_FRAME_DATA_GET_LINE (acomp, 0), acomp->stride, SCHRO_FRAME_DATA_GET_LINE (comp, 0), comp->stride, motion->width, motion->ybsep - motion->yoffset); } else { orc_rrshift6_add_s32_2d (SCHRO_FRAME_DATA_GET_LINE (ocomp, 0), ocomp->stride, SCHRO_FRAME_DATA_GET_LINE (acomp, 0), acomp->stride, SCHRO_FRAME_DATA_GET_LINE (comp, 0), comp->stride, motion->width, motion->ybsep - motion->yoffset); } } else { orc_rrshift6_sub_s16_2d (SCHRO_FRAME_DATA_GET_LINE (acomp, 0), acomp->stride, SCHRO_FRAME_DATA_GET_LINE (comp, 0), comp->stride, motion->width, motion->ybsep - motion->yoffset); } for (j = 1; j < max_y_blocks; j++) { y = motion->ybsep * j - motion->yoffset; orc_splat_s16_2d (SCHRO_FRAME_DATA_GET_LINE (comp, y + motion->yoffset * 2), comp->stride, 0, comp->width, motion->ybsep); i = 0; { x = motion->xbsep * i - motion->xoffset; schro_motion_block_predict_block (motion, x, y, k, i, j); schro_motion_block_accumulate_slow (motion, comp, x, y); } for (i = 1; i < max_x_blocks; i++) { x = motion->xbsep * i - motion->xoffset; schro_motion_block_predict_and_acc (motion, x, y, k, i, j, comp); } for (; i < params->x_num_blocks; i++) { x = motion->xbsep * i - motion->xoffset; schro_motion_block_predict_block (motion, x, y, k, i, j); schro_motion_block_accumulate_slow (motion, comp, x, y); } if (add) { if (SCHRO_FRAME_FORMAT_DEPTH (addframe->format) == SCHRO_FRAME_FORMAT_DEPTH_S16) { orc_rrshift6_add_s16_2d (SCHRO_FRAME_DATA_GET_LINE (ocomp, y), ocomp->stride, SCHRO_FRAME_DATA_GET_LINE (acomp, y), acomp->stride, SCHRO_FRAME_DATA_GET_LINE (comp, y), comp->stride, motion->width, motion->ybsep); } else { orc_rrshift6_add_s32_2d (SCHRO_FRAME_DATA_GET_LINE (ocomp, y), ocomp->stride, SCHRO_FRAME_DATA_GET_LINE (acomp, y), acomp->stride, SCHRO_FRAME_DATA_GET_LINE (comp, y), comp->stride, motion->width, motion->ybsep); } } else { orc_rrshift6_sub_s16_2d (SCHRO_FRAME_DATA_GET_LINE (acomp, y), acomp->stride, SCHRO_FRAME_DATA_GET_LINE (comp, y), comp->stride, motion->width, motion->ybsep); } } for (j = max_y_blocks; j < params->y_num_blocks; j++) { y = motion->ybsep * j - motion->yoffset; orc_splat_s16_2d (SCHRO_FRAME_DATA_GET_LINE (comp, y + motion->yoffset * 2), comp->stride, 0, comp->width, CLAMP (comp->height - (y + motion->yoffset * 2), 0, motion->ybsep)); for (i = 0; i < params->x_num_blocks; i++) { x = motion->xbsep * i - motion->xoffset; schro_motion_block_predict_block (motion, x, y, k, i, j); schro_motion_block_accumulate_slow (motion, comp, x, y); } if (add) { if (SCHRO_FRAME_FORMAT_DEPTH (addframe->format) == SCHRO_FRAME_FORMAT_DEPTH_S16) { orc_rrshift6_add_s16_2d (SCHRO_FRAME_DATA_GET_LINE (ocomp, y), ocomp->stride, SCHRO_FRAME_DATA_GET_LINE (acomp, y), acomp->stride, SCHRO_FRAME_DATA_GET_LINE (comp, y), comp->stride, comp->width, CLAMP (comp->height - y, 0, motion->ybsep)); } else { orc_rrshift6_add_s32_2d (SCHRO_FRAME_DATA_GET_LINE (ocomp, y), ocomp->stride, SCHRO_FRAME_DATA_GET_LINE (acomp, y), acomp->stride, SCHRO_FRAME_DATA_GET_LINE (comp, y), comp->stride, comp->width, CLAMP (comp->height - y, 0, motion->ybsep)); } } else { orc_rrshift6_sub_s16_2d (SCHRO_FRAME_DATA_GET_LINE (acomp, y), acomp->stride, SCHRO_FRAME_DATA_GET_LINE (comp, y), comp->stride, comp->width, CLAMP (comp->height - y, 0, motion->ybsep)); } } y = params->y_num_blocks * motion->ybsep - motion->yoffset; if (add) { if (SCHRO_FRAME_FORMAT_DEPTH (addframe->format) == SCHRO_FRAME_FORMAT_DEPTH_S16) { orc_rrshift6_add_s16_2d (SCHRO_FRAME_DATA_GET_LINE (ocomp, y), ocomp->stride, SCHRO_FRAME_DATA_GET_LINE (acomp, y), acomp->stride, SCHRO_FRAME_DATA_GET_LINE (comp, y), comp->stride, comp->width, CLAMP (comp->height - y, 0, motion->ybsep)); } else { orc_rrshift6_add_s32_2d (SCHRO_FRAME_DATA_GET_LINE (ocomp, y), ocomp->stride, SCHRO_FRAME_DATA_GET_LINE (acomp, y), acomp->stride, SCHRO_FRAME_DATA_GET_LINE (comp, y), comp->stride, comp->width, CLAMP (comp->height - y, 0, motion->ybsep)); } } else { orc_rrshift6_sub_s16_2d (SCHRO_FRAME_DATA_GET_LINE (acomp, y), acomp->stride, SCHRO_FRAME_DATA_GET_LINE (comp, y), comp->stride, comp->width, CLAMP (comp->height - y, 0, motion->ybsep)); } schro_free (motion->alloc_block.data); schro_free (motion->obmc_weight.data); schro_free (motion->alloc_block_ref[0].data); schro_free (motion->alloc_block_ref[1].data); } } schroedinger-1.0.11/schroedinger/schrolist.c0000644000175000017500000000450511541755167016041 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include SchroList * schro_list_new (void) { SchroList *list; list = schro_malloc0 (sizeof (*list)); return list; } SchroList * schro_list_new_full (SchroListFreeFunc freefunc, void *priv) { SchroList *list = schro_list_new (); list->free = freefunc; list->priv = priv; return list; } void schro_list_free (SchroList * list) { int i; if (list->free) { for (i = 0; i < list->n; i++) { list->free (list->members[i], list->priv); } } if (list->members) { schro_free (list->members); } schro_free (list); } void * schro_list_get (SchroList * list, int i) { if (i < 0 || i >= list->n) return NULL; return list->members[i]; } int schro_list_get_size (SchroList * list) { return list->n; } static void _schro_list_expand (SchroList * list, int n) { if (n <= list->n_alloc) return; list->members = schro_realloc (list->members, n * sizeof (void *)); list->n_alloc = n; } static void _schro_list_free_member (SchroList * list, void *value) { if (list->free) { list->free (value, list->priv); } } void schro_list_append (SchroList * list, void *value) { _schro_list_expand (list, list->n + 1); list->members[list->n] = value; list->n++; } #ifdef unused void schro_list_insert (SchroList * list, int i, void *value) { if (i < 0 || i >= list->n) return; _schro_list_expand (list, list->n + 1); memmove (list->members + i + 1, list->members + i, (list->n - i - 1) * sizeof (void *)); list->members[i] = value; list->n++; } #endif void * schro_list_remove (SchroList * list, int i) { void *value; if (i < 0 || i >= list->n) return NULL; value = list->members[i]; memmove (list->members + i, list->members + i + 1, (list->n - i - 1) * sizeof (void *)); list->n--; return value; } void schro_list_delete (SchroList * list, int i) { _schro_list_free_member (list, schro_list_remove (list, i)); } #ifdef unused void * schro_list_replace (SchroList * list, int i, void *value) { if (i < 0 || i >= list->n) return NULL; value = list->members[i]; list->members[i] = value; return value; } #endif #ifdef unused void schro_list_prepend (SchroList * list, void *value) { schro_list_insert (list, 0, value); } #endif schroedinger-1.0.11/schroedinger/schro.h0000644000175000017500000000207611320237456015142 00000000000000 #ifndef __SCHRO_SCHRO_H__ #define __SCHRO_SCHRO_H__ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include SCHRO_BEGIN_DECLS void schro_init(void); SCHRO_END_DECLS #endif schroedinger-1.0.11/schroedinger/schroorc.orc0000644000175000017500000007144011703737425016211 00000000000000 .init schro_orc_init .function orc_add2_rshift_add_s16_22_vert .dest 2 d1 int16_t .source 2 s2 int16_t .source 2 s3 int16_t .temp 2 t1 addw t1, s2, s3 addw t1, t1, 2 shrsw t1, t1, 2 addw d1, d1, t1 .function orc_add2_rshift_add_s32_22_vert .dest 4 d1 int32_t .source 4 s2 int32_t .source 4 s3 int32_t .temp 4 t1 addl t1, s2, s3 addl t1, t1, 2 shrsl t1, t1, 2 addl d1, d1, t1 .function orc_add2_rshift_add_s16_22 .dest 2 d1 int16_t .source 2 s1 int16_t .temp 2 t1 loadoffw t1, s1, 1 addw t1, s1, t1 addw t1, t1, 2 shrsw t1, t1, 2 addw d1, d1, t1 .function orc_add2_rshift_add_s32_22 .dest 4 d1 int32_t .source 4 s1 int32_t .temp 4 t1 loadoffl t1, s1, 1 addl t1, s1, t1 addl t1, t1, 2 shrsl t1, t1, 2 addl d1, d1, t1 .function orc_add2_rshift_sub_s16_22_vert .dest 2 d1 int16_t .source 2 s2 int16_t .source 2 s3 int16_t .temp 2 t1 addw t1, s2, s3 addw t1, t1, 2 shrsw t1, t1, 2 subw d1, d1, t1 .function orc_add2_rshift_sub_s16_22 .dest 2 d1 int16_t .source 2 s1 int16_t .temp 2 t1 loadoffw t1, s1, 1 addw t1, s1, t1 addw t1, t1, 2 shrsw t1, t1, 2 subw d1, d1, t1 .function orc_add2_rshift_add_s16_11_op .dest 2 d1 int16_t .source 2 s1 int16_t .source 2 s2 int16_t .source 2 s3 int16_t .temp 2 t1 avgsw t1, s2, s3 addw d1, s1, t1 .function orc_add2_rshift_add_s16_11 .dest 2 d1 int16_t .source 2 s1 int16_t .temp 2 t1 loadoffw t1, s1, 1 avgsw t1, s1, t1 addw d1, d1, t1 .function orc_add2_rshift_sub_s16_11_vert .dest 2 d1 int16_t .source 2 s2 int16_t .source 2 s3 int16_t .temp 2 t1 avgsw t1, s2, s3 subw d1, d1, t1 .function orc_add2_rshift_sub_s32_11_vert .dest 4 d1 int32_t .source 4 s2 int32_t .source 4 s3 int32_t .temp 4 t1 avgsl t1, s2, s3 subl d1, d1, t1 .function orc_add2_rshift_sub_s16_11 .dest 2 d1 int16_t .source 2 s1 int16_t .temp 2 t1 loadoffw t1, s1, 1 avgsw t1, s1, t1 subw d1, d1, t1 .function orc_add2_rshift_sub_s32_11 .dest 4 d1 int32_t .source 4 s1 int32_t .temp 4 t1 loadoffl t1, s1, 1 avgsl t1, s1, t1 subl d1, d1, t1 .function orc_add_const_rshift_s16_11 .dest 2 d1 int16_t .source 2 s1 int16_t .temp 2 t1 addw t1, s1, 1 shrsw d1, t1, 1 .function orc_add_const_rshift_s16 .dest 2 d1 int16_t .param 2 p1 .param 2 p2 .temp 2 t1 addw t1, d1, p1 shrsw d1, t1, p2 .function orc_add_const_rshift_s32 .dest 4 d1 int32_t .param 4 p1 .param 4 p2 .temp 4 t1 addl t1, d1, p1 shrsl d1, t1, p2 .function orc_add_s16 .dest 2 d1 int16_t .source 2 s1 int16_t .source 2 s2 int16_t addw d1, s1, s2 .function orc_add_s16_2d .flags 2d .dest 2 d1 int16_t .source 2 s1 int16_t addw d1, d1, s1 .function orc_addc_rshift_s16 .dest 2 d1 int16_t .source 2 s1 int16_t .source 2 s2 int16_t .temp 2 t1 .param 2 p1 addw t1, s1, s2 shrsw d1, t1, p1 .function orc_lshift1_s16 .dest 2 d1 int16_t .source 2 s1 int16_t shlw d1, s1, 1 .function orc_lshift2_s16 .dest 2 d1 int16_t .source 2 s1 int16_t shlw d1, s1, 2 .function orc_lshift_s16_ip .dest 2 d1 int16_t .param 2 p1 shlw d1, d1, p1 .function orc_lshift_s32_ip .dest 4 d1 int32_t .param 4 p1 shll d1, d1, p1 .function orc_mas2_add_s16_op .dest 2 d1 int16_t .source 2 s0 int16_t .source 2 s1 int16_t .source 2 s2 int16_t .temp 2 t1 .temp 4 t2 .param 2 p1 .param 4 p2 .param 4 p3 addw t1, s1, s2 mulswl t2, t1, p1 addl t2, t2, p2 shrsl t2, t2, p3 convlw t1, t2 addw d1, s0, t1 .function orc_mas2_add_s16_ip .dest 2 d1 int16_t .source 2 s1 int16_t .temp 2 t1 .temp 4 t2 .param 2 p1 .param 4 p2 .param 4 p3 loadoffw t1, s1, 1 addw t1, s1, t1 mulswl t2, t1, p1 addl t2, t2, p2 shrsl t2, t2, p3 convlw t1, t2 addw d1, d1, t1 .function orc_mas2_sub_s16_op .dest 2 d1 int16_t .source 2 s0 int16_t .source 2 s1 int16_t .source 2 s2 int16_t .temp 2 t1 .temp 4 t2 .param 2 p1 .param 4 p2 .param 4 p3 addw t1, s1, s2 mulswl t2, t1, p1 addl t2, t2, p2 shrsl t2, t2, p3 convlw t1, t2 subw d1, s0, t1 .function orc_mas2_sub_s16_ip .dest 2 d1 int16_t .source 2 s1 int16_t .temp 2 t1 .temp 4 t2 .param 2 p1 .param 4 p2 .param 4 p3 loadoffw t1, s1, 1 addw t1, s1, t1 mulswl t2, t1, p1 addl t2, t2, p2 shrsl t2, t2, p3 convlw t1, t2 subw d1, d1, t1 .function orc_mas4_vert_add_s16_1991 .dest 2 d1 int16_t .source 2 s1 int16_t .source 2 s2 int16_t .source 2 s3 int16_t .source 2 s4 int16_t .param 4 p1 .param 4 p2 .temp 2 t1 .temp 2 t2 .temp 4 t3 .temp 4 t4 addw t1, s2, s3 mulswl t3, t1, 9 addw t2, s1, s4 convswl t4, t2 subl t3, t3, t4 addl t3, t3, p1 shrsl t3, t3, p2 convlw t1, t3 addw d1, d1, t1 .function orc_mas4_vert_add_s32_1991 .dest 4 d1 int32_t .source 4 s1 int32_t .source 4 s2 int32_t .source 4 s3 int32_t .source 4 s4 int32_t .param 4 p1 .param 4 p2 .temp 4 t1 .temp 4 t2 .temp 4 t3 addl t1, s2, s3 mulll t3, t1, 9 addl t2, s1, s4 subl t3, t3, t2 addl t3, t3, p1 shrsl t3, t3, p2 addl d1, d1, t3 .function orc_mas4_horiz_add_s16_1991_ip .dest 2 d1 int16_t .source 2 s1 int16_t .param 4 p1 .param 4 p2 .temp 2 t1 .temp 2 t2 .temp 4 t3 .temp 4 t4 loadoffw t1, s1, 1 loadoffw t2, s1, 2 addw t1, t1, t2 mulswl t3, t1, 9 loadw t1, s1 loadoffw t2, s1, 3 addw t2, t1, t2 convswl t4, t2 subl t3, t3, t4 addl t3, t3, p1 shrsl t3, t3, p2 convlw t1, t3 addw d1, d1, t1 .function orc_mas4_vert_sub_s16_1991 .dest 2 d1 int16_t .source 2 s1 int16_t .source 2 s2 int16_t .source 2 s3 int16_t .source 2 s4 int16_t .param 4 p1 .param 4 p2 .temp 2 t1 .temp 2 t2 .temp 4 t3 .temp 4 t4 addw t1, s2, s3 mulswl t3, t1, 9 addw t2, s1, s4 convswl t4, t2 subl t3, t3, t4 addl t3, t3, p1 shrsl t3, t3, p2 convlw t1, t3 subw d1, d1, t1 .function orc_mas4_horiz_sub_s16_1991_ip .dest 2 d1 int16_t .source 2 s1 int16_t .param 4 p1 .param 4 p2 .temp 2 t1 .temp 2 t2 .temp 4 t3 .temp 4 t4 loadoffw t1, s1, 1 loadoffw t2, s1, 2 addw t1, t1, t2 mulswl t3, t1, 9 loadw t1, s1 loadoffw t2, s1, 3 addw t2, t1, t2 convswl t4, t2 subl t3, t3, t4 addl t3, t3, p1 shrsl t3, t3, p2 convlw t1, t3 subw d1, d1, t1 #.function schro_orc_split_add_fidelity_161 #.dest 2 d1 int16_t #.source 2 s1 int16_t #.temp 2 t1 #.temp 2 t2 #.temp 4 t3 #.temp 4 t4 # #loadw t1, s1 #loadoffw t2, s1, 7 #addw t1, t1, t2 #mulswl t3, t1, -8 #loadoffw t1, s1, 1 #loadoffw t2, s1, 6 #addw t1, t1, t2 #mulswl t4, t1, 21 #addl t3, t3, t4 #loadoffw t1, s1, 2 #loadoffw t2, s1, 5 #addw t1, t1, t2 #mulswl t4, t1, -46 #addl t3, t3, t4 #loadoffw t1, s1, 3 #loadoffw t2, s1, 4 #addw t1, t1, t2 #mulswl t4, t1, 161 #addl t3, t3, t4 #addl t3, t3, 128 #shrsl t3, t3, 8 #convlw t1, t3 #addw d1, d1, t1 .function orc_subtract_s16 .dest 2 d1 int16_t .source 2 s1 int16_t .source 2 s2 int16_t subw d1, s1, s2 .function orc_add_s16_u8 .dest 2 d1 int16_t .source 2 s1 int16_t .source 1 s2 .temp 2 t1 convubw t1, s2 addw d1, t1, s1 .function orc_add_s16_u8_2d .flags 2d .dest 2 d1 int16_t .source 1 s1 .temp 2 t1 convubw t1, s1 addw d1, d1, t1 .function orc_convert_s16_u8 .dest 2 d1 orc_int16 .source 1 s1 convubw d1, s1 .function orc_convert_s16_s32 .dest 2 d1 orc_int16 .source 4 s1 orc_int32 convlw d1, s1 .function orc_convert_u8_s16 .dest 1 d1 .source 2 s1 int16_t convsuswb d1, s1 .function orc_convert_s32_s16 .dest 4 d1 orc_int32 .source 2 s1 orc_int16 convswl d1, s1 .function orc_offsetconvert_u8_s16 .dest 1 d1 .source 2 s1 int16_t .temp 2 t1 addw t1, s1, 128 convsuswb d1, t1 .function orc_offsetconvert_u8_s32 .dest 1 d1 .source 4 s1 int32_t .temp 4 t1 .temp 2 t2 addl t1, s1, 128 convsuslw t2, t1 convsuswb d1, t2 .function orc_offsetconvert_s16_u8 .dest 2 d1 int16_t .source 1 s1 .temp 2 t1 convubw t1, s1 subw d1, t1, 128 .function orc_offsetconvert_s32_u8 .dest 4 d1 int32_t .source 1 s1 .temp 2 t1 convubw t1, s1 subw t1, t1, 128 convswl d1, t1 .function orc_offsetconvert_s32_s16 .dest 4 d1 int32_t .source 2 s1 int16_t .temp 2 t1 subw t1, s1, 128 convswl d1, t1 .function orc_subtract_s16_u8 .dest 2 d1 int16_t .source 2 s1 int16_t .source 1 s2 .temp 2 t1 convubw t1, s2 subw d1, s1, t1 .function orc_multiply_and_add_s16_u8 .dest 2 d1 int16_t .source 2 s1 int16_t .source 1 s2 .temp 2 t1 convubw t1, s2 mullw t1, t1, s1 addw d1, d1, t1 .function orc_splat_s16_ns .dest 2 d1 int16_t .param 2 p1 copyw d1, p1 .function orc_splat_s32_ns .dest 4 d1 int32_t .param 4 p1 copyl d1, p1 .function orc_splat_s16_2d_4xn .n 4 .flags 2d .dest 2 d1 int16_t .param 2 p1 copyw d1, p1 .function orc_splat_s16_2d_8xn .n 8 .flags 2d .dest 2 d1 int16_t .param 2 p1 copyw d1, p1 .function orc_splat_s16_2d .flags 2d .dest 2 d1 int16_t .param 2 p1 copyw d1, p1 .function orc_splat_u8_ns .dest 1 d1 .param 1 p1 copyb d1, p1 .function orc_splat_u8_2d .flags 2d .dest 1 d1 .param 1 p1 copyb d1, p1 .function orc_average_u8 .dest 1 d1 .source 1 s1 .source 1 s2 avgub d1, s1, s2 .function orc_rrshift6_add_s16_2d .flags 2d .dest 1 d1 uint8_t .source 2 s1 int16_t .source 2 s2 int16_t .temp 2 t1 addw t1, s2, 32 shrsw t1, t1, 6 addw t1, s1, t1 convsuswb d1, t1 .function orc_rrshift6_add_s32_2d .flags 2d .dest 1 d1 uint8_t .source 4 s1 int32_t .source 2 s2 int16_t .temp 2 t1 .temp 2 t2 addw t1, s2, 32 shrsw t1, t1, 6 convlw t2, s1 addw t1, t2, t1 convsuswb d1, t1 .function orc_rrshift6_sub_s16_2d .flags 2d .dest 2 d1 int16_t .dest 2 d2 int16_t .temp 2 t1 subw t1, d2, 8160 shrsw t1, t1, 6 copyw d2, t1 subw d1, d1, t1 .function orc_rrshift6_s16_ip_2d .flags 2d .dest 2 d1 int16_t .temp 2 t1 subw t1, d1, 8160 shrsw d1, t1, 6 .function orc_rrshift6_s16_ip .dest 2 d1 int16_t .temp 2 t1 subw t1, d1, 8160 shrsw d1, t1, 6 .function orc_unpack_yuyv_y .dest 1 d1 .source 2 s1 select0wb d1, s1 .function orc_unpack_yuyv_u .dest 1 d1 .source 4 s1 .temp 2 t1 select0lw t1, s1 select1wb d1, t1 .function orc_unpack_yuyv_v .dest 1 d1 .source 4 s1 .temp 2 t1 select1lw t1, s1 select1wb d1, t1 .function orc_packyuyv .dest 4 d1 .source 2 s1 uint8_t .source 1 s2 .source 1 s3 .temp 1 t1 .temp 1 t2 .temp 2 t3 .temp 2 t4 .temp 2 t5 copyw t5, s1 select0wb t1, t5 select1wb t2, t5 mergebw t3, t1, s2 mergebw t4, t2, s3 mergewl d1, t3, t4 .function orc_unpack_uyvy_y .dest 1 d1 .source 2 s1 select1wb d1, s1 .function orc_unpack_uyvy_u .dest 1 d1 .source 4 s1 .temp 2 t1 select0lw t1, s1 select0wb d1, t1 .function orc_unpack_uyvy_v .dest 1 d1 .source 4 s1 .temp 2 t1 select1lw t1, s1 select0wb d1, t1 .function orc_interleave2_s16 .dest 4 d1 int16_t .source 2 s1 int16_t .source 2 s2 int16_t mergewl d1, s1, s2 .function orc_interleave2_rrshift1_s16 .dest 4 d1 int16_t .source 2 s1 int16_t .source 2 s2 int16_t .temp 2 t1 .temp 2 t2 addw t1, s1, 1 shrsw t1, t1, 1 addw t2, s2, 1 shrsw t2, t2, 1 mergewl d1, t1, t2 .function orc_deinterleave2_s16 .dest 2 d1 int16_t .dest 2 d2 int16_t .source 4 s1 int16_t splitlw d2, d1, s1 .function orc_deinterleave2_s32 .dest 4 d1 int32_t .dest 4 d2 int32_t .source 8 s1 int32_t splitql d2, d1, s1 .function orc_deinterleave2_lshift1_s16 .dest 2 d1 int16_t .dest 2 d2 int16_t .source 4 s1 int16_t .temp 4 t1 x2 shlw t1, s1, 1 splitlw d2, d1, t1 .function orc_deinterleave2_lshift1_s32 .dest 4 d1 int32_t .dest 4 d2 int32_t .source 8 s1 int32_t .temp 8 t1 x2 shll t1, s1, 1 splitql d2, d1, t1 .function orc_haar_deint_lshift1_split_s16 .dest 2 d1 int16_t .dest 2 d2 int16_t .source 4 s1 int16_t .temp 2 t1 .temp 2 t2 .temp 4 t3 x2 shlw t3, s1, 1 splitlw t2, t1, t3 subw t2, t2, t1 copyw d2, t2 avgsw t2, t2, 0 addw d1, t1, t2 .function orc_haar_deint_lshift1_split_s32 .dest 4 d1 int32_t .dest 4 d2 int32_t .source 8 s1 int32_t .temp 4 t1 .temp 4 t2 .temp 8 t3 x2 shll t3, s1, 1 splitql t2, t1, t3 subl t2, t2, t1 copyl d2, t2 avgsl t2, t2, 0 addl d1, t1, t2 .function orc_haar_deint_split_s16 .dest 2 d1 int16_t .dest 2 d2 int16_t .source 4 s1 int16_t .temp 2 t1 .temp 2 t2 splitlw t2, t1, s1 subw t2, t2, t1 copyw d2, t2 avgsw t2, t2, 0 addw d1, t1, t2 .function orc_haar_deint_split_s32 .dest 4 d1 int32_t .dest 4 d2 int32_t .source 8 s1 int32_t .temp 4 t1 .temp 4 t2 splitql t2, t1, s1 subl t2, t2, t1 copyl d2, t2 avgsl t2, t2, 0 addl d1, t1, t2 .function orc_haar_split_s16_lo .dest 2 d1 int16_t .source 2 s1 int16_t .source 2 s2 int16_t .temp 2 t1 .temp 2 t2 copyw t1, s1 subw t2, s2, t1 avgsw t2, t2, 0 addw d1, t1, t2 .function orc_haar_split_s16_hi .dest 2 d1 int16_t .source 2 s1 int16_t .source 2 s2 int16_t subw d1, s2, s1 .function orc_haar_split_s16_op .dest 2 d1 int16_t .dest 2 d2 int16_t .source 2 s1 int16_t .source 2 s2 int16_t .temp 2 t1 .temp 2 t2 copyw t1, s1 subw t2, s2, t1 copyw d2, t2 avgsw t2, t2, 0 addw d1, t1, t2 .function orc_haar_split_s32_op .dest 4 d1 int32_t .dest 4 d2 int32_t .source 4 s1 int32_t .source 4 s2 int32_t .temp 4 t1 .temp 4 t2 copyl t1, s1 subl t2, s2, t1 copyl d2, t2 avgsl t2, t2, 0 addl d1, t1, t2 .function orc_haar_split_s16 .dest 2 d1 int16_t .dest 2 d2 int16_t .temp 2 t1 .temp 2 t2 copyw t1, d1 copyw t2, d2 subw t2, t2, t1 copyw d2, t2 avgsw t2, t2, 0 addw d1, t1, t2 .function orc_haar_synth_s16_lo .dest 2 d1 int16_t .source 2 s1 int16_t .source 2 s2 int16_t .temp 2 t1 avgsw t1, s2, 0 subw d1, s1, t1 .function orc_haar_synth_s16_hi .dest 2 d1 int16_t .source 2 s1 int16_t .source 2 s2 int16_t .temp 2 t1 .temp 2 t2 .temp 2 t3 copyw t2, s2 avgsw t3, t2, 0 subw t1, s1, t3 addw d1, t2, t1 .function orc_haar_synth_s16_op .dest 2 d1 int16_t .dest 2 d2 int16_t .source 2 s1 int16_t .source 2 s2 int16_t .temp 2 t1 .temp 2 t2 .temp 2 t3 copyw t2, s2 avgsw t3, t2, 0 subw t1, s1, t3 copyw d1, t1 addw d2, t2, t1 .function orc_haar_synth_s16 .dest 2 d1 int16_t .dest 2 d2 int16_t .temp 2 t1 .temp 2 t2 .temp 2 t3 copyw t1, d1 copyw t2, d2 avgsw t3, t2, 0 subw t1, t1, t3 copyw d1, t1 addw d2, t2, t1 .function orc_haar_synth_rrshift1_int_s16 .dest 4 d1 int16_t .source 2 s1 int16_t .source 2 s2 int16_t .temp 2 t1 .temp 2 t2 copyw t2, s2 avgsw t1, t2, 0 subw t1, s1, t1 addw t2, t2, t1 avgsw t1, t1, 0 avgsw t2, t2, 0 mergewl d1, t1, t2 .function orc_haar_synth_int_s16 .dest 4 d1 int16_t .source 2 s1 int16_t .source 2 s2 int16_t .temp 2 t1 .temp 2 t2 copyw t2, s2 avgsw t1, t2, 0 subw t1, s1, t1 addw t2, t2, t1 mergewl d1, t1, t2 .function orc_haar_sub_s16 .dest 2 d1 int16_t .source 2 s1 int16_t subw d1, d1, s1 .function orc_haar_add_half_s16 .dest 2 d1 int16_t .source 2 s1 int16_t .temp 2 t1 avgsw t1, s1, 0 addw d1, d1, t1 .function orc_haar_add_s16 .dest 2 d1 int16_t .source 2 s1 int16_t addw d1, d1, s1 .function orc_haar_sub_half_s16 .dest 2 d1 int16_t .source 2 s1 int16_t .temp 2 t1 avgsw t1, s1, 0 subw d1, d1, t1 .function orc_sum_u8 .accumulator 4 a1 int32_t .source 1 s1 .temp 2 t1 .temp 4 t2 convubw t1, s1 convuwl t2, t1 accl a1, t2 .function orc_sum_s16 .accumulator 4 a1 int32_t .source 2 s1 int16_t .temp 4 t1 convswl t1, s1 accl a1, t1 .function orc_sum_square_diff_u8 .accumulator 4 a1 int32_t .source 1 s1 .source 1 s2 .temp 2 t1 .temp 2 t2 .temp 4 t3 convubw t1, s1 convubw t2, s2 subw t1, t1, t2 mullw t1, t1, t1 convuwl t3, t1 accl a1, t3 .function orc_dequantise_s16_2d_4xn .n 4 .flags 2d .dest 2 d1 int16_t .source 2 s1 int16_t .param 2 p1 .param 2 p2 .temp 2 t1 .temp 2 t2 copyw t1, s1 signw t2, t1 absw t1, t1 mullw t1, t1, p1 addw t1, t1, p2 shrsw t1, t1, 2 mullw d1, t1, t2 .function orc_dequantise_s16_2d_8xn .n 8 .flags 2d .dest 2 d1 int16_t .source 2 s1 int16_t .param 2 p1 .param 2 p2 .temp 2 t1 .temp 2 t2 copyw t1, s1 signw t2, t1 absw t1, t1 mullw t1, t1, p1 addw t1, t1, p2 shrsw t1, t1, 2 mullw d1, t1, t2 .function orc_dequantise_s16_ip_2d_8xn .n 8 .flags 2d .dest 2 d1 int16_t .param 2 p1 .param 2 p2 .temp 2 t1 .temp 2 t2 copyw t1, d1 signw t2, t1 absw t1, t1 mullw t1, t1, p1 addw t1, t1, p2 shrsw t1, t1, 2 mullw d1, t1, t2 .function orc_dequantise_s16_ip_2d .flags 2d .dest 2 d1 int16_t .param 2 p1 .param 2 p2 .temp 2 t1 .temp 2 t2 copyw t1, d1 signw t2, t1 absw t1, t1 mullw t1, t1, p1 addw t1, t1, p2 shrsw t1, t1, 2 mullw d1, t1, t2 .function orc_dequantise_s16_ip .dest 2 d1 int16_t .param 2 p1 .param 2 p2 .temp 2 t1 .temp 2 t2 copyw t1, d1 signw t2, t1 absw t1, t1 mullw t1, t1, p1 addw t1, t1, p2 shrsw t1, t1, 2 mullw d1, t1, t2 .function orc_dequantise_s16 .dest 2 d1 int16_t .source 2 s1 int16_t .param 2 p1 .param 2 p2 .temp 2 t1 .temp 2 t2 copyw t1, s1 signw t2, t1 absw t1, t1 mullw t1, t1, p1 addw t1, t1, p2 shrsw t1, t1, 2 mullw d1, t1, t2 .function orc_dequantise_var_s16_ip .dest 2 d1 int16_t .source 2 s1 int16_t .source 2 s2 int16_t .temp 2 t1 .temp 2 t2 copyw t1, d1 signw t2, t1 absw t1, t1 mullw t1, t1, s1 addw t1, t1, s2 shrsw t1, t1, 2 mullw d1, t1, t2 # only works for values between -16384 and 16384 .function orc_quantise1_s16 .dest 2 d1 int16_t .source 2 s1 int16_t .param 2 p1 .param 2 p2 .param 2 p3 .temp 2 t1 .temp 2 t2 copyw t1, s1 signw t2, t1 absw t1, t1 shlw t1, t1, 2 subw t1, t1, p2 mulhuw t1, t1, p1 shruw t1, t1, p3 mullw d1, t1, t2 # only works for values between -16384 and 16384 .function orc_quantise2_s16 .dest 2 d1 int16_t .source 2 s1 int16_t .param 2 p1 .param 2 p2 .temp 2 t1 .temp 2 t2 copyw t1, s1 signw t2, t1 absw t1, t1 shlw t1, t1, 2 subw t1, t1, p2 shruw t1, t1, p1 mullw d1, t1, t2 # only works for values between -16384 and 16384 .function orc_quantdequant1_s16 .dest 2 d1 int16_t .dest 2 d2 int16_t .param 2 p1 .param 2 p2 .param 2 p3 .param 2 p4 .param 2 p5 .temp 2 t1 .temp 2 t2 copyw t1, d2 signw t2, t1 absw t1, t1 shlw t1, t1, 2 subw t1, t1, p2 mulhuw t1, t1, p1 shruw t1, t1, p3 mullw t2, t1, t2 copyw d1, t2 signw t2, t2 mullw t1, t1, p4 addw t1, t1, p5 shrsw t1, t1, 2 mullw d2, t1, t2 # only works for values between -16384 and 16384 .function orc_quantdequant3_s16 .dest 2 d1 int16_t .dest 2 d2 int16_t .param 2 p1 .param 2 p2 .param 2 p3 .param 2 p4 .param 2 p5 .param 4 p6 .temp 2 t1 .temp 2 t2 .temp 4 t3 copyw t1, d2 signw t2, t1 absw t1, t1 shlw t1, t1, 2 subw t1, t1, p2 muluwl t3, t1, p1 addl t3, t3, p6 shrul t3, t3, p3 convlw t1, t3 mullw t2, t1, t2 copyw d1, t2 signw t2, t2 mullw t1, t1, p4 addw t1, t1, p5 shrsw t1, t1, 2 mullw d2, t1, t2 # only works for values between -16384 and 16384 .function orc_quantdequant2_s16 .dest 2 d1 int16_t .dest 2 d2 int16_t .param 2 p1 .param 2 p2 .param 2 p4 .param 2 p5 .temp 2 t1 .temp 2 t2 copyw t1, d2 signw t2, t1 absw t1, t1 shlw t1, t1, 2 subw t1, t1, p2 shruw t1, t1, p1 mullw t2, t1, t2 copyw d1, t2 signw t2, t2 mullw t1, t1, p4 addw t1, t1, p5 shrsw t1, t1, 2 mullw d2, t1, t2 .function orc_downsample_vert_u8 .dest 1 d1 .source 1 s1 .source 1 s2 .source 1 s3 .source 1 s4 .temp 2 t1 .temp 2 t2 .temp 2 t3 convubw t1, s1 convubw t2, s4 addw t1, t1, t2 mullw t1, t1, 6 convubw t2, s2 convubw t3, s3 addw t2, t2, t3 mullw t2, t2, 26 addw t2, t2, t1 addw t2, t2, 32 shruw t2, t2, 6 convwb d1, t2 .function orc_downsample_horiz_u8 .dest 1 d1 .source 2 s1 uint8_t .temp 2 a .temp 2 b .temp 2 t1 .temp 1 t2 .temp 1 t3 .temp 2 c loadw t1, s1 select1wb t2, t1 convubw a, t2 loadoffw t1, s1, 2 select0wb t2, t1 convubw b, t2 addw c, a, b mullw c, c, 6 loadoffw t1, s1, 1 splitwb t2, t3, t1 convubw a, t2 convubw b, t3 addw a, a, b mullw a, a, 26 addw c, c, a addw c, c, 32 shruw c, c, 6 convwb d1, c .function orc_stats_moment_s16 .source 2 s1 int16_t .accumulator 4 a1 int32_t .temp 2 t1 .temp 4 t2 absw t1, s1 subw t1, t1, 2 maxsw t1, t1, 0 convuwl t2, t1 accl a1, t2 .function orc_stats_above_s16 .source 2 s1 int16_t .accumulator 4 a1 int32_t .temp 2 t1 .temp 4 t2 absw t1, s1 subw t1, t1, 1 maxsw t1, t1, 0 minsw t1, t1, 1 convuwl t2, t1 accl a1, t2 .function orc_accw .accumulator 2 a1 int .source 2 s1 int16_t .temp 2 t1 absw t1, s1 accw a1, t1 .function orc_avg2_8xn_u8 .flags 2d .n 8 .dest 1 d1 uint8_t .source 1 s1 uint8_t .source 1 s2 uint8_t avgub d1, s1, s2 .function orc_avg2_12xn_u8 .flags 2d .n 12 .dest 1 d1 uint8_t .source 1 s1 uint8_t .source 1 s2 uint8_t avgub d1, s1, s2 .function orc_avg2_16xn_u8 .flags 2d .n 16 .dest 1 d1 uint8_t .source 1 s1 uint8_t .source 1 s2 uint8_t avgub d1, s1, s2 .function orc_avg2_32xn_u8 .flags 2d .n 32 .dest 1 d1 uint8_t .source 1 s1 uint8_t .source 1 s2 uint8_t avgub d1, s1, s2 .function orc_avg2_nxm_u8 .flags 2d .dest 1 d1 uint8_t .source 1 s1 uint8_t .source 1 s2 uint8_t avgub d1, s1, s2 .function orc_combine4_8xn_u8 .flags 2d .n 8 .dest 1 d1 uint8_t .source 1 s1 uint8_t .source 1 s2 uint8_t .source 1 s3 uint8_t .source 1 s4 uint8_t .param 2 p1 .param 2 p2 .param 2 p3 .param 2 p4 .temp 2 t1 .temp 2 t2 convubw t1, s1 mullw t2, t1, p1 convubw t1, s2 mullw t1, t1, p2 addw t2, t2, t1 convubw t1, s3 mullw t1, t1, p3 addw t2, t2, t1 convubw t1, s4 mullw t1, t1, p4 addw t2, t2, t1 addw t2, t2, 8 convsuswb d1, t2 .function orc_combine4_12xn_u8 .flags 2d .n 12 .dest 1 d1 uint8_t .source 1 s1 uint8_t .source 1 s2 uint8_t .source 1 s3 uint8_t .source 1 s4 uint8_t .param 2 p1 .param 2 p2 .param 2 p3 .param 2 p4 .temp 2 t1 .temp 2 t2 convubw t1, s1 mullw t2, t1, p1 convubw t1, s2 mullw t1, t1, p2 addw t2, t2, t1 convubw t1, s3 mullw t1, t1, p3 addw t2, t2, t1 convubw t1, s4 mullw t1, t1, p4 addw t2, t2, t1 addw t2, t2, 8 convsuswb d1, t2 .function orc_combine4_16xn_u8 .flags 2d .n 16 .dest 1 d1 uint8_t .source 1 s1 uint8_t .source 1 s2 uint8_t .source 1 s3 uint8_t .source 1 s4 uint8_t .param 2 p1 .param 2 p2 .param 2 p3 .param 2 p4 .temp 2 t1 .temp 2 t2 convubw t1, s1 mullw t2, t1, p1 convubw t1, s2 mullw t1, t1, p2 addw t2, t2, t1 convubw t1, s3 mullw t1, t1, p3 addw t2, t2, t1 convubw t1, s4 mullw t1, t1, p4 addw t2, t2, t1 addw t2, t2, 8 convsuswb d1, t2 .function orc_combine4_24xn_u8 .flags 2d .n 24 .dest 1 d1 uint8_t .source 1 s1 uint8_t .source 1 s2 uint8_t .source 1 s3 uint8_t .source 1 s4 uint8_t .param 2 p1 .param 2 p2 .param 2 p3 .param 2 p4 .temp 2 t1 .temp 2 t2 convubw t1, s1 mullw t2, t1, p1 convubw t1, s2 mullw t1, t1, p2 addw t2, t2, t1 convubw t1, s3 mullw t1, t1, p3 addw t2, t2, t1 convubw t1, s4 mullw t1, t1, p4 addw t2, t2, t1 addw t2, t2, 8 convsuswb d1, t2 .function orc_combine4_32xn_u8 .flags 2d .n 32 .dest 1 d1 uint8_t .source 1 s1 uint8_t .source 1 s2 uint8_t .source 1 s3 uint8_t .source 1 s4 uint8_t .param 2 p1 .param 2 p2 .param 2 p3 .param 2 p4 .temp 2 t1 .temp 2 t2 convubw t1, s1 mullw t2, t1, p1 convubw t1, s2 mullw t1, t1, p2 addw t2, t2, t1 convubw t1, s3 mullw t1, t1, p3 addw t2, t2, t1 convubw t1, s4 mullw t1, t1, p4 addw t2, t2, t1 addw t2, t2, 8 convsuswb d1, t2 .function orc_combine4_nxm_u8 .flags 2d .dest 1 d1 uint8_t .source 1 s1 uint8_t .source 1 s2 uint8_t .source 1 s3 uint8_t .source 1 s4 uint8_t .param 2 p1 .param 2 p2 .param 2 p3 .param 2 p4 .temp 2 t1 .temp 2 t2 convubw t1, s1 mullw t2, t1, p1 convubw t1, s2 mullw t1, t1, p2 addw t2, t2, t1 convubw t1, s3 mullw t1, t1, p3 addw t2, t2, t1 convubw t1, s4 mullw t1, t1, p4 addw t2, t2, t1 addw t2, t2, 8 shrsw t2, t2, 4 convsuswb d1, t2 .function orc_combine2_8xn_u8 .flags 2d .n 8 .dest 1 d1 uint8_t .source 1 s1 uint8_t .source 1 s2 uint8_t .param 2 p1 .param 2 p2 .param 2 p3 .param 2 p4 .temp 2 t1 .temp 2 t2 convubw t1, s1 convubw t2, s2 mullw t1, t1, p1 mullw t2, t2, p2 addw t1, t1, t2 addw t1, t1, p3 shrsw t1, t1, p4 convsuswb d1, t1 .function orc_combine2_12xn_u8 .flags 2d .n 12 .dest 1 d1 uint8_t .source 1 s1 uint8_t .source 1 s2 uint8_t .param 2 p1 .param 2 p2 .param 2 p3 .param 2 p4 .temp 2 t1 .temp 2 t2 convubw t1, s1 convubw t2, s2 mullw t1, t1, p1 mullw t2, t2, p2 addw t1, t1, t2 addw t1, t1, p3 shrsw t1, t1, p4 convsuswb d1, t1 .function orc_combine2_16xn_u8 .flags 2d .n 16 .dest 1 d1 uint8_t .source 1 s1 uint8_t .source 1 s2 uint8_t .param 2 p1 .param 2 p2 .param 2 p3 .param 2 p4 .temp 2 t1 .temp 2 t2 convubw t1, s1 convubw t2, s2 mullw t1, t1, p1 mullw t2, t2, p2 addw t1, t1, t2 addw t1, t1, p3 shrsw t1, t1, p4 convsuswb d1, t1 .function orc_combine2_nxm_u8 .flags 2d .dest 1 d1 uint8_t .source 1 s1 uint8_t .source 1 s2 uint8_t .param 2 p1 .param 2 p2 .param 2 p3 .param 2 p4 .temp 2 t1 .temp 2 t2 convubw t1, s1 convubw t2, s2 mullw t1, t1, p1 mullw t2, t2, p2 addw t1, t1, t2 addw t1, t1, p3 shrsw t1, t1, p4 convsuswb d1, t1 .function orc_sad_nxm_u8 .flags 2d .accumulator 4 a1 uint32_t .source 1 s1 uint8_t .source 1 s2 uint8_t accsadubl a1, s1, s2 .function orc_sad_8x8_u8 .flags 2d .n 8 .m 8 .accumulator 4 a1 uint32_t .source 1 s1 uint8_t .source 1 s2 uint8_t accsadubl a1, s1, s2 .function orc_sad_12x12_u8 .flags 2d .n 12 .m 12 .accumulator 4 a1 uint32_t .source 1 s1 uint8_t .source 1 s2 uint8_t accsadubl a1, s1, s2 .function orc_sad_16xn_u8 .flags 2d .n 16 .accumulator 4 a1 uint32_t .source 1 s1 uint8_t .source 1 s2 uint8_t accsadubl a1, s1, s2 .function orc_sad_32xn_u8 .flags 2d .n 32 .accumulator 4 a1 uint32_t .source 1 s1 uint8_t .source 1 s2 uint8_t accsadubl a1, s1, s2 # 32-bit IIWT .function orc_add2_rshift_add_s32_22_op .dest 4 d1 int32_t .source 4 s1 int32_t .source 4 s2 int32_t .source 4 s3 int32_t .temp 4 t1 addl t1, s2, s3 addl t1, t1, 2 shrsl t1, t1, 2 addl d1, s1, t1 .function orc_mas4_vert_add_s32_1991_op .dest 4 d1 int32_t .source 4 s0 int32_t .source 4 s1 int32_t .source 4 s2 int32_t .source 4 s3 int32_t .source 4 s4 int32_t .param 4 p1 .param 4 p2 .temp 4 t1 .temp 4 t2 .temp 4 t3 .temp 4 t4 addl t1, s2, s3 mulll t3, t1, 9 addl t2, s1, s4 subl t3, t3, t2 addl t3, t3, p1 shrsl t3, t3, p2 addl d1, s0, t3 .function orc_add2_rshift_sub_s32_22_op .dest 4 d1 int32_t .source 4 s1 int32_t .source 4 s2 int32_t .source 4 s3 int32_t .temp 4 t1 addl t1, s2, s3 addl t1, t1, 2 shrsl t1, t1, 2 subl d1, s1, t1 .function orc_interleave2_rrshift1_s32 .dest 8 d1 int32_t .source 4 s1 int32_t .source 4 s2 int32_t .temp 4 t1 .temp 4 t2 addl t1, s1, 1 shrsl t1, t1, 1 addl t2, s2, 1 shrsl t2, t2, 1 mergelq d1, t1, t2 .function orc_mas4_vert_sub_s32_1991_op .dest 4 d1 int32_t .source 4 s0 int32_t .source 4 s1 int32_t .source 4 s2 int32_t .source 4 s3 int32_t .source 4 s4 int32_t .param 4 p1 .param 4 p2 .temp 4 t1 .temp 4 t2 .temp 4 t3 .temp 4 t4 addl t1, s2, s3 mulll t3, t1, 9 addl t2, s1, s4 subl t3, t3, t2 addl t3, t3, p1 shrsl t3, t3, p2 subl d1, s0, t3 .function orc_mas4_vert_sub_s32_1991 .dest 4 d1 int32_t .source 4 s1 int32_t .source 4 s2 int32_t .source 4 s3 int32_t .source 4 s4 int32_t .param 4 p1 .param 4 p2 .temp 4 t1 .temp 4 t2 .temp 4 t3 .temp 4 t4 addl t1, s2, s3 mulll t3, t1, 9 addl t2, s1, s4 subl t3, t3, t2 addl t3, t3, p1 shrsl t3, t3, p2 subl d1, d1, t3 .function orc_mas4_horiz_add_s32_1991_ip .dest 4 d1 int32_t .source 4 s1 int32_t .param 4 p1 .param 4 p2 .temp 4 t1 .temp 4 t2 .temp 4 t3 .temp 4 t4 loadoffl t1, s1, 1 loadoffl t2, s1, 2 addl t1, t1, t2 mulll t3, t1, 9 loadl t1, s1 loadoffl t2, s1, 3 addl t2, t1, t2 subl t3, t3, t2 addl t3, t3, p1 shrsl t3, t3, p2 addl d1, d1, t3 .function orc_add2_rshift_add_s32_11_op .dest 4 d1 int32_t .source 4 s1 int32_t .source 4 s2 int32_t .source 4 s3 int32_t .temp 4 t1 avgsl t1, s2, s3 addl d1, s1, t1 .function orc_mas4_horiz_sub_s32_1991_ip .dest 4 d1 int32_t .source 4 s1 int32_t .param 4 p1 .param 4 p2 .temp 4 t1 .temp 4 t2 .temp 4 t3 .temp 4 t4 loadoffl t1, s1, 1 loadoffl t2, s1, 2 addl t1, t1, t2 mulll t3, t1, 9 loadl t1, s1 loadoffl t2, s1, 3 addl t2, t1, t2 subl t3, t3, t2 addl t3, t3, p1 shrsl t3, t3, p2 subl d1, d1, t3 .function orc_haar_synth_s32_lo .dest 4 d1 int32_t .source 4 s1 int32_t .source 4 s2 int32_t .temp 4 t1 avgsl t1, s2, 0 subl d1, s1, t1 .function orc_haar_synth_int_s32 .dest 8 d1 int32_t .source 4 s1 int32_t .source 4 s2 int32_t .temp 4 t1 .temp 4 t2 copyl t2, s2 avgsl t1, t2, 0 subl t1, s1, t1 addl t2, t2, t1 mergelq d1, t1, t2 .function orc_haar_synth_rrshift1_int_s32 .dest 8 d1 int32_t .source 4 s1 int32_t .source 4 s2 int32_t .temp 4 t1 .temp 4 t2 copyl t2, s2 avgsl t1, t2, 0 subl t1, s1, t1 addl t2, t2, t1 avgsl t1, t1, 0 avgsl t2, t2, 0 mergelq d1, t1, t2 .function orc_interleave2_s32 .dest 8 d1 int32_t .source 4 s1 int32_t .source 4 s2 int32_t mergelq d1, s1, s2 .function orc_mas2_sub_s32_ip .dest 4 d1 int32_t .source 4 s1 int32_t .temp 4 t1 .temp 4 t2 .param 4 p1 .param 4 p2 .param 4 p3 loadoffl t1, s1, 1 addl t1, s1, t1 mulll t2, t1, p1 addl t2, t2, p2 shrsl t2, t2, p3 subl d1, d1, t2 .function orc_mas2_add_s32_ip .dest 4 d1 int32_t .source 4 s1 int32_t .temp 4 t1 .temp 4 t2 .param 4 p1 .param 4 p2 .param 4 p3 loadoffl t1, s1, 1 addl t1, s1, t1 mulll t2, t1, p1 addl t2, t2, p2 shrsl t2, t2, p3 addl d1, d1, t2 .function orc_mas2_add_s32_op .dest 4 d1 int32_t .source 4 s0 int32_t .source 4 s1 int32_t .source 4 s2 int32_t .temp 4 t1 .temp 4 t2 .param 4 p1 .param 4 p2 .param 4 p3 addl t1, s1, s2 mulll t2, t1, p1 addl t2, t2, p2 shrsl t2, t2, p3 addl d1, s0, t2 .function orc_mas2_sub_s32_op .dest 4 d1 int32_t .source 4 s0 int32_t .source 4 s1 int32_t .source 4 s2 int32_t .temp 4 t1 .temp 4 t2 .param 4 p1 .param 4 p2 .param 4 p3 addl t1, s1, s2 mulll t2, t1, p1 addl t2, t2, p2 shrsl t2, t2, p3 subl d1, s0, t2 .function orc_add2_rshift_sub_s32_22 .dest 4 d1 int32_t .source 4 s1 int32_t .temp 4 t1 loadoffl t1, s1, 1 addl t1, s1, t1 addl t1, t1, 2 shrsl t1, t1, 2 subl d1, d1, t1 .function orc_add2_rshift_add_s32_11 .dest 4 d1 int32_t .source 4 s1 int32_t .temp 4 t1 loadoffl t1, s1, 1 avgsl t1, s1, t1 addl d1, d1, t1 .function orc_haar_synth_s32 .dest 4 d1 int32_t .dest 4 d2 int32_t .temp 4 t1 .temp 4 t2 .temp 4 t3 copyl t1, d1 copyl t2, d2 avgsl t3, t2, 0 subl t1, t1, t3 copyl d1, t1 addl d2, t2, t1 .function orc_splat_s32_2d .flags 2d .dest 4 d1 int32_t .param 4 p1 copyl d1, p1 .function orc_dequantise_s32_ip_2d .flags 2d .dest 4 d1 int32_t .param 4 p1 .param 4 p2 .temp 4 t1 .temp 4 t2 copyl t1, d1 signl t2, t1 absl t1, t1 mulll t1, t1, p1 addl t1, t1, p2 shrsl t1, t1, 2 mulll d1, t1, t2 schroedinger-1.0.11/schroedinger/schroorc-dist.h0000664000175000017500000025004211707126525016612 00000000000000 /* autogenerated from schroorc.orc */ #ifndef _SCHROORC_H_ #define _SCHROORC_H_ #ifdef __cplusplus extern "C" { #endif void schro_orc_init (void); #include extern OrcCode *_orc_code_orc_add2_rshift_add_s16_22_vert; static inline void orc_add2_rshift_add_s16_22_vert (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add2_rshift_add_s16_22_vert; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_add2_rshift_add_s32_22_vert; static inline void orc_add2_rshift_add_s32_22_vert (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add2_rshift_add_s32_22_vert; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_add2_rshift_add_s16_22; static inline void orc_add2_rshift_add_s16_22 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add2_rshift_add_s16_22; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_add2_rshift_add_s32_22; static inline void orc_add2_rshift_add_s32_22 (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add2_rshift_add_s32_22; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_add2_rshift_sub_s16_22_vert; static inline void orc_add2_rshift_sub_s16_22_vert (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add2_rshift_sub_s16_22_vert; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_add2_rshift_sub_s16_22; static inline void orc_add2_rshift_sub_s16_22 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add2_rshift_sub_s16_22; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_add2_rshift_add_s16_11_op; static inline void orc_add2_rshift_add_s16_11_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add2_rshift_add_s16_11_op; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_add2_rshift_add_s16_11; static inline void orc_add2_rshift_add_s16_11 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add2_rshift_add_s16_11; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_add2_rshift_sub_s16_11_vert; static inline void orc_add2_rshift_sub_s16_11_vert (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add2_rshift_sub_s16_11_vert; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_add2_rshift_sub_s32_11_vert; static inline void orc_add2_rshift_sub_s32_11_vert (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add2_rshift_sub_s32_11_vert; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_add2_rshift_sub_s16_11; static inline void orc_add2_rshift_sub_s16_11 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add2_rshift_sub_s16_11; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_add2_rshift_sub_s32_11; static inline void orc_add2_rshift_sub_s32_11 (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add2_rshift_sub_s32_11; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_add_const_rshift_s16_11; static inline void orc_add_const_rshift_s16_11 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add_const_rshift_s16_11; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_add_const_rshift_s16; static inline void orc_add_const_rshift_s16 (orc_int16 * ORC_RESTRICT d1, int p1, int p2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add_const_rshift_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_add_const_rshift_s32; static inline void orc_add_const_rshift_s32 (orc_int32 * ORC_RESTRICT d1, int p1, int p2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add_const_rshift_s32; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_add_s16; static inline void orc_add_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_add_s16_2d; static inline void orc_add_s16_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, const orc_int16 * ORC_RESTRICT s1, int s1_stride, int n, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add_s16_2d; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_addc_rshift_s16; static inline void orc_addc_rshift_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int p1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_addc_rshift_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_P1] = p1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_lshift1_s16; static inline void orc_lshift1_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_lshift1_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_lshift2_s16; static inline void orc_lshift2_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_lshift2_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_lshift_s16_ip; static inline void orc_lshift_s16_ip (orc_int16 * ORC_RESTRICT d1, int p1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_lshift_s16_ip; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_P1] = p1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_lshift_s32_ip; static inline void orc_lshift_s32_ip (orc_int32 * ORC_RESTRICT d1, int p1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_lshift_s32_ip; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_P1] = p1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_mas2_add_s16_op; static inline void orc_mas2_add_s16_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, int p1, int p2, int p3, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_mas2_add_s16_op; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_mas2_add_s16_ip; static inline void orc_mas2_add_s16_ip (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int p1, int p2, int p3, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_mas2_add_s16_ip; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_mas2_sub_s16_op; static inline void orc_mas2_sub_s16_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, int p1, int p2, int p3, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_mas2_sub_s16_op; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_mas2_sub_s16_ip; static inline void orc_mas2_sub_s16_ip (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int p1, int p2, int p3, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_mas2_sub_s16_ip; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_mas4_vert_add_s16_1991; static inline void orc_mas4_vert_add_s16_1991 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, const orc_int16 * ORC_RESTRICT s4, int p1, int p2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_mas4_vert_add_s16_1991; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->arrays[ORC_VAR_S4] = (void *)s4; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_mas4_vert_add_s32_1991; static inline void orc_mas4_vert_add_s32_1991 (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, const orc_int32 * ORC_RESTRICT s3, const orc_int32 * ORC_RESTRICT s4, int p1, int p2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_mas4_vert_add_s32_1991; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->arrays[ORC_VAR_S4] = (void *)s4; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_mas4_horiz_add_s16_1991_ip; static inline void orc_mas4_horiz_add_s16_1991_ip (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int p1, int p2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_mas4_horiz_add_s16_1991_ip; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_mas4_vert_sub_s16_1991; static inline void orc_mas4_vert_sub_s16_1991 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, const orc_int16 * ORC_RESTRICT s4, int p1, int p2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_mas4_vert_sub_s16_1991; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->arrays[ORC_VAR_S4] = (void *)s4; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_mas4_horiz_sub_s16_1991_ip; static inline void orc_mas4_horiz_sub_s16_1991_ip (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int p1, int p2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_mas4_horiz_sub_s16_1991_ip; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_subtract_s16; static inline void orc_subtract_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_subtract_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_add_s16_u8; static inline void orc_add_s16_u8 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add_s16_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_add_s16_u8_2d; static inline void orc_add_s16_u8_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, int n, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add_s16_u8_2d; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_convert_s16_u8; static inline void orc_convert_s16_u8 (orc_int16 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_convert_s16_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_convert_s16_s32; static inline void orc_convert_s16_s32 (orc_int16 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_convert_s16_s32; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_convert_u8_s16; static inline void orc_convert_u8_s16 (orc_uint8 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_convert_u8_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_convert_s32_s16; static inline void orc_convert_s32_s16 (orc_int32 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_convert_s32_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_offsetconvert_u8_s16; static inline void orc_offsetconvert_u8_s16 (orc_uint8 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_offsetconvert_u8_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_offsetconvert_u8_s32; static inline void orc_offsetconvert_u8_s32 (orc_uint8 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_offsetconvert_u8_s32; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_offsetconvert_s16_u8; static inline void orc_offsetconvert_s16_u8 (orc_int16 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_offsetconvert_s16_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_offsetconvert_s32_u8; static inline void orc_offsetconvert_s32_u8 (orc_int32 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_offsetconvert_s32_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_offsetconvert_s32_s16; static inline void orc_offsetconvert_s32_s16 (orc_int32 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_offsetconvert_s32_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_subtract_s16_u8; static inline void orc_subtract_s16_u8 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_subtract_s16_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_multiply_and_add_s16_u8; static inline void orc_multiply_and_add_s16_u8 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_multiply_and_add_s16_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_splat_s16_ns; static inline void orc_splat_s16_ns (orc_int16 * ORC_RESTRICT d1, int p1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_splat_s16_ns; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_P1] = p1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_splat_s32_ns; static inline void orc_splat_s32_ns (orc_int32 * ORC_RESTRICT d1, int p1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_splat_s32_ns; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_P1] = p1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_splat_s16_2d_4xn; static inline void orc_splat_s16_2d_4xn (orc_int16 * ORC_RESTRICT d1, int d1_stride, int p1, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_splat_s16_2d_4xn; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 4; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->params[ORC_VAR_P1] = p1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_splat_s16_2d_8xn; static inline void orc_splat_s16_2d_8xn (orc_int16 * ORC_RESTRICT d1, int d1_stride, int p1, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_splat_s16_2d_8xn; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 8; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->params[ORC_VAR_P1] = p1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_splat_s16_2d; static inline void orc_splat_s16_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, int p1, int n, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_splat_s16_2d; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->params[ORC_VAR_P1] = p1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_splat_u8_ns; static inline void orc_splat_u8_ns (orc_uint8 * ORC_RESTRICT d1, int p1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_splat_u8_ns; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_P1] = p1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_splat_u8_2d; static inline void orc_splat_u8_2d (orc_uint8 * ORC_RESTRICT d1, int d1_stride, int p1, int n, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_splat_u8_2d; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->params[ORC_VAR_P1] = p1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_average_u8; static inline void orc_average_u8 (orc_uint8 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_average_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_rrshift6_add_s16_2d; static inline void orc_rrshift6_add_s16_2d (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_int16 * ORC_RESTRICT s1, int s1_stride, const orc_int16 * ORC_RESTRICT s2, int s2_stride, int n, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_rrshift6_add_s16_2d; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_rrshift6_add_s32_2d; static inline void orc_rrshift6_add_s32_2d (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_int32 * ORC_RESTRICT s1, int s1_stride, const orc_int16 * ORC_RESTRICT s2, int s2_stride, int n, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_rrshift6_add_s32_2d; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_rrshift6_sub_s16_2d; static inline void orc_rrshift6_sub_s16_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, orc_int16 * ORC_RESTRICT d2, int d2_stride, int n, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_rrshift6_sub_s16_2d; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_D2] = d2; ex->params[ORC_VAR_D2] = d2_stride; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_rrshift6_s16_ip_2d; static inline void orc_rrshift6_s16_ip_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, int n, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_rrshift6_s16_ip_2d; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_rrshift6_s16_ip; static inline void orc_rrshift6_s16_ip (orc_int16 * ORC_RESTRICT d1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_rrshift6_s16_ip; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_unpack_yuyv_y; static inline void orc_unpack_yuyv_y (orc_uint8 * ORC_RESTRICT d1, const orc_uint16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_unpack_yuyv_y; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_unpack_yuyv_u; static inline void orc_unpack_yuyv_u (orc_uint8 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_unpack_yuyv_u; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_unpack_yuyv_v; static inline void orc_unpack_yuyv_v (orc_uint8 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_unpack_yuyv_v; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_packyuyv; static inline void orc_packyuyv (orc_uint32 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, const orc_uint8 * ORC_RESTRICT s3, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_packyuyv; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_unpack_uyvy_y; static inline void orc_unpack_uyvy_y (orc_uint8 * ORC_RESTRICT d1, const orc_uint16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_unpack_uyvy_y; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_unpack_uyvy_u; static inline void orc_unpack_uyvy_u (orc_uint8 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_unpack_uyvy_u; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_unpack_uyvy_v; static inline void orc_unpack_uyvy_v (orc_uint8 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_unpack_uyvy_v; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_interleave2_s16; static inline void orc_interleave2_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_interleave2_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_interleave2_rrshift1_s16; static inline void orc_interleave2_rrshift1_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_interleave2_rrshift1_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_deinterleave2_s16; static inline void orc_deinterleave2_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_deinterleave2_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_deinterleave2_s32; static inline void orc_deinterleave2_s32 (orc_int32 * ORC_RESTRICT d1, orc_int32 * ORC_RESTRICT d2, const orc_int32 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_deinterleave2_s32; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_deinterleave2_lshift1_s16; static inline void orc_deinterleave2_lshift1_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_deinterleave2_lshift1_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_deinterleave2_lshift1_s32; static inline void orc_deinterleave2_lshift1_s32 (orc_int32 * ORC_RESTRICT d1, orc_int32 * ORC_RESTRICT d2, const orc_int32 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_deinterleave2_lshift1_s32; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_haar_deint_lshift1_split_s16; static inline void orc_haar_deint_lshift1_split_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_deint_lshift1_split_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_haar_deint_lshift1_split_s32; static inline void orc_haar_deint_lshift1_split_s32 (orc_int32 * ORC_RESTRICT d1, orc_int32 * ORC_RESTRICT d2, const orc_int32 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_deint_lshift1_split_s32; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_haar_deint_split_s16; static inline void orc_haar_deint_split_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_deint_split_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_haar_deint_split_s32; static inline void orc_haar_deint_split_s32 (orc_int32 * ORC_RESTRICT d1, orc_int32 * ORC_RESTRICT d2, const orc_int32 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_deint_split_s32; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_haar_split_s16_lo; static inline void orc_haar_split_s16_lo (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_split_s16_lo; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_haar_split_s16_hi; static inline void orc_haar_split_s16_hi (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_split_s16_hi; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_haar_split_s16_op; static inline void orc_haar_split_s16_op (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_split_s16_op; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_haar_split_s32_op; static inline void orc_haar_split_s32_op (orc_int32 * ORC_RESTRICT d1, orc_int32 * ORC_RESTRICT d2, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_split_s32_op; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_haar_split_s16; static inline void orc_haar_split_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_split_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_haar_synth_s16_lo; static inline void orc_haar_synth_s16_lo (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_synth_s16_lo; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_haar_synth_s16_hi; static inline void orc_haar_synth_s16_hi (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_synth_s16_hi; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_haar_synth_s16_op; static inline void orc_haar_synth_s16_op (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_synth_s16_op; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_haar_synth_s16; static inline void orc_haar_synth_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_synth_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_haar_synth_rrshift1_int_s16; static inline void orc_haar_synth_rrshift1_int_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_synth_rrshift1_int_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_haar_synth_int_s16; static inline void orc_haar_synth_int_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_synth_int_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_haar_sub_s16; static inline void orc_haar_sub_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_sub_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_haar_add_half_s16; static inline void orc_haar_add_half_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_add_half_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_haar_add_s16; static inline void orc_haar_add_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_add_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_haar_sub_half_s16; static inline void orc_haar_sub_half_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_sub_half_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_sum_u8; static inline void orc_sum_u8 (orc_int32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_sum_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); *a1 = orc_executor_get_accumulator (ex, ORC_VAR_A1); } extern OrcCode *_orc_code_orc_sum_s16; static inline void orc_sum_s16 (orc_int32 * ORC_RESTRICT a1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_sum_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); *a1 = orc_executor_get_accumulator (ex, ORC_VAR_A1); } extern OrcCode *_orc_code_orc_sum_square_diff_u8; static inline void orc_sum_square_diff_u8 (orc_int32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_sum_square_diff_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); *a1 = orc_executor_get_accumulator (ex, ORC_VAR_A1); } extern OrcCode *_orc_code_orc_dequantise_s16_2d_4xn; static inline void orc_dequantise_s16_2d_4xn (orc_int16 * ORC_RESTRICT d1, int d1_stride, const orc_int16 * ORC_RESTRICT s1, int s1_stride, int p1, int p2, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_dequantise_s16_2d_4xn; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 4; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_dequantise_s16_2d_8xn; static inline void orc_dequantise_s16_2d_8xn (orc_int16 * ORC_RESTRICT d1, int d1_stride, const orc_int16 * ORC_RESTRICT s1, int s1_stride, int p1, int p2, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_dequantise_s16_2d_8xn; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 8; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_dequantise_s16_ip_2d_8xn; static inline void orc_dequantise_s16_ip_2d_8xn (orc_int16 * ORC_RESTRICT d1, int d1_stride, int p1, int p2, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_dequantise_s16_ip_2d_8xn; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 8; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_dequantise_s16_ip_2d; static inline void orc_dequantise_s16_ip_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, int p1, int p2, int n, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_dequantise_s16_ip_2d; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_dequantise_s16_ip; static inline void orc_dequantise_s16_ip (orc_int16 * ORC_RESTRICT d1, int p1, int p2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_dequantise_s16_ip; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_dequantise_s16; static inline void orc_dequantise_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int p1, int p2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_dequantise_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_dequantise_var_s16_ip; static inline void orc_dequantise_var_s16_ip (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_dequantise_var_s16_ip; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_quantise1_s16; static inline void orc_quantise1_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int p1, int p2, int p3, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_quantise1_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_quantise2_s16; static inline void orc_quantise2_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int p1, int p2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_quantise2_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_quantdequant1_s16; static inline void orc_quantdequant1_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, int p1, int p2, int p3, int p4, int p5, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_quantdequant1_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; ex->params[ORC_VAR_P5] = p5; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_quantdequant3_s16; static inline void orc_quantdequant3_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, int p1, int p2, int p3, int p4, int p5, int p6, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_quantdequant3_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; ex->params[ORC_VAR_P5] = p5; ex->params[ORC_VAR_P6] = p6; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_quantdequant2_s16; static inline void orc_quantdequant2_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, int p1, int p2, int p3, int p4, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_quantdequant2_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_downsample_vert_u8; static inline void orc_downsample_vert_u8 (orc_uint8 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, const orc_uint8 * ORC_RESTRICT s3, const orc_uint8 * ORC_RESTRICT s4, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_downsample_vert_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->arrays[ORC_VAR_S4] = (void *)s4; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_downsample_horiz_u8; static inline void orc_downsample_horiz_u8 (orc_uint8 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_downsample_horiz_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_stats_moment_s16; static inline void orc_stats_moment_s16 (orc_int32 * ORC_RESTRICT a1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_stats_moment_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); *a1 = orc_executor_get_accumulator (ex, ORC_VAR_A1); } extern OrcCode *_orc_code_orc_stats_above_s16; static inline void orc_stats_above_s16 (orc_int32 * ORC_RESTRICT a1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_stats_above_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); *a1 = orc_executor_get_accumulator (ex, ORC_VAR_A1); } extern OrcCode *_orc_code_orc_accw; static inline void orc_accw (int * ORC_RESTRICT a1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_accw; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); *a1 = orc_executor_get_accumulator (ex, ORC_VAR_A1); } extern OrcCode *_orc_code_orc_avg2_8xn_u8; static inline void orc_avg2_8xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_avg2_8xn_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 8; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_avg2_12xn_u8; static inline void orc_avg2_12xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_avg2_12xn_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 12; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_avg2_16xn_u8; static inline void orc_avg2_16xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_avg2_16xn_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 16; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_avg2_32xn_u8; static inline void orc_avg2_32xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_avg2_32xn_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 32; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_avg2_nxm_u8; static inline void orc_avg2_nxm_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int n, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_avg2_nxm_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_combine4_8xn_u8; static inline void orc_combine4_8xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_combine4_8xn_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 8; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->params[ORC_VAR_S3] = s3_stride; ex->arrays[ORC_VAR_S4] = (void *)s4; ex->params[ORC_VAR_S4] = s4_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_combine4_12xn_u8; static inline void orc_combine4_12xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_combine4_12xn_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 12; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->params[ORC_VAR_S3] = s3_stride; ex->arrays[ORC_VAR_S4] = (void *)s4; ex->params[ORC_VAR_S4] = s4_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_combine4_16xn_u8; static inline void orc_combine4_16xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_combine4_16xn_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 16; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->params[ORC_VAR_S3] = s3_stride; ex->arrays[ORC_VAR_S4] = (void *)s4; ex->params[ORC_VAR_S4] = s4_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_combine4_24xn_u8; static inline void orc_combine4_24xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_combine4_24xn_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 24; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->params[ORC_VAR_S3] = s3_stride; ex->arrays[ORC_VAR_S4] = (void *)s4; ex->params[ORC_VAR_S4] = s4_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_combine4_32xn_u8; static inline void orc_combine4_32xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_combine4_32xn_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 32; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->params[ORC_VAR_S3] = s3_stride; ex->arrays[ORC_VAR_S4] = (void *)s4; ex->params[ORC_VAR_S4] = s4_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_combine4_nxm_u8; static inline void orc_combine4_nxm_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int n, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_combine4_nxm_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->params[ORC_VAR_S3] = s3_stride; ex->arrays[ORC_VAR_S4] = (void *)s4; ex->params[ORC_VAR_S4] = s4_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_combine2_8xn_u8; static inline void orc_combine2_8xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int p1, int p2, int p3, int p4, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_combine2_8xn_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 8; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_combine2_12xn_u8; static inline void orc_combine2_12xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int p1, int p2, int p3, int p4, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_combine2_12xn_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 12; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_combine2_16xn_u8; static inline void orc_combine2_16xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int p1, int p2, int p3, int p4, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_combine2_16xn_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 16; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_combine2_nxm_u8; static inline void orc_combine2_nxm_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int p1, int p2, int p3, int p4, int n, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_combine2_nxm_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_sad_nxm_u8; static inline void orc_sad_nxm_u8 (orc_uint32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int n, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_sad_nxm_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; func = c->exec; func (ex); *a1 = orc_executor_get_accumulator (ex, ORC_VAR_A1); } extern OrcCode *_orc_code_orc_sad_8x8_u8; static inline void orc_sad_8x8_u8 (orc_uint32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_sad_8x8_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 8; ORC_EXECUTOR_M(ex) = 8; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; func = c->exec; func (ex); *a1 = orc_executor_get_accumulator (ex, ORC_VAR_A1); } extern OrcCode *_orc_code_orc_sad_12x12_u8; static inline void orc_sad_12x12_u8 (orc_uint32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_sad_12x12_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 12; ORC_EXECUTOR_M(ex) = 12; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; func = c->exec; func (ex); *a1 = orc_executor_get_accumulator (ex, ORC_VAR_A1); } extern OrcCode *_orc_code_orc_sad_16xn_u8; static inline void orc_sad_16xn_u8 (orc_uint32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_sad_16xn_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 16; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; func = c->exec; func (ex); *a1 = orc_executor_get_accumulator (ex, ORC_VAR_A1); } extern OrcCode *_orc_code_orc_sad_32xn_u8; static inline void orc_sad_32xn_u8 (orc_uint32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_sad_32xn_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 32; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; func = c->exec; func (ex); *a1 = orc_executor_get_accumulator (ex, ORC_VAR_A1); } extern OrcCode *_orc_code_orc_add2_rshift_add_s32_22_op; static inline void orc_add2_rshift_add_s32_22_op (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, const orc_int32 * ORC_RESTRICT s3, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add2_rshift_add_s32_22_op; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_mas4_vert_add_s32_1991_op; static inline void orc_mas4_vert_add_s32_1991_op (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, const orc_int32 * ORC_RESTRICT s3, const orc_int32 * ORC_RESTRICT s4, const orc_int32 * ORC_RESTRICT s5, int p1, int p2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_mas4_vert_add_s32_1991_op; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->arrays[ORC_VAR_S4] = (void *)s4; ex->arrays[ORC_VAR_S5] = (void *)s5; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_add2_rshift_sub_s32_22_op; static inline void orc_add2_rshift_sub_s32_22_op (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, const orc_int32 * ORC_RESTRICT s3, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add2_rshift_sub_s32_22_op; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_interleave2_rrshift1_s32; static inline void orc_interleave2_rrshift1_s32 (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_interleave2_rrshift1_s32; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_mas4_vert_sub_s32_1991_op; static inline void orc_mas4_vert_sub_s32_1991_op (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, const orc_int32 * ORC_RESTRICT s3, const orc_int32 * ORC_RESTRICT s4, const orc_int32 * ORC_RESTRICT s5, int p1, int p2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_mas4_vert_sub_s32_1991_op; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->arrays[ORC_VAR_S4] = (void *)s4; ex->arrays[ORC_VAR_S5] = (void *)s5; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_mas4_vert_sub_s32_1991; static inline void orc_mas4_vert_sub_s32_1991 (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, const orc_int32 * ORC_RESTRICT s3, const orc_int32 * ORC_RESTRICT s4, int p1, int p2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_mas4_vert_sub_s32_1991; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->arrays[ORC_VAR_S4] = (void *)s4; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_mas4_horiz_add_s32_1991_ip; static inline void orc_mas4_horiz_add_s32_1991_ip (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, int p1, int p2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_mas4_horiz_add_s32_1991_ip; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_add2_rshift_add_s32_11_op; static inline void orc_add2_rshift_add_s32_11_op (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, const orc_int32 * ORC_RESTRICT s3, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add2_rshift_add_s32_11_op; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_mas4_horiz_sub_s32_1991_ip; static inline void orc_mas4_horiz_sub_s32_1991_ip (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, int p1, int p2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_mas4_horiz_sub_s32_1991_ip; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_haar_synth_s32_lo; static inline void orc_haar_synth_s32_lo (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_synth_s32_lo; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_haar_synth_int_s32; static inline void orc_haar_synth_int_s32 (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_synth_int_s32; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_haar_synth_rrshift1_int_s32; static inline void orc_haar_synth_rrshift1_int_s32 (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_synth_rrshift1_int_s32; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_interleave2_s32; static inline void orc_interleave2_s32 (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_interleave2_s32; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_mas2_sub_s32_ip; static inline void orc_mas2_sub_s32_ip (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, int p1, int p2, int p3, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_mas2_sub_s32_ip; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_mas2_add_s32_ip; static inline void orc_mas2_add_s32_ip (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, int p1, int p2, int p3, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_mas2_add_s32_ip; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_mas2_add_s32_op; static inline void orc_mas2_add_s32_op (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, const orc_int32 * ORC_RESTRICT s3, int p1, int p2, int p3, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_mas2_add_s32_op; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_mas2_sub_s32_op; static inline void orc_mas2_sub_s32_op (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, const orc_int32 * ORC_RESTRICT s3, int p1, int p2, int p3, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_mas2_sub_s32_op; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_add2_rshift_sub_s32_22; static inline void orc_add2_rshift_sub_s32_22 (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add2_rshift_sub_s32_22; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_add2_rshift_add_s32_11; static inline void orc_add2_rshift_add_s32_11 (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add2_rshift_add_s32_11; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_haar_synth_s32; static inline void orc_haar_synth_s32 (orc_int32 * ORC_RESTRICT d1, orc_int32 * ORC_RESTRICT d2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_synth_s32; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_splat_s32_2d; static inline void orc_splat_s32_2d (orc_int32 * ORC_RESTRICT d1, int d1_stride, int p1, int n, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_splat_s32_2d; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->params[ORC_VAR_P1] = p1; func = c->exec; func (ex); } extern OrcCode *_orc_code_orc_dequantise_s32_ip_2d; static inline void orc_dequantise_s32_ip_2d (orc_int32 * ORC_RESTRICT d1, int d1_stride, int p1, int p2, int n, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_dequantise_s32_ip_2d; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } #ifdef __cplusplus } #endif #endif schroedinger-1.0.11/schroedinger/schroqueue.h0000644000175000017500000000242411317770056016210 00000000000000 #ifndef __SCHRO_QUEUE_H__ #define __SCHRO_QUEUE_H__ #include SCHRO_BEGIN_DECLS typedef struct _SchroQueue SchroQueue; typedef struct _SchroQueueElement SchroQueueElement; typedef void (*SchroQueueFreeFunc)(void *data, SchroPictureNumber number); struct _SchroQueueElement { void *data; SchroPictureNumber picture_number; }; struct _SchroQueue { int size; int n; SchroQueueElement *elements; SchroQueueFreeFunc free; }; #ifdef SCHRO_ENABLE_UNSTABLE_API SchroQueue *schro_queue_new (int size, SchroQueueFreeFunc func); void schro_queue_free (SchroQueue *queue); void schro_queue_add (SchroQueue *queue, void *element, SchroPictureNumber picture_number); void *schro_queue_find (SchroQueue *queue, SchroPictureNumber picture_number); void schro_queue_delete (SchroQueue *queue, SchroPictureNumber picture_number); void *schro_queue_remove (SchroQueue *queue, SchroPictureNumber picture_number); void schro_queue_clear (SchroQueue *queue); void schro_queue_pop (SchroQueue *queue); void * schro_queue_pull (SchroQueue *queue); void *schro_queue_peek (SchroQueue *queue); int schro_queue_is_full (SchroQueue *queue); int schro_queue_is_empty (SchroQueue *queue); int schro_queue_slots_available (SchroQueue *queue); #endif SCHRO_END_DECLS #endif schroedinger-1.0.11/schroedinger/schrowavelettables.c0000644000175000017500000024214211346060402017711 00000000000000/* This file is autogenerated */ #include const float schro_tables_wavelet_noise_curve[SCHRO_N_WAVELETS][8][128] = { { { /* wavelet type 0, n_levels 1, high */ 0.000574, 0.000419, 0.000419, 0.000421, 0.000426, 0.000435, 0.000451, 0.000475, 0.000516, 0.000575, 0.000658, 0.000771, 0.000920, 0.001114, 0.001357, 0.001665, 0.002044, 0.002493, 0.003035, 0.003683, 0.004481, 0.005355, 0.006493, 0.007623, 0.009025, 0.010581, 0.012401, 0.014401, 0.016705, 0.019196, 0.022019, 0.025064, 0.028258, 0.031925, 0.035914, 0.040316, 0.044941, 0.049618, 0.054841, 0.060577, 0.066367, 0.072405, 0.079775, 0.086156, 0.092870, 0.101068, 0.108124, 0.115877, 0.123644, 0.131757, 0.140603, 0.147980, 0.157224, 0.165461, 0.173690, 0.183054, 0.190249, 0.198556, 0.207624, 0.213571, 0.222516, 0.229930, 0.235654, 0.243279, 0.249072, 0.255464, 0.260016, 0.266553, 0.271044, 0.273611, 0.279935, 0.281699, 0.284500, 0.288692, 0.289452, 0.291363, 0.293102, 0.292624, 0.295046, 0.294121, 0.294116, 0.294416, 0.293891, 0.294561, 0.291195, 0.291388, 0.291374, 0.286807, 0.285627, 0.284520, 0.281745, 0.280172, 0.279749, 0.277635, 0.274919, 0.272721, 0.270717, 0.270279, 0.268429, 0.266318, 0.265018, 0.262580, 0.261398, 0.259272, 0.258818, 0.257296, 0.259137, 0.254028, 0.254421, 0.253685, 0.252507, 0.252336, 0.252607, 0.252498, 0.252334, 0.251203, 0.249662, 0.250503, 0.251116, 0.249652, 0.251298, 0.248460, 0.249173, 0.250587, 0.250904, 0.250140, 0.250497, 0.250168, }, { /* wavelet type 0, n_levels 1, low */ 1.004448, 1.000726, 1.002665, 1.004558, 0.997625, 0.999695, 1.001262, 0.996124, 0.997137, 1.001106, 0.995252, 0.998148, 1.001019, 0.996769, 0.989950, 0.995967, 0.993213, 0.987558, 0.985659, 0.985117, 0.978179, 0.977213, 0.975829, 0.962191, 0.961872, 0.955232, 0.945845, 0.936059, 0.923234, 0.922730, 0.912311, 0.902993, 0.883404, 0.871201, 0.859177, 0.843540, 0.827795, 0.823553, 0.802672, 0.779115, 0.765036, 0.745169, 0.724668, 0.701950, 0.680772, 0.665643, 0.640761, 0.622840, 0.596463, 0.577257, 0.557431, 0.526557, 0.505256, 0.483729, 0.460862, 0.437582, 0.415923, 0.393477, 0.372857, 0.351255, 0.328408, 0.309830, 0.288798, 0.268526, 0.251480, 0.232190, 0.215726, 0.199810, 0.183158, 0.168605, 0.154595, 0.140661, 0.127996, 0.115835, 0.104843, 0.094533, 0.084488, 0.075411, 0.068213, 0.060274, 0.053025, 0.047041, 0.041109, 0.036138, 0.031199, 0.027120, 0.023554, 0.020286, 0.017422, 0.014810, 0.012719, 0.010877, 0.009105, 0.007713, 0.006512, 0.005504, 0.004656, 0.003987, 0.003387, 0.002911, 0.002509, 0.002199, 0.001957, 0.001758, 0.001601, 0.001482, 0.001393, 0.001321, 0.001271, 0.001232, 0.001204, 0.001183, 0.001169, 0.001158, 0.001149, 0.001142, 0.001137, 0.001134, 0.001131, 0.001128, 0.001125, 0.001123, 0.001121, 0.001120, 0.001118, 0.001118, 0.001116, 0.001116, }, { /* wavelet type 0, n_levels 2, high */ 0.001447, 0.001391, 0.001406, 0.001445, 0.001532, 0.001700, 0.001995, 0.002478, 0.003212, 0.004283, 0.005773, 0.007752, 0.010441, 0.013876, 0.018011, 0.023395, 0.029730, 0.037372, 0.045950, 0.055953, 0.066733, 0.079239, 0.091822, 0.106319, 0.120048, 0.134904, 0.149964, 0.164300, 0.178121, 0.190569, 0.202406, 0.213374, 0.220041, 0.228592, 0.232339, 0.235167, 0.236624, 0.235861, 0.233326, 0.228882, 0.223333, 0.218317, 0.210102, 0.203424, 0.194391, 0.186817, 0.178133, 0.170034, 0.161069, 0.153052, 0.144110, 0.138255, 0.130621, 0.123527, 0.117043, 0.111198, 0.104986, 0.098840, 0.092840, 0.087323, 0.082078, 0.076961, 0.072267, 0.067311, 0.062436, 0.058263, 0.054071, 0.049800, 0.045939, 0.042282, 0.038837, 0.035659, 0.032663, 0.029811, 0.026983, 0.024457, 0.022180, 0.020099, 0.017917, 0.016222, 0.014524, 0.013030, 0.011555, 0.010237, 0.008977, 0.007895, 0.006834, 0.005926, 0.005042, 0.004290, 0.003618, 0.003014, 0.002488, 0.002030, 0.001655, 0.001333, 0.001062, 0.000863, 0.000689, 0.000564, 0.000462, 0.000393, 0.000341, 0.000304, 0.000281, 0.000266, 0.000257, 0.000252, 0.000250, 0.000249, 0.000249, 0.000249, 0.000250, 0.000250, 0.000250, 0.000250, 0.000250, 0.000250, 0.000250, 0.000249, 0.000249, 0.000249, 0.000248, 0.000248, 0.000248, 0.000248, 0.000247, 0.000247, }, { /* wavelet type 0, n_levels 2, low */ 1.001893, 0.999051, 0.998821, 1.007029, 1.006653, 0.999623, 0.996682, 0.996392, 0.996448, 0.988962, 0.974877, 0.967721, 0.955771, 0.945287, 0.928679, 0.904876, 0.879051, 0.846235, 0.822928, 0.782494, 0.748462, 0.704467, 0.660423, 0.616836, 0.572762, 0.524966, 0.473811, 0.430626, 0.383517, 0.339814, 0.298198, 0.258827, 0.221713, 0.188340, 0.157398, 0.130029, 0.105990, 0.085944, 0.067626, 0.053570, 0.041413, 0.031404, 0.023601, 0.017589, 0.012943, 0.009457, 0.006929, 0.005118, 0.003852, 0.003015, 0.002436, 0.002074, 0.001830, 0.001665, 0.001559, 0.001478, 0.001417, 0.001364, 0.001318, 0.001275, 0.001237, 0.001200, 0.001166, 0.001134, 0.001105, 0.001075, 0.001047, 0.001020, 0.000995, 0.000969, 0.000944, 0.000920, 0.000897, 0.000878, 0.000863, 0.000852, 0.000850, 0.000856, 0.000875, 0.000903, 0.000951, 0.001004, 0.001076, 0.001154, 0.001244, 0.001337, 0.001434, 0.001521, 0.001598, 0.001671, 0.001711, 0.001744, 0.001757, 0.001745, 0.001705, 0.001657, 0.001581, 0.001507, 0.001409, 0.001317, 0.001218, 0.001123, 0.001028, 0.000952, 0.000873, 0.000808, 0.000754, 0.000707, 0.000668, 0.000639, 0.000615, 0.000599, 0.000586, 0.000576, 0.000569, 0.000565, 0.000562, 0.000559, 0.000557, 0.000556, 0.000555, 0.000554, 0.000553, 0.000552, 0.000552, 0.000551, 0.000551, 0.000551, }, { /* wavelet type 0, n_levels 3, high */ 0.003793, 0.003811, 0.004007, 0.004595, 0.005957, 0.008773, 0.013662, 0.021718, 0.033850, 0.050062, 0.070986, 0.095612, 0.122996, 0.151819, 0.179582, 0.203027, 0.218738, 0.230520, 0.232962, 0.227166, 0.216517, 0.203716, 0.187287, 0.170777, 0.154159, 0.137296, 0.122232, 0.108442, 0.095729, 0.084718, 0.074264, 0.064541, 0.055514, 0.047276, 0.039703, 0.033155, 0.027198, 0.022338, 0.018065, 0.014484, 0.011507, 0.008933, 0.006798, 0.005084, 0.003670, 0.002630, 0.001818, 0.001243, 0.000858, 0.000623, 0.000485, 0.000410, 0.000369, 0.000349, 0.000335, 0.000325, 0.000315, 0.000305, 0.000295, 0.000286, 0.000278, 0.000270, 0.000262, 0.000255, 0.000248, 0.000241, 0.000235, 0.000229, 0.000223, 0.000217, 0.000211, 0.000205, 0.000199, 0.000192, 0.000186, 0.000180, 0.000176, 0.000176, 0.000180, 0.000191, 0.000207, 0.000230, 0.000258, 0.000288, 0.000319, 0.000347, 0.000376, 0.000396, 0.000413, 0.000421, 0.000428, 0.000432, 0.000429, 0.000425, 0.000418, 0.000405, 0.000390, 0.000372, 0.000350, 0.000329, 0.000306, 0.000286, 0.000263, 0.000243, 0.000225, 0.000206, 0.000190, 0.000173, 0.000160, 0.000149, 0.000140, 0.000134, 0.000129, 0.000127, 0.000125, 0.000125, 0.000125, 0.000125, 0.000126, 0.000126, 0.000126, 0.000126, 0.000126, 0.000126, 0.000125, 0.000125, 0.000125, 0.000125, }, { /* wavelet type 0, n_levels 3, low */ 1.020641, 1.016982, 1.008008, 1.007444, 0.996722, 0.981720, 0.959496, 0.925598, 0.875309, 0.810711, 0.739097, 0.652825, 0.564447, 0.470468, 0.378801, 0.292208, 0.216692, 0.154084, 0.104708, 0.067808, 0.041481, 0.024427, 0.014224, 0.008398, 0.005386, 0.003933, 0.003215, 0.002818, 0.002555, 0.002350, 0.002177, 0.002029, 0.001901, 0.001783, 0.001673, 0.001570, 0.001474, 0.001393, 0.001340, 0.001323, 0.001353, 0.001422, 0.001518, 0.001621, 0.001698, 0.001722, 0.001695, 0.001604, 0.001468, 0.001314, 0.001158, 0.001024, 0.000907, 0.000823, 0.000763, 0.000722, 0.000690, 0.000667, 0.000647, 0.000627, 0.000609, 0.000592, 0.000576, 0.000560, 0.000546, 0.000532, 0.000518, 0.000505, 0.000493, 0.000481, 0.000470, 0.000460, 0.000453, 0.000448, 0.000447, 0.000449, 0.000453, 0.000458, 0.000462, 0.000462, 0.000457, 0.000447, 0.000432, 0.000416, 0.000397, 0.000380, 0.000366, 0.000355, 0.000346, 0.000341, 0.000336, 0.000332, 0.000329, 0.000325, 0.000321, 0.000318, 0.000315, 0.000311, 0.000308, 0.000305, 0.000302, 0.000299, 0.000296, 0.000294, 0.000293, 0.000293, 0.000293, 0.000294, 0.000295, 0.000295, 0.000295, 0.000294, 0.000291, 0.000288, 0.000284, 0.000281, 0.000278, 0.000275, 0.000273, 0.000272, 0.000271, 0.000270, 0.000270, 0.000269, 0.000269, 0.000269, 0.000269, 0.000268, }, { /* wavelet type 0, n_levels 4, high */ 0.008764, 0.009186, 0.011754, 0.020465, 0.041601, 0.079371, 0.131313, 0.183543, 0.221221, 0.230188, 0.214049, 0.183486, 0.149616, 0.118430, 0.093592, 0.072012, 0.054162, 0.039140, 0.027281, 0.018252, 0.011730, 0.007074, 0.003974, 0.002126, 0.001200, 0.000828, 0.000694, 0.000630, 0.000579, 0.000534, 0.000494, 0.000461, 0.000431, 0.000404, 0.000379, 0.000355, 0.000330, 0.000307, 0.000290, 0.000287, 0.000305, 0.000338, 0.000374, 0.000396, 0.000405, 0.000400, 0.000392, 0.000376, 0.000354, 0.000327, 0.000294, 0.000262, 0.000231, 0.000202, 0.000180, 0.000163, 0.000154, 0.000149, 0.000146, 0.000142, 0.000138, 0.000134, 0.000131, 0.000127, 0.000124, 0.000121, 0.000117, 0.000114, 0.000111, 0.000108, 0.000105, 0.000102, 0.000101, 0.000101, 0.000103, 0.000104, 0.000105, 0.000105, 0.000106, 0.000106, 0.000106, 0.000106, 0.000104, 0.000101, 0.000096, 0.000090, 0.000085, 0.000079, 0.000076, 0.000075, 0.000075, 0.000074, 0.000074, 0.000073, 0.000072, 0.000072, 0.000071, 0.000070, 0.000070, 0.000069, 0.000068, 0.000067, 0.000066, 0.000065, 0.000065, 0.000066, 0.000067, 0.000068, 0.000068, 0.000068, 0.000068, 0.000067, 0.000067, 0.000066, 0.000065, 0.000065, 0.000064, 0.000063, 0.000062, 0.000061, 0.000061, 0.000061, 0.000061, 0.000061, 0.000061, 0.000061, 0.000061, 0.000061, }, { /* wavelet type 0, n_levels 4, low */ 1.035418, 1.031749, 1.012051, 0.961042, 0.876021, 0.732428, 0.555374, 0.372193, 0.212609, 0.105257, 0.043942, 0.017672, 0.008821, 0.006169, 0.005013, 0.004241, 0.003679, 0.003221, 0.002819, 0.002530, 0.002444, 0.002532, 0.002625, 0.002509, 0.002180, 0.001808, 0.001509, 0.001333, 0.001225, 0.001141, 0.001064, 0.000994, 0.000932, 0.000876, 0.000824, 0.000777, 0.000740, 0.000717, 0.000705, 0.000690, 0.000661, 0.000619, 0.000573, 0.000537, 0.000512, 0.000492, 0.000473, 0.000455, 0.000438, 0.000422, 0.000406, 0.000391, 0.000380, 0.000371, 0.000363, 0.000353, 0.000341, 0.000328, 0.000317, 0.000307, 0.000298, 0.000290, 0.000283, 0.000275, 0.000268, 0.000262, 0.000255, 0.000250, 0.000244, 0.000239, 0.000236, 0.000232, 0.000227, 0.000222, 0.000217, 0.000211, 0.000207, 0.000203, 0.000200, 0.000196, 0.000193, 0.000190, 0.000187, 0.000184, 0.000181, 0.000180, 0.000179, 0.000178, 0.000175, 0.000172, 0.000169, 0.000166, 0.000164, 0.000162, 0.000160, 0.000159, 0.000157, 0.000155, 0.000154, 0.000152, 0.000151, 0.000150, 0.000150, 0.000149, 0.000149, 0.000147, 0.000145, 0.000143, 0.000142, 0.000141, 0.000140, 0.000139, 0.000138, 0.000138, 0.000137, 0.000137, 0.000136, 0.000136, 0.000136, 0.000135, 0.000135, 0.000134, 0.000134, 0.000133, 0.000133, 0.000133, 0.000134, 0.000134, } }, { { /* wavelet type 1, n_levels 1, high */ 0.000436, 0.000436, 0.000437, 0.000441, 0.000449, 0.000468, 0.000503, 0.000559, 0.000642, 0.000766, 0.000932, 0.001161, 0.001446, 0.001823, 0.002269, 0.002846, 0.003516, 0.004292, 0.005261, 0.006412, 0.007639, 0.009076, 0.010735, 0.012511, 0.014617, 0.016812, 0.019346, 0.022078, 0.025018, 0.028496, 0.031863, 0.035487, 0.039462, 0.043745, 0.048274, 0.053340, 0.058415, 0.063506, 0.069269, 0.074478, 0.080595, 0.087381, 0.093712, 0.100245, 0.106767, 0.113683, 0.121222, 0.127783, 0.135198, 0.142288, 0.150019, 0.156654, 0.164757, 0.171756, 0.180691, 0.187522, 0.194217, 0.202280, 0.209472, 0.215981, 0.223948, 0.229313, 0.236326, 0.241707, 0.249848, 0.253802, 0.260744, 0.265853, 0.272683, 0.276531, 0.281947, 0.286375, 0.289426, 0.294463, 0.298893, 0.299559, 0.303185, 0.304621, 0.308804, 0.310140, 0.312180, 0.313316, 0.316020, 0.315577, 0.315951, 0.317152, 0.317445, 0.317197, 0.314360, 0.313506, 0.314557, 0.312664, 0.312166, 0.311014, 0.307406, 0.305633, 0.303324, 0.301527, 0.300332, 0.299937, 0.294573, 0.293133, 0.290537, 0.287548, 0.286472, 0.282192, 0.281093, 0.278446, 0.276405, 0.275905, 0.271564, 0.267965, 0.267308, 0.265822, 0.263068, 0.263001, 0.259892, 0.259583, 0.257155, 0.256021, 0.255532, 0.253292, 0.253230, 0.251006, 0.250201, 0.249281, 0.250246, 0.248938, }, { /* wavelet type 1, n_levels 1, low */ 0.995262, 0.994154, 1.002928, 0.995186, 0.993834, 0.994970, 0.985555, 0.984629, 0.982005, 0.971136, 0.974649, 0.963639, 0.964280, 0.954998, 0.943275, 0.936966, 0.925054, 0.916754, 0.913524, 0.897272, 0.884590, 0.874011, 0.861950, 0.857532, 0.837396, 0.826188, 0.810356, 0.797604, 0.786250, 0.773149, 0.758934, 0.744998, 0.724812, 0.715524, 0.704575, 0.681223, 0.668739, 0.654488, 0.641121, 0.621646, 0.604644, 0.589114, 0.572185, 0.558090, 0.541690, 0.526878, 0.511662, 0.493433, 0.480556, 0.460607, 0.446115, 0.433038, 0.413941, 0.403200, 0.388269, 0.372898, 0.358450, 0.342462, 0.329809, 0.317664, 0.302990, 0.289209, 0.275405, 0.263029, 0.250685, 0.238475, 0.226526, 0.215635, 0.204835, 0.194531, 0.183283, 0.172275, 0.163241, 0.153614, 0.144680, 0.135825, 0.125944, 0.118965, 0.110548, 0.102849, 0.096674, 0.089289, 0.083103, 0.076768, 0.070687, 0.065251, 0.059818, 0.054975, 0.050240, 0.045978, 0.042055, 0.038060, 0.034417, 0.030913, 0.028162, 0.025093, 0.022272, 0.020014, 0.017763, 0.015702, 0.013843, 0.012145, 0.010643, 0.009285, 0.008060, 0.007045, 0.006011, 0.005189, 0.004448, 0.003831, 0.003294, 0.002808, 0.002422, 0.002096, 0.001828, 0.001610, 0.001445, 0.001300, 0.001198, 0.001121, 0.001063, 0.001030, 0.001003, 0.000989, 0.000979, 0.000975, 0.000974, 0.000974, }, { /* wavelet type 1, n_levels 2, high */ 0.001534, 0.001446, 0.001469, 0.001536, 0.001694, 0.002010, 0.002544, 0.003401, 0.004642, 0.006369, 0.008720, 0.011605, 0.015314, 0.019813, 0.025085, 0.031233, 0.038092, 0.045815, 0.054060, 0.063679, 0.073105, 0.082858, 0.093519, 0.103871, 0.114795, 0.124883, 0.135448, 0.145124, 0.153607, 0.161386, 0.169626, 0.177544, 0.182484, 0.187840, 0.189954, 0.191461, 0.193449, 0.194397, 0.193470, 0.190968, 0.188711, 0.184699, 0.180825, 0.175237, 0.170310, 0.165399, 0.157385, 0.151777, 0.145089, 0.138440, 0.132050, 0.124940, 0.118442, 0.112117, 0.106724, 0.101025, 0.095454, 0.090724, 0.085319, 0.081635, 0.076623, 0.072938, 0.069723, 0.065927, 0.062968, 0.059842, 0.057472, 0.054620, 0.052058, 0.050294, 0.047740, 0.046038, 0.043839, 0.042040, 0.040173, 0.038140, 0.036445, 0.034660, 0.033071, 0.031233, 0.029460, 0.027682, 0.025776, 0.024276, 0.022400, 0.020586, 0.018928, 0.017225, 0.015648, 0.014037, 0.012584, 0.011176, 0.009792, 0.008521, 0.007408, 0.006409, 0.005434, 0.004600, 0.003813, 0.003131, 0.002573, 0.002098, 0.001682, 0.001337, 0.001058, 0.000833, 0.000659, 0.000521, 0.000417, 0.000347, 0.000291, 0.000255, 0.000231, 0.000216, 0.000208, 0.000204, 0.000203, 0.000204, 0.000205, 0.000207, 0.000208, 0.000210, 0.000211, 0.000212, 0.000212, 0.000213, 0.000213, 0.000213, }, { /* wavelet type 1, n_levels 2, low */ 1.001972, 0.997948, 0.996925, 0.986740, 0.974428, 0.966613, 0.952118, 0.937876, 0.910814, 0.891195, 0.858519, 0.836561, 0.801940, 0.776527, 0.742965, 0.709935, 0.674141, 0.642087, 0.609899, 0.572361, 0.538353, 0.501257, 0.469828, 0.433498, 0.403339, 0.370496, 0.340615, 0.308256, 0.280637, 0.254238, 0.228808, 0.204940, 0.183052, 0.161821, 0.142812, 0.124876, 0.108637, 0.093849, 0.081400, 0.069396, 0.059016, 0.049250, 0.041442, 0.034050, 0.028093, 0.022843, 0.018447, 0.014686, 0.011636, 0.009184, 0.007180, 0.005638, 0.004373, 0.003452, 0.002757, 0.002237, 0.001867, 0.001602, 0.001418, 0.001293, 0.001201, 0.001132, 0.001076, 0.001025, 0.001000, 0.000929, 0.000886, 0.000850, 0.000824, 0.000815, 0.000826, 0.000863, 0.000931, 0.001032, 0.001165, 0.001346, 0.001548, 0.001800, 0.002076, 0.002382, 0.002717, 0.003067, 0.003450, 0.003808, 0.004178, 0.004511, 0.004877, 0.005152, 0.005482, 0.005714, 0.005932, 0.006037, 0.006161, 0.006224, 0.006223, 0.006188, 0.006093, 0.005945, 0.005754, 0.005520, 0.005255, 0.004951, 0.004680, 0.004344, 0.004014, 0.003630, 0.003320, 0.002959, 0.002651, 0.002343, 0.002056, 0.001781, 0.001546, 0.001334, 0.001148, 0.000996, 0.000860, 0.000757, 0.000673, 0.000608, 0.000562, 0.000528, 0.000507, 0.000496, 0.000490, 0.000487, 0.000488, 0.000488, }, { /* wavelet type 1, n_levels 3, high */ 0.003975, 0.003839, 0.004136, 0.005102, 0.007347, 0.011561, 0.018188, 0.027809, 0.040483, 0.056237, 0.074307, 0.092732, 0.112695, 0.130562, 0.147723, 0.160448, 0.169013, 0.175194, 0.176226, 0.172178, 0.166346, 0.156379, 0.146025, 0.133113, 0.119647, 0.107275, 0.095509, 0.084296, 0.074348, 0.065604, 0.057903, 0.051351, 0.045509, 0.040806, 0.036656, 0.032926, 0.029552, 0.026401, 0.023494, 0.020635, 0.017933, 0.015464, 0.012980, 0.010664, 0.008595, 0.006707, 0.005145, 0.003803, 0.002728, 0.001934, 0.001347, 0.000928, 0.000659, 0.000491, 0.000389, 0.000335, 0.000305, 0.000288, 0.000277, 0.000267, 0.000257, 0.000246, 0.000236, 0.000225, 0.000227, 0.000204, 0.000194, 0.000184, 0.000173, 0.000163, 0.000153, 0.000144, 0.000137, 0.000137, 0.000148, 0.000171, 0.000215, 0.000281, 0.000373, 0.000488, 0.000622, 0.000776, 0.000938, 0.001091, 0.001245, 0.001370, 0.001489, 0.001569, 0.001614, 0.001648, 0.001660, 0.001655, 0.001635, 0.001609, 0.001576, 0.001550, 0.001517, 0.001498, 0.001476, 0.001454, 0.001427, 0.001392, 0.001343, 0.001282, 0.001208, 0.001127, 0.001021, 0.000903, 0.000784, 0.000659, 0.000544, 0.000434, 0.000338, 0.000261, 0.000200, 0.000155, 0.000126, 0.000108, 0.000099, 0.000096, 0.000097, 0.000099, 0.000101, 0.000103, 0.000105, 0.000106, 0.000107, 0.000107, }, { /* wavelet type 1, n_levels 3, low */ 1.008485, 1.001015, 0.988907, 0.953240, 0.918525, 0.862883, 0.803254, 0.735199, 0.666078, 0.595311, 0.523902, 0.453963, 0.386172, 0.321167, 0.264377, 0.214185, 0.168342, 0.131130, 0.098438, 0.072750, 0.052656, 0.036906, 0.025358, 0.016875, 0.011187, 0.007430, 0.005092, 0.003684, 0.002874, 0.002406, 0.002096, 0.001860, 0.001662, 0.001472, 0.001332, 0.001259, 0.001278, 0.001400, 0.001622, 0.001921, 0.002285, 0.002681, 0.003045, 0.003370, 0.003599, 0.003705, 0.003725, 0.003633, 0.003420, 0.003157, 0.002798, 0.002441, 0.002084, 0.001734, 0.001435, 0.001167, 0.000965, 0.000812, 0.000706, 0.000634, 0.000587, 0.000556, 0.000531, 0.000508, 0.000497, 0.000461, 0.000440, 0.000426, 0.000423, 0.000435, 0.000464, 0.000509, 0.000570, 0.000644, 0.000721, 0.000796, 0.000861, 0.000906, 0.000936, 0.000945, 0.000924, 0.000889, 0.000826, 0.000757, 0.000682, 0.000602, 0.000531, 0.000462, 0.000408, 0.000366, 0.000337, 0.000317, 0.000305, 0.000299, 0.000293, 0.000289, 0.000284, 0.000278, 0.000272, 0.000267, 0.000267, 0.000272, 0.000285, 0.000305, 0.000334, 0.000371, 0.000412, 0.000454, 0.000494, 0.000526, 0.000551, 0.000566, 0.000566, 0.000557, 0.000531, 0.000499, 0.000462, 0.000419, 0.000378, 0.000338, 0.000304, 0.000278, 0.000261, 0.000249, 0.000243, 0.000241, 0.000241, 0.000242, }, { /* wavelet type 1, n_levels 4, high */ 0.008796, 0.009147, 0.012854, 0.024419, 0.046960, 0.080068, 0.117157, 0.148576, 0.167127, 0.171143, 0.159458, 0.138175, 0.112200, 0.088756, 0.068717, 0.053253, 0.042056, 0.033584, 0.027058, 0.021359, 0.016092, 0.011519, 0.007540, 0.004556, 0.002555, 0.001445, 0.000899, 0.000673, 0.000573, 0.000512, 0.000460, 0.000411, 0.000370, 0.000324, 0.000287, 0.000253, 0.000227, 0.000224, 0.000266, 0.000368, 0.000522, 0.000700, 0.000857, 0.000954, 0.000985, 0.000973, 0.000929, 0.000883, 0.000846, 0.000810, 0.000773, 0.000715, 0.000625, 0.000515, 0.000393, 0.000282, 0.000200, 0.000152, 0.000130, 0.000124, 0.000122, 0.000120, 0.000117, 0.000112, 0.000113, 0.000102, 0.000096, 0.000090, 0.000083, 0.000079, 0.000081, 0.000095, 0.000121, 0.000156, 0.000191, 0.000218, 0.000232, 0.000237, 0.000234, 0.000230, 0.000227, 0.000225, 0.000222, 0.000215, 0.000197, 0.000171, 0.000139, 0.000107, 0.000082, 0.000068, 0.000062, 0.000062, 0.000063, 0.000064, 0.000064, 0.000064, 0.000063, 0.000061, 0.000059, 0.000057, 0.000054, 0.000051, 0.000051, 0.000057, 0.000069, 0.000086, 0.000107, 0.000124, 0.000135, 0.000140, 0.000140, 0.000139, 0.000139, 0.000139, 0.000139, 0.000137, 0.000129, 0.000116, 0.000097, 0.000078, 0.000061, 0.000052, 0.000048, 0.000048, 0.000050, 0.000052, 0.000053, 0.000054, }, { /* wavelet type 1, n_levels 4, low */ 1.032875, 1.001943, 0.929350, 0.807950, 0.667854, 0.522924, 0.380002, 0.258343, 0.163485, 0.095501, 0.051653, 0.026499, 0.013361, 0.007673, 0.005308, 0.004100, 0.003218, 0.002564, 0.002314, 0.002541, 0.003103, 0.003703, 0.004055, 0.003998, 0.003573, 0.002925, 0.002258, 0.001726, 0.001353, 0.001150, 0.001031, 0.000935, 0.000840, 0.000746, 0.000696, 0.000708, 0.000777, 0.000868, 0.000938, 0.000950, 0.000898, 0.000798, 0.000684, 0.000586, 0.000513, 0.000473, 0.000447, 0.000424, 0.000396, 0.000369, 0.000351, 0.000352, 0.000374, 0.000405, 0.000432, 0.000441, 0.000427, 0.000394, 0.000353, 0.000317, 0.000289, 0.000274, 0.000265, 0.000256, 0.000251, 0.000233, 0.000225, 0.000225, 0.000235, 0.000251, 0.000267, 0.000274, 0.000269, 0.000254, 0.000233, 0.000213, 0.000198, 0.000190, 0.000185, 0.000182, 0.000177, 0.000171, 0.000166, 0.000167, 0.000173, 0.000184, 0.000194, 0.000201, 0.000200, 0.000191, 0.000178, 0.000165, 0.000155, 0.000149, 0.000147, 0.000146, 0.000144, 0.000140, 0.000138, 0.000138, 0.000143, 0.000151, 0.000160, 0.000166, 0.000167, 0.000161, 0.000152, 0.000142, 0.000134, 0.000130, 0.000128, 0.000128, 0.000127, 0.000126, 0.000124, 0.000125, 0.000129, 0.000136, 0.000145, 0.000151, 0.000153, 0.000150, 0.000143, 0.000134, 0.000127, 0.000123, 0.000122, 0.000122, } }, { { /* wavelet type 2, n_levels 1, high */ 0.000561, 0.000562, 0.000561, 0.000561, 0.000562, 0.000562, 0.000563, 0.000563, 0.000565, 0.000567, 0.000567, 0.000569, 0.000573, 0.000578, 0.000585, 0.000597, 0.000615, 0.000641, 0.000680, 0.000736, 0.000812, 0.000915, 0.001061, 0.001246, 0.001498, 0.001818, 0.002234, 0.002729, 0.003391, 0.004182, 0.005146, 0.006326, 0.007663, 0.009344, 0.011273, 0.013695, 0.016217, 0.019236, 0.022656, 0.026451, 0.030721, 0.035602, 0.040860, 0.046699, 0.053082, 0.060196, 0.067473, 0.075808, 0.084266, 0.092825, 0.102040, 0.112564, 0.122427, 0.132867, 0.143857, 0.155135, 0.166447, 0.177508, 0.187794, 0.199046, 0.210583, 0.219753, 0.230184, 0.240630, 0.250572, 0.258886, 0.266745, 0.274133, 0.282990, 0.288458, 0.293882, 0.300137, 0.304783, 0.308088, 0.310269, 0.312213, 0.313947, 0.316133, 0.314696, 0.315036, 0.315885, 0.315457, 0.312571, 0.311660, 0.308824, 0.306106, 0.303763, 0.301718, 0.298510, 0.295824, 0.294076, 0.290911, 0.287936, 0.286691, 0.281258, 0.278796, 0.275645, 0.274286, 0.271949, 0.270387, 0.267057, 0.264899, 0.263392, 0.261633, 0.259267, 0.258291, 0.257249, 0.254848, 0.255581, 0.254286, 0.252156, 0.252590, 0.252560, 0.250656, 0.251795, 0.250857, 0.251076, 0.251000, 0.248883, 0.251230, 0.250490, 0.250402, 0.250581, 0.250464, 0.249601, 0.250429, 0.250348, 0.249897, }, { /* wavelet type 2, n_levels 1, low */ 0.998247, 1.001062, 1.007452, 1.002119, 1.007055, 1.002418, 0.999518, 0.998298, 0.999299, 1.001393, 0.995800, 0.997422, 0.994546, 1.003670, 0.993961, 0.994274, 0.993388, 0.994388, 0.985668, 0.983039, 0.986950, 0.976515, 0.964193, 0.962724, 0.958130, 0.950121, 0.947644, 0.938316, 0.929199, 0.916153, 0.906296, 0.901639, 0.882407, 0.874681, 0.855184, 0.844421, 0.832220, 0.811134, 0.800614, 0.780476, 0.763361, 0.744424, 0.724489, 0.705977, 0.682888, 0.663364, 0.642770, 0.618046, 0.596513, 0.577290, 0.554348, 0.529626, 0.507167, 0.482058, 0.458859, 0.439497, 0.415634, 0.394682, 0.370984, 0.350999, 0.329211, 0.308480, 0.289255, 0.269721, 0.251719, 0.232946, 0.216037, 0.198971, 0.183240, 0.168705, 0.153891, 0.140913, 0.127975, 0.116211, 0.104440, 0.094128, 0.084956, 0.075866, 0.067924, 0.060208, 0.053044, 0.046753, 0.041233, 0.036035, 0.031265, 0.027296, 0.023481, 0.020330, 0.017408, 0.014867, 0.012686, 0.010709, 0.009120, 0.007687, 0.006486, 0.005518, 0.004649, 0.003967, 0.003371, 0.002879, 0.002503, 0.002190, 0.001948, 0.001748, 0.001601, 0.001477, 0.001384, 0.001315, 0.001267, 0.001228, 0.001197, 0.001177, 0.001160, 0.001151, 0.001143, 0.001136, 0.001132, 0.001128, 0.001124, 0.001121, 0.001120, 0.001117, 0.001115, 0.001114, 0.001113, 0.001111, 0.001111, 0.001110, }, { /* wavelet type 2, n_levels 2, high */ 0.001835, 0.001835, 0.001835, 0.001839, 0.001843, 0.001852, 0.001864, 0.001889, 0.001935, 0.002017, 0.002184, 0.002462, 0.002958, 0.003726, 0.004972, 0.006797, 0.009396, 0.013062, 0.017982, 0.024358, 0.032236, 0.042278, 0.053890, 0.067062, 0.082882, 0.099811, 0.118017, 0.136576, 0.154668, 0.174368, 0.192497, 0.208135, 0.222051, 0.233718, 0.243613, 0.248829, 0.250131, 0.252369, 0.250472, 0.245895, 0.239520, 0.230720, 0.223358, 0.214710, 0.202921, 0.193786, 0.183606, 0.173839, 0.164313, 0.155519, 0.147043, 0.138716, 0.130685, 0.123455, 0.116748, 0.110767, 0.104765, 0.098520, 0.092783, 0.087717, 0.082726, 0.077195, 0.072145, 0.067100, 0.062474, 0.058099, 0.053955, 0.049966, 0.046305, 0.042430, 0.038767, 0.035568, 0.032603, 0.029676, 0.026911, 0.024440, 0.022222, 0.020206, 0.018305, 0.016527, 0.014875, 0.013375, 0.011967, 0.010691, 0.009415, 0.008380, 0.007283, 0.006291, 0.005429, 0.004618, 0.003897, 0.003232, 0.002645, 0.002152, 0.001730, 0.001376, 0.001085, 0.000855, 0.000680, 0.000542, 0.000443, 0.000376, 0.000330, 0.000300, 0.000281, 0.000272, 0.000267, 0.000265, 0.000264, 0.000265, 0.000266, 0.000266, 0.000267, 0.000267, 0.000267, 0.000267, 0.000267, 0.000266, 0.000266, 0.000265, 0.000265, 0.000264, 0.000264, 0.000264, 0.000264, 0.000263, 0.000263, 0.000263, }, { /* wavelet type 2, n_levels 2, low */ 1.010288, 1.001214, 1.006176, 1.005860, 1.004706, 1.009355, 1.001355, 1.000806, 0.993479, 0.990500, 0.979894, 0.967318, 0.957782, 0.936170, 0.922604, 0.907470, 0.879640, 0.854123, 0.815306, 0.785721, 0.744194, 0.706898, 0.661054, 0.617808, 0.573470, 0.523966, 0.477577, 0.431328, 0.382891, 0.341675, 0.296242, 0.257919, 0.221873, 0.187738, 0.156381, 0.130401, 0.105876, 0.085866, 0.068296, 0.053433, 0.041416, 0.031541, 0.023654, 0.017542, 0.012901, 0.009520, 0.006928, 0.005157, 0.003884, 0.003022, 0.002450, 0.002081, 0.001834, 0.001680, 0.001570, 0.001489, 0.001427, 0.001374, 0.001328, 0.001285, 0.001245, 0.001209, 0.001175, 0.001143, 0.001113, 0.001083, 0.001056, 0.001028, 0.001002, 0.000976, 0.000951, 0.000927, 0.000905, 0.000885, 0.000869, 0.000858, 0.000856, 0.000860, 0.000879, 0.000912, 0.000951, 0.001011, 0.001081, 0.001163, 0.001250, 0.001343, 0.001435, 0.001525, 0.001610, 0.001673, 0.001724, 0.001753, 0.001762, 0.001759, 0.001713, 0.001655, 0.001587, 0.001507, 0.001416, 0.001324, 0.001223, 0.001126, 0.001038, 0.000954, 0.000879, 0.000814, 0.000757, 0.000709, 0.000673, 0.000644, 0.000621, 0.000603, 0.000589, 0.000580, 0.000573, 0.000569, 0.000566, 0.000564, 0.000562, 0.000560, 0.000559, 0.000558, 0.000557, 0.000557, 0.000556, 0.000555, 0.000555, 0.000555, }, { /* wavelet type 2, n_levels 3, high */ 0.004840, 0.004842, 0.004861, 0.004907, 0.005028, 0.005370, 0.006292, 0.008584, 0.013321, 0.022225, 0.036914, 0.058634, 0.087544, 0.122079, 0.157934, 0.192593, 0.221132, 0.239365, 0.247235, 0.244775, 0.232735, 0.215127, 0.194821, 0.174848, 0.154906, 0.138232, 0.122250, 0.108390, 0.096603, 0.085412, 0.074401, 0.064572, 0.056091, 0.047317, 0.039892, 0.033346, 0.027461, 0.022256, 0.018094, 0.014661, 0.011656, 0.009240, 0.007157, 0.005427, 0.003982, 0.002841, 0.001934, 0.001305, 0.000879, 0.000631, 0.000488, 0.000419, 0.000384, 0.000367, 0.000355, 0.000345, 0.000334, 0.000324, 0.000313, 0.000303, 0.000294, 0.000286, 0.000277, 0.000270, 0.000263, 0.000256, 0.000249, 0.000242, 0.000236, 0.000230, 0.000223, 0.000217, 0.000210, 0.000203, 0.000196, 0.000190, 0.000184, 0.000182, 0.000186, 0.000197, 0.000216, 0.000242, 0.000275, 0.000310, 0.000344, 0.000372, 0.000394, 0.000412, 0.000422, 0.000433, 0.000436, 0.000439, 0.000440, 0.000437, 0.000425, 0.000412, 0.000400, 0.000379, 0.000359, 0.000338, 0.000315, 0.000292, 0.000271, 0.000253, 0.000234, 0.000218, 0.000201, 0.000186, 0.000172, 0.000159, 0.000149, 0.000141, 0.000136, 0.000133, 0.000132, 0.000132, 0.000132, 0.000132, 0.000133, 0.000133, 0.000133, 0.000133, 0.000133, 0.000132, 0.000132, 0.000132, 0.000132, 0.000132, }, { /* wavelet type 2, n_levels 3, low */ 1.011167, 1.010938, 1.011138, 1.002786, 0.999767, 0.986612, 0.958557, 0.921467, 0.878774, 0.814297, 0.733877, 0.658595, 0.564007, 0.471374, 0.380793, 0.292060, 0.219567, 0.154087, 0.105213, 0.067694, 0.041648, 0.024698, 0.014219, 0.008461, 0.005433, 0.003940, 0.003221, 0.002827, 0.002566, 0.002360, 0.002186, 0.002038, 0.001908, 0.001789, 0.001679, 0.001575, 0.001479, 0.001398, 0.001344, 0.001327, 0.001357, 0.001423, 0.001517, 0.001623, 0.001700, 0.001733, 0.001707, 0.001602, 0.001482, 0.001315, 0.001164, 0.001025, 0.000913, 0.000828, 0.000767, 0.000724, 0.000694, 0.000669, 0.000649, 0.000630, 0.000611, 0.000594, 0.000578, 0.000562, 0.000548, 0.000534, 0.000520, 0.000507, 0.000495, 0.000482, 0.000471, 0.000461, 0.000454, 0.000449, 0.000448, 0.000450, 0.000455, 0.000460, 0.000464, 0.000462, 0.000460, 0.000448, 0.000435, 0.000417, 0.000399, 0.000381, 0.000367, 0.000356, 0.000348, 0.000342, 0.000338, 0.000334, 0.000330, 0.000326, 0.000323, 0.000319, 0.000316, 0.000313, 0.000309, 0.000306, 0.000303, 0.000300, 0.000297, 0.000295, 0.000294, 0.000293, 0.000294, 0.000295, 0.000296, 0.000296, 0.000296, 0.000294, 0.000292, 0.000289, 0.000286, 0.000282, 0.000279, 0.000276, 0.000274, 0.000273, 0.000272, 0.000271, 0.000271, 0.000270, 0.000270, 0.000270, 0.000270, 0.000269, }, { /* wavelet type 2, n_levels 4, high */ 0.010996, 0.011043, 0.011358, 0.013197, 0.021390, 0.046593, 0.096959, 0.163983, 0.221685, 0.243305, 0.227860, 0.190883, 0.151444, 0.119743, 0.094010, 0.072668, 0.054687, 0.039477, 0.027339, 0.018470, 0.012005, 0.007505, 0.004271, 0.002263, 0.001238, 0.000852, 0.000724, 0.000661, 0.000607, 0.000559, 0.000518, 0.000482, 0.000451, 0.000423, 0.000397, 0.000371, 0.000346, 0.000321, 0.000301, 0.000295, 0.000316, 0.000354, 0.000393, 0.000411, 0.000415, 0.000412, 0.000405, 0.000386, 0.000363, 0.000335, 0.000302, 0.000271, 0.000241, 0.000214, 0.000189, 0.000171, 0.000161, 0.000156, 0.000152, 0.000148, 0.000144, 0.000140, 0.000136, 0.000133, 0.000129, 0.000126, 0.000123, 0.000119, 0.000116, 0.000113, 0.000110, 0.000107, 0.000105, 0.000106, 0.000107, 0.000108, 0.000109, 0.000109, 0.000110, 0.000110, 0.000110, 0.000109, 0.000108, 0.000105, 0.000100, 0.000095, 0.000089, 0.000083, 0.000079, 0.000078, 0.000078, 0.000078, 0.000077, 0.000076, 0.000076, 0.000075, 0.000074, 0.000073, 0.000073, 0.000072, 0.000071, 0.000070, 0.000069, 0.000068, 0.000068, 0.000069, 0.000070, 0.000071, 0.000071, 0.000071, 0.000070, 0.000070, 0.000069, 0.000069, 0.000068, 0.000067, 0.000067, 0.000066, 0.000065, 0.000064, 0.000064, 0.000063, 0.000063, 0.000063, 0.000063, 0.000063, 0.000063, 0.000063, }, { /* wavelet type 2, n_levels 4, low */ 1.036081, 1.029923, 1.015325, 0.962159, 0.874939, 0.731578, 0.554597, 0.372400, 0.213549, 0.104950, 0.044006, 0.017580, 0.008769, 0.006095, 0.004949, 0.004186, 0.003631, 0.003179, 0.002782, 0.002496, 0.002409, 0.002505, 0.002589, 0.002487, 0.002162, 0.001783, 0.001493, 0.001317, 0.001210, 0.001126, 0.001050, 0.000981, 0.000919, 0.000864, 0.000813, 0.000766, 0.000730, 0.000708, 0.000695, 0.000682, 0.000653, 0.000610, 0.000566, 0.000530, 0.000506, 0.000486, 0.000467, 0.000449, 0.000432, 0.000416, 0.000400, 0.000386, 0.000374, 0.000366, 0.000358, 0.000349, 0.000337, 0.000324, 0.000312, 0.000303, 0.000294, 0.000286, 0.000279, 0.000272, 0.000265, 0.000258, 0.000252, 0.000246, 0.000241, 0.000236, 0.000232, 0.000229, 0.000225, 0.000219, 0.000214, 0.000208, 0.000204, 0.000201, 0.000197, 0.000194, 0.000191, 0.000187, 0.000184, 0.000181, 0.000179, 0.000177, 0.000177, 0.000175, 0.000173, 0.000170, 0.000166, 0.000164, 0.000162, 0.000160, 0.000158, 0.000156, 0.000155, 0.000153, 0.000152, 0.000150, 0.000149, 0.000148, 0.000148, 0.000147, 0.000147, 0.000145, 0.000143, 0.000141, 0.000140, 0.000139, 0.000138, 0.000137, 0.000137, 0.000136, 0.000135, 0.000135, 0.000134, 0.000134, 0.000134, 0.000133, 0.000133, 0.000132, 0.000132, 0.000131, 0.000132, 0.000132, 0.000132, 0.000132, } }, { { /* wavelet type 3, n_levels 1, high */ 0.001613, 0.000088, 0.000312, 0.000689, 0.001215, 0.001903, 0.002727, 0.003699, 0.004800, 0.006081, 0.007526, 0.009057, 0.010801, 0.012595, 0.014665, 0.016769, 0.019126, 0.021469, 0.024068, 0.026637, 0.029447, 0.032438, 0.035563, 0.038561, 0.041903, 0.045459, 0.049417, 0.053037, 0.056806, 0.061031, 0.064846, 0.068868, 0.073366, 0.077172, 0.082130, 0.086967, 0.091962, 0.096284, 0.101275, 0.106151, 0.111350, 0.116435, 0.121988, 0.126992, 0.132215, 0.137587, 0.143304, 0.147925, 0.154865, 0.159534, 0.165659, 0.171422, 0.177282, 0.185150, 0.189916, 0.195206, 0.199383, 0.207949, 0.213255, 0.220775, 0.226060, 0.232767, 0.239263, 0.243221, 0.248700, 0.255462, 0.263936, 0.269726, 0.275170, 0.282371, 0.286570, 0.293714, 0.296038, 0.304754, 0.311824, 0.319825, 0.322283, 0.328114, 0.333975, 0.338933, 0.346871, 0.349469, 0.357356, 0.362351, 0.368006, 0.373807, 0.380083, 0.384367, 0.389708, 0.394310, 0.399691, 0.404162, 0.411060, 0.414510, 0.417962, 0.419948, 0.427537, 0.430580, 0.435739, 0.441681, 0.443652, 0.448019, 0.452681, 0.452884, 0.455249, 0.458336, 0.464270, 0.466756, 0.469174, 0.472120, 0.477034, 0.478733, 0.483077, 0.483396, 0.486574, 0.486023, 0.490236, 0.490430, 0.493830, 0.493708, 0.493644, 0.497236, 0.498995, 0.501093, 0.498420, 0.498491, 0.497468, 0.500190, }, { /* wavelet type 3, n_levels 1, low */ 2.001747, 1.995591, 1.990535, 2.003239, 1.993379, 1.997798, 1.987905, 1.983315, 1.985552, 1.969733, 1.970910, 1.954133, 1.957132, 1.958694, 1.943602, 1.921348, 1.924774, 1.906994, 1.910033, 1.887825, 1.892721, 1.867104, 1.863846, 1.858332, 1.823802, 1.816805, 1.801056, 1.798876, 1.775451, 1.759501, 1.749132, 1.727799, 1.715353, 1.686054, 1.664825, 1.646941, 1.631376, 1.608763, 1.599052, 1.576455, 1.563328, 1.530854, 1.511170, 1.494819, 1.476502, 1.454744, 1.426441, 1.401164, 1.386215, 1.352633, 1.340058, 1.312349, 1.286299, 1.268025, 1.245463, 1.214609, 1.197205, 1.176184, 1.144992, 1.121591, 1.095304, 1.078922, 1.052275, 1.020213, 0.999804, 0.971338, 0.953839, 0.931059, 0.899754, 0.876948, 0.851976, 0.832736, 0.806334, 0.778021, 0.758532, 0.734047, 0.707523, 0.685622, 0.664682, 0.636687, 0.618893, 0.593033, 0.571998, 0.552337, 0.530437, 0.507754, 0.484956, 0.463747, 0.446646, 0.424366, 0.405150, 0.383227, 0.364932, 0.345520, 0.327118, 0.309819, 0.294308, 0.276321, 0.260266, 0.243108, 0.227302, 0.212900, 0.196558, 0.182337, 0.167825, 0.156280, 0.142740, 0.129706, 0.118756, 0.106471, 0.096315, 0.085467, 0.076156, 0.066604, 0.058518, 0.050709, 0.043064, 0.036046, 0.029982, 0.024224, 0.019261, 0.014708, 0.010817, 0.007541, 0.004811, 0.002718, 0.001200, 0.000301, }, { /* wavelet type 3, n_levels 2, high */ 0.001626, 0.000627, 0.002436, 0.005414, 0.009600, 0.014944, 0.021431, 0.029180, 0.037532, 0.047445, 0.057884, 0.069955, 0.082587, 0.095482, 0.110032, 0.124637, 0.140438, 0.157648, 0.173871, 0.191717, 0.208424, 0.226694, 0.245251, 0.264613, 0.281939, 0.302875, 0.322220, 0.338047, 0.358015, 0.374856, 0.392117, 0.411892, 0.422452, 0.445203, 0.458309, 0.473938, 0.489985, 0.501283, 0.518384, 0.529397, 0.536327, 0.549020, 0.556372, 0.563829, 0.570313, 0.579336, 0.582671, 0.588878, 0.588130, 0.589225, 0.591651, 0.589475, 0.591542, 0.588980, 0.581796, 0.580281, 0.572138, 0.571236, 0.560902, 0.552337, 0.543311, 0.532282, 0.524528, 0.512192, 0.498527, 0.487655, 0.475461, 0.459334, 0.446311, 0.431860, 0.417361, 0.404434, 0.385343, 0.371701, 0.354335, 0.340954, 0.325375, 0.307965, 0.293464, 0.277349, 0.262578, 0.249238, 0.233649, 0.219962, 0.204886, 0.191519, 0.178548, 0.166317, 0.153230, 0.142508, 0.131342, 0.119412, 0.109608, 0.099430, 0.090052, 0.081808, 0.072481, 0.065872, 0.058346, 0.051793, 0.045835, 0.040008, 0.035165, 0.030397, 0.025944, 0.022253, 0.018782, 0.015748, 0.013077, 0.010813, 0.008768, 0.007065, 0.005557, 0.004321, 0.003313, 0.002472, 0.001817, 0.001290, 0.000881, 0.000583, 0.000364, 0.000216, 0.000117, 0.000056, 0.000023, 0.000007, 0.000001, 0.000000, }, { /* wavelet type 3, n_levels 2, low */ 4.018015, 4.004651, 4.002912, 3.962997, 3.945035, 3.934522, 3.879685, 3.837979, 3.803062, 3.760686, 3.703711, 3.631829, 3.585704, 3.499915, 3.433670, 3.349924, 3.274991, 3.201063, 3.097869, 3.031924, 2.933240, 2.824423, 2.724634, 2.629738, 2.540180, 2.432355, 2.324094, 2.214624, 2.104537, 2.030086, 1.924348, 1.803836, 1.705314, 1.602183, 1.517777, 1.421132, 1.306617, 1.218221, 1.131248, 1.045986, 0.963251, 0.877403, 0.797777, 0.723581, 0.655224, 0.588195, 0.519576, 0.461733, 0.403835, 0.350675, 0.302692, 0.257384, 0.217551, 0.179410, 0.146622, 0.117015, 0.090786, 0.068156, 0.049213, 0.033717, 0.021061, 0.011591, 0.005070, 0.001236, 0.000000, 0.001177, 0.004596, 0.010002, 0.017301, 0.026362, 0.036619, 0.048254, 0.061146, 0.074954, 0.089298, 0.103859, 0.119663, 0.134467, 0.150138, 0.165064, 0.180297, 0.195425, 0.208348, 0.223326, 0.235391, 0.245783, 0.256018, 0.265795, 0.275203, 0.281569, 0.286623, 0.290196, 0.292285, 0.298146, 0.298225, 0.294407, 0.292586, 0.288481, 0.286338, 0.280494, 0.269433, 0.262104, 0.253639, 0.244114, 0.233745, 0.221153, 0.208662, 0.196210, 0.184042, 0.170997, 0.156213, 0.143464, 0.129579, 0.116125, 0.103381, 0.090610, 0.078898, 0.066993, 0.056342, 0.046250, 0.036892, 0.028462, 0.021110, 0.014851, 0.009521, 0.005376, 0.002412, 0.000603, }, { /* wavelet type 3, n_levels 3, high */ 0.001651, 0.004839, 0.019159, 0.042823, 0.075211, 0.116780, 0.164060, 0.217711, 0.277220, 0.344538, 0.412597, 0.481487, 0.555375, 0.624522, 0.695875, 0.760309, 0.821210, 0.880039, 0.934032, 0.975784, 1.015988, 1.040211, 1.064579, 1.078235, 1.073536, 1.071854, 1.065353, 1.053615, 1.018323, 0.985914, 0.944265, 0.898629, 0.854727, 0.798170, 0.744763, 0.690175, 0.632233, 0.579573, 0.518558, 0.460930, 0.407091, 0.359749, 0.311710, 0.266489, 0.226950, 0.189303, 0.156656, 0.126940, 0.101262, 0.079590, 0.061344, 0.045927, 0.033696, 0.023785, 0.016334, 0.010720, 0.006618, 0.003866, 0.002081, 0.001001, 0.000402, 0.000125, 0.000024, 0.000001, 0.000000, 0.000001, 0.000022, 0.000108, 0.000330, 0.000782, 0.001548, 0.002737, 0.004457, 0.006867, 0.009948, 0.013769, 0.018534, 0.023994, 0.030427, 0.037463, 0.045210, 0.053727, 0.062819, 0.071874, 0.081532, 0.090520, 0.100032, 0.108980, 0.116307, 0.124078, 0.131387, 0.138062, 0.141428, 0.144795, 0.146337, 0.146667, 0.146648, 0.143715, 0.140504, 0.136222, 0.130371, 0.124697, 0.116267, 0.107573, 0.098786, 0.090676, 0.081529, 0.072262, 0.063747, 0.055033, 0.047100, 0.039441, 0.032492, 0.026356, 0.020951, 0.016168, 0.012220, 0.008882, 0.006277, 0.004237, 0.002689, 0.001614, 0.000893, 0.000441, 0.000182, 0.000058, 0.000012, 0.000001, }, { /* wavelet type 3, n_levels 3, low */ 8.062731, 7.919124, 7.910108, 7.763633, 7.600093, 7.413601, 7.171674, 6.821633, 6.488860, 6.150393, 5.761420, 5.374051, 4.937562, 4.542007, 4.103923, 3.710333, 3.277144, 2.897987, 2.498665, 2.146962, 1.800576, 1.498459, 1.213614, 0.963228, 0.739817, 0.550560, 0.394439, 0.263420, 0.161226, 0.086642, 0.036781, 0.008649, 0.000000, 0.007682, 0.029010, 0.060652, 0.100098, 0.144902, 0.191992, 0.236757, 0.280543, 0.321378, 0.355348, 0.383886, 0.402210, 0.416512, 0.419077, 0.418017, 0.404100, 0.388404, 0.361778, 0.334019, 0.299571, 0.265475, 0.228082, 0.191371, 0.154901, 0.121141, 0.090971, 0.063531, 0.040573, 0.022706, 0.010020, 0.002445, 0.000000, 0.002328, 0.009082, 0.019594, 0.033330, 0.049673, 0.067690, 0.085768, 0.104328, 0.122583, 0.138910, 0.153681, 0.164777, 0.174504, 0.179445, 0.182822, 0.180416, 0.176923, 0.168049, 0.158141, 0.144495, 0.130397, 0.114036, 0.097356, 0.080152, 0.063733, 0.048645, 0.034517, 0.022392, 0.012725, 0.005700, 0.001412, 0.000000, 0.001383, 0.005473, 0.011971, 0.020641, 0.031176, 0.043047, 0.055255, 0.068077, 0.081005, 0.092943, 0.104096, 0.112975, 0.121086, 0.125998, 0.129881, 0.129664, 0.128619, 0.123561, 0.117589, 0.108644, 0.099130, 0.087645, 0.075640, 0.062946, 0.050588, 0.039022, 0.027982, 0.018342, 0.010532, 0.004767, 0.001193, }, { /* wavelet type 3, n_levels 4, high */ 0.001701, 0.038326, 0.151509, 0.328045, 0.557922, 0.819717, 1.097042, 1.372419, 1.612052, 1.833130, 1.987515, 2.084868, 2.119055, 2.079199, 1.992807, 1.825678, 1.648329, 1.425962, 1.213317, 0.982817, 0.772754, 0.581328, 0.418660, 0.287091, 0.183796, 0.110765, 0.060337, 0.029126, 0.011836, 0.003661, 0.000704, 0.000042, 0.000000, 0.000037, 0.000556, 0.002563, 0.007348, 0.016022, 0.029369, 0.047632, 0.069696, 0.095787, 0.122584, 0.148929, 0.172617, 0.190667, 0.203498, 0.205686, 0.203253, 0.191115, 0.175674, 0.152904, 0.128567, 0.102991, 0.078681, 0.057038, 0.038483, 0.024372, 0.013916, 0.007025, 0.002978, 0.000959, 0.000192, 0.000012, 0.000000, 0.000011, 0.000174, 0.000828, 0.002447, 0.005492, 0.010354, 0.017255, 0.025919, 0.036536, 0.047920, 0.059621, 0.070718, 0.079883, 0.087136, 0.089958, 0.090745, 0.087055, 0.081602, 0.072392, 0.062013, 0.050588, 0.039339, 0.029017, 0.019912, 0.012822, 0.007441, 0.003817, 0.001644, 0.000538, 0.000109, 0.000007, 0.000000, 0.000007, 0.000105, 0.000506, 0.001515, 0.003447, 0.006585, 0.011117, 0.016913, 0.024143, 0.032062, 0.040384, 0.048485, 0.055430, 0.061183, 0.063908, 0.065218, 0.063287, 0.059999, 0.053829, 0.046627, 0.038458, 0.030235, 0.022544, 0.015638, 0.010178, 0.005969, 0.003094, 0.001347, 0.000445, 0.000091, 0.000006, }, { /* wavelet type 3, n_levels 4, low */ 15.997478, 15.829120, 15.252260, 14.260300, 13.000626, 11.467471, 9.811182, 8.160368, 6.487478, 4.944460, 3.543399, 2.380766, 1.453833, 0.765554, 0.314288, 0.071148, 0.000000, 0.055571, 0.191354, 0.361870, 0.530168, 0.663834, 0.746399, 0.774364, 0.739659, 0.658607, 0.539610, 0.407462, 0.275791, 0.159145, 0.070921, 0.017289, 0.000000, 0.015356, 0.055937, 0.111407, 0.171227, 0.224137, 0.262654, 0.283221, 0.280483, 0.258364, 0.218547, 0.170066, 0.118428, 0.070203, 0.032094, 0.008016, 0.000000, 0.007448, 0.027706, 0.056299, 0.088207, 0.117608, 0.140275, 0.153848, 0.154868, 0.144915, 0.124452, 0.098270, 0.069404, 0.041707, 0.019320, 0.004887, 0.000000, 0.004653, 0.017513, 0.035991, 0.057013, 0.076835, 0.092603, 0.102599, 0.104306, 0.098548, 0.085433, 0.068082, 0.048518, 0.029413, 0.013742, 0.003506, 0.000000, 0.003393, 0.012870, 0.026655, 0.042546, 0.057767, 0.070135, 0.078267, 0.080135, 0.076240, 0.066548, 0.053392, 0.038303, 0.023373, 0.010991, 0.002822, 0.000000, 0.002765, 0.010553, 0.021989, 0.035308, 0.048224, 0.058890, 0.066099, 0.068063, 0.065122, 0.057162, 0.046116, 0.033265, 0.020409, 0.009649, 0.002491, 0.000000, 0.002466, 0.009463, 0.019820, 0.031990, 0.043916, 0.053903, 0.060809, 0.062932, 0.060515, 0.053385, 0.043283, 0.031376, 0.019346, 0.009192, 0.002384, } }, { { /* wavelet type 4, n_levels 1, high */ 0.000806, 0.000044, 0.000157, 0.000344, 0.000605, 0.000948, 0.001363, 0.001849, 0.002402, 0.003043, 0.003740, 0.004527, 0.005413, 0.006310, 0.007315, 0.008423, 0.009456, 0.010693, 0.011977, 0.013368, 0.014767, 0.016283, 0.017858, 0.019306, 0.020972, 0.022784, 0.024566, 0.026600, 0.028375, 0.030490, 0.032368, 0.034446, 0.036572, 0.038925, 0.040903, 0.043407, 0.045830, 0.048068, 0.050588, 0.053093, 0.055521, 0.058075, 0.061047, 0.063490, 0.066130, 0.069032, 0.071475, 0.074429, 0.076889, 0.080075, 0.082817, 0.085841, 0.088356, 0.091847, 0.094616, 0.097464, 0.100731, 0.104032, 0.106621, 0.109481, 0.112014, 0.115317, 0.118830, 0.121650, 0.124587, 0.127765, 0.131093, 0.133630, 0.136355, 0.140019, 0.143289, 0.146936, 0.149566, 0.152153, 0.155356, 0.158651, 0.160638, 0.164307, 0.166967, 0.170101, 0.172208, 0.175857, 0.178232, 0.181807, 0.184072, 0.186892, 0.190212, 0.191705, 0.194306, 0.197201, 0.199644, 0.201755, 0.204843, 0.206893, 0.208151, 0.211797, 0.213108, 0.215356, 0.217492, 0.220634, 0.221599, 0.224692, 0.225051, 0.226977, 0.227831, 0.229490, 0.233103, 0.234267, 0.235265, 0.236923, 0.237405, 0.238430, 0.238886, 0.242801, 0.242743, 0.243495, 0.245685, 0.245128, 0.245378, 0.246861, 0.247081, 0.248477, 0.249379, 0.249594, 0.248151, 0.248618, 0.250805, 0.249091, }, { /* wavelet type 4, n_levels 1, low */ 0.998443, 1.003652, 1.001016, 0.996621, 0.998828, 0.993762, 0.997257, 0.992822, 0.991092, 0.987433, 0.980029, 0.982836, 0.978727, 0.978081, 0.968536, 0.963377, 0.960105, 0.959063, 0.947386, 0.943162, 0.941407, 0.929917, 0.930037, 0.924322, 0.915625, 0.907764, 0.901489, 0.892129, 0.884073, 0.880877, 0.873240, 0.861576, 0.855335, 0.846330, 0.834843, 0.826742, 0.818542, 0.807717, 0.798169, 0.786959, 0.776066, 0.767654, 0.756424, 0.746448, 0.737922, 0.723057, 0.710895, 0.700637, 0.693083, 0.681083, 0.673115, 0.657189, 0.645556, 0.632993, 0.621641, 0.608030, 0.598387, 0.583181, 0.572912, 0.561271, 0.548830, 0.533831, 0.523898, 0.511375, 0.495517, 0.486877, 0.474889, 0.460671, 0.450845, 0.438846, 0.426298, 0.412890, 0.403022, 0.389476, 0.378602, 0.366433, 0.355085, 0.343341, 0.333872, 0.320587, 0.309435, 0.296540, 0.285067, 0.274530, 0.265101, 0.253551, 0.242747, 0.232548, 0.221724, 0.211842, 0.202231, 0.192408, 0.183104, 0.173446, 0.164037, 0.155516, 0.146752, 0.137789, 0.129936, 0.121710, 0.113183, 0.105585, 0.098384, 0.091104, 0.084255, 0.077733, 0.071226, 0.064600, 0.059067, 0.053193, 0.047773, 0.042983, 0.037988, 0.033395, 0.029161, 0.025322, 0.021535, 0.018129, 0.014909, 0.012144, 0.009614, 0.007363, 0.005426, 0.003751, 0.002411, 0.001352, 0.000603, 0.000151, }, { /* wavelet type 4, n_levels 2, high */ 0.000406, 0.000156, 0.000608, 0.001352, 0.002382, 0.003753, 0.005365, 0.007274, 0.009401, 0.011870, 0.014560, 0.017462, 0.020590, 0.023972, 0.027501, 0.031189, 0.035352, 0.039172, 0.043349, 0.047921, 0.052240, 0.056774, 0.061767, 0.066188, 0.070735, 0.075501, 0.079693, 0.084660, 0.088838, 0.093560, 0.098305, 0.102309, 0.106784, 0.110591, 0.114905, 0.118288, 0.121579, 0.125551, 0.128198, 0.131956, 0.134560, 0.137328, 0.140119, 0.141223, 0.142957, 0.144798, 0.145271, 0.146339, 0.148068, 0.147441, 0.147879, 0.147969, 0.147492, 0.147020, 0.146355, 0.145176, 0.143266, 0.142354, 0.140413, 0.138734, 0.134765, 0.132960, 0.130878, 0.127363, 0.124154, 0.121261, 0.118635, 0.114738, 0.110705, 0.108473, 0.104480, 0.100786, 0.096492, 0.092993, 0.089135, 0.085108, 0.081128, 0.077305, 0.073349, 0.069401, 0.066107, 0.061937, 0.058253, 0.054977, 0.051358, 0.047970, 0.044966, 0.041601, 0.038444, 0.035521, 0.032482, 0.029908, 0.027197, 0.024816, 0.022578, 0.020322, 0.018321, 0.016362, 0.014628, 0.012927, 0.011373, 0.010020, 0.008697, 0.007577, 0.006509, 0.005566, 0.004730, 0.003944, 0.003278, 0.002703, 0.002186, 0.001756, 0.001399, 0.001081, 0.000828, 0.000621, 0.000453, 0.000322, 0.000221, 0.000146, 0.000091, 0.000054, 0.000029, 0.000014, 0.000006, 0.000002, 0.000000, 0.000000, }, { /* wavelet type 4, n_levels 2, low */ 1.008294, 1.002310, 0.997248, 0.991985, 0.992559, 0.980531, 0.975146, 0.967305, 0.951669, 0.938959, 0.925192, 0.907394, 0.895205, 0.876136, 0.862898, 0.843806, 0.820765, 0.797374, 0.776325, 0.752514, 0.730463, 0.710677, 0.680844, 0.656741, 0.633669, 0.607166, 0.580508, 0.558010, 0.531283, 0.505201, 0.479443, 0.452633, 0.427063, 0.402033, 0.378148, 0.353659, 0.329851, 0.306950, 0.282561, 0.261099, 0.240291, 0.219119, 0.199352, 0.182066, 0.163170, 0.145988, 0.130206, 0.115016, 0.101207, 0.088331, 0.076068, 0.064431, 0.054314, 0.044825, 0.036626, 0.029216, 0.022718, 0.017178, 0.012369, 0.008403, 0.005299, 0.002901, 0.001263, 0.000309, 0.000000, 0.000295, 0.001145, 0.002504, 0.004353, 0.006570, 0.009204, 0.012162, 0.015301, 0.018714, 0.022307, 0.025949, 0.029875, 0.033661, 0.037730, 0.041578, 0.045185, 0.048680, 0.052212, 0.055429, 0.058619, 0.061844, 0.063975, 0.066379, 0.068652, 0.070285, 0.071592, 0.073119, 0.073786, 0.074196, 0.074301, 0.073875, 0.073272, 0.072388, 0.071340, 0.069803, 0.068018, 0.066041, 0.063354, 0.060936, 0.058310, 0.055230, 0.052141, 0.049370, 0.045832, 0.042441, 0.039147, 0.035736, 0.032474, 0.029251, 0.025980, 0.022682, 0.019698, 0.016738, 0.014074, 0.011548, 0.009232, 0.007173, 0.005306, 0.003701, 0.002395, 0.001346, 0.000601, 0.000151, }, { /* wavelet type 4, n_levels 3, high */ 0.000206, 0.000609, 0.002400, 0.005357, 0.009446, 0.014436, 0.020443, 0.027222, 0.034732, 0.043065, 0.051297, 0.060400, 0.069125, 0.077943, 0.086178, 0.094584, 0.102993, 0.109472, 0.115677, 0.121772, 0.126459, 0.130479, 0.132374, 0.134774, 0.134500, 0.134011, 0.132738, 0.130232, 0.127949, 0.123339, 0.118312, 0.112898, 0.107753, 0.100277, 0.093315, 0.086341, 0.079438, 0.071638, 0.064610, 0.057629, 0.051003, 0.044967, 0.038759, 0.033427, 0.028248, 0.023624, 0.019401, 0.015791, 0.012700, 0.009901, 0.007597, 0.005732, 0.004194, 0.002984, 0.002031, 0.001340, 0.000829, 0.000483, 0.000259, 0.000124, 0.000050, 0.000016, 0.000003, 0.000000, 0.000000, 0.000000, 0.000003, 0.000014, 0.000041, 0.000097, 0.000193, 0.000342, 0.000558, 0.000858, 0.001237, 0.001727, 0.002307, 0.002995, 0.003768, 0.004661, 0.005670, 0.006683, 0.007780, 0.008969, 0.010148, 0.011354, 0.012438, 0.013622, 0.014572, 0.015513, 0.016370, 0.017065, 0.017770, 0.018114, 0.018335, 0.018426, 0.018487, 0.018055, 0.017604, 0.017042, 0.016381, 0.015413, 0.014486, 0.013450, 0.012377, 0.011334, 0.010138, 0.009064, 0.007934, 0.006868, 0.005833, 0.004906, 0.004075, 0.003279, 0.002595, 0.002018, 0.001521, 0.001114, 0.000780, 0.000530, 0.000337, 0.000202, 0.000111, 0.000054, 0.000023, 0.000007, 0.000001, 0.000000, }, { /* wavelet type 4, n_levels 3, low */ 1.006367, 1.001665, 0.982750, 0.975829, 0.947261, 0.924336, 0.894690, 0.851131, 0.813173, 0.768413, 0.717653, 0.670502, 0.623827, 0.566936, 0.516041, 0.459400, 0.412065, 0.358818, 0.314191, 0.267985, 0.227490, 0.186957, 0.151170, 0.120343, 0.092713, 0.068693, 0.049208, 0.032843, 0.020095, 0.010890, 0.004570, 0.001094, 0.000000, 0.000972, 0.003604, 0.007624, 0.012476, 0.018067, 0.023952, 0.029540, 0.035157, 0.040152, 0.044263, 0.047896, 0.050816, 0.051989, 0.052696, 0.051757, 0.050811, 0.048091, 0.045491, 0.041692, 0.037849, 0.033122, 0.028410, 0.023909, 0.019412, 0.015115, 0.011349, 0.007921, 0.005057, 0.002854, 0.001245, 0.000309, 0.000000, 0.000294, 0.001128, 0.002463, 0.004154, 0.006193, 0.008445, 0.010701, 0.013074, 0.015315, 0.017303, 0.019174, 0.020818, 0.021782, 0.022564, 0.022636, 0.022685, 0.021906, 0.021131, 0.019739, 0.018256, 0.016269, 0.014205, 0.012163, 0.010044, 0.007952, 0.006069, 0.004304, 0.002791, 0.001599, 0.000708, 0.000179, 0.000000, 0.000175, 0.000680, 0.001505, 0.002573, 0.003887, 0.005370, 0.006894, 0.008531, 0.010120, 0.011577, 0.012988, 0.014274, 0.015114, 0.015843, 0.016081, 0.016304, 0.015925, 0.015537, 0.014678, 0.013726, 0.012368, 0.010917, 0.009450, 0.007888, 0.006312, 0.004868, 0.003489, 0.002286, 0.001324, 0.000592, 0.000151, }, { /* wavelet type 4, n_levels 4, high */ 0.000106, 0.002394, 0.009428, 0.020609, 0.034888, 0.051182, 0.068768, 0.085619, 0.101361, 0.114355, 0.124600, 0.130174, 0.132523, 0.130647, 0.124022, 0.114072, 0.103390, 0.089097, 0.075511, 0.061755, 0.048327, 0.036297, 0.026246, 0.017909, 0.011557, 0.006910, 0.003782, 0.001819, 0.000740, 0.000230, 0.000044, 0.000003, 0.000000, 0.000002, 0.000035, 0.000161, 0.000460, 0.001000, 0.001841, 0.002972, 0.004382, 0.005975, 0.007685, 0.009299, 0.010795, 0.011981, 0.012665, 0.012852, 0.012749, 0.011941, 0.010933, 0.009608, 0.008040, 0.006431, 0.004933, 0.003558, 0.002420, 0.001520, 0.000872, 0.000439, 0.000186, 0.000060, 0.000012, 0.000001, 0.000000, 0.000001, 0.000011, 0.000052, 0.000153, 0.000343, 0.000649, 0.001076, 0.001630, 0.002279, 0.003004, 0.003723, 0.004423, 0.005019, 0.005423, 0.005621, 0.005692, 0.005439, 0.005078, 0.004549, 0.003878, 0.003159, 0.002466, 0.001810, 0.001252, 0.000800, 0.000466, 0.000238, 0.000103, 0.000034, 0.000007, 0.000000, 0.000000, 0.000000, 0.000007, 0.000032, 0.000095, 0.000215, 0.000413, 0.000694, 0.001063, 0.001506, 0.002010, 0.002521, 0.003032, 0.003483, 0.003808, 0.003993, 0.004091, 0.003954, 0.003734, 0.003382, 0.002916, 0.002401, 0.001895, 0.001406, 0.000983, 0.000635, 0.000374, 0.000193, 0.000084, 0.000028, 0.000006, 0.000000, }, { /* wavelet type 4, n_levels 4, low */ 1.002702, 0.989281, 0.954609, 0.891052, 0.812346, 0.720936, 0.614692, 0.512573, 0.406052, 0.310574, 0.222002, 0.149674, 0.090843, 0.047835, 0.019671, 0.004447, 0.000000, 0.003473, 0.011976, 0.022611, 0.033128, 0.041734, 0.046764, 0.048640, 0.046295, 0.041369, 0.033808, 0.025616, 0.017233, 0.009944, 0.004439, 0.001081, 0.000000, 0.000960, 0.003501, 0.006961, 0.010699, 0.014091, 0.016456, 0.017790, 0.017555, 0.016228, 0.013692, 0.010692, 0.007400, 0.004387, 0.002009, 0.000501, 0.000000, 0.000465, 0.001734, 0.003518, 0.005512, 0.007394, 0.008789, 0.009664, 0.009693, 0.009102, 0.007797, 0.006178, 0.004337, 0.002606, 0.001209, 0.000305, 0.000000, 0.000291, 0.001096, 0.002249, 0.003562, 0.004830, 0.005802, 0.006445, 0.006529, 0.006190, 0.005353, 0.004280, 0.003032, 0.001838, 0.000860, 0.000219, 0.000000, 0.000212, 0.000805, 0.001666, 0.002658, 0.003632, 0.004394, 0.004916, 0.005016, 0.004789, 0.004169, 0.003357, 0.002393, 0.001460, 0.000688, 0.000176, 0.000000, 0.000173, 0.000660, 0.001374, 0.002206, 0.003032, 0.003690, 0.004152, 0.004260, 0.004090, 0.003581, 0.002899, 0.002079, 0.001275, 0.000604, 0.000156, 0.000000, 0.000154, 0.000592, 0.001238, 0.001999, 0.002761, 0.003377, 0.003820, 0.003939, 0.003801, 0.003345, 0.002721, 0.001961, 0.001209, 0.000575, 0.000149, } }, { { /* wavelet type 5, n_levels 1, high */ 0.002595, 0.002597, 0.002600, 0.002606, 0.002619, 0.002635, 0.002663, 0.002695, 0.002729, 0.002776, 0.002818, 0.002862, 0.002887, 0.002915, 0.002926, 0.002918, 0.002888, 0.002872, 0.002837, 0.002804, 0.002786, 0.002783, 0.002801, 0.002838, 0.002895, 0.002968, 0.003054, 0.003136, 0.003203, 0.003260, 0.003300, 0.003314, 0.003315, 0.003315, 0.003324, 0.003357, 0.003425, 0.003533, 0.003682, 0.003870, 0.004069, 0.004247, 0.004381, 0.004432, 0.004405, 0.004284, 0.004147, 0.004088, 0.004303, 0.005064, 0.006741, 0.009859, 0.014935, 0.022710, 0.033938, 0.049836, 0.070242, 0.096776, 0.131264, 0.171956, 0.221314, 0.278327, 0.343740, 0.421060, 0.504085, 0.595385, 0.687968, 0.792338, 0.902305, 1.011408, 1.125901, 1.228590, 1.337175, 1.449565, 1.539085, 1.631291, 1.712787, 1.791943, 1.855993, 1.923277, 1.973381, 2.004378, 2.023211, 2.046509, 2.069794, 2.068362, 2.068938, 2.072374, 2.053384, 2.034586, 2.027720, 2.029951, 1.998720, 1.991417, 1.985641, 1.976770, 1.973506, 1.969570, 1.956708, 1.955048, 1.955800, 1.960471, 1.967690, 1.977747, 1.983530, 1.989884, 1.996222, 1.999750, 2.009197, 2.020285, 2.030327, 2.029737, 2.040368, 2.051355, 2.050382, 2.041016, 2.052132, 2.042117, 2.036588, 2.040382, 2.023273, 2.036546, 2.018233, 2.013358, 2.015954, 2.009561, 2.000925, 2.012375, }, { /* wavelet type 5, n_levels 1, low */ 0.500354, 0.500909, 0.502459, 0.497063, 0.500583, 0.496434, 0.496028, 0.495888, 0.490318, 0.491619, 0.491063, 0.490099, 0.490859, 0.493032, 0.490001, 0.487984, 0.491228, 0.493291, 0.492319, 0.495210, 0.496340, 0.498262, 0.501362, 0.502826, 0.503675, 0.507398, 0.507418, 0.510305, 0.510615, 0.509443, 0.511850, 0.513170, 0.507748, 0.505713, 0.503861, 0.500335, 0.498501, 0.495215, 0.492960, 0.487586, 0.484018, 0.485884, 0.478905, 0.481812, 0.483078, 0.488015, 0.492269, 0.496882, 0.505814, 0.516459, 0.534585, 0.545753, 0.563953, 0.576369, 0.591982, 0.602367, 0.615686, 0.621857, 0.624499, 0.620840, 0.610190, 0.591889, 0.569175, 0.535250, 0.497930, 0.452891, 0.406175, 0.354118, 0.303100, 0.253124, 0.205284, 0.161135, 0.122698, 0.089177, 0.062598, 0.041364, 0.025731, 0.014741, 0.007905, 0.004215, 0.002820, 0.002940, 0.003893, 0.005181, 0.006340, 0.007290, 0.007809, 0.007909, 0.007608, 0.007093, 0.006344, 0.005509, 0.004699, 0.003966, 0.003325, 0.002814, 0.002425, 0.002163, 0.001993, 0.001891, 0.001839, 0.001817, 0.001805, 0.001794, 0.001783, 0.001759, 0.001727, 0.001695, 0.001657, 0.001628, 0.001597, 0.001573, 0.001554, 0.001539, 0.001528, 0.001519, 0.001510, 0.001501, 0.001491, 0.001478, 0.001466, 0.001456, 0.001445, 0.001435, 0.001428, 0.001422, 0.001418, 0.001416, }, { /* wavelet type 5, n_levels 2, high */ 0.004724, 0.004723, 0.004726, 0.004738, 0.004761, 0.004788, 0.004808, 0.004826, 0.004813, 0.004793, 0.004793, 0.004834, 0.004920, 0.005043, 0.005168, 0.005274, 0.005356, 0.005431, 0.005546, 0.005745, 0.005988, 0.006238, 0.006358, 0.006398, 0.006751, 0.008371, 0.012944, 0.023116, 0.042056, 0.072905, 0.119245, 0.180859, 0.258314, 0.352147, 0.456199, 0.560656, 0.663925, 0.756761, 0.832879, 0.896570, 0.946287, 0.969998, 0.987442, 0.997235, 0.990770, 0.986439, 0.993097, 0.988018, 1.004891, 1.017268, 1.037004, 1.077121, 1.109456, 1.151329, 1.194006, 1.229384, 1.262612, 1.268666, 1.273590, 1.262940, 1.238807, 1.200836, 1.149052, 1.082965, 0.997877, 0.916663, 0.821101, 0.719983, 0.617317, 0.516508, 0.420541, 0.331392, 0.253885, 0.184304, 0.127961, 0.084162, 0.052190, 0.030423, 0.016588, 0.009174, 0.006291, 0.006402, 0.008246, 0.010775, 0.013324, 0.015224, 0.016219, 0.016218, 0.015411, 0.013828, 0.011923, 0.009953, 0.008215, 0.006837, 0.005793, 0.005105, 0.004677, 0.004419, 0.004257, 0.004135, 0.004037, 0.003950, 0.003874, 0.003805, 0.003745, 0.003689, 0.003635, 0.003584, 0.003539, 0.003493, 0.003454, 0.003414, 0.003376, 0.003344, 0.003308, 0.003277, 0.003250, 0.003220, 0.003194, 0.003167, 0.003145, 0.003125, 0.003106, 0.003091, 0.003078, 0.003068, 0.003062, 0.003058, }, { /* wavelet type 5, n_levels 2, low */ 0.251971, 0.250260, 0.249298, 0.247372, 0.247843, 0.244483, 0.244701, 0.243708, 0.243555, 0.242427, 0.244513, 0.245713, 0.247803, 0.248979, 0.250168, 0.250186, 0.249932, 0.247870, 0.245530, 0.243274, 0.241421, 0.243278, 0.242929, 0.248587, 0.255961, 0.270254, 0.284892, 0.300515, 0.312424, 0.315756, 0.307577, 0.284339, 0.250465, 0.202281, 0.152001, 0.103334, 0.062567, 0.032693, 0.014340, 0.005353, 0.002518, 0.002749, 0.003775, 0.004380, 0.004302, 0.003714, 0.002957, 0.002302, 0.001867, 0.001634, 0.001544, 0.001520, 0.001507, 0.001480, 0.001448, 0.001413, 0.001387, 0.001369, 0.001353, 0.001337, 0.001316, 0.001296, 0.001279, 0.001267, 0.001257, 0.001248, 0.001237, 0.001225, 0.001210, 0.001189, 0.001163, 0.001135, 0.001106, 0.001081, 0.001052, 0.001025, 0.000995, 0.000963, 0.000929, 0.000895, 0.000859, 0.000824, 0.000795, 0.000777, 0.000764, 0.000757, 0.000737, 0.000710, 0.000686, 0.000682, 0.000712, 0.000766, 0.000825, 0.000847, 0.000821, 0.000750, 0.000661, 0.000587, 0.000541, 0.000527, 0.000533, 0.000548, 0.000560, 0.000566, 0.000561, 0.000552, 0.000537, 0.000523, 0.000507, 0.000492, 0.000481, 0.000473, 0.000467, 0.000464, 0.000463, 0.000463, 0.000464, 0.000466, 0.000465, 0.000464, 0.000463, 0.000460, 0.000459, 0.000458, 0.000456, 0.000455, 0.000454, 0.000454, }, { /* wavelet type 5, n_levels 3, high */ 0.005316, 0.005299, 0.005271, 0.005249, 0.005234, 0.005263, 0.005396, 0.005604, 0.005797, 0.005997, 0.006307, 0.006654, 0.007279, 0.011096, 0.026114, 0.063420, 0.130629, 0.222171, 0.324015, 0.406984, 0.462533, 0.489195, 0.488459, 0.496384, 0.500828, 0.527589, 0.567456, 0.609271, 0.635695, 0.643378, 0.625581, 0.575561, 0.503679, 0.410659, 0.311061, 0.212871, 0.129572, 0.068456, 0.030192, 0.011707, 0.005811, 0.006026, 0.007952, 0.009179, 0.008772, 0.007235, 0.005567, 0.004435, 0.003884, 0.003645, 0.003519, 0.003428, 0.003359, 0.003305, 0.003257, 0.003215, 0.003171, 0.003131, 0.003094, 0.003057, 0.003022, 0.002989, 0.002958, 0.002929, 0.002902, 0.002873, 0.002843, 0.002809, 0.002767, 0.002722, 0.002670, 0.002611, 0.002549, 0.002483, 0.002413, 0.002338, 0.002263, 0.002184, 0.002103, 0.002021, 0.001934, 0.001847, 0.001771, 0.001721, 0.001691, 0.001673, 0.001636, 0.001578, 0.001522, 0.001504, 0.001555, 0.001648, 0.001742, 0.001779, 0.001704, 0.001558, 0.001389, 0.001237, 0.001155, 0.001136, 0.001160, 0.001196, 0.001221, 0.001231, 0.001219, 0.001203, 0.001171, 0.001136, 0.001095, 0.001057, 0.001027, 0.001009, 0.001001, 0.000995, 0.000995, 0.000993, 0.000988, 0.000988, 0.000985, 0.000983, 0.000982, 0.000980, 0.000979, 0.000979, 0.000977, 0.000977, 0.000977, 0.000976, }, { /* wavelet type 5, n_levels 3, low */ 0.127119, 0.125727, 0.125124, 0.123451, 0.121938, 0.123443, 0.123742, 0.124335, 0.123178, 0.121895, 0.119121, 0.120075, 0.125597, 0.137693, 0.149887, 0.147217, 0.119203, 0.074049, 0.031952, 0.008626, 0.002261, 0.002418, 0.002619, 0.002002, 0.001448, 0.001254, 0.001209, 0.001171, 0.001131, 0.001098, 0.001069, 0.001046, 0.001036, 0.001024, 0.001001, 0.000961, 0.000916, 0.000871, 0.000820, 0.000763, 0.000701, 0.000642, 0.000605, 0.000575, 0.000542, 0.000534, 0.000549, 0.000519, 0.000435, 0.000383, 0.000387, 0.000407, 0.000410, 0.000395, 0.000376, 0.000359, 0.000348, 0.000343, 0.000340, 0.000337, 0.000332, 0.000327, 0.000323, 0.000319, 0.000317, 0.000314, 0.000310, 0.000306, 0.000299, 0.000291, 0.000282, 0.000273, 0.000266, 0.000261, 0.000257, 0.000253, 0.000249, 0.000243, 0.000236, 0.000227, 0.000221, 0.000217, 0.000214, 0.000208, 0.000201, 0.000195, 0.000190, 0.000186, 0.000180, 0.000175, 0.000170, 0.000166, 0.000163, 0.000160, 0.000158, 0.000157, 0.000156, 0.000156, 0.000156, 0.000155, 0.000155, 0.000155, 0.000155, 0.000154, 0.000154, 0.000153, 0.000152, 0.000149, 0.000148, 0.000150, 0.000151, 0.000151, 0.000148, 0.000144, 0.000141, 0.000140, 0.000141, 0.000142, 0.000144, 0.000144, 0.000145, 0.000145, 0.000145, 0.000145, 0.000144, 0.000144, 0.000143, 0.000143, }, { /* wavelet type 5, n_levels 4, high */ 0.005679, 0.005582, 0.005504, 0.005700, 0.006092, 0.006551, 0.007645, 0.018500, 0.067314, 0.155150, 0.218829, 0.237691, 0.244399, 0.274728, 0.303556, 0.298851, 0.241435, 0.152208, 0.066759, 0.018836, 0.005229, 0.005133, 0.005319, 0.003909, 0.003075, 0.002818, 0.002691, 0.002609, 0.002541, 0.002482, 0.002431, 0.002397, 0.002367, 0.002331, 0.002276, 0.002199, 0.002108, 0.001997, 0.001878, 0.001742, 0.001598, 0.001453, 0.001356, 0.001301, 0.001232, 0.001203, 0.001205, 0.001103, 0.000919, 0.000822, 0.000848, 0.000904, 0.000911, 0.000887, 0.000839, 0.000795, 0.000769, 0.000757, 0.000749, 0.000740, 0.000734, 0.000729, 0.000721, 0.000717, 0.000710, 0.000703, 0.000693, 0.000681, 0.000666, 0.000649, 0.000631, 0.000614, 0.000597, 0.000582, 0.000572, 0.000565, 0.000555, 0.000541, 0.000521, 0.000500, 0.000484, 0.000475, 0.000465, 0.000452, 0.000433, 0.000419, 0.000408, 0.000396, 0.000382, 0.000370, 0.000358, 0.000348, 0.000339, 0.000333, 0.000330, 0.000327, 0.000326, 0.000325, 0.000326, 0.000325, 0.000326, 0.000326, 0.000325, 0.000323, 0.000323, 0.000321, 0.000318, 0.000313, 0.000310, 0.000311, 0.000315, 0.000316, 0.000308, 0.000298, 0.000291, 0.000288, 0.000290, 0.000293, 0.000297, 0.000300, 0.000301, 0.000301, 0.000300, 0.000299, 0.000298, 0.000299, 0.000298, 0.000298, }, { /* wavelet type 5, n_levels 4, low */ 0.064230, 0.063741, 0.062202, 0.062262, 0.061834, 0.059815, 0.062436, 0.070680, 0.055026, 0.016703, 0.002116, 0.001753, 0.001222, 0.001044, 0.000983, 0.000926, 0.000905, 0.000877, 0.000805, 0.000723, 0.000617, 0.000523, 0.000469, 0.000418, 0.000323, 0.000314, 0.000325, 0.000302, 0.000283, 0.000272, 0.000262, 0.000255, 0.000252, 0.000249, 0.000239, 0.000225, 0.000213, 0.000205, 0.000198, 0.000187, 0.000174, 0.000167, 0.000156, 0.000147, 0.000138, 0.000129, 0.000120, 0.000114, 0.000110, 0.000108, 0.000108, 0.000108, 0.000108, 0.000106, 0.000104, 0.000106, 0.000105, 0.000098, 0.000097, 0.000098, 0.000098, 0.000098, 0.000097, 0.000096, 0.000096, 0.000096, 0.000094, 0.000093, 0.000091, 0.000089, 0.000086, 0.000083, 0.000084, 0.000085, 0.000083, 0.000082, 0.000082, 0.000081, 0.000080, 0.000079, 0.000078, 0.000077, 0.000076, 0.000075, 0.000074, 0.000073, 0.000071, 0.000069, 0.000068, 0.000066, 0.000064, 0.000063, 0.000062, 0.000061, 0.000060, 0.000059, 0.000058, 0.000058, 0.000057, 0.000057, 0.000056, 0.000056, 0.000055, 0.000055, 0.000055, 0.000054, 0.000053, 0.000053, 0.000052, 0.000052, 0.000052, 0.000051, 0.000051, 0.000051, 0.000050, 0.000050, 0.000049, 0.000049, 0.000050, 0.000048, 0.000045, 0.000046, 0.000049, 0.000050, 0.000050, 0.000050, 0.000050, 0.000049, } }, { { /* wavelet type 6, n_levels 1, high */ 0.000553, 0.000553, 0.000553, 0.000554, 0.000555, 0.000556, 0.000556, 0.000559, 0.000560, 0.000563, 0.000567, 0.000574, 0.000577, 0.000585, 0.000599, 0.000615, 0.000639, 0.000678, 0.000732, 0.000802, 0.000901, 0.001036, 0.001223, 0.001461, 0.001764, 0.002170, 0.002661, 0.003271, 0.004042, 0.004948, 0.006063, 0.007372, 0.009020, 0.010781, 0.012997, 0.015435, 0.018304, 0.021575, 0.025056, 0.029086, 0.033609, 0.038726, 0.043839, 0.050262, 0.056332, 0.063320, 0.070861, 0.078569, 0.086427, 0.095468, 0.104300, 0.113921, 0.124308, 0.134063, 0.144866, 0.155015, 0.165599, 0.176705, 0.186427, 0.197338, 0.208489, 0.218967, 0.228904, 0.239244, 0.248845, 0.258137, 0.266732, 0.275631, 0.283669, 0.290663, 0.297066, 0.305498, 0.310578, 0.316542, 0.322205, 0.325464, 0.330328, 0.331969, 0.334549, 0.337917, 0.338548, 0.341795, 0.343868, 0.344149, 0.343675, 0.346947, 0.343372, 0.346632, 0.344465, 0.344107, 0.343252, 0.345289, 0.343921, 0.343094, 0.343357, 0.341426, 0.343992, 0.340985, 0.341927, 0.342292, 0.344353, 0.342378, 0.344376, 0.345798, 0.345556, 0.349152, 0.350143, 0.350198, 0.350241, 0.352611, 0.354583, 0.358081, 0.357902, 0.361298, 0.362604, 0.363269, 0.365196, 0.368424, 0.369967, 0.371294, 0.372755, 0.374818, 0.375376, 0.373707, 0.376777, 0.377480, 0.376646, 0.379415, }, { /* wavelet type 6, n_levels 1, low */ 0.668716, 0.657824, 0.662184, 0.661322, 0.668182, 0.666077, 0.666719, 0.668314, 0.671077, 0.678355, 0.683653, 0.684401, 0.693741, 0.688476, 0.693567, 0.697310, 0.700140, 0.705483, 0.707220, 0.705467, 0.708888, 0.718672, 0.717257, 0.722719, 0.721522, 0.722120, 0.721899, 0.725325, 0.723239, 0.723033, 0.723836, 0.719420, 0.716061, 0.713778, 0.701703, 0.697912, 0.690726, 0.683464, 0.675482, 0.663488, 0.660308, 0.645283, 0.633768, 0.620846, 0.606675, 0.589822, 0.580432, 0.561179, 0.545094, 0.531155, 0.509650, 0.492453, 0.474675, 0.457072, 0.437225, 0.417769, 0.398047, 0.378271, 0.360856, 0.339683, 0.323416, 0.305768, 0.284644, 0.268699, 0.252998, 0.234178, 0.216414, 0.202476, 0.186719, 0.170521, 0.157700, 0.143721, 0.131317, 0.119797, 0.108696, 0.098462, 0.088443, 0.079228, 0.070657, 0.063427, 0.055863, 0.049324, 0.043637, 0.037822, 0.033139, 0.028913, 0.024924, 0.021477, 0.018521, 0.015671, 0.013410, 0.011338, 0.009571, 0.008067, 0.006744, 0.005724, 0.004798, 0.004025, 0.003396, 0.002864, 0.002446, 0.002107, 0.001818, 0.001607, 0.001427, 0.001300, 0.001196, 0.001121, 0.001060, 0.001017, 0.000989, 0.000964, 0.000945, 0.000931, 0.000920, 0.000913, 0.000906, 0.000901, 0.000896, 0.000893, 0.000889, 0.000886, 0.000884, 0.000881, 0.000879, 0.000878, 0.000877, 0.000875, }, { /* wavelet type 6, n_levels 2, high */ 0.001160, 0.001161, 0.001165, 0.001176, 0.001187, 0.001202, 0.001228, 0.001257, 0.001307, 0.001394, 0.001528, 0.001777, 0.002186, 0.002857, 0.003847, 0.005353, 0.007532, 0.010449, 0.014324, 0.019436, 0.025712, 0.033390, 0.042432, 0.053082, 0.064653, 0.078095, 0.092164, 0.107014, 0.121219, 0.136319, 0.152052, 0.164709, 0.178060, 0.188816, 0.200815, 0.207068, 0.213054, 0.219036, 0.221653, 0.222229, 0.220569, 0.219622, 0.215936, 0.212054, 0.207775, 0.203158, 0.196456, 0.191748, 0.186735, 0.180068, 0.173804, 0.170405, 0.164473, 0.160353, 0.154484, 0.148543, 0.143136, 0.136726, 0.133123, 0.125521, 0.120579, 0.114964, 0.108060, 0.101638, 0.094768, 0.088688, 0.082226, 0.076309, 0.069795, 0.063304, 0.058534, 0.052283, 0.047595, 0.042927, 0.038680, 0.034834, 0.030952, 0.027692, 0.024451, 0.021800, 0.019497, 0.017199, 0.015086, 0.013341, 0.011636, 0.010120, 0.008749, 0.007529, 0.006374, 0.005420, 0.004524, 0.003742, 0.003030, 0.002454, 0.001970, 0.001555, 0.001222, 0.000963, 0.000763, 0.000608, 0.000496, 0.000419, 0.000366, 0.000331, 0.000309, 0.000296, 0.000289, 0.000285, 0.000283, 0.000281, 0.000280, 0.000278, 0.000276, 0.000274, 0.000273, 0.000271, 0.000269, 0.000268, 0.000266, 0.000264, 0.000263, 0.000262, 0.000262, 0.000261, 0.000261, 0.000260, 0.000260, 0.000260, }, { /* wavelet type 6, n_levels 2, low */ 0.438173, 0.441967, 0.444218, 0.446307, 0.449549, 0.452663, 0.458776, 0.468048, 0.472998, 0.477636, 0.484404, 0.490281, 0.494331, 0.496326, 0.498736, 0.500035, 0.499817, 0.492739, 0.485010, 0.476884, 0.465039, 0.451514, 0.431323, 0.412652, 0.391014, 0.366654, 0.340269, 0.312326, 0.285939, 0.258881, 0.230278, 0.205259, 0.178655, 0.154410, 0.130322, 0.109870, 0.090837, 0.074022, 0.059747, 0.047476, 0.037103, 0.028529, 0.021566, 0.016202, 0.011887, 0.008666, 0.006303, 0.004587, 0.003381, 0.002520, 0.001961, 0.001592, 0.001347, 0.001190, 0.001077, 0.001000, 0.000941, 0.000892, 0.000852, 0.000813, 0.000779, 0.000748, 0.000719, 0.000692, 0.000667, 0.000644, 0.000622, 0.000601, 0.000580, 0.000562, 0.000543, 0.000526, 0.000510, 0.000497, 0.000487, 0.000485, 0.000489, 0.000503, 0.000529, 0.000571, 0.000626, 0.000695, 0.000777, 0.000873, 0.000981, 0.001095, 0.001200, 0.001311, 0.001404, 0.001480, 0.001533, 0.001570, 0.001583, 0.001570, 0.001533, 0.001475, 0.001399, 0.001304, 0.001202, 0.001094, 0.000987, 0.000885, 0.000785, 0.000701, 0.000624, 0.000559, 0.000502, 0.000458, 0.000420, 0.000392, 0.000373, 0.000357, 0.000347, 0.000339, 0.000333, 0.000330, 0.000328, 0.000326, 0.000325, 0.000324, 0.000323, 0.000322, 0.000321, 0.000321, 0.000321, 0.000320, 0.000320, 0.000320, }, { /* wavelet type 6, n_levels 3, high */ 0.001988, 0.001997, 0.002036, 0.002097, 0.002218, 0.002468, 0.003061, 0.004364, 0.006967, 0.011892, 0.019790, 0.031476, 0.046788, 0.064749, 0.085888, 0.106252, 0.125212, 0.139851, 0.150423, 0.154181, 0.156118, 0.153832, 0.147810, 0.140871, 0.132081, 0.124855, 0.117665, 0.109499, 0.102609, 0.094382, 0.085571, 0.076882, 0.067359, 0.058055, 0.048713, 0.040547, 0.033088, 0.026472, 0.021245, 0.016716, 0.013054, 0.010188, 0.007775, 0.005815, 0.004228, 0.002982, 0.002077, 0.001404, 0.000957, 0.000672, 0.000513, 0.000426, 0.000380, 0.000354, 0.000335, 0.000318, 0.000302, 0.000287, 0.000272, 0.000259, 0.000247, 0.000236, 0.000227, 0.000218, 0.000210, 0.000202, 0.000194, 0.000187, 0.000180, 0.000173, 0.000167, 0.000161, 0.000154, 0.000148, 0.000142, 0.000136, 0.000131, 0.000130, 0.000134, 0.000145, 0.000167, 0.000198, 0.000235, 0.000277, 0.000323, 0.000365, 0.000403, 0.000440, 0.000467, 0.000497, 0.000523, 0.000539, 0.000557, 0.000560, 0.000555, 0.000539, 0.000512, 0.000477, 0.000435, 0.000393, 0.000351, 0.000309, 0.000275, 0.000242, 0.000214, 0.000191, 0.000169, 0.000152, 0.000137, 0.000125, 0.000115, 0.000108, 0.000104, 0.000101, 0.000100, 0.000099, 0.000099, 0.000099, 0.000099, 0.000099, 0.000099, 0.000099, 0.000099, 0.000099, 0.000098, 0.000098, 0.000098, 0.000098, }, { /* wavelet type 6, n_levels 3, low */ 0.292207, 0.295189, 0.298285, 0.307129, 0.312898, 0.323471, 0.329078, 0.334797, 0.333940, 0.326526, 0.313487, 0.291816, 0.264399, 0.231758, 0.195198, 0.158539, 0.123168, 0.090757, 0.063646, 0.042459, 0.026897, 0.016212, 0.009362, 0.005393, 0.003282, 0.002196, 0.001661, 0.001380, 0.001205, 0.001074, 0.000966, 0.000878, 0.000803, 0.000737, 0.000677, 0.000623, 0.000574, 0.000538, 0.000521, 0.000534, 0.000590, 0.000682, 0.000806, 0.000926, 0.001032, 0.001094, 0.001089, 0.001035, 0.000930, 0.000798, 0.000664, 0.000549, 0.000457, 0.000390, 0.000343, 0.000314, 0.000295, 0.000281, 0.000270, 0.000261, 0.000252, 0.000243, 0.000235, 0.000228, 0.000221, 0.000215, 0.000208, 0.000202, 0.000197, 0.000191, 0.000186, 0.000181, 0.000179, 0.000178, 0.000181, 0.000187, 0.000196, 0.000207, 0.000216, 0.000224, 0.000226, 0.000222, 0.000211, 0.000198, 0.000184, 0.000170, 0.000157, 0.000148, 0.000143, 0.000139, 0.000136, 0.000135, 0.000133, 0.000132, 0.000130, 0.000128, 0.000127, 0.000126, 0.000124, 0.000123, 0.000121, 0.000120, 0.000119, 0.000118, 0.000118, 0.000119, 0.000120, 0.000122, 0.000124, 0.000125, 0.000125, 0.000125, 0.000123, 0.000121, 0.000118, 0.000116, 0.000114, 0.000113, 0.000112, 0.000111, 0.000111, 0.000111, 0.000111, 0.000110, 0.000110, 0.000110, 0.000110, 0.000110, }, { /* wavelet type 6, n_levels 4, high */ 0.003000, 0.003067, 0.003329, 0.004195, 0.007348, 0.016306, 0.034512, 0.059346, 0.084620, 0.099726, 0.103963, 0.097953, 0.088967, 0.079405, 0.069780, 0.058453, 0.046357, 0.033897, 0.023497, 0.015372, 0.009746, 0.005957, 0.003420, 0.001838, 0.001010, 0.000656, 0.000520, 0.000453, 0.000399, 0.000353, 0.000315, 0.000284, 0.000259, 0.000237, 0.000216, 0.000197, 0.000180, 0.000163, 0.000150, 0.000147, 0.000166, 0.000204, 0.000254, 0.000294, 0.000329, 0.000356, 0.000372, 0.000367, 0.000338, 0.000289, 0.000242, 0.000199, 0.000164, 0.000138, 0.000117, 0.000102, 0.000094, 0.000089, 0.000086, 0.000083, 0.000080, 0.000077, 0.000074, 0.000072, 0.000069, 0.000067, 0.000065, 0.000063, 0.000061, 0.000059, 0.000057, 0.000055, 0.000054, 0.000054, 0.000056, 0.000058, 0.000061, 0.000065, 0.000070, 0.000075, 0.000077, 0.000076, 0.000072, 0.000068, 0.000063, 0.000057, 0.000051, 0.000046, 0.000043, 0.000042, 0.000042, 0.000042, 0.000041, 0.000041, 0.000040, 0.000040, 0.000039, 0.000039, 0.000039, 0.000038, 0.000038, 0.000037, 0.000037, 0.000036, 0.000036, 0.000037, 0.000038, 0.000039, 0.000039, 0.000040, 0.000040, 0.000040, 0.000040, 0.000039, 0.000038, 0.000037, 0.000036, 0.000036, 0.000035, 0.000035, 0.000035, 0.000035, 0.000035, 0.000035, 0.000035, 0.000035, 0.000035, 0.000035, }, { /* wavelet type 6, n_levels 4, low */ 0.197961, 0.201233, 0.211686, 0.219771, 0.223845, 0.206688, 0.173137, 0.126964, 0.080694, 0.042246, 0.018833, 0.007556, 0.003440, 0.002116, 0.001581, 0.001257, 0.001034, 0.000865, 0.000728, 0.000644, 0.000674, 0.000818, 0.000966, 0.000984, 0.000850, 0.000646, 0.000490, 0.000403, 0.000358, 0.000327, 0.000300, 0.000276, 0.000257, 0.000239, 0.000223, 0.000208, 0.000197, 0.000194, 0.000201, 0.000209, 0.000209, 0.000194, 0.000173, 0.000156, 0.000146, 0.000139, 0.000133, 0.000126, 0.000121, 0.000116, 0.000111, 0.000106, 0.000104, 0.000103, 0.000103, 0.000101, 0.000097, 0.000092, 0.000088, 0.000085, 0.000082, 0.000080, 0.000078, 0.000075, 0.000073, 0.000071, 0.000069, 0.000067, 0.000066, 0.000064, 0.000063, 0.000063, 0.000062, 0.000061, 0.000059, 0.000057, 0.000056, 0.000055, 0.000054, 0.000053, 0.000052, 0.000051, 0.000050, 0.000049, 0.000048, 0.000049, 0.000050, 0.000050, 0.000050, 0.000048, 0.000046, 0.000045, 0.000044, 0.000044, 0.000043, 0.000043, 0.000043, 0.000042, 0.000042, 0.000041, 0.000041, 0.000041, 0.000041, 0.000041, 0.000041, 0.000041, 0.000040, 0.000039, 0.000039, 0.000039, 0.000039, 0.000039, 0.000038, 0.000038, 0.000038, 0.000038, 0.000038, 0.000038, 0.000038, 0.000038, 0.000038, 0.000038, 0.000038, 0.000038, 0.000038, 0.000038, 0.000038, 0.000038, } } }; const double schro_tables_wavelet_gain[SCHRO_N_WAVELETS][2] = { { 1.33924, 3.31833 }, { 1.42877, 3.03795 }, { 1.30392, 3.31785 }, { 0.992823, 4.03191 }, { 0.991972, 4.02965 }, { 3.71281, 1.13154 }, { 1.564, 2.62481 }, }; #if 0 const int schro_tables_lowdelay_quants[SCHRO_N_WAVELETS][4][9] = { { /* wavelet 0 */ { 5, 3, 0 }, { 8, 6, 3, 3, 0 }, { 11, 8, 6, 6, 3, 3, 0 }, { 14, 11, 9, 8, 6, 6, 3, 3, 0 }, }, { /* wavelet 1 */ { 4, 2, 0 }, { 7, 5, 2, 2, 0 }, { 9, 7, 5, 5, 2, 2, 0 }, { 12, 9, 7, 7, 5, 5, 2, 2, 0 }, }, { /* wavelet 2 */ { 5, 3, 0 }, { 8, 6, 3, 3, 0 }, { 11, 9, 6, 6, 3, 3, 0 }, { 14, 11, 9, 9, 6, 6, 3, 3, 0 }, }, { /* wavelet 3 */ { 8, 4, 0 }, { 16, 12, 8, 4, 0 }, { 24, 20, 16, 12, 8, 4, 0 }, { 32, 28, 24, 20, 16, 12, 8, 4, 0 }, }, { /* wavelet 4 */ { 8, 4, 0 }, { 12, 8, 4, 4, 0 }, { 16, 12, 8, 8, 4, 4, 0 }, { 20, 16, 12, 12, 8, 8, 4, 4, 0 }, }, { /* wavelet 5 */ { 0, 3, 7 }, { 0, 3, 7, 3, 6 }, { 0, 3, 7, 3, 6, 2, 5 }, { 0, 3, 7, 3, 6, 2, 5, 1, 5 }, }, { /* wavelet 6 */ { 3, 1, 0 }, { 5, 3, 2, 1, 0 }, { 6, 5, 3, 3, 2, 1, 0 }, { 8, 6, 5, 5, 3, 3, 2, 1, 0 }, }, }; #endif schroedinger-1.0.11/schroedinger/schrofft.h0000644000175000017500000000112211046356147015635 00000000000000 #ifndef __SCHRO_SCHRO_FFT_H__ #define __SCHRO_SCHRO_FFT_H__ #include SCHRO_BEGIN_DECLS #ifdef SCHRO_ENABLE_UNSTABLE_API void schro_fft_generate_tables_f32 (float *costable, float *sintable, int shift); void schro_fft_fwd_f32 (float *d_real, float *d_imag, const float *s_real, const float *s_imag, const float *costable, const float *sintable, int shift); void schro_fft_rev_f32 (float *d_real, float *d_imag, const float *s_real, const float *s_imag, const float *costable, const float *sintable, int shift); #endif SCHRO_END_DECLS #endif schroedinger-1.0.11/schroedinger/schrofilter.c0000644000175000017500000005772211541755167016364 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #include #include #include static void sort_u8 (uint8_t * d, int n) { int start = 0; int end = n; int i; int x; /* OMG bubble sort! */ while (start < end) { for (i = start; i < end - 1; i++) { if (d[i] > d[i + 1]) { x = d[i]; d[i] = d[i + 1]; d[i + 1] = x; } } end--; for (i = end - 2; i >= start; i--) { if (d[i] > d[i + 1]) { x = d[i]; d[i] = d[i + 1]; d[i + 1] = x; } } start++; } } #ifdef unused /* reference */ void schro_filter_cwmN_ref (uint8_t * d, uint8_t * s1, uint8_t * s2, uint8_t * s3, int n, int weight) { int i; int j; uint8_t list[8 + 12]; for (i = 0; i < n; i++) { list[0] = s1[i + 0]; list[1] = s1[i + 1]; list[2] = s1[i + 2]; list[3] = s2[i + 0]; list[4] = s2[i + 2]; list[5] = s3[i + 0]; list[6] = s3[i + 1]; list[7] = s3[i + 2]; for (j = 0; j < weight; j++) { list[8 + j] = s2[i + 1]; } sort_u8 (list, 8 + weight); d[i] = list[(8 + weight) / 2]; } } #endif void schro_filter_cwmN (uint8_t * d, uint8_t * s1, uint8_t * s2, uint8_t * s3, int n, int weight) { int i; int j; uint8_t list[8 + 12]; int low, hi; for (i = 0; i < n; i++) { list[0] = s1[i + 0]; list[1] = s1[i + 1]; list[2] = s1[i + 2]; list[3] = s2[i + 0]; list[4] = s2[i + 2]; list[5] = s3[i + 0]; list[6] = s3[i + 1]; list[7] = s3[i + 2]; low = 0; hi = 0; for (j = 0; j < 8; j++) { if (list[j] < s2[i + 1]) low++; if (list[j] > s2[i + 1]) hi++; } if (low < ((9 - weight) / 2) || hi < ((9 - weight) / 2)) { for (j = 0; j < weight; j++) { list[8 + j] = s2[i + 1]; } sort_u8 (list, 8 + weight); d[i] = list[(8 + weight) / 2]; } else { d[i] = s2[i + 1]; } } } static void schro_frame_component_filter_cwmN (SchroFrameData * comp, int weight) { int i; uint8_t *tmp; uint8_t *tmp1; uint8_t *tmp2; tmp1 = schro_malloc (comp->width); tmp2 = schro_malloc (comp->width); schro_filter_cwmN (tmp1, OFFSET (comp->data, comp->stride * 0), OFFSET (comp->data, comp->stride * 1), OFFSET (comp->data, comp->stride * 2), comp->width - 2, weight); schro_filter_cwmN (tmp2, OFFSET (comp->data, comp->stride * 1), OFFSET (comp->data, comp->stride * 2), OFFSET (comp->data, comp->stride * 3), comp->width - 2, weight); for (i = 3; i < comp->height - 1; i++) { memcpy (OFFSET (comp->data, comp->stride * (i - 2) + 1), tmp1, comp->width - 2); tmp = tmp1; tmp1 = tmp2; tmp2 = tmp; schro_filter_cwmN (tmp2, OFFSET (comp->data, comp->stride * (i - 1)), OFFSET (comp->data, comp->stride * (i + 0)), OFFSET (comp->data, comp->stride * (i + 1)), comp->width - 2, weight); } memcpy (OFFSET (comp->data, comp->stride * (i - 2) + 1), tmp1, comp->width - 2); memcpy (OFFSET (comp->data, comp->stride * (i - 1) + 1), tmp2, comp->width - 2); schro_free (tmp1); schro_free (tmp2); } void schro_frame_filter_cwmN (SchroFrame * frame, int weight) { schro_frame_component_filter_cwmN (&frame->components[0], weight); schro_frame_component_filter_cwmN (&frame->components[1], weight); schro_frame_component_filter_cwmN (&frame->components[2], weight); } #ifdef unused static void schro_frame_component_filter_cwmN_ref (SchroFrameData * comp, int weight) { int i; uint8_t *tmp; uint8_t *tmp1; uint8_t *tmp2; tmp1 = schro_malloc (comp->width); tmp2 = schro_malloc (comp->width); schro_filter_cwmN_ref (tmp1, OFFSET (comp->data, comp->stride * 0), OFFSET (comp->data, comp->stride * 1), OFFSET (comp->data, comp->stride * 2), comp->width - 2, weight); schro_filter_cwmN_ref (tmp2, OFFSET (comp->data, comp->stride * 1), OFFSET (comp->data, comp->stride * 2), OFFSET (comp->data, comp->stride * 3), comp->width - 2, weight); for (i = 3; i < comp->height - 1; i++) { memcpy (OFFSET (comp->data, comp->stride * (i - 2) + 1), tmp1, comp->width - 2); tmp = tmp1; tmp1 = tmp2; tmp2 = tmp; schro_filter_cwmN_ref (tmp2, OFFSET (comp->data, comp->stride * (i - 1)), OFFSET (comp->data, comp->stride * (i + 0)), OFFSET (comp->data, comp->stride * (i + 1)), comp->width - 2, weight); } memcpy (OFFSET (comp->data, comp->stride * (i - 2) + 1), tmp1, comp->width - 2); memcpy (OFFSET (comp->data, comp->stride * (i - 1) + 1), tmp2, comp->width - 2); schro_free (tmp1); schro_free (tmp2); } #endif #ifdef unused void schro_frame_filter_cwmN_ref (SchroFrame * frame, int weight) { schro_frame_component_filter_cwmN_ref (&frame->components[0], weight); schro_frame_component_filter_cwmN_ref (&frame->components[1], weight); schro_frame_component_filter_cwmN_ref (&frame->components[2], weight); } #endif #if 0 /* reference */ void schro_filter_cwm7 (uint8_t * d, uint8_t * s1, uint8_t * s2, uint8_t * s3, int n) { int i; int min, max; for (i = 0; i < n; i++) { min = MIN (s1[i + 0], s1[i + 1]); max = MAX (s1[i + 0], s1[i + 1]); min = MIN (min, s1[i + 2]); max = MAX (max, s1[i + 2]); min = MIN (min, s2[i + 0]); max = MAX (max, s2[i + 0]); min = MIN (min, s2[i + 2]); max = MAX (max, s2[i + 2]); min = MIN (min, s3[i + 0]); max = MAX (max, s3[i + 0]); min = MIN (min, s3[i + 1]); max = MAX (max, s3[i + 1]); min = MIN (min, s3[i + 2]); max = MAX (max, s3[i + 2]); d[i] = MIN (max, MAX (min, s2[i + 1])); } } #endif #ifdef unused /* FIXME move to schrooil */ void schro_filter_cwm7 (uint8_t * d, uint8_t * s1, uint8_t * s2, uint8_t * s3, int n) { int i; int min, max; for (i = 0; i < n; i++) { if (s1[i + 0] < s2[i + 1]) { max = MAX (s1[i + 0], s1[i + 1]); max = MAX (max, s1[i + 2]); max = MAX (max, s2[i + 0]); max = MAX (max, s2[i + 2]); max = MAX (max, s3[i + 0]); max = MAX (max, s3[i + 1]); max = MAX (max, s3[i + 2]); d[i] = MIN (max, s2[i + 1]); } else if (s1[i + 0] > s2[i + 1]) { min = MIN (s1[i + 0], s1[i + 1]); min = MIN (min, s1[i + 2]); min = MIN (min, s2[i + 0]); min = MIN (min, s2[i + 2]); min = MIN (min, s3[i + 0]); min = MIN (min, s3[i + 1]); min = MIN (min, s3[i + 2]); d[i] = MAX (min, s2[i + 1]); } else { d[i] = s2[i + 1]; } } } #endif #ifdef unused static void schro_frame_component_filter_cwm7 (SchroFrameData * comp) { int i; uint8_t *tmp; uint8_t *tmp1; uint8_t *tmp2; tmp1 = schro_malloc (comp->width); tmp2 = schro_malloc (comp->width); schro_filter_cwm7 (tmp1, OFFSET (comp->data, comp->stride * 0), OFFSET (comp->data, comp->stride * 1), OFFSET (comp->data, comp->stride * 2), comp->width - 2); schro_filter_cwm7 (tmp2, OFFSET (comp->data, comp->stride * 1), OFFSET (comp->data, comp->stride * 2), OFFSET (comp->data, comp->stride * 3), comp->width - 2); for (i = 3; i < comp->height - 1; i++) { memcpy (OFFSET (comp->data, comp->stride * (i - 2) + 1), tmp1, comp->width - 2); tmp = tmp1; tmp1 = tmp2; tmp2 = tmp; schro_filter_cwm7 (tmp2, OFFSET (comp->data, comp->stride * (i - 1)), OFFSET (comp->data, comp->stride * (i + 0)), OFFSET (comp->data, comp->stride * (i + 1)), comp->width - 2); } memcpy (OFFSET (comp->data, comp->stride * (i - 2) + 1), tmp1, comp->width - 2); memcpy (OFFSET (comp->data, comp->stride * (i - 1) + 1), tmp2, comp->width - 2); schro_free (tmp1); schro_free (tmp2); } #endif #ifdef unused void schro_frame_filter_cwm7 (SchroFrame * frame) { schro_frame_component_filter_cwm7 (&frame->components[0]); schro_frame_component_filter_cwm7 (&frame->components[1]); schro_frame_component_filter_cwm7 (&frame->components[2]); } #endif static void lowpass3_h_u8 (SchroFrame *frame, void *_dest, int component, int i) { uint8_t *dest = _dest; uint8_t *src; int tap1, tap2; tap1 = *(int *)frame->virt_priv2; tap2 = 256 - 2*tap1; src = schro_virt_frame_get_line (frame->virt_frame1, component, i); if (component > 0) { memcpy (dest, src, frame->components[component].width); return; } i = 0; dest[i] = (src[i] * tap1 + src[i] * tap2 + src[i+1] * tap1 + 128)>>8; for(i=1;iwidth-1;i++) { dest[i] = (src[i-1] * tap1 + src[i] * tap2 + src[i+1] * tap1 + 128)>>8; } i = frame->width - 1; dest[i] = (src[i-1] * tap1 + src[i] * tap2 + src[i] * tap1 + 128)>>8; } static void lowpass3_v_u8 (SchroFrame *frame, void *_dest, int component, int i) { uint8_t *dest = _dest; uint8_t *src1, *src2, *src3; int tap1, tap2; if (component > 0) { src2 = schro_virt_frame_get_line (frame->virt_frame1, component, i); memcpy (dest, src2, frame->components[component].width); return; } tap1 = *(int *)frame->virt_priv2; tap2 = 256 - 2*tap1; src1 = schro_virt_frame_get_line (frame->virt_frame1, component, CLAMP(i-1,0,frame->height)); src2 = schro_virt_frame_get_line (frame->virt_frame1, component, i); src3 = schro_virt_frame_get_line (frame->virt_frame1, component, CLAMP(i+1,0,frame->height)); for(i=0;iwidth;i++) { dest[i] = (src1[i] * tap1 + src2[i] * tap2 + src3[i] * tap1 + 128)>>8; } } void schro_frame_filter_lowpass (SchroFrame * frame, int tap) { SchroFrame *vf; SchroFrame *vf2; SchroFrame *dup; dup = schro_frame_dup (frame); vf = schro_frame_new_virtual (NULL, frame->format, frame->width, frame->height); vf->virt_frame1 = schro_frame_ref(frame); vf->render_line = lowpass3_h_u8; vf->virt_priv2 = (void *) &tap; vf2 = schro_frame_new_virtual (NULL, frame->format, frame->width, frame->height); vf2->virt_frame1 = vf; vf2->render_line = lowpass3_v_u8; vf2->virt_priv2 = (void *) &tap; schro_virt_frame_render (vf2, dup); schro_frame_convert (frame, dup); schro_frame_unref (vf2); schro_frame_unref (dup); } #ifdef unused static void lowpass_s16 (int16_t * d, int16_t * s, int n) { int i; int j; int x; const int32_t taps[] = { 2, 9, 28, 55, 68, 55, 28, 9, 2, 0 }; const int32_t offsetshift[] = { 128, 8 }; for (i = 0; i < 4; i++) { x = 0; for (j = 0; j < 9; j++) { x += s[CLAMP (i + j - 4, 0, n - 1)] * taps[j]; } d[i] = (x + 128) >> 8; } schro_mas10_s16 (d + 4, s, taps, offsetshift, n - 9); for (i = n - 6; i < n; i++) { x = 0; for (j = 0; j < 9; j++) { x += s[CLAMP (i + j - 4, 0, n - 1)] * taps[j]; } d[i] = (x + 128) >> 8; } } #endif #ifdef unused /* FIXME move to schrooil */ static void lowpass_vert_s16 (int16_t * d, int16_t * s, int n) { int i; int j; int x; static int taps[] = { 2, 9, 28, 55, 68, 55, 28, 9, 2, 0 }; for (i = 0; i < n; i++) { x = 0; for (j = 0; j < 9; j++) { x += s[j * n + i] * taps[j]; } d[i] = (x + 128) >> 8; } } #endif #ifdef unused static void schro_frame_component_filter_lowpass_16 (SchroFrameData * comp) { int i; int16_t *tmp; tmp = schro_malloc (comp->width * 9 * sizeof (int16_t)); lowpass_s16 (tmp + 0 * comp->width, OFFSET (comp->data, comp->stride * 0), comp->width); memcpy (tmp + 1 * comp->width, tmp + 0 * comp->width, comp->width * 2); memcpy (tmp + 2 * comp->width, tmp + 0 * comp->width, comp->width * 2); memcpy (tmp + 3 * comp->width, tmp + 0 * comp->width, comp->width * 2); memcpy (tmp + 4 * comp->width, tmp + 0 * comp->width, comp->width * 2); lowpass_s16 (tmp + 5 * comp->width, OFFSET (comp->data, comp->stride * 1), comp->width); lowpass_s16 (tmp + 6 * comp->width, OFFSET (comp->data, comp->stride * 2), comp->width); lowpass_s16 (tmp + 7 * comp->width, OFFSET (comp->data, comp->stride * 3), comp->width); for (i = 0; i < comp->height; i++) { lowpass_s16 (tmp + 8 * comp->width, OFFSET (comp->data, comp->stride * CLAMP (i + 4, 0, comp->height - 1)), comp->width); lowpass_vert_s16 (OFFSET (comp->data, comp->stride * i), tmp, comp->width); memmove (tmp, tmp + comp->width * 1, comp->width * 8 * sizeof (int16_t)); } schro_free (tmp); } #endif #ifdef unused void schro_frame_filter_lowpass_16 (SchroFrame * frame) { schro_frame_component_filter_lowpass_16 (&frame->components[0]); schro_frame_component_filter_lowpass_16 (&frame->components[1]); schro_frame_component_filter_lowpass_16 (&frame->components[2]); } #endif static void schro_convert_f64_u8 (double *dest, uint8_t * src, int n) { int i; for (i = 0; i < n; i++) { dest[i] = src[i]; } } static void schro_iir3_s16_f64 (int16_t * d, int16_t * s, double *i_3, double *s2_4, int n) { int i; for (i = 0; i < n; i++) { double x; x = s2_4[0] * s[i] + s2_4[1] * i_3[0] + s2_4[2] * i_3[1] + s2_4[3] * i_3[2]; i_3[2] = i_3[1]; i_3[1] = i_3[0]; i_3[0] = x; d[i] = rint (x); } } static void schro_iir3_rev_s16_f64 (int16_t * d, int16_t * s, double *i_3, double *s2_4, int n) { int i; for (i = n - 1; i >= 0; i--) { double x; x = s2_4[0] * s[i] + s2_4[1] * i_3[0] + s2_4[2] * i_3[1] + s2_4[3] * i_3[2]; i_3[2] = i_3[1]; i_3[1] = i_3[0]; i_3[0] = x; d[i] = rint (x); } } static void schro_iir3_across_u8_f64 (uint8_t * d, uint8_t * s, double *i1, double *i2, double *i3, double *s2_4, int n) { int i; for (i = 0; i < n; i++) { double x; x = s2_4[0] * s[i] + s2_4[1] * i1[i] + s2_4[2] * i2[i] + s2_4[3] * i3[i]; i3[i] = i2[i]; i2[i] = i1[i]; i1[i] = x; d[i] = rint (x); } } static void schro_iir3_across_s16_f64 (int16_t * d, int16_t * s, double *i1, double *i2, double *i3, double *s2_4, int n) { int i; for (i = 0; i < n; i++) { double x; x = s2_4[0] * s[i] + s2_4[1] * i1[i] + s2_4[2] * i2[i] + s2_4[3] * i3[i]; i3[i] = i2[i]; i2[i] = i1[i]; i1[i] = x; d[i] = rint (x); } } static void schro_convert_f64_s16 (double *dest, int16_t * src, int n) { int i; for (i = 0; i < n; i++) { dest[i] = src[i]; } } static void schro_iir3_u8_f64 (uint8_t * d, uint8_t * s, double *i_3, double *s2_4, int n) { int i; for (i = 0; i < n; i++) { double x; x = s2_4[0] * s[i] + s2_4[1] * i_3[0] + s2_4[2] * i_3[1] + s2_4[3] * i_3[2]; i_3[2] = i_3[1]; i_3[1] = i_3[0]; i_3[0] = x; d[i] = rint (x); } } static void schro_iir3_rev_u8_f64 (uint8_t * d, uint8_t * s, double *i_3, double *s2_4, int n) { int i; for (i = n - 1; i >= 0; i--) { double x; x = s2_4[0] * s[i] + s2_4[1] * i_3[0] + s2_4[2] * i_3[1] + s2_4[3] * i_3[2]; i_3[2] = i_3[1]; i_3[1] = i_3[0]; i_3[0] = x; d[i] = rint (x); } } static void lowpass2_u8 (uint8_t * d, uint8_t * s, double *coeff, int n) { double state[3]; state[0] = s[0]; state[1] = s[0]; state[2] = s[0]; schro_iir3_u8_f64 (d, s, state, coeff, n); state[0] = d[n - 1]; state[1] = d[n - 1]; state[2] = d[n - 1]; schro_iir3_rev_u8_f64 (d, s, state, coeff, n); } static void lowpass2_s16 (int16_t * d, int16_t * s, double *coeff, int n) { double state[3]; state[0] = s[0]; state[1] = s[0]; state[2] = s[0]; schro_iir3_s16_f64 (d, s, state, coeff, n); state[0] = d[n - 1]; state[1] = d[n - 1]; state[2] = d[n - 1]; schro_iir3_rev_s16_f64 (d, s, state, coeff, n); } static void generate_coeff (double *coeff, double sigma) { double q; double b0, b0inv, b1, b2, b3, B; if (sigma >= 2.5) { q = 0.98711 * sigma - 0.96330; } else { q = 3.97156 - 4.41554 * sqrt (1 - 0.26891 * sigma); } b0 = 1.57825 + 2.44413 * q + 1.4281 * q * q + 0.422205 * q * q * q; b0inv = 1.0 / b0; b1 = 2.44413 * q + 2.85619 * q * q + 1.26661 * q * q * q; b2 = -1.4281 * q * q - 1.26661 * q * q * q; b3 = 0.422205 * q * q * q; B = 1 - (b1 + b2 + b3) / b0; coeff[0] = B; coeff[1] = b1 * b0inv; coeff[2] = b2 * b0inv; coeff[3] = b3 * b0inv; } static void schro_frame_component_filter_lowpass2_u8 (SchroFrameData * comp, double h_sigma, double v_sigma) { int i; double h_coeff[4]; double v_coeff[4]; double *i1, *i2, *i3; generate_coeff (h_coeff, h_sigma); generate_coeff (v_coeff, v_sigma); i1 = schro_malloc (sizeof (double) * comp->width); i2 = schro_malloc (sizeof (double) * comp->width); i3 = schro_malloc (sizeof (double) * comp->width); for (i = 0; i < comp->height; i++) { lowpass2_u8 (OFFSET (comp->data, comp->stride * i), OFFSET (comp->data, comp->stride * i), h_coeff, comp->width); } schro_convert_f64_u8 (i1, OFFSET (comp->data, comp->stride * 0), comp->width); memcpy (i2, i1, sizeof (double) * comp->width); memcpy (i3, i1, sizeof (double) * comp->width); for (i = 0; i < comp->height; i++) { schro_iir3_across_u8_f64 (OFFSET (comp->data, comp->stride * i), OFFSET (comp->data, comp->stride * i), i1, i2, i3, v_coeff, comp->width); } schro_convert_f64_u8 (i1, OFFSET (comp->data, comp->stride * (comp->height - 1)), comp->width); memcpy (i2, i1, sizeof (double) * comp->width); memcpy (i3, i1, sizeof (double) * comp->width); for (i = comp->height - 1; i >= 0; i--) { schro_iir3_across_u8_f64 (OFFSET (comp->data, comp->stride * i), OFFSET (comp->data, comp->stride * i), i1, i2, i3, v_coeff, comp->width); } schro_free (i1); schro_free (i2); schro_free (i3); } static void schro_frame_component_filter_lowpass2_s16 (SchroFrameData * comp, double h_sigma, double v_sigma) { int i; double h_coeff[4]; double v_coeff[4]; double *i1, *i2, *i3; generate_coeff (h_coeff, h_sigma); generate_coeff (v_coeff, v_sigma); i1 = schro_malloc (sizeof (double) * comp->width); i2 = schro_malloc (sizeof (double) * comp->width); i3 = schro_malloc (sizeof (double) * comp->width); for (i = 0; i < comp->height; i++) { lowpass2_s16 (OFFSET (comp->data, comp->stride * i), OFFSET (comp->data, comp->stride * i), h_coeff, comp->width); } schro_convert_f64_s16 (i1, OFFSET (comp->data, comp->stride * 0), comp->width); memcpy (i2, i1, sizeof (double) * comp->width); memcpy (i3, i1, sizeof (double) * comp->width); for (i = 0; i < comp->height; i++) { schro_iir3_across_s16_f64 (OFFSET (comp->data, comp->stride * i), OFFSET (comp->data, comp->stride * i), i1, i2, i3, v_coeff, comp->width); } schro_convert_f64_s16 (i1, OFFSET (comp->data, comp->stride * (comp->height - 1)), comp->width); memcpy (i2, i1, sizeof (double) * comp->width); memcpy (i3, i1, sizeof (double) * comp->width); for (i = comp->height - 1; i >= 0; i--) { schro_iir3_across_s16_f64 (OFFSET (comp->data, comp->stride * i), OFFSET (comp->data, comp->stride * i), i1, i2, i3, v_coeff, comp->width); } schro_free (i1); schro_free (i2); schro_free (i3); } void schro_frame_filter_lowpass2 (SchroFrame * frame, double sigma) { double chroma_sigma_h; double chroma_sigma_v; chroma_sigma_h = sigma / (1 << SCHRO_FRAME_FORMAT_H_SHIFT (frame->format)); chroma_sigma_v = sigma / (1 << SCHRO_FRAME_FORMAT_V_SHIFT (frame->format)); switch (SCHRO_FRAME_FORMAT_DEPTH (frame->format)) { case SCHRO_FRAME_FORMAT_DEPTH_U8: schro_frame_component_filter_lowpass2_u8 (&frame->components[0], sigma, sigma); schro_frame_component_filter_lowpass2_u8 (&frame->components[1], chroma_sigma_h, chroma_sigma_v); schro_frame_component_filter_lowpass2_u8 (&frame->components[2], chroma_sigma_h, chroma_sigma_v); break; case SCHRO_FRAME_FORMAT_DEPTH_S16: schro_frame_component_filter_lowpass2_s16 (&frame->components[0], sigma, sigma); schro_frame_component_filter_lowpass2_s16 (&frame->components[1], chroma_sigma_h, chroma_sigma_v); schro_frame_component_filter_lowpass2_s16 (&frame->components[2], chroma_sigma_h, chroma_sigma_v); break; default: SCHRO_ASSERT (0); break; } } #ifdef unused void schro_frame_filter_wavelet (SchroFrame * frame) { SchroFrame *tmpframe; SchroFrameData *comp; SchroHistogram hist; int component; int16_t *tmp; SchroParams params; int i; tmp = schro_malloc (2 * frame->width * sizeof (int16_t)); tmpframe = schro_frame_new_and_alloc (NULL, SCHRO_FRAME_FORMAT_S16_444 | frame->format, ROUND_UP_POW2 (frame->width, 5), ROUND_UP_POW2 (frame->height, 5)); schro_frame_convert (tmpframe, frame); params.transform_depth = 1; params.iwt_luma_width = frame->width; params.iwt_luma_height = frame->height; params.iwt_chroma_width = frame->components[1].width; params.iwt_chroma_height = frame->components[1].height; for (component = 0; component < 3; component++) { comp = &tmpframe->components[component]; schro_wavelet_transform_2d (comp, SCHRO_WAVELET_LE_GALL_5_3, tmp); for (i = 1; i < 4; i++) { SchroFrameData fd; int y; int cutoff; schro_subband_get_frame_data (&fd, tmpframe, component, i, ¶ms); schro_histogram_init (&hist); for (y = 0; y < fd.height; y++) { schro_histogram_add_array_s16 (&hist, OFFSET (fd.data, y * fd.stride), fd.width); } cutoff = 100; for (y = 0; y < fd.height; y++) { int16_t *line = OFFSET (fd.data, fd.stride * y); int x; for (x = 0; x < fd.width; x++) { if (line[x] > -cutoff && line[x] < cutoff) line[x] = 0; } } } schro_wavelet_inverse_transform_2d (comp, SCHRO_WAVELET_LE_GALL_5_3, tmp); } schro_frame_convert (frame, tmpframe); schro_frame_unref (tmpframe); } #endif static double random_std (void) { double x; double y; while (1) { x = -5.0 + rand () * (1.0 / RAND_MAX) * 10; y = rand () * (1.0 / RAND_MAX); if (y < exp (-x * x * 0.5)) return x; } } static void addnoise_u8 (uint8_t * dest, int n, double sigma) { int i; int x; for (i = 0; i < n; i++) { x = rint (random_std () * sigma) + dest[i]; dest[i] = CLAMP (x, 0, 255); } } static void schro_frame_component_filter_addnoise (SchroFrameData * comp, double sigma) { int i; for (i = 0; i < comp->height; i++) { addnoise_u8 (OFFSET (comp->data, comp->stride * i), comp->width, sigma); } } void schro_frame_filter_addnoise (SchroFrame * frame, double sigma) { schro_frame_component_filter_addnoise (&frame->components[0], sigma); schro_frame_component_filter_addnoise (&frame->components[1], sigma); schro_frame_component_filter_addnoise (&frame->components[2], sigma); } static int ilogx_size (int i) { if (i < (1 << SCHRO_HISTOGRAM_SHIFT)) return 1; return 1 << ((i >> SCHRO_HISTOGRAM_SHIFT) - 1); } static int iexpx (int x) { if (x < (1 << SCHRO_HISTOGRAM_SHIFT)) return x; return ((1 << SCHRO_HISTOGRAM_SHIFT) | (x & ((1 << SCHRO_HISTOGRAM_SHIFT) - 1))) << ((x >> SCHRO_HISTOGRAM_SHIFT) - 1); } void schro_frame_filter_adaptive_lowpass (SchroFrame * frame) { SchroHistogram hist; double slope; SchroFrame *tmp; int16_t tmpdata[2048]; double sigma; int j; int i; tmp = schro_frame_new_and_alloc (NULL, SCHRO_FRAME_FORMAT_S16_444 | frame->format, frame->width, frame->height); schro_frame_convert (tmp, frame); schro_wavelet_transform_2d (&tmp->components[0], SCHRO_WAVELET_LE_GALL_5_3, tmpdata); schro_histogram_init (&hist); for (j = 0; j < tmp->height / 2; j++) { schro_histogram_add_array_s16 (&hist, OFFSET (tmp->components[0].data, tmp->components[0].stride * (2 * j + 1)), tmp->width / 2); } schro_frame_unref (tmp); tmp = NULL; slope = schro_histogram_estimate_slope (&hist); for (i = 0; i < SCHRO_HISTOGRAM_SIZE; i++) { schro_dump (SCHRO_DUMP_HIST_TEST, "%d %g\n", iexpx (i), hist.bins[i] / ilogx_size (i)); } /* good for 2 Mb DVD intra-only rip */ sigma = -1.0 / slope; if (sigma > 1.0) { SCHRO_DEBUG ("enabling filtering (slope %g)", slope); schro_frame_filter_lowpass2 (frame, sigma); } } schroedinger-1.0.11/schroedinger/schrounpack.h0000644000175000017500000000324411556115124016340 00000000000000 #ifndef _SCHRO_UNPACK_H_ #define _SCHRO_UNPACK_H_ #include SCHRO_BEGIN_DECLS typedef struct _SchroUnpack SchroUnpack; struct _SchroUnpack { /* pointer to data that haven't been shifted into the shift register */ uint8_t *data; /* number of bits remaining that haven't been shifted into the shift * register */ int n_bits_left; /* number of bits read by reader */ int n_bits_read; /* chunk of bits we're currently frobbing, aligned to (1<<31) */ uint32_t shift_register; int n_bits_in_shift_register; /* bit pattern used after an error */ unsigned int guard_bit; /* unpacking has overrun the end of the buffer */ int overrun; }; #ifdef SCHRO_ENABLE_UNSTABLE_API void schro_unpack_init_with_data (SchroUnpack *unpack, uint8_t *data, int n_bytes, unsigned int guard_bit); void schro_unpack_copy (SchroUnpack *dest, SchroUnpack *src); int schro_unpack_get_bits_read (SchroUnpack *unpack); int schro_unpack_get_bits_remaining (SchroUnpack *unpack); void schro_unpack_limit_bits_remaining (SchroUnpack *unpack, int n_bits); void schro_unpack_byte_sync (SchroUnpack *unpack); void schro_unpack_skip_bits (SchroUnpack *unpack, int n_bits); unsigned int schro_unpack_decode_bit (SchroUnpack *unpack); unsigned int schro_unpack_decode_bits (SchroUnpack *unpack, int n); unsigned int schro_unpack_decode_uint (SchroUnpack *unpack); int schro_unpack_decode_sint (SchroUnpack *unpack); int schro_unpack_decode_sint_slow (SchroUnpack *unpack); void schro_unpack_decode_sint_s16 (int16_t *dest, SchroUnpack *unpack, int n); void schro_unpack_decode_sint_s32 (int32_t *dest, SchroUnpack *unpack, int n); #endif SCHRO_END_DECLS #endif schroedinger-1.0.11/schroedinger/schrobufferlist.h0000644000175000017500000000176111320237456017230 00000000000000#ifndef __SCHRO_BUFFERLIST_H__ #define __SCHRO_BUFFERLIST_H__ #include #include #include SCHRO_BEGIN_DECLS #ifdef SCHRO_ENABLE_UNSTABLE_API typedef struct _SchroBufferList SchroBufferList; struct _SchroBufferList { /* private */ SchroList *list; unsigned offset; /* stashed tag for use in next extraction */ SchroTag *tag; }; SchroBufferList *schro_buflist_new (void); void schro_buflist_free (SchroBufferList *buflist); void schro_buflist_append (SchroBufferList *buflist, SchroBuffer *buf); int schro_buflist_peekbytes (uint8_t *dst, unsigned len, SchroBufferList *buflist, unsigned offset); int schro_buflist_findbytes (SchroBufferList *buflist, unsigned *start, const uint8_t *needle, unsigned needle_len); void schro_buflist_flush (SchroBufferList *buflist, unsigned amount); SchroBuffer * schro_buflist_extract (SchroBufferList *buflist, unsigned start, unsigned len); #endif SCHRO_END_DECLS #endif schroedinger-1.0.11/schroedinger/schroarith.c0000644000175000017500000004527311541755167016204 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #define SCHRO_ARITH_DEFINE_INLINE #include #include #include #include static const unsigned int next_list[] = { 0, SCHRO_CTX_QUANTISER_CONT, 0, 0, SCHRO_CTX_ZP_F2, SCHRO_CTX_ZP_F2, SCHRO_CTX_ZP_F3, SCHRO_CTX_ZP_F4, SCHRO_CTX_ZP_F5, SCHRO_CTX_ZP_F6p, SCHRO_CTX_ZP_F6p, SCHRO_CTX_NP_F2, SCHRO_CTX_NP_F2, SCHRO_CTX_NP_F3, SCHRO_CTX_NP_F4, SCHRO_CTX_NP_F5, SCHRO_CTX_NP_F6p, SCHRO_CTX_NP_F6p, 0, 0, 0, 0, SCHRO_CTX_SB_F2, SCHRO_CTX_SB_F2, 0, 0, 0, 0, SCHRO_CTX_LUMA_DC_CONT_BIN2, SCHRO_CTX_LUMA_DC_CONT_BIN2, 0, 0, SCHRO_CTX_CHROMA1_DC_CONT_BIN2, SCHRO_CTX_CHROMA1_DC_CONT_BIN2, 0, 0, SCHRO_CTX_CHROMA2_DC_CONT_BIN2, SCHRO_CTX_CHROMA2_DC_CONT_BIN2, 0, 0, SCHRO_CTX_MV_REF1_H_CONT_BIN2, SCHRO_CTX_MV_REF1_H_CONT_BIN3, SCHRO_CTX_MV_REF1_H_CONT_BIN4, SCHRO_CTX_MV_REF1_H_CONT_BIN5, SCHRO_CTX_MV_REF1_H_CONT_BIN5, 0, 0, SCHRO_CTX_MV_REF1_V_CONT_BIN2, SCHRO_CTX_MV_REF1_V_CONT_BIN3, SCHRO_CTX_MV_REF1_V_CONT_BIN4, SCHRO_CTX_MV_REF1_V_CONT_BIN5, SCHRO_CTX_MV_REF1_V_CONT_BIN5, 0, 0, SCHRO_CTX_MV_REF2_H_CONT_BIN2, SCHRO_CTX_MV_REF2_H_CONT_BIN3, SCHRO_CTX_MV_REF2_H_CONT_BIN4, SCHRO_CTX_MV_REF2_H_CONT_BIN5, SCHRO_CTX_MV_REF2_H_CONT_BIN5, 0, 0, SCHRO_CTX_MV_REF2_V_CONT_BIN2, SCHRO_CTX_MV_REF2_V_CONT_BIN3, SCHRO_CTX_MV_REF2_V_CONT_BIN4, SCHRO_CTX_MV_REF2_V_CONT_BIN5, SCHRO_CTX_MV_REF2_V_CONT_BIN5, 0, 0, 0, }; static const uint16_t lut[256] = { //LUT corresponds to window = 16 @ p0=0.5 & 256 @ p=1.0 0, 2, 5, 8, 11, 15, 20, 24, 29, 35, 41, 47, 53, 60, 67, 74, 82, 89, 97, 106, 114, 123, 132, 141, 150, 160, 170, 180, 190, 201, 211, 222, 233, 244, 256, 267, 279, 291, 303, 315, 327, 340, 353, 366, 379, 392, 405, 419, 433, 447, 461, 475, 489, 504, 518, 533, 548, 563, 578, 593, 609, 624, 640, 656, 672, 688, 705, 721, 738, 754, 771, 788, 805, 822, 840, 857, 875, 892, 910, 928, 946, 964, 983, 1001, 1020, 1038, 1057, 1076, 1095, 1114, 1133, 1153, 1172, 1192, 1211, 1231, 1251, 1271, 1291, 1311, 1332, 1352, 1373, 1393, 1414, 1435, 1456, 1477, 1498, 1520, 1541, 1562, 1584, 1606, 1628, 1649, 1671, 1694, 1716, 1738, 1760, 1783, 1806, 1828, 1851, 1874, 1897, 1920, 1935, 1942, 1949, 1955, 1961, 1968, 1974, 1980, 1985, 1991, 1996, 2001, 2006, 2011, 2016, 2021, 2025, 2029, 2033, 2037, 2040, 2044, 2047, 2050, 2053, 2056, 2058, 2061, 2063, 2065, 2066, 2068, 2069, 2070, 2071, 2072, 2072, 2072, 2072, 2072, 2072, 2071, 2070, 2069, 2068, 2066, 2065, 2063, 2060, 2058, 2055, 2052, 2049, 2045, 2042, 2038, 2033, 2029, 2024, 2019, 2013, 2008, 2002, 1996, 1989, 1982, 1975, 1968, 1960, 1952, 1943, 1934, 1925, 1916, 1906, 1896, 1885, 1874, 1863, 1851, 1839, 1827, 1814, 1800, 1786, 1772, 1757, 1742, 1727, 1710, 1694, 1676, 1659, 1640, 1622, 1602, 1582, 1561, 1540, 1518, 1495, 1471, 1447, 1422, 1396, 1369, 1341, 1312, 1282, 1251, 1219, 1186, 1151, 1114, 1077, 1037, 995, 952, 906, 857, 805, 750, 690, 625, 553, 471, 376, 255 }; /* This is a copy of the above lookup-table, with the elements interleaved in a way that decreases the number of operations during decode. */ static const int16_t lut_interleaved[512] = { 255, 0, 376, -2, 471, -5, 553, -8, 625, -11, 690, -15, 750, -20, 805, -24, 857, -29, 906, -35, 952, -41, 995, -47, 1037, -53, 1077, -60, 1114, -67, 1151, -74, 1186, -82, 1219, -89, 1251, -97, 1282, -106, 1312, -114, 1341, -123, 1369, -132, 1396, -141, 1422, -150, 1447, -160, 1471, -170, 1495, -180, 1518, -190, 1540, -201, 1561, -211, 1582, -222, 1602, -233, 1622, -244, 1640, -256, 1659, -267, 1676, -279, 1694, -291, 1710, -303, 1727, -315, 1742, -327, 1757, -340, 1772, -353, 1786, -366, 1800, -379, 1814, -392, 1827, -405, 1839, -419, 1851, -433, 1863, -447, 1874, -461, 1885, -475, 1896, -489, 1906, -504, 1916, -518, 1925, -533, 1934, -548, 1943, -563, 1952, -578, 1960, -593, 1968, -609, 1975, -624, 1982, -640, 1989, -656, 1996, -672, 2002, -688, 2008, -705, 2013, -721, 2019, -738, 2024, -754, 2029, -771, 2033, -788, 2038, -805, 2042, -822, 2045, -840, 2049, -857, 2052, -875, 2055, -892, 2058, -910, 2060, -928, 2063, -946, 2065, -964, 2066, -983, 2068, -1001, 2069, -1020, 2070, -1038, 2071, -1057, 2072, -1076, 2072, -1095, 2072, -1114, 2072, -1133, 2072, -1153, 2072, -1172, 2071, -1192, 2070, -1211, 2069, -1231, 2068, -1251, 2066, -1271, 2065, -1291, 2063, -1311, 2061, -1332, 2058, -1352, 2056, -1373, 2053, -1393, 2050, -1414, 2047, -1435, 2044, -1456, 2040, -1477, 2037, -1498, 2033, -1520, 2029, -1541, 2025, -1562, 2021, -1584, 2016, -1606, 2011, -1628, 2006, -1649, 2001, -1671, 1996, -1694, 1991, -1716, 1985, -1738, 1980, -1760, 1974, -1783, 1968, -1806, 1961, -1828, 1955, -1851, 1949, -1874, 1942, -1897, 1935, -1920, 1920, -1935, 1897, -1942, 1874, -1949, 1851, -1955, 1828, -1961, 1806, -1968, 1783, -1974, 1760, -1980, 1738, -1985, 1716, -1991, 1694, -1996, 1671, -2001, 1649, -2006, 1628, -2011, 1606, -2016, 1584, -2021, 1562, -2025, 1541, -2029, 1520, -2033, 1498, -2037, 1477, -2040, 1456, -2044, 1435, -2047, 1414, -2050, 1393, -2053, 1373, -2056, 1352, -2058, 1332, -2061, 1311, -2063, 1291, -2065, 1271, -2066, 1251, -2068, 1231, -2069, 1211, -2070, 1192, -2071, 1172, -2072, 1153, -2072, 1133, -2072, 1114, -2072, 1095, -2072, 1076, -2072, 1057, -2071, 1038, -2070, 1020, -2069, 1001, -2068, 983, -2066, 964, -2065, 946, -2063, 928, -2060, 910, -2058, 892, -2055, 875, -2052, 857, -2049, 840, -2045, 822, -2042, 805, -2038, 788, -2033, 771, -2029, 754, -2024, 738, -2019, 721, -2013, 705, -2008, 688, -2002, 672, -1996, 656, -1989, 640, -1982, 624, -1975, 609, -1968, 593, -1960, 578, -1952, 563, -1943, 548, -1934, 533, -1925, 518, -1916, 504, -1906, 489, -1896, 475, -1885, 461, -1874, 447, -1863, 433, -1851, 419, -1839, 405, -1827, 392, -1814, 379, -1800, 366, -1786, 353, -1772, 340, -1757, 327, -1742, 315, -1727, 303, -1710, 291, -1694, 279, -1676, 267, -1659, 256, -1640, 244, -1622, 233, -1602, 222, -1582, 211, -1561, 201, -1540, 190, -1518, 180, -1495, 170, -1471, 160, -1447, 150, -1422, 141, -1396, 132, -1369, 123, -1341, 114, -1312, 106, -1282, 97, -1251, 89, -1219, 82, -1186, 74, -1151, 67, -1114, 60, -1077, 53, -1037, 47, -995, 41, -952, 35, -906, 29, -857, 24, -805, 20, -750, 15, -690, 11, -625, 8, -553, 5, -471, 2, -376, 0, -255 }; SchroArith * schro_arith_new (void) { SchroArith *arith; arith = schro_malloc (sizeof (*arith)); return arith; } void schro_arith_free (SchroArith * arith) { schro_free (arith); } void schro_arith_decode_init (SchroArith * arith, SchroBuffer * buffer) { int i; int size; orc_memset (arith, 0, sizeof (SchroArith)); arith->range[0] = 0; arith->range[1] = 0xffff0000; arith->range_size = arith->range[1] - arith->range[0]; arith->code = 0; arith->cntr = 16; arith->buffer = buffer; size = arith->buffer->length; arith->dataptr = arith->buffer->data; arith->code = ((size > 0) ? arith->dataptr[0] : 0xff) << 24; arith->code |= ((size > 1) ? arith->dataptr[1] : 0xff) << 16; arith->code |= ((size > 2) ? arith->dataptr[2] : 0xff) << 8; arith->code |= ((size > 3) ? arith->dataptr[3] : 0xff); arith->offset = 3; for (i = 0; i < SCHRO_CTX_LAST; i++) { arith->contexts[i].next = next_list[i]; arith->probabilities[i] = 0x8000; } orc_memcpy (arith->lut, (void *) lut_interleaved, 512 * sizeof (int16_t)); } void schro_arith_encode_init (SchroArith * arith, SchroBuffer * buffer) { int i; orc_memset (arith, 0, sizeof (SchroArith)); arith->range[0] = 0; arith->range[1] = 0xffff; arith->range_size = arith->range[1] - arith->range[0]; arith->code = 0; arith->buffer = buffer; arith->offset = 0; arith->dataptr = arith->buffer->data; for (i = 0; i < SCHRO_CTX_LAST; i++) { arith->contexts[i].next = next_list[i]; arith->probabilities[i] = 0x8000; } for (i = 0; i < 256; i++) { arith->lut[i] = lut[i]; arith->lut[511 - i] = lut[255 - i]; } } #ifdef unused void schro_arith_estimate_init (SchroArith * arith) { int i; memset (arith, 0, sizeof (SchroArith)); for (i = 0; i < SCHRO_CTX_LAST; i++) { arith->contexts[i].stat_range = 0xffff; arith->contexts[i].next = next_list[i]; arith->probabilities[i] = 0x8000; } } #endif void schro_arith_decode_flush (SchroArith * arith) { if (arith->cntr < 8) { arith->offset++; } } void schro_arith_flush (SchroArith * arith) { int extra_byte; int i; if (arith->cntr > 0) { extra_byte = TRUE; } else { extra_byte = FALSE; } for (i = 0; i < 16; i++) { if ((arith->range[0] | ((1 << (i + 1)) - 1)) > arith->range[1] - 1) break; } arith->range[0] |= ((1 << i) - 1); //arith->range[0] += arith->range[1] - 1; while (arith->cntr < 8) { arith->range[0] <<= 1; arith->range[0] |= 1; arith->cntr++; } if (arith->range[0] >= (1 << 24)) { arith->dataptr[arith->offset - 1]++; while (arith->carry) { arith->dataptr[arith->offset] = 0x00; arith->carry--; arith->offset++; } } else { while (arith->carry) { arith->dataptr[arith->offset] = 0xff; arith->carry--; arith->offset++; } } arith->dataptr[arith->offset] = arith->range[0] >> 16; arith->offset++; arith->dataptr[arith->offset] = arith->range[0] >> 8; arith->offset++; if (extra_byte) { arith->dataptr[arith->offset] = arith->range[0] >> 0; arith->offset++; } while (arith->offset > 1 && arith->dataptr[arith->offset - 1] == 0xff) { arith->offset--; } } #ifndef SCHRO_ARITH_DEFINE_INLINE #define faster #ifdef faster static int __schro_arith_decode_bit (SchroArith * arith, unsigned int i) { unsigned int range_x_prob; int value; int lut_index; range_x_prob = (arith->range[1] * arith->probabilities[i]) >> 16; lut_index = arith->probabilities[i] >> 8; value = (arith->code - arith->range[0] >= range_x_prob); arith->probabilities[i] += arith->lut[(value << 8) | lut_index]; if (value) { arith->range[0] += range_x_prob; arith->range[1] -= range_x_prob; } else { arith->range[1] = range_x_prob; } while (arith->range[1] <= 0x4000) { arith->range[0] <<= 1; arith->range[1] <<= 1; arith->code <<= 1; arith->code |= arith->shift >> (7 - arith->cntr) & 1; if (!--arith->cntr) { arith->offset++; if (arith->offset < arith->buffer->length) { arith->shift = arith->dataptr[arith->offset]; } else { arith->shift = 0xff; } arith->range[0] &= 0xffff; arith->code &= 0xffff; if (arith->code < arith->range[0]) { arith->code |= (1 << 16); } arith->cntr = 8; } } return value; } #else static int __schro_arith_decode_bit (SchroArith * arith, unsigned int i) { unsigned int range; unsigned int probability0; unsigned int range_x_prob; unsigned int count; int value; probability0 = arith->probabilities[i]; count = arith->code - arith->range[0]; range = arith->range[1]; range_x_prob = (range * probability0) >> 16; value = (count >= range_x_prob); if (value) { arith->range[0] = arith->range[0] + range_x_prob; arith->range[1] -= range_x_prob; arith->probabilities[i] -= lut[arith->probabilities[i] >> 8]; } else { arith->range[1] = range_x_prob; arith->probabilities[i] += lut[255 - (arith->probabilities[i] >> 8)]; } while (arith->range[1] <= 0x4000) { arith->range[0] <<= 1; arith->range[1] <<= 1; arith->code <<= 1; arith->code |= (arith->dataptr[arith->offset] >> (7 - arith->cntr)) & 1; if (!--arith->cntr) { arith->offset++; arith->range[0] &= 0xffff; arith->code &= 0xffff; if (arith->code < arith->range[0]) { arith->code |= (1 << 16); } arith->cntr = 8; } } return value; } #endif int _schro_arith_decode_bit (SchroArith * arith, unsigned int i) { return __schro_arith_decode_bit (arith, i); } #endif #ifndef SCHRO_ARITH_DEFINE_INLINE void _schro_arith_encode_bit (SchroArith * arith, int i, int value) { unsigned int range; unsigned int probability0; unsigned int range_x_prob; probability0 = arith->probabilities[i]; range = arith->range[1]; range_x_prob = (range * probability0) >> 16; if (value) { arith->range[0] = arith->range[0] + range_x_prob; arith->range[1] -= range_x_prob; arith->probabilities[i] -= lut[arith->probabilities[i] >> 8]; } else { arith->range[1] = range_x_prob; arith->probabilities[i] += lut[255 - (arith->probabilities[i] >> 8)]; } while (arith->range[1] <= 0x4000) { arith->range[0] <<= 1; arith->range[1] <<= 1; arith->cntr++; if (arith->cntr == 8) { if (arith->range[0] < (1 << 24) && (arith->range[0] + arith->range[1]) >= (1 << 24)) { arith->carry++; } else { if (arith->range[0] >= (1 << 24)) { arith->dataptr[arith->offset - 1]++; while (arith->carry) { arith->dataptr[arith->offset] = 0x00; arith->carry--; arith->offset++; } } else { while (arith->carry) { arith->dataptr[arith->offset] = 0xff; arith->carry--; arith->offset++; } } arith->dataptr[arith->offset] = arith->range[0] >> 16; arith->offset++; } arith->range[0] &= 0xffff; arith->cntr = 0; } } } #endif #ifdef unused void schro_arith_estimate_bit (SchroArith * arith, int i, int value) { unsigned int range; unsigned int probability0; unsigned int range_x_prob; probability0 = arith->probabilities[i]; range = arith->contexts[i].stat_range; range_x_prob = (range * probability0) >> 16; if (value) { arith->contexts[i].stat_range -= range_x_prob; arith->probabilities[i] -= lut[arith->probabilities[i] >> 8]; arith->contexts[i].ones++; } else { arith->contexts[i].stat_range = range_x_prob; arith->probabilities[i] += lut[255 - (arith->probabilities[i] >> 8)]; } arith->contexts[i].n_symbols++; while (arith->contexts[i].stat_range <= 0x4000) { arith->contexts[i].stat_range <<= 1; arith->contexts[i].n_bits++; } } #endif #ifndef SCHRO_ARITH_DEFINE_INLINE static int maxbit (unsigned int x) { int i; for (i = 0; x; i++) { x >>= 1; } return i; } void _schro_arith_encode_uint (SchroArith * arith, int cont_context, int value_context, int value) { int i; int n_bits; value++; n_bits = maxbit (value); for (i = 0; i < n_bits - 1; i++) { _schro_arith_encode_bit (arith, cont_context, 0); _schro_arith_encode_bit (arith, value_context, (value >> (n_bits - 2 - i)) & 1); cont_context = arith->contexts[cont_context].next; } _schro_arith_encode_bit (arith, cont_context, 1); } void _schro_arith_encode_sint (SchroArith * arith, int cont_context, int value_context, int sign_context, int value) { int sign; if (value < 0) { sign = 1; value = -value; } else { sign = 0; } _schro_arith_encode_uint (arith, cont_context, value_context, value); if (value) { _schro_arith_encode_bit (arith, sign_context, sign); } } #endif #ifdef unused void schro_arith_estimate_uint (SchroArith * arith, int cont_context, int value_context, int value) { int i; int n_bits; value++; n_bits = maxbit (value); for (i = 0; i < n_bits - 1; i++) { schro_arith_estimate_bit (arith, cont_context, 0); schro_arith_estimate_bit (arith, value_context, (value >> (n_bits - 2 - i)) & 1); cont_context = arith->contexts[cont_context].next; } schro_arith_estimate_bit (arith, cont_context, 1); } #endif #ifdef unused void schro_arith_estimate_sint (SchroArith * arith, int cont_context, int value_context, int sign_context, int value) { int sign; if (value < 0) { sign = 1; value = -value; } else { sign = 0; } schro_arith_estimate_uint (arith, cont_context, value_context, value); if (value) { schro_arith_estimate_bit (arith, sign_context, sign); } } #endif #ifndef SCHRO_ARITH_DEFINE_INLINE int _schro_arith_decode_uint (SchroArith * arith, unsigned int cont_context, unsigned int value_context) { unsigned int bits = 1; int count = 0; while (!__schro_arith_decode_bit (arith, cont_context)) { bits <<= 1; bits |= __schro_arith_decode_bit (arith, value_context); cont_context = arith->contexts[cont_context].next; count++; /* FIXME being careful */ if (count == 30) break; } return bits - 1; } #endif int _schro_arith_decode_sint (SchroArith * arith, unsigned int cont_context, unsigned int value_context, unsigned int sign_context) { unsigned int bits = 1; int count = 0; int value; while (!_schro_arith_decode_bit (arith, cont_context)) { bits <<= 1; bits |= _schro_arith_decode_bit (arith, value_context); cont_context = arith->contexts[cont_context].next; count++; /* FIXME being careful */ if (count == 30) break; } value = bits - 1; if (value) { if (_schro_arith_decode_bit (arith, sign_context)) { value = -value; } } return value; } /* wrappers */ void schro_arith_encode_bit (SchroArith * arith, int i, int value) { _schro_arith_encode_bit (arith, i, value); } void schro_arith_encode_uint (SchroArith * arith, int cont_context, int value_context, int value) { _schro_arith_encode_uint (arith, cont_context, value_context, value); } void schro_arith_encode_sint (SchroArith * arith, int cont_context, int value_context, int sign_context, int value) { _schro_arith_encode_sint (arith, cont_context, value_context, sign_context, value); } int schro_arith_decode_bit (SchroArith * arith, unsigned int context) { return _schro_arith_decode_bit (arith, context); } int schro_arith_decode_uint (SchroArith * arith, unsigned int cont_context, unsigned int value_context) { return _schro_arith_decode_uint (arith, cont_context, value_context); } int schro_arith_decode_sint (SchroArith * arith, unsigned int cont_context, unsigned int value_context, unsigned int sign_context) { return _schro_arith_decode_sint (arith, cont_context, value_context, sign_context); } schroedinger-1.0.11/schroedinger/schroparams.h0000644000175000017500000000573111556115124016345 00000000000000 #ifndef __SCHRO_PARAMS_H__ #define __SCHRO_PARAMS_H__ #include #include #include #include #include SCHRO_BEGIN_DECLS typedef struct _SchroParams SchroParams; typedef struct _SchroGlobalMotion SchroGlobalMotion; #ifdef SCHRO_ENABLE_UNSTABLE_API struct _SchroGlobalMotion { int b0; int b1; int a_exp; int a00; int a01; int a10; int a11; int c_exp; int c0; int c1; }; struct _SchroParams { /*< private >*/ SchroVideoFormat *video_format; int is_noarith; /* transform parameters */ int wavelet_filter_index; int transform_depth; int horiz_codeblocks[SCHRO_LIMIT_TRANSFORM_DEPTH + 1]; int vert_codeblocks[SCHRO_LIMIT_TRANSFORM_DEPTH + 1]; int codeblock_mode_index; /* motion prediction parameters */ int num_refs; int have_global_motion; /* using_global_motion */ int xblen_luma; int yblen_luma; int xbsep_luma; int ybsep_luma; int mv_precision; SchroGlobalMotion global_motion[2]; int picture_pred_mode; int picture_weight_bits; int picture_weight_1; int picture_weight_2; /* DiracPro parameters */ int is_lowdelay; int n_horiz_slices; /* slices_x */ int n_vert_slices; /* slices_y */ int slice_bytes_num; int slice_bytes_denom; int quant_matrix[3*SCHRO_LIMIT_TRANSFORM_DEPTH+1]; /* calculated sizes */ int iwt_chroma_width; int iwt_chroma_height; int iwt_luma_width; int iwt_luma_height; int x_num_blocks; int y_num_blocks; int x_offset; int y_offset; }; #define SCHRO_SUBBAND_IS_HORIZONTALLY_ORIENTED(position) (((position)&3) == 2) #define SCHRO_SUBBAND_IS_VERTICALLY_ORIENTED(position) (((position)&3) == 1) #define SCHRO_SUBBAND_IS_DIAGONALLY_ORIENTED(position) (((position)&3) == 3) #define SCHRO_SUBBAND_SHIFT(position) ((position)>>2) extern const int schro_tables_lowdelay_quants[7][4][9]; void schro_params_init (SchroParams *params, int video_format); void schro_params_calculate_iwt_sizes (SchroParams *params); void schro_params_calculate_mc_sizes (SchroParams *params); int schro_params_set_block_params (SchroParams *params, int index); int schro_params_get_block_params (SchroParams *params); int schro_params_verify_block_params (SchroParams *params); void schro_params_set_default_codeblock (SchroParams *params); schro_bool schro_params_is_default_codeblock (SchroParams *params); void schro_subband_get_frame_data (SchroFrameData *dest, SchroFrame *frame, int component, int position, SchroParams *params); int schro_subband_get_position (int index); void schro_params_set_default_quant_matrix (SchroParams *params); schro_bool schro_params_is_default_quant_matrix (SchroParams *params); /* FIXME should be SchroFrameFormat */ int schro_params_get_frame_format (int depth, SchroChromaFormat chroma_format); /* FIXME should be moved */ void schro_frame_iwt_transform (SchroFrame *frame, SchroParams *params); #endif SCHRO_END_DECLS #endif schroedinger-1.0.11/schroedinger/schromotion.c0000644000175000017500000002730511556115124016363 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include extern int _schro_motion_ref; SchroMotion * schro_motion_new (SchroParams * params, SchroUpsampledFrame * ref1, SchroUpsampledFrame * ref2) { SchroMotion *motion; motion = schro_malloc0 (sizeof (SchroMotion)); motion->params = params; motion->src1 = ref1; motion->src2 = ref2; motion->motion_vectors = schro_malloc0 (sizeof (SchroMotionVector) * params->x_num_blocks * params->y_num_blocks); motion->tmpdata = schro_malloc (64 * 64 * 3); return motion; } void schro_motion_free (SchroMotion * motion) { schro_free (motion->tmpdata); schro_free (motion->motion_vectors); schro_free (motion); } static int get_ramp (int x, int offset) { if (offset == 1) { if (x == 0) return 3; return 5; } return 1 + (6 * x + offset - 1) / (2 * offset - 1); } void schro_motion_init_obmc_weight (SchroMotion * motion) { int i; int j; int wx, wy; for (i = 0; i < motion->xblen; i++) { if (motion->xoffset == 0) { wx = 8; } else if (i < 2 * motion->xoffset) { wx = get_ramp (i, motion->xoffset); } else if (motion->xblen - 1 - i < 2 * motion->xoffset) { wx = get_ramp (motion->xblen - 1 - i, motion->xoffset); } else { wx = 8; } motion->weight_x[i] = wx; } for (j = 0; j < motion->yblen; j++) { if (motion->yoffset == 0) { wy = 8; } else if (j < 2 * motion->yoffset) { wy = get_ramp (j, motion->yoffset); } else if (motion->yblen - 1 - j < 2 * motion->yoffset) { wy = get_ramp (motion->yblen - 1 - j, motion->yoffset); } else { wy = 8; } motion->weight_y[j] = wy; } for (j = 0; j < motion->yblen; j++) { int16_t *w = SCHRO_FRAME_DATA_GET_LINE (&motion->obmc_weight, j); for (i = 0; i < motion->xblen; i++) { w[i] = motion->weight_x[i] * motion->weight_y[j]; } } } void schro_motion_render (SchroMotion * motion, SchroFrame * dest, SchroFrame * addframe, int add, SchroFrame * output_frame) { SchroParams *params = motion->params; #ifdef ENABLE_MOTION_REF if (_schro_motion_ref) { schro_motion_render_ref (motion, dest, addframe, add, output_frame); return; } #endif if (0 && schro_motion_render_fast_allowed (motion)) { schro_motion_render_fast (motion, dest, addframe, add, output_frame); return; } if (params->have_global_motion) { #ifdef ENABLE_MOTION_REF SCHRO_WARNING ("global motion enabled, using reference motion renderer"); schro_motion_render_ref (motion, dest, addframe, add, output_frame); return; #else SCHRO_ERROR ("global motion enabled, probably will crash"); #endif } { int min_extension; int i; min_extension = motion->src1->frames[0]->extension; for (i = 0; i < 4; i++) { if (motion->src1->frames[i]) { min_extension = MIN (min_extension, motion->src1->frames[i]->extension); } if (motion->src2 && motion->src2->frames[i]) { min_extension = MIN (min_extension, motion->src2->frames[i]->extension); } } if (MAX (params->xblen_luma, params->yblen_luma) > min_extension) { #ifdef ENABLE_MOTION_REF SCHRO_WARNING ("block size (%dx%d) larger than minimum frame extension %d, using reference motion renderer", params->xblen_luma, params->yblen_luma, min_extension); schro_motion_render_ref (motion, dest, addframe, add, output_frame); return; #else SCHRO_ERROR ("block size (%dx%d) larger than minimum frame extension %d, probably will crash", params->xblen_luma, params->yblen_luma, min_extension); #endif } } schro_motion_render_u8 (motion, dest, addframe, add, output_frame); } /* original */ void schro_motion_dc_prediction (SchroMotion * motion, int x, int y, int *pred) { SchroMotionVector *mv; int i; for (i = 0; i < 3; i++) { int sum = 0; int n = 0; if (x > 0) { mv = SCHRO_MOTION_GET_BLOCK (motion, x - 1, y); if (mv->pred_mode == 0) { sum += mv->u.dc.dc[i]; n++; } } if (y > 0) { mv = SCHRO_MOTION_GET_BLOCK (motion, x, y - 1); if (mv->pred_mode == 0) { sum += mv->u.dc.dc[i]; n++; } } if (x > 0 && y > 0) { mv = SCHRO_MOTION_GET_BLOCK (motion, x - 1, y - 1); if (mv->pred_mode == 0) { sum += mv->u.dc.dc[i]; n++; } } switch (n) { case 0: pred[i] = 0; break; case 1: pred[i] = (short) sum; break; case 2: pred[i] = (sum + 1) >> 1; break; case 3: pred[i] = schro_divide3 (sum + 1); break; default: SCHRO_ASSERT (0); } } } int schro_motion_get_global_prediction (SchroMotion * motion, int x, int y) { SchroMotionVector *mv; int sum; if (x == 0 && y == 0) { return 0; } if (y == 0) { mv = SCHRO_MOTION_GET_BLOCK (motion, x - 1, 0); return mv->using_global; } if (x == 0) { mv = SCHRO_MOTION_GET_BLOCK (motion, 0, y - 1); return mv->using_global; } sum = 0; mv = SCHRO_MOTION_GET_BLOCK (motion, x - 1, y); sum += mv->using_global; mv = SCHRO_MOTION_GET_BLOCK (motion, x, y - 1); sum += mv->using_global; mv = SCHRO_MOTION_GET_BLOCK (motion, x - 1, y - 1); sum += mv->using_global; return (sum >= 2); } static int median3 (int a, int b, int c) { if (a < b) { if (b < c) return b; if (c < a) return a; return c; } else { if (a < c) return a; if (c < b) return b; return c; } } void schro_mf_vector_prediction (SchroMotionField * mf, int x, int y, int *pred_x, int *pred_y, int mode) { int x_num_blocks; SchroMotionVector *mv; int vx[3], vy[3]; int n = 0; int ref = mode - 1; SCHRO_ASSERT (mf && pred_x && pred_y); SCHRO_ASSERT (1 == mode || 2 == mode); x_num_blocks = mf->x_num_blocks; if (0 < x) { mv = &mf->motion_vectors[y * x_num_blocks + x - 1]; vx[n] = mv->u.vec.dx[ref]; vy[n] = mv->u.vec.dy[ref]; ++n; } if (0 < y) { mv = &mf->motion_vectors[(y - 1) * x_num_blocks + x]; vx[n] = mv->u.vec.dx[ref]; vy[n] = mv->u.vec.dy[ref]; ++n; } if (0 < x && 0 < y) { mv = &mf->motion_vectors[(y - 1) * x_num_blocks + x - 1]; vx[n] = mv->u.vec.dx[ref]; vy[n] = mv->u.vec.dy[ref]; ++n; } switch (n) { case 0: *pred_x = 0; *pred_y = 0; break; case 1: *pred_x = vx[0]; *pred_y = vy[0]; break; case 2: *pred_x = (vx[0] + vx[1] + 1) >> 1; *pred_y = (vy[0] + vy[1] + 1) >> 1; break; case 3: *pred_x = median3 (vx[0], vx[1], vx[2]); *pred_y = median3 (vy[0], vy[1], vy[2]); break; default: SCHRO_ASSERT (0); } } void schro_motion_vector_prediction (SchroMotion * motion, int x, int y, int *pred_x, int *pred_y, int mode) { SchroMotionVector *mv; int vx[3]; int vy[3]; int n = 0; SCHRO_ASSERT (mode == 1 || mode == 2); if (x > 0) { mv = SCHRO_MOTION_GET_BLOCK (motion, x - 1, y); if (mv->using_global == FALSE && (mv->pred_mode & mode)) { vx[n] = mv->u.vec.dx[mode - 1]; vy[n] = mv->u.vec.dy[mode - 1]; n++; } } if (y > 0) { mv = SCHRO_MOTION_GET_BLOCK (motion, x, y - 1); if (mv->using_global == FALSE && (mv->pred_mode & mode)) { vx[n] = mv->u.vec.dx[mode - 1]; vy[n] = mv->u.vec.dy[mode - 1]; n++; } } if (x > 0 && y > 0) { mv = SCHRO_MOTION_GET_BLOCK (motion, x - 1, y - 1); if (mv->using_global == FALSE && (mv->pred_mode & mode)) { vx[n] = mv->u.vec.dx[mode - 1]; vy[n] = mv->u.vec.dy[mode - 1]; n++; } } switch (n) { case 0: *pred_x = 0; *pred_y = 0; break; case 1: *pred_x = vx[0]; *pred_y = vy[0]; break; case 2: *pred_x = (vx[0] + vx[1] + 1) >> 1; *pred_y = (vy[0] + vy[1] + 1) >> 1; break; case 3: *pred_x = median3 (vx[0], vx[1], vx[2]); *pred_y = median3 (vy[0], vy[1], vy[2]); break; default: SCHRO_ASSERT (0); } } int schro_motion_split_prediction (SchroMotion * motion, int x, int y) { SchroMotionVector *mv; if (y == 0) { if (x == 0) { return 0; } else { mv = SCHRO_MOTION_GET_BLOCK (motion, x - 4, 0); return mv->split; } } else { if (x == 0) { mv = SCHRO_MOTION_GET_BLOCK (motion, x, y - 4); return mv->split; } else { int sum; mv = SCHRO_MOTION_GET_BLOCK (motion, x, y - 4); sum = mv->split; mv = SCHRO_MOTION_GET_BLOCK (motion, x - 4, y); sum += mv->split; mv = SCHRO_MOTION_GET_BLOCK (motion, x - 4, y - 4); sum += mv->split; return (sum + 1) / 3; } } } int schro_motion_get_mode_prediction (SchroMotion * motion, int x, int y) { SchroMotionVector *mv; if (y == 0) { if (x == 0) { return 0; } else { mv = SCHRO_MOTION_GET_BLOCK (motion, x - 1, 0); return mv->pred_mode; } } else { if (x == 0) { mv = SCHRO_MOTION_GET_BLOCK (motion, 0, y - 1); return mv->pred_mode; } else { int a, b, c; mv = SCHRO_MOTION_GET_BLOCK (motion, x - 1, y); a = mv->pred_mode; mv = SCHRO_MOTION_GET_BLOCK (motion, x, y - 1); b = mv->pred_mode; mv = SCHRO_MOTION_GET_BLOCK (motion, x - 1, y - 1); c = mv->pred_mode; return (a & b) | (b & c) | (c & a); } } } int schro_motion_vector_is_equal (SchroMotionVector * a, SchroMotionVector * b) { if (a == b) return 1; return (memcmp (a, b, sizeof (SchroMotionVector)) == 0); } int schro_motion_verify (SchroMotion * motion) { int x, y; SchroMotionVector *mv, *sbmv, *bmv; SchroParams *params = motion->params; if (motion->src1 == NULL) { SCHRO_ERROR ("motion->src1 is NULL"); return 0; } for (y = 0; y < params->y_num_blocks; y++) { for (x = 0; x < params->x_num_blocks; x++) { mv = &motion->motion_vectors[y * params->x_num_blocks + x]; sbmv = &motion->motion_vectors[(y & ~3) * params->x_num_blocks + (x & ~3)]; if (mv->split != sbmv->split) { SCHRO_ERROR ("mv(%d,%d) has the wrong split", x, y); return 0; } switch (sbmv->split) { case 0: if (!schro_motion_vector_is_equal (mv, sbmv)) { SCHRO_ERROR ("mv(%d,%d) not equal to superblock mv", x, y); return 0; } break; case 1: bmv = &motion->motion_vectors[(y & ~1) * params->x_num_blocks + (x & ~1)]; if (!schro_motion_vector_is_equal (mv, bmv)) { SCHRO_ERROR ("mv(%d,%d) not equal to 2-block mv", x, y); return 0; } break; case 2: break; default: SCHRO_ERROR ("mv(%d,%d) had bad split %d", sbmv->split); break; } switch (mv->pred_mode) { case 0: { int i; for (i = 0; i < 3; i++) { /* FIXME 8bit */ if (mv->u.dc.dc[i] < -128 || mv->u.dc.dc[i] > 127) { SCHRO_ERROR ("mv(%d,%d) has bad DC value [%d] %d", x, y, i, mv->u.dc.dc[i]); return 0; } } } break; case 1: break; case 2: case 3: if (motion->params->num_refs < 2) { SCHRO_ERROR ("mv(%d,%d) uses non-existent src2", x, y); return 0; } break; default: SCHRO_ASSERT (0); break; } if (params->have_global_motion == FALSE) { if (mv->using_global) { SCHRO_ERROR ("mv(%d,%d) uses global motion (disabled)", x, y); return 0; } } } } return 1; } schroedinger-1.0.11/schroedinger/schrobufferlist.c0000644000175000017500000001671211541755167017236 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include /** * schro_buflist_new: * * Creates a new (empty) buffer list; this should be freed * using @schro_buflist_free() when nolonger required. * * A buffer list allows: * - extraction of a range of bytes * - searching for a sequence of bytes * From a set of non-contiguous buffers. * * Returns: a new (empty) buffer list. */ SchroBufferList * schro_buflist_new (void) { SchroBufferList *buflist = schro_malloc0 (sizeof (*buflist)); buflist->list = schro_list_new_full ((SchroListFreeFunc) schro_buffer_unref, NULL); buflist->offset = 0; return buflist; } /** * schro_buflist_free: * * Frees resources associated with @buflist@. */ void schro_buflist_free (SchroBufferList * buflist) { if (!buflist) { return; } schro_list_free (buflist->list); if (buflist->tag) schro_tag_free (buflist->tag); schro_free (buflist); } /** * schro_buflist_append: * * Append @buf@ to the end of the buffer list. */ void schro_buflist_append (SchroBufferList * buflist, SchroBuffer * buf) { schro_list_append (buflist->list, buf); } /** * schro_buflist_internal_seek: * * xxx */ static int schro_buflist_internal_seek (SchroBufferList * buflist, unsigned *offset) { int bufidx; /* skip over any discarded (consumed) data at start of buflist */ *offset += buflist->offset; /* find buffer @offset@ starts in */ for (bufidx = 0; bufidx < buflist->list->n; bufidx++) { SchroBuffer *buf = buflist->list->members[bufidx]; if (*offset < buf->length) { /* found */ break; } *offset -= buf->length; } return bufidx; } /** * schro_buflist_peekbytes: * * Extracts @len@ bytes (without marking them as consumed) to be stored * in @dst@ commencing at @offset@ bytes into the buflist. * * NB, @*dst@ must have sufficient storage for @len@ bytes. * * Returns: Number of bytes copied */ int schro_buflist_peekbytes (uint8_t * dst, unsigned len, SchroBufferList * buflist, unsigned offset) { int bufidx; int coppied = 0; if (!dst || !len) { return 0; } bufidx = schro_buflist_internal_seek (buflist, &offset); /* copy out upto len worth of bytes. NB, this may cross * buffer boundries */ for (; bufidx < buflist->list->n; bufidx++) { SchroBuffer *buf = buflist->list->members[bufidx]; unsigned size = MIN (len, buf->length - offset); memcpy (dst + coppied, buf->data + offset, size); offset = 0; coppied += size; len -= size; if (!len) { break; } } return coppied; } /** * schro_buflist_findbytes: * * Searches @buflist@ for @needle_len@ bytes of @needle[]@, commencing at * @*start@. * * if needle is found, @*start@ is updated to contain the offset to the start of the found * needle. * * Returns: non-zero if found */ int schro_buflist_findbytes (SchroBufferList * buflist, unsigned *start, const uint8_t * needle, unsigned needle_len) { SchroBuffer *buf; unsigned bufidx = 0; unsigned where = *start; unsigned offset = *start; unsigned n = 0; unsigned backtrack_bufidx = 0, backtrack_where = 0, backtrack_i = 0; if (!needle || !needle_len) { return 0; } bufidx = schro_buflist_internal_seek (buflist, &offset); /* search for what[], NB this may span multiple buffers */ /* NB, if a search fails, it must be backtracked */ for (; bufidx < buflist->list->n; bufidx++) { /* todo, maybe add memmem call ? */ unsigned i = offset; buf = buflist->list->members[bufidx]; for (; i < buf->length; i++) { if (needle[n] == buf->data[i]) { if (!n) { /* save back tracking point */ backtrack_where = where; backtrack_i = i; backtrack_bufidx = bufidx; } n++; if (n == needle_len) { *start = backtrack_where; return 1; } } else if (n) { n = 0; /* restore backtracking point */ i = backtrack_i; where = backtrack_where; bufidx = backtrack_bufidx; } } where += buf->length - offset; offset = 0; } /* not found */ /* NB, to make it possible to resume a search where this failed, * must move where back by (needle_len-1), but don't go past start */ /* but avoid unsigned wraparound */ if (needle_len <= where) *start = MAX (where - needle_len + 1, *start); return 0; } /** * schro_buflist_flush: * * flushes (consumes) @ammount@ bytes. */ void schro_buflist_flush (SchroBufferList * buflist, unsigned amount) { SchroBuffer *buf; int bufidx = 0; /* include any discarded data at start of buflist */ buflist->offset += amount; /* pop and unref all buffers that end before ammount */ for (bufidx = 0; bufidx < buflist->list->n; bufidx++) { buf = buflist->list->members[bufidx]; if (buflist->offset < buf->length) { /* found */ break; } buflist->offset -= buf->length; schro_list_delete (buflist->list, 0); bufidx--; } } /** * schro_buflist_extract: * * extract @len@ bytes from @buflist@, commencing at @start@; stored * in a SchroBuffer. * * This operation does not flush (consume) any of the buffer list, * call @schro_buflist_flush to do so. * * NB, the returned buffer may be a subbuffer. * * Returns: SchroBuffer* or NULL on failure. */ SchroBuffer * schro_buflist_extract (SchroBufferList * buflist, unsigned start, unsigned len) { SchroBuffer *buf, *dst; SchroTag *tag = NULL; unsigned pos = start; int bufidx; uint8_t tmp; SCHRO_ASSERT (buflist); if (!len) { return NULL; } /* first check that the (start + len)th byte is avaliable */ if (!schro_buflist_peekbytes (&tmp, 1, buflist, start + len - 1)) { return NULL; } /* guaranteed that the range is wholly contained within buflist */ bufidx = schro_buflist_internal_seek (buflist, &pos); SCHRO_ASSERT (bufidx < buflist->list->n); buf = buflist->list->members[bufidx]; /* Semantics for private void* in buffers in a bufferlist: * - Shall be associated with the next dataunit to commence after (or at) * the start of the buffer in the bufferist. * - May only be extracted once. * - If multiple void* could apply to the next dataunit, behaviour is undefined * NB: this implementation will discard all but the first. * - Ownership of the tag is transfered to the output buffer */ if (buflist->tag) { /* take a previously discovered tag */ tag = buflist->tag; buflist->tag = NULL; } else { /* fall back and try to take from the buffer */ tag = buf->tag; buf->tag = NULL; } if (pos + len <= buf->length) { /* Special case, if the requested range is contained within a single * buffer, then use a subbuffer */ dst = schro_buffer_new_subbuffer (buf, pos, len); dst->tag = tag; return dst; } /* dataunit spans multiple buffers */ dst = schro_buffer_new_and_alloc (len); dst->tag = tag; schro_buflist_peekbytes (dst->data, len, buflist, start); /* sort out rescuing the first tag that was in the extracted * region and saving it ready for extraction at start+len. */ len += pos; for (pos = 0; pos < len;) { buf = buflist->list->members[bufidx]; if (!tag) { /* find the first non null tag we come across, take it, * and store in internal state */ buflist->tag = buf->tag; buf->tag = NULL; } pos += buf->length; bufidx++; } return dst; } schroedinger-1.0.11/schroedinger/schrounpacktables.c0000644000175000017500000013135311541755167017544 00000000000000 #include #define X(a,b) (((a)<<4)|(b)) const int16_t schro_table_unpack_sint[1024][10] = { /* 0 */ { X(15,0), }, /* 1 */ { X(15,0), }, /* 2 */ { X(15,10), }, /* 3 */ { X(-15,10), }, /* 4 */ { X(16,0), }, /* 5 */ { X(16,0), }, /* 6 */ { X(16,10), }, /* 7 */ { X(-16,10), }, /* 8 */ { X(7,8), }, /* 9 */ { X(7,8), }, /* 10 */ { X(7,8), X(0,9), }, /* 11 */ { X(7,8), X(0,9), X(0,10), }, /* 12 */ { X(-7,8), }, /* 13 */ { X(-7,8), }, /* 14 */ { X(-7,8), X(0,9), }, /* 15 */ { X(-7,8), X(0,9), X(0,10), }, /* 16 */ { X(17,0), }, /* 17 */ { X(17,0), }, /* 18 */ { X(17,10), }, /* 19 */ { X(-17,10), }, /* 20 */ { X(18,0), }, /* 21 */ { X(18,0), }, /* 22 */ { X(18,10), }, /* 23 */ { X(-18,10), }, /* 24 */ { X(8,8), }, /* 25 */ { X(8,8), }, /* 26 */ { X(8,8), X(0,9), }, /* 27 */ { X(8,8), X(0,9), X(0,10), }, /* 28 */ { X(-8,8), }, /* 29 */ { X(-8,8), }, /* 30 */ { X(-8,8), X(0,9), }, /* 31 */ { X(-8,8), X(0,9), X(0,10), }, /* 32 */ { X(3,6), }, /* 33 */ { X(3,6), }, /* 34 */ { X(3,6), X(1,10), }, /* 35 */ { X(3,6), X(-1,10), }, /* 36 */ { X(3,6), }, /* 37 */ { X(3,6), }, /* 38 */ { X(3,6), X(2,10), }, /* 39 */ { X(3,6), X(-2,10), }, /* 40 */ { X(3,6), X(0,7), }, /* 41 */ { X(3,6), X(0,7), }, /* 42 */ { X(3,6), X(0,7), }, /* 43 */ { X(3,6), X(0,7), }, /* 44 */ { X(3,6), X(0,7), X(0,8), }, /* 45 */ { X(3,6), X(0,7), X(0,8), }, /* 46 */ { X(3,6), X(0,7), X(0,8), X(0,9), }, /* 47 */ { X(3,6), X(0,7), X(0,8), X(0,9), X(0,10), }, /* 48 */ { X(-3,6), }, /* 49 */ { X(-3,6), }, /* 50 */ { X(-3,6), X(1,10), }, /* 51 */ { X(-3,6), X(-1,10), }, /* 52 */ { X(-3,6), }, /* 53 */ { X(-3,6), }, /* 54 */ { X(-3,6), X(2,10), }, /* 55 */ { X(-3,6), X(-2,10), }, /* 56 */ { X(-3,6), X(0,7), }, /* 57 */ { X(-3,6), X(0,7), }, /* 58 */ { X(-3,6), X(0,7), }, /* 59 */ { X(-3,6), X(0,7), }, /* 60 */ { X(-3,6), X(0,7), X(0,8), }, /* 61 */ { X(-3,6), X(0,7), X(0,8), }, /* 62 */ { X(-3,6), X(0,7), X(0,8), X(0,9), }, /* 63 */ { X(-3,6), X(0,7), X(0,8), X(0,9), X(0,10), }, /* 64 */ { X(19,0), }, /* 65 */ { X(19,0), }, /* 66 */ { X(19,10), }, /* 67 */ { X(-19,10), }, /* 68 */ { X(20,0), }, /* 69 */ { X(20,0), }, /* 70 */ { X(20,10), }, /* 71 */ { X(-20,10), }, /* 72 */ { X(9,8), }, /* 73 */ { X(9,8), }, /* 74 */ { X(9,8), X(0,9), }, /* 75 */ { X(9,8), X(0,9), X(0,10), }, /* 76 */ { X(-9,8), }, /* 77 */ { X(-9,8), }, /* 78 */ { X(-9,8), X(0,9), }, /* 79 */ { X(-9,8), X(0,9), X(0,10), }, /* 80 */ { X(21,0), }, /* 81 */ { X(21,0), }, /* 82 */ { X(21,10), }, /* 83 */ { X(-21,10), }, /* 84 */ { X(22,0), }, /* 85 */ { X(22,0), }, /* 86 */ { X(22,10), }, /* 87 */ { X(-22,10), }, /* 88 */ { X(10,8), }, /* 89 */ { X(10,8), }, /* 90 */ { X(10,8), X(0,9), }, /* 91 */ { X(10,8), X(0,9), X(0,10), }, /* 92 */ { X(-10,8), }, /* 93 */ { X(-10,8), }, /* 94 */ { X(-10,8), X(0,9), }, /* 95 */ { X(-10,8), X(0,9), X(0,10), }, /* 96 */ { X(4,6), }, /* 97 */ { X(4,6), }, /* 98 */ { X(4,6), X(1,10), }, /* 99 */ { X(4,6), X(-1,10), }, /* 100 */ { X(4,6), }, /* 101 */ { X(4,6), }, /* 102 */ { X(4,6), X(2,10), }, /* 103 */ { X(4,6), X(-2,10), }, /* 104 */ { X(4,6), X(0,7), }, /* 105 */ { X(4,6), X(0,7), }, /* 106 */ { X(4,6), X(0,7), }, /* 107 */ { X(4,6), X(0,7), }, /* 108 */ { X(4,6), X(0,7), X(0,8), }, /* 109 */ { X(4,6), X(0,7), X(0,8), }, /* 110 */ { X(4,6), X(0,7), X(0,8), X(0,9), }, /* 111 */ { X(4,6), X(0,7), X(0,8), X(0,9), X(0,10), }, /* 112 */ { X(-4,6), }, /* 113 */ { X(-4,6), }, /* 114 */ { X(-4,6), X(1,10), }, /* 115 */ { X(-4,6), X(-1,10), }, /* 116 */ { X(-4,6), }, /* 117 */ { X(-4,6), }, /* 118 */ { X(-4,6), X(2,10), }, /* 119 */ { X(-4,6), X(-2,10), }, /* 120 */ { X(-4,6), X(0,7), }, /* 121 */ { X(-4,6), X(0,7), }, /* 122 */ { X(-4,6), X(0,7), }, /* 123 */ { X(-4,6), X(0,7), }, /* 124 */ { X(-4,6), X(0,7), X(0,8), }, /* 125 */ { X(-4,6), X(0,7), X(0,8), }, /* 126 */ { X(-4,6), X(0,7), X(0,8), X(0,9), }, /* 127 */ { X(-4,6), X(0,7), X(0,8), X(0,9), X(0,10), }, /* 128 */ { X(1,4), }, /* 129 */ { X(1,4), }, /* 130 */ { X(1,4), X(3,10), }, /* 131 */ { X(1,4), X(-3,10), }, /* 132 */ { X(1,4), }, /* 133 */ { X(1,4), }, /* 134 */ { X(1,4), X(4,10), }, /* 135 */ { X(1,4), X(-4,10), }, /* 136 */ { X(1,4), X(1,8), }, /* 137 */ { X(1,4), X(1,8), }, /* 138 */ { X(1,4), X(1,8), X(0,9), }, /* 139 */ { X(1,4), X(1,8), X(0,9), X(0,10), }, /* 140 */ { X(1,4), X(-1,8), }, /* 141 */ { X(1,4), X(-1,8), }, /* 142 */ { X(1,4), X(-1,8), X(0,9), }, /* 143 */ { X(1,4), X(-1,8), X(0,9), X(0,10), }, /* 144 */ { X(1,4), }, /* 145 */ { X(1,4), }, /* 146 */ { X(1,4), X(5,10), }, /* 147 */ { X(1,4), X(-5,10), }, /* 148 */ { X(1,4), }, /* 149 */ { X(1,4), }, /* 150 */ { X(1,4), X(6,10), }, /* 151 */ { X(1,4), X(-6,10), }, /* 152 */ { X(1,4), X(2,8), }, /* 153 */ { X(1,4), X(2,8), }, /* 154 */ { X(1,4), X(2,8), X(0,9), }, /* 155 */ { X(1,4), X(2,8), X(0,9), X(0,10), }, /* 156 */ { X(1,4), X(-2,8), }, /* 157 */ { X(1,4), X(-2,8), }, /* 158 */ { X(1,4), X(-2,8), X(0,9), }, /* 159 */ { X(1,4), X(-2,8), X(0,9), X(0,10), }, /* 160 */ { X(1,4), X(0,5), }, /* 161 */ { X(1,4), X(0,5), }, /* 162 */ { X(1,4), X(0,5), }, /* 163 */ { X(1,4), X(0,5), }, /* 164 */ { X(1,4), X(0,5), X(1,9), }, /* 165 */ { X(1,4), X(0,5), X(1,9), X(0,10), }, /* 166 */ { X(1,4), X(0,5), X(-1,9), }, /* 167 */ { X(1,4), X(0,5), X(-1,9), X(0,10), }, /* 168 */ { X(1,4), X(0,5), }, /* 169 */ { X(1,4), X(0,5), }, /* 170 */ { X(1,4), X(0,5), }, /* 171 */ { X(1,4), X(0,5), }, /* 172 */ { X(1,4), X(0,5), X(2,9), }, /* 173 */ { X(1,4), X(0,5), X(2,9), X(0,10), }, /* 174 */ { X(1,4), X(0,5), X(-2,9), }, /* 175 */ { X(1,4), X(0,5), X(-2,9), X(0,10), }, /* 176 */ { X(1,4), X(0,5), X(0,6), }, /* 177 */ { X(1,4), X(0,5), X(0,6), }, /* 178 */ { X(1,4), X(0,5), X(0,6), X(1,10), }, /* 179 */ { X(1,4), X(0,5), X(0,6), X(-1,10), }, /* 180 */ { X(1,4), X(0,5), X(0,6), }, /* 181 */ { X(1,4), X(0,5), X(0,6), }, /* 182 */ { X(1,4), X(0,5), X(0,6), X(2,10), }, /* 183 */ { X(1,4), X(0,5), X(0,6), X(-2,10), }, /* 184 */ { X(1,4), X(0,5), X(0,6), X(0,7), }, /* 185 */ { X(1,4), X(0,5), X(0,6), X(0,7), }, /* 186 */ { X(1,4), X(0,5), X(0,6), X(0,7), }, /* 187 */ { X(1,4), X(0,5), X(0,6), X(0,7), }, /* 188 */ { X(1,4), X(0,5), X(0,6), X(0,7), X(0,8), }, /* 189 */ { X(1,4), X(0,5), X(0,6), X(0,7), X(0,8), }, /* 190 */ { X(1,4), X(0,5), X(0,6), X(0,7), X(0,8), X(0,9), }, /* 191 */ { X(1,4), X(0,5), X(0,6), X(0,7), X(0,8), X(0,9), X(0,10), }, /* 192 */ { X(-1,4), }, /* 193 */ { X(-1,4), }, /* 194 */ { X(-1,4), X(3,10), }, /* 195 */ { X(-1,4), X(-3,10), }, /* 196 */ { X(-1,4), }, /* 197 */ { X(-1,4), }, /* 198 */ { X(-1,4), X(4,10), }, /* 199 */ { X(-1,4), X(-4,10), }, /* 200 */ { X(-1,4), X(1,8), }, /* 201 */ { X(-1,4), X(1,8), }, /* 202 */ { X(-1,4), X(1,8), X(0,9), }, /* 203 */ { X(-1,4), X(1,8), X(0,9), X(0,10), }, /* 204 */ { X(-1,4), X(-1,8), }, /* 205 */ { X(-1,4), X(-1,8), }, /* 206 */ { X(-1,4), X(-1,8), X(0,9), }, /* 207 */ { X(-1,4), X(-1,8), X(0,9), X(0,10), }, /* 208 */ { X(-1,4), }, /* 209 */ { X(-1,4), }, /* 210 */ { X(-1,4), X(5,10), }, /* 211 */ { X(-1,4), X(-5,10), }, /* 212 */ { X(-1,4), }, /* 213 */ { X(-1,4), }, /* 214 */ { X(-1,4), X(6,10), }, /* 215 */ { X(-1,4), X(-6,10), }, /* 216 */ { X(-1,4), X(2,8), }, /* 217 */ { X(-1,4), X(2,8), }, /* 218 */ { X(-1,4), X(2,8), X(0,9), }, /* 219 */ { X(-1,4), X(2,8), X(0,9), X(0,10), }, /* 220 */ { X(-1,4), X(-2,8), }, /* 221 */ { X(-1,4), X(-2,8), }, /* 222 */ { X(-1,4), X(-2,8), X(0,9), }, /* 223 */ { X(-1,4), X(-2,8), X(0,9), X(0,10), }, /* 224 */ { X(-1,4), X(0,5), }, /* 225 */ { X(-1,4), X(0,5), }, /* 226 */ { X(-1,4), X(0,5), }, /* 227 */ { X(-1,4), X(0,5), }, /* 228 */ { X(-1,4), X(0,5), X(1,9), }, /* 229 */ { X(-1,4), X(0,5), X(1,9), X(0,10), }, /* 230 */ { X(-1,4), X(0,5), X(-1,9), }, /* 231 */ { X(-1,4), X(0,5), X(-1,9), X(0,10), }, /* 232 */ { X(-1,4), X(0,5), }, /* 233 */ { X(-1,4), X(0,5), }, /* 234 */ { X(-1,4), X(0,5), }, /* 235 */ { X(-1,4), X(0,5), }, /* 236 */ { X(-1,4), X(0,5), X(2,9), }, /* 237 */ { X(-1,4), X(0,5), X(2,9), X(0,10), }, /* 238 */ { X(-1,4), X(0,5), X(-2,9), }, /* 239 */ { X(-1,4), X(0,5), X(-2,9), X(0,10), }, /* 240 */ { X(-1,4), X(0,5), X(0,6), }, /* 241 */ { X(-1,4), X(0,5), X(0,6), }, /* 242 */ { X(-1,4), X(0,5), X(0,6), X(1,10), }, /* 243 */ { X(-1,4), X(0,5), X(0,6), X(-1,10), }, /* 244 */ { X(-1,4), X(0,5), X(0,6), }, /* 245 */ { X(-1,4), X(0,5), X(0,6), }, /* 246 */ { X(-1,4), X(0,5), X(0,6), X(2,10), }, /* 247 */ { X(-1,4), X(0,5), X(0,6), X(-2,10), }, /* 248 */ { X(-1,4), X(0,5), X(0,6), X(0,7), }, /* 249 */ { X(-1,4), X(0,5), X(0,6), X(0,7), }, /* 250 */ { X(-1,4), X(0,5), X(0,6), X(0,7), }, /* 251 */ { X(-1,4), X(0,5), X(0,6), X(0,7), }, /* 252 */ { X(-1,4), X(0,5), X(0,6), X(0,7), X(0,8), }, /* 253 */ { X(-1,4), X(0,5), X(0,6), X(0,7), X(0,8), }, /* 254 */ { X(-1,4), X(0,5), X(0,6), X(0,7), X(0,8), X(0,9), }, /* 255 */ { X(-1,4), X(0,5), X(0,6), X(0,7), X(0,8), X(0,9), X(0,10), }, /* 256 */ { X(23,0), }, /* 257 */ { X(23,0), }, /* 258 */ { X(23,10), }, /* 259 */ { X(-23,10), }, /* 260 */ { X(24,0), }, /* 261 */ { X(24,0), }, /* 262 */ { X(24,10), }, /* 263 */ { X(-24,10), }, /* 264 */ { X(11,8), }, /* 265 */ { X(11,8), }, /* 266 */ { X(11,8), X(0,9), }, /* 267 */ { X(11,8), X(0,9), X(0,10), }, /* 268 */ { X(-11,8), }, /* 269 */ { X(-11,8), }, /* 270 */ { X(-11,8), X(0,9), }, /* 271 */ { X(-11,8), X(0,9), X(0,10), }, /* 272 */ { X(25,0), }, /* 273 */ { X(25,0), }, /* 274 */ { X(25,10), }, /* 275 */ { X(-25,10), }, /* 276 */ { X(26,0), }, /* 277 */ { X(26,0), }, /* 278 */ { X(26,10), }, /* 279 */ { X(-26,10), }, /* 280 */ { X(12,8), }, /* 281 */ { X(12,8), }, /* 282 */ { X(12,8), X(0,9), }, /* 283 */ { X(12,8), X(0,9), X(0,10), }, /* 284 */ { X(-12,8), }, /* 285 */ { X(-12,8), }, /* 286 */ { X(-12,8), X(0,9), }, /* 287 */ { X(-12,8), X(0,9), X(0,10), }, /* 288 */ { X(5,6), }, /* 289 */ { X(5,6), }, /* 290 */ { X(5,6), X(1,10), }, /* 291 */ { X(5,6), X(-1,10), }, /* 292 */ { X(5,6), }, /* 293 */ { X(5,6), }, /* 294 */ { X(5,6), X(2,10), }, /* 295 */ { X(5,6), X(-2,10), }, /* 296 */ { X(5,6), X(0,7), }, /* 297 */ { X(5,6), X(0,7), }, /* 298 */ { X(5,6), X(0,7), }, /* 299 */ { X(5,6), X(0,7), }, /* 300 */ { X(5,6), X(0,7), X(0,8), }, /* 301 */ { X(5,6), X(0,7), X(0,8), }, /* 302 */ { X(5,6), X(0,7), X(0,8), X(0,9), }, /* 303 */ { X(5,6), X(0,7), X(0,8), X(0,9), X(0,10), }, /* 304 */ { X(-5,6), }, /* 305 */ { X(-5,6), }, /* 306 */ { X(-5,6), X(1,10), }, /* 307 */ { X(-5,6), X(-1,10), }, /* 308 */ { X(-5,6), }, /* 309 */ { X(-5,6), }, /* 310 */ { X(-5,6), X(2,10), }, /* 311 */ { X(-5,6), X(-2,10), }, /* 312 */ { X(-5,6), X(0,7), }, /* 313 */ { X(-5,6), X(0,7), }, /* 314 */ { X(-5,6), X(0,7), }, /* 315 */ { X(-5,6), X(0,7), }, /* 316 */ { X(-5,6), X(0,7), X(0,8), }, /* 317 */ { X(-5,6), X(0,7), X(0,8), }, /* 318 */ { X(-5,6), X(0,7), X(0,8), X(0,9), }, /* 319 */ { X(-5,6), X(0,7), X(0,8), X(0,9), X(0,10), }, /* 320 */ { X(27,0), }, /* 321 */ { X(27,0), }, /* 322 */ { X(27,10), }, /* 323 */ { X(-27,10), }, /* 324 */ { X(28,0), }, /* 325 */ { X(28,0), }, /* 326 */ { X(28,10), }, /* 327 */ { X(-28,10), }, /* 328 */ { X(13,8), }, /* 329 */ { X(13,8), }, /* 330 */ { X(13,8), X(0,9), }, /* 331 */ { X(13,8), X(0,9), X(0,10), }, /* 332 */ { X(-13,8), }, /* 333 */ { X(-13,8), }, /* 334 */ { X(-13,8), X(0,9), }, /* 335 */ { X(-13,8), X(0,9), X(0,10), }, /* 336 */ { X(29,0), }, /* 337 */ { X(29,0), }, /* 338 */ { X(29,10), }, /* 339 */ { X(-29,10), }, /* 340 */ { X(30,0), }, /* 341 */ { X(30,0), }, /* 342 */ { X(30,10), }, /* 343 */ { X(-30,10), }, /* 344 */ { X(14,8), }, /* 345 */ { X(14,8), }, /* 346 */ { X(14,8), X(0,9), }, /* 347 */ { X(14,8), X(0,9), X(0,10), }, /* 348 */ { X(-14,8), }, /* 349 */ { X(-14,8), }, /* 350 */ { X(-14,8), X(0,9), }, /* 351 */ { X(-14,8), X(0,9), X(0,10), }, /* 352 */ { X(6,6), }, /* 353 */ { X(6,6), }, /* 354 */ { X(6,6), X(1,10), }, /* 355 */ { X(6,6), X(-1,10), }, /* 356 */ { X(6,6), }, /* 357 */ { X(6,6), }, /* 358 */ { X(6,6), X(2,10), }, /* 359 */ { X(6,6), X(-2,10), }, /* 360 */ { X(6,6), X(0,7), }, /* 361 */ { X(6,6), X(0,7), }, /* 362 */ { X(6,6), X(0,7), }, /* 363 */ { X(6,6), X(0,7), }, /* 364 */ { X(6,6), X(0,7), X(0,8), }, /* 365 */ { X(6,6), X(0,7), X(0,8), }, /* 366 */ { X(6,6), X(0,7), X(0,8), X(0,9), }, /* 367 */ { X(6,6), X(0,7), X(0,8), X(0,9), X(0,10), }, /* 368 */ { X(-6,6), }, /* 369 */ { X(-6,6), }, /* 370 */ { X(-6,6), X(1,10), }, /* 371 */ { X(-6,6), X(-1,10), }, /* 372 */ { X(-6,6), }, /* 373 */ { X(-6,6), }, /* 374 */ { X(-6,6), X(2,10), }, /* 375 */ { X(-6,6), X(-2,10), }, /* 376 */ { X(-6,6), X(0,7), }, /* 377 */ { X(-6,6), X(0,7), }, /* 378 */ { X(-6,6), X(0,7), }, /* 379 */ { X(-6,6), X(0,7), }, /* 380 */ { X(-6,6), X(0,7), X(0,8), }, /* 381 */ { X(-6,6), X(0,7), X(0,8), }, /* 382 */ { X(-6,6), X(0,7), X(0,8), X(0,9), }, /* 383 */ { X(-6,6), X(0,7), X(0,8), X(0,9), X(0,10), }, /* 384 */ { X(2,4), }, /* 385 */ { X(2,4), }, /* 386 */ { X(2,4), X(3,10), }, /* 387 */ { X(2,4), X(-3,10), }, /* 388 */ { X(2,4), }, /* 389 */ { X(2,4), }, /* 390 */ { X(2,4), X(4,10), }, /* 391 */ { X(2,4), X(-4,10), }, /* 392 */ { X(2,4), X(1,8), }, /* 393 */ { X(2,4), X(1,8), }, /* 394 */ { X(2,4), X(1,8), X(0,9), }, /* 395 */ { X(2,4), X(1,8), X(0,9), X(0,10), }, /* 396 */ { X(2,4), X(-1,8), }, /* 397 */ { X(2,4), X(-1,8), }, /* 398 */ { X(2,4), X(-1,8), X(0,9), }, /* 399 */ { X(2,4), X(-1,8), X(0,9), X(0,10), }, /* 400 */ { X(2,4), }, /* 401 */ { X(2,4), }, /* 402 */ { X(2,4), X(5,10), }, /* 403 */ { X(2,4), X(-5,10), }, /* 404 */ { X(2,4), }, /* 405 */ { X(2,4), }, /* 406 */ { X(2,4), X(6,10), }, /* 407 */ { X(2,4), X(-6,10), }, /* 408 */ { X(2,4), X(2,8), }, /* 409 */ { X(2,4), X(2,8), }, /* 410 */ { X(2,4), X(2,8), X(0,9), }, /* 411 */ { X(2,4), X(2,8), X(0,9), X(0,10), }, /* 412 */ { X(2,4), X(-2,8), }, /* 413 */ { X(2,4), X(-2,8), }, /* 414 */ { X(2,4), X(-2,8), X(0,9), }, /* 415 */ { X(2,4), X(-2,8), X(0,9), X(0,10), }, /* 416 */ { X(2,4), X(0,5), }, /* 417 */ { X(2,4), X(0,5), }, /* 418 */ { X(2,4), X(0,5), }, /* 419 */ { X(2,4), X(0,5), }, /* 420 */ { X(2,4), X(0,5), X(1,9), }, /* 421 */ { X(2,4), X(0,5), X(1,9), X(0,10), }, /* 422 */ { X(2,4), X(0,5), X(-1,9), }, /* 423 */ { X(2,4), X(0,5), X(-1,9), X(0,10), }, /* 424 */ { X(2,4), X(0,5), }, /* 425 */ { X(2,4), X(0,5), }, /* 426 */ { X(2,4), X(0,5), }, /* 427 */ { X(2,4), X(0,5), }, /* 428 */ { X(2,4), X(0,5), X(2,9), }, /* 429 */ { X(2,4), X(0,5), X(2,9), X(0,10), }, /* 430 */ { X(2,4), X(0,5), X(-2,9), }, /* 431 */ { X(2,4), X(0,5), X(-2,9), X(0,10), }, /* 432 */ { X(2,4), X(0,5), X(0,6), }, /* 433 */ { X(2,4), X(0,5), X(0,6), }, /* 434 */ { X(2,4), X(0,5), X(0,6), X(1,10), }, /* 435 */ { X(2,4), X(0,5), X(0,6), X(-1,10), }, /* 436 */ { X(2,4), X(0,5), X(0,6), }, /* 437 */ { X(2,4), X(0,5), X(0,6), }, /* 438 */ { X(2,4), X(0,5), X(0,6), X(2,10), }, /* 439 */ { X(2,4), X(0,5), X(0,6), X(-2,10), }, /* 440 */ { X(2,4), X(0,5), X(0,6), X(0,7), }, /* 441 */ { X(2,4), X(0,5), X(0,6), X(0,7), }, /* 442 */ { X(2,4), X(0,5), X(0,6), X(0,7), }, /* 443 */ { X(2,4), X(0,5), X(0,6), X(0,7), }, /* 444 */ { X(2,4), X(0,5), X(0,6), X(0,7), X(0,8), }, /* 445 */ { X(2,4), X(0,5), X(0,6), X(0,7), X(0,8), }, /* 446 */ { X(2,4), X(0,5), X(0,6), X(0,7), X(0,8), X(0,9), }, /* 447 */ { X(2,4), X(0,5), X(0,6), X(0,7), X(0,8), X(0,9), X(0,10), }, /* 448 */ { X(-2,4), }, /* 449 */ { X(-2,4), }, /* 450 */ { X(-2,4), X(3,10), }, /* 451 */ { X(-2,4), X(-3,10), }, /* 452 */ { X(-2,4), }, /* 453 */ { X(-2,4), }, /* 454 */ { X(-2,4), X(4,10), }, /* 455 */ { X(-2,4), X(-4,10), }, /* 456 */ { X(-2,4), X(1,8), }, /* 457 */ { X(-2,4), X(1,8), }, /* 458 */ { X(-2,4), X(1,8), X(0,9), }, /* 459 */ { X(-2,4), X(1,8), X(0,9), X(0,10), }, /* 460 */ { X(-2,4), X(-1,8), }, /* 461 */ { X(-2,4), X(-1,8), }, /* 462 */ { X(-2,4), X(-1,8), X(0,9), }, /* 463 */ { X(-2,4), X(-1,8), X(0,9), X(0,10), }, /* 464 */ { X(-2,4), }, /* 465 */ { X(-2,4), }, /* 466 */ { X(-2,4), X(5,10), }, /* 467 */ { X(-2,4), X(-5,10), }, /* 468 */ { X(-2,4), }, /* 469 */ { X(-2,4), }, /* 470 */ { X(-2,4), X(6,10), }, /* 471 */ { X(-2,4), X(-6,10), }, /* 472 */ { X(-2,4), X(2,8), }, /* 473 */ { X(-2,4), X(2,8), }, /* 474 */ { X(-2,4), X(2,8), X(0,9), }, /* 475 */ { X(-2,4), X(2,8), X(0,9), X(0,10), }, /* 476 */ { X(-2,4), X(-2,8), }, /* 477 */ { X(-2,4), X(-2,8), }, /* 478 */ { X(-2,4), X(-2,8), X(0,9), }, /* 479 */ { X(-2,4), X(-2,8), X(0,9), X(0,10), }, /* 480 */ { X(-2,4), X(0,5), }, /* 481 */ { X(-2,4), X(0,5), }, /* 482 */ { X(-2,4), X(0,5), }, /* 483 */ { X(-2,4), X(0,5), }, /* 484 */ { X(-2,4), X(0,5), X(1,9), }, /* 485 */ { X(-2,4), X(0,5), X(1,9), X(0,10), }, /* 486 */ { X(-2,4), X(0,5), X(-1,9), }, /* 487 */ { X(-2,4), X(0,5), X(-1,9), X(0,10), }, /* 488 */ { X(-2,4), X(0,5), }, /* 489 */ { X(-2,4), X(0,5), }, /* 490 */ { X(-2,4), X(0,5), }, /* 491 */ { X(-2,4), X(0,5), }, /* 492 */ { X(-2,4), X(0,5), X(2,9), }, /* 493 */ { X(-2,4), X(0,5), X(2,9), X(0,10), }, /* 494 */ { X(-2,4), X(0,5), X(-2,9), }, /* 495 */ { X(-2,4), X(0,5), X(-2,9), X(0,10), }, /* 496 */ { X(-2,4), X(0,5), X(0,6), }, /* 497 */ { X(-2,4), X(0,5), X(0,6), }, /* 498 */ { X(-2,4), X(0,5), X(0,6), X(1,10), }, /* 499 */ { X(-2,4), X(0,5), X(0,6), X(-1,10), }, /* 500 */ { X(-2,4), X(0,5), X(0,6), }, /* 501 */ { X(-2,4), X(0,5), X(0,6), }, /* 502 */ { X(-2,4), X(0,5), X(0,6), X(2,10), }, /* 503 */ { X(-2,4), X(0,5), X(0,6), X(-2,10), }, /* 504 */ { X(-2,4), X(0,5), X(0,6), X(0,7), }, /* 505 */ { X(-2,4), X(0,5), X(0,6), X(0,7), }, /* 506 */ { X(-2,4), X(0,5), X(0,6), X(0,7), }, /* 507 */ { X(-2,4), X(0,5), X(0,6), X(0,7), }, /* 508 */ { X(-2,4), X(0,5), X(0,6), X(0,7), X(0,8), }, /* 509 */ { X(-2,4), X(0,5), X(0,6), X(0,7), X(0,8), }, /* 510 */ { X(-2,4), X(0,5), X(0,6), X(0,7), X(0,8), X(0,9), }, /* 511 */ { X(-2,4), X(0,5), X(0,6), X(0,7), X(0,8), X(0,9), X(0,10), }, /* 512 */ { X(0,1), }, /* 513 */ { X(0,1), }, /* 514 */ { X(0,1), }, /* 515 */ { X(0,1), }, /* 516 */ { X(0,1), X(7,9), }, /* 517 */ { X(0,1), X(7,9), X(0,10), }, /* 518 */ { X(0,1), X(-7,9), }, /* 519 */ { X(0,1), X(-7,9), X(0,10), }, /* 520 */ { X(0,1), }, /* 521 */ { X(0,1), }, /* 522 */ { X(0,1), }, /* 523 */ { X(0,1), }, /* 524 */ { X(0,1), X(8,9), }, /* 525 */ { X(0,1), X(8,9), X(0,10), }, /* 526 */ { X(0,1), X(-8,9), }, /* 527 */ { X(0,1), X(-8,9), X(0,10), }, /* 528 */ { X(0,1), X(3,7), }, /* 529 */ { X(0,1), X(3,7), }, /* 530 */ { X(0,1), X(3,7), }, /* 531 */ { X(0,1), X(3,7), }, /* 532 */ { X(0,1), X(3,7), X(0,8), }, /* 533 */ { X(0,1), X(3,7), X(0,8), }, /* 534 */ { X(0,1), X(3,7), X(0,8), X(0,9), }, /* 535 */ { X(0,1), X(3,7), X(0,8), X(0,9), X(0,10), }, /* 536 */ { X(0,1), X(-3,7), }, /* 537 */ { X(0,1), X(-3,7), }, /* 538 */ { X(0,1), X(-3,7), }, /* 539 */ { X(0,1), X(-3,7), }, /* 540 */ { X(0,1), X(-3,7), X(0,8), }, /* 541 */ { X(0,1), X(-3,7), X(0,8), }, /* 542 */ { X(0,1), X(-3,7), X(0,8), X(0,9), }, /* 543 */ { X(0,1), X(-3,7), X(0,8), X(0,9), X(0,10), }, /* 544 */ { X(0,1), }, /* 545 */ { X(0,1), }, /* 546 */ { X(0,1), }, /* 547 */ { X(0,1), }, /* 548 */ { X(0,1), X(9,9), }, /* 549 */ { X(0,1), X(9,9), X(0,10), }, /* 550 */ { X(0,1), X(-9,9), }, /* 551 */ { X(0,1), X(-9,9), X(0,10), }, /* 552 */ { X(0,1), }, /* 553 */ { X(0,1), }, /* 554 */ { X(0,1), }, /* 555 */ { X(0,1), }, /* 556 */ { X(0,1), X(10,9), }, /* 557 */ { X(0,1), X(10,9), X(0,10), }, /* 558 */ { X(0,1), X(-10,9), }, /* 559 */ { X(0,1), X(-10,9), X(0,10), }, /* 560 */ { X(0,1), X(4,7), }, /* 561 */ { X(0,1), X(4,7), }, /* 562 */ { X(0,1), X(4,7), }, /* 563 */ { X(0,1), X(4,7), }, /* 564 */ { X(0,1), X(4,7), X(0,8), }, /* 565 */ { X(0,1), X(4,7), X(0,8), }, /* 566 */ { X(0,1), X(4,7), X(0,8), X(0,9), }, /* 567 */ { X(0,1), X(4,7), X(0,8), X(0,9), X(0,10), }, /* 568 */ { X(0,1), X(-4,7), }, /* 569 */ { X(0,1), X(-4,7), }, /* 570 */ { X(0,1), X(-4,7), }, /* 571 */ { X(0,1), X(-4,7), }, /* 572 */ { X(0,1), X(-4,7), X(0,8), }, /* 573 */ { X(0,1), X(-4,7), X(0,8), }, /* 574 */ { X(0,1), X(-4,7), X(0,8), X(0,9), }, /* 575 */ { X(0,1), X(-4,7), X(0,8), X(0,9), X(0,10), }, /* 576 */ { X(0,1), X(1,5), }, /* 577 */ { X(0,1), X(1,5), }, /* 578 */ { X(0,1), X(1,5), }, /* 579 */ { X(0,1), X(1,5), }, /* 580 */ { X(0,1), X(1,5), X(1,9), }, /* 581 */ { X(0,1), X(1,5), X(1,9), X(0,10), }, /* 582 */ { X(0,1), X(1,5), X(-1,9), }, /* 583 */ { X(0,1), X(1,5), X(-1,9), X(0,10), }, /* 584 */ { X(0,1), X(1,5), }, /* 585 */ { X(0,1), X(1,5), }, /* 586 */ { X(0,1), X(1,5), }, /* 587 */ { X(0,1), X(1,5), }, /* 588 */ { X(0,1), X(1,5), X(2,9), }, /* 589 */ { X(0,1), X(1,5), X(2,9), X(0,10), }, /* 590 */ { X(0,1), X(1,5), X(-2,9), }, /* 591 */ { X(0,1), X(1,5), X(-2,9), X(0,10), }, /* 592 */ { X(0,1), X(1,5), X(0,6), }, /* 593 */ { X(0,1), X(1,5), X(0,6), }, /* 594 */ { X(0,1), X(1,5), X(0,6), X(1,10), }, /* 595 */ { X(0,1), X(1,5), X(0,6), X(-1,10), }, /* 596 */ { X(0,1), X(1,5), X(0,6), }, /* 597 */ { X(0,1), X(1,5), X(0,6), }, /* 598 */ { X(0,1), X(1,5), X(0,6), X(2,10), }, /* 599 */ { X(0,1), X(1,5), X(0,6), X(-2,10), }, /* 600 */ { X(0,1), X(1,5), X(0,6), X(0,7), }, /* 601 */ { X(0,1), X(1,5), X(0,6), X(0,7), }, /* 602 */ { X(0,1), X(1,5), X(0,6), X(0,7), }, /* 603 */ { X(0,1), X(1,5), X(0,6), X(0,7), }, /* 604 */ { X(0,1), X(1,5), X(0,6), X(0,7), X(0,8), }, /* 605 */ { X(0,1), X(1,5), X(0,6), X(0,7), X(0,8), }, /* 606 */ { X(0,1), X(1,5), X(0,6), X(0,7), X(0,8), X(0,9), }, /* 607 */ { X(0,1), X(1,5), X(0,6), X(0,7), X(0,8), X(0,9), X(0,10), }, /* 608 */ { X(0,1), X(-1,5), }, /* 609 */ { X(0,1), X(-1,5), }, /* 610 */ { X(0,1), X(-1,5), }, /* 611 */ { X(0,1), X(-1,5), }, /* 612 */ { X(0,1), X(-1,5), X(1,9), }, /* 613 */ { X(0,1), X(-1,5), X(1,9), X(0,10), }, /* 614 */ { X(0,1), X(-1,5), X(-1,9), }, /* 615 */ { X(0,1), X(-1,5), X(-1,9), X(0,10), }, /* 616 */ { X(0,1), X(-1,5), }, /* 617 */ { X(0,1), X(-1,5), }, /* 618 */ { X(0,1), X(-1,5), }, /* 619 */ { X(0,1), X(-1,5), }, /* 620 */ { X(0,1), X(-1,5), X(2,9), }, /* 621 */ { X(0,1), X(-1,5), X(2,9), X(0,10), }, /* 622 */ { X(0,1), X(-1,5), X(-2,9), }, /* 623 */ { X(0,1), X(-1,5), X(-2,9), X(0,10), }, /* 624 */ { X(0,1), X(-1,5), X(0,6), }, /* 625 */ { X(0,1), X(-1,5), X(0,6), }, /* 626 */ { X(0,1), X(-1,5), X(0,6), X(1,10), }, /* 627 */ { X(0,1), X(-1,5), X(0,6), X(-1,10), }, /* 628 */ { X(0,1), X(-1,5), X(0,6), }, /* 629 */ { X(0,1), X(-1,5), X(0,6), }, /* 630 */ { X(0,1), X(-1,5), X(0,6), X(2,10), }, /* 631 */ { X(0,1), X(-1,5), X(0,6), X(-2,10), }, /* 632 */ { X(0,1), X(-1,5), X(0,6), X(0,7), }, /* 633 */ { X(0,1), X(-1,5), X(0,6), X(0,7), }, /* 634 */ { X(0,1), X(-1,5), X(0,6), X(0,7), }, /* 635 */ { X(0,1), X(-1,5), X(0,6), X(0,7), }, /* 636 */ { X(0,1), X(-1,5), X(0,6), X(0,7), X(0,8), }, /* 637 */ { X(0,1), X(-1,5), X(0,6), X(0,7), X(0,8), }, /* 638 */ { X(0,1), X(-1,5), X(0,6), X(0,7), X(0,8), X(0,9), }, /* 639 */ { X(0,1), X(-1,5), X(0,6), X(0,7), X(0,8), X(0,9), X(0,10), }, /* 640 */ { X(0,1), }, /* 641 */ { X(0,1), }, /* 642 */ { X(0,1), }, /* 643 */ { X(0,1), }, /* 644 */ { X(0,1), X(11,9), }, /* 645 */ { X(0,1), X(11,9), X(0,10), }, /* 646 */ { X(0,1), X(-11,9), }, /* 647 */ { X(0,1), X(-11,9), X(0,10), }, /* 648 */ { X(0,1), }, /* 649 */ { X(0,1), }, /* 650 */ { X(0,1), }, /* 651 */ { X(0,1), }, /* 652 */ { X(0,1), X(12,9), }, /* 653 */ { X(0,1), X(12,9), X(0,10), }, /* 654 */ { X(0,1), X(-12,9), }, /* 655 */ { X(0,1), X(-12,9), X(0,10), }, /* 656 */ { X(0,1), X(5,7), }, /* 657 */ { X(0,1), X(5,7), }, /* 658 */ { X(0,1), X(5,7), }, /* 659 */ { X(0,1), X(5,7), }, /* 660 */ { X(0,1), X(5,7), X(0,8), }, /* 661 */ { X(0,1), X(5,7), X(0,8), }, /* 662 */ { X(0,1), X(5,7), X(0,8), X(0,9), }, /* 663 */ { X(0,1), X(5,7), X(0,8), X(0,9), X(0,10), }, /* 664 */ { X(0,1), X(-5,7), }, /* 665 */ { X(0,1), X(-5,7), }, /* 666 */ { X(0,1), X(-5,7), }, /* 667 */ { X(0,1), X(-5,7), }, /* 668 */ { X(0,1), X(-5,7), X(0,8), }, /* 669 */ { X(0,1), X(-5,7), X(0,8), }, /* 670 */ { X(0,1), X(-5,7), X(0,8), X(0,9), }, /* 671 */ { X(0,1), X(-5,7), X(0,8), X(0,9), X(0,10), }, /* 672 */ { X(0,1), }, /* 673 */ { X(0,1), }, /* 674 */ { X(0,1), }, /* 675 */ { X(0,1), }, /* 676 */ { X(0,1), X(13,9), }, /* 677 */ { X(0,1), X(13,9), X(0,10), }, /* 678 */ { X(0,1), X(-13,9), }, /* 679 */ { X(0,1), X(-13,9), X(0,10), }, /* 680 */ { X(0,1), }, /* 681 */ { X(0,1), }, /* 682 */ { X(0,1), }, /* 683 */ { X(0,1), }, /* 684 */ { X(0,1), X(14,9), }, /* 685 */ { X(0,1), X(14,9), X(0,10), }, /* 686 */ { X(0,1), X(-14,9), }, /* 687 */ { X(0,1), X(-14,9), X(0,10), }, /* 688 */ { X(0,1), X(6,7), }, /* 689 */ { X(0,1), X(6,7), }, /* 690 */ { X(0,1), X(6,7), }, /* 691 */ { X(0,1), X(6,7), }, /* 692 */ { X(0,1), X(6,7), X(0,8), }, /* 693 */ { X(0,1), X(6,7), X(0,8), }, /* 694 */ { X(0,1), X(6,7), X(0,8), X(0,9), }, /* 695 */ { X(0,1), X(6,7), X(0,8), X(0,9), X(0,10), }, /* 696 */ { X(0,1), X(-6,7), }, /* 697 */ { X(0,1), X(-6,7), }, /* 698 */ { X(0,1), X(-6,7), }, /* 699 */ { X(0,1), X(-6,7), }, /* 700 */ { X(0,1), X(-6,7), X(0,8), }, /* 701 */ { X(0,1), X(-6,7), X(0,8), }, /* 702 */ { X(0,1), X(-6,7), X(0,8), X(0,9), }, /* 703 */ { X(0,1), X(-6,7), X(0,8), X(0,9), X(0,10), }, /* 704 */ { X(0,1), X(2,5), }, /* 705 */ { X(0,1), X(2,5), }, /* 706 */ { X(0,1), X(2,5), }, /* 707 */ { X(0,1), X(2,5), }, /* 708 */ { X(0,1), X(2,5), X(1,9), }, /* 709 */ { X(0,1), X(2,5), X(1,9), X(0,10), }, /* 710 */ { X(0,1), X(2,5), X(-1,9), }, /* 711 */ { X(0,1), X(2,5), X(-1,9), X(0,10), }, /* 712 */ { X(0,1), X(2,5), }, /* 713 */ { X(0,1), X(2,5), }, /* 714 */ { X(0,1), X(2,5), }, /* 715 */ { X(0,1), X(2,5), }, /* 716 */ { X(0,1), X(2,5), X(2,9), }, /* 717 */ { X(0,1), X(2,5), X(2,9), X(0,10), }, /* 718 */ { X(0,1), X(2,5), X(-2,9), }, /* 719 */ { X(0,1), X(2,5), X(-2,9), X(0,10), }, /* 720 */ { X(0,1), X(2,5), X(0,6), }, /* 721 */ { X(0,1), X(2,5), X(0,6), }, /* 722 */ { X(0,1), X(2,5), X(0,6), X(1,10), }, /* 723 */ { X(0,1), X(2,5), X(0,6), X(-1,10), }, /* 724 */ { X(0,1), X(2,5), X(0,6), }, /* 725 */ { X(0,1), X(2,5), X(0,6), }, /* 726 */ { X(0,1), X(2,5), X(0,6), X(2,10), }, /* 727 */ { X(0,1), X(2,5), X(0,6), X(-2,10), }, /* 728 */ { X(0,1), X(2,5), X(0,6), X(0,7), }, /* 729 */ { X(0,1), X(2,5), X(0,6), X(0,7), }, /* 730 */ { X(0,1), X(2,5), X(0,6), X(0,7), }, /* 731 */ { X(0,1), X(2,5), X(0,6), X(0,7), }, /* 732 */ { X(0,1), X(2,5), X(0,6), X(0,7), X(0,8), }, /* 733 */ { X(0,1), X(2,5), X(0,6), X(0,7), X(0,8), }, /* 734 */ { X(0,1), X(2,5), X(0,6), X(0,7), X(0,8), X(0,9), }, /* 735 */ { X(0,1), X(2,5), X(0,6), X(0,7), X(0,8), X(0,9), X(0,10), }, /* 736 */ { X(0,1), X(-2,5), }, /* 737 */ { X(0,1), X(-2,5), }, /* 738 */ { X(0,1), X(-2,5), }, /* 739 */ { X(0,1), X(-2,5), }, /* 740 */ { X(0,1), X(-2,5), X(1,9), }, /* 741 */ { X(0,1), X(-2,5), X(1,9), X(0,10), }, /* 742 */ { X(0,1), X(-2,5), X(-1,9), }, /* 743 */ { X(0,1), X(-2,5), X(-1,9), X(0,10), }, /* 744 */ { X(0,1), X(-2,5), }, /* 745 */ { X(0,1), X(-2,5), }, /* 746 */ { X(0,1), X(-2,5), }, /* 747 */ { X(0,1), X(-2,5), }, /* 748 */ { X(0,1), X(-2,5), X(2,9), }, /* 749 */ { X(0,1), X(-2,5), X(2,9), X(0,10), }, /* 750 */ { X(0,1), X(-2,5), X(-2,9), }, /* 751 */ { X(0,1), X(-2,5), X(-2,9), X(0,10), }, /* 752 */ { X(0,1), X(-2,5), X(0,6), }, /* 753 */ { X(0,1), X(-2,5), X(0,6), }, /* 754 */ { X(0,1), X(-2,5), X(0,6), X(1,10), }, /* 755 */ { X(0,1), X(-2,5), X(0,6), X(-1,10), }, /* 756 */ { X(0,1), X(-2,5), X(0,6), }, /* 757 */ { X(0,1), X(-2,5), X(0,6), }, /* 758 */ { X(0,1), X(-2,5), X(0,6), X(2,10), }, /* 759 */ { X(0,1), X(-2,5), X(0,6), X(-2,10), }, /* 760 */ { X(0,1), X(-2,5), X(0,6), X(0,7), }, /* 761 */ { X(0,1), X(-2,5), X(0,6), X(0,7), }, /* 762 */ { X(0,1), X(-2,5), X(0,6), X(0,7), }, /* 763 */ { X(0,1), X(-2,5), X(0,6), X(0,7), }, /* 764 */ { X(0,1), X(-2,5), X(0,6), X(0,7), X(0,8), }, /* 765 */ { X(0,1), X(-2,5), X(0,6), X(0,7), X(0,8), }, /* 766 */ { X(0,1), X(-2,5), X(0,6), X(0,7), X(0,8), X(0,9), }, /* 767 */ { X(0,1), X(-2,5), X(0,6), X(0,7), X(0,8), X(0,9), X(0,10), }, /* 768 */ { X(0,1), X(0,2), }, /* 769 */ { X(0,1), X(0,2), }, /* 770 */ { X(0,1), X(0,2), X(7,10), }, /* 771 */ { X(0,1), X(0,2), X(-7,10), }, /* 772 */ { X(0,1), X(0,2), }, /* 773 */ { X(0,1), X(0,2), }, /* 774 */ { X(0,1), X(0,2), X(8,10), }, /* 775 */ { X(0,1), X(0,2), X(-8,10), }, /* 776 */ { X(0,1), X(0,2), X(3,8), }, /* 777 */ { X(0,1), X(0,2), X(3,8), }, /* 778 */ { X(0,1), X(0,2), X(3,8), X(0,9), }, /* 779 */ { X(0,1), X(0,2), X(3,8), X(0,9), X(0,10), }, /* 780 */ { X(0,1), X(0,2), X(-3,8), }, /* 781 */ { X(0,1), X(0,2), X(-3,8), }, /* 782 */ { X(0,1), X(0,2), X(-3,8), X(0,9), }, /* 783 */ { X(0,1), X(0,2), X(-3,8), X(0,9), X(0,10), }, /* 784 */ { X(0,1), X(0,2), }, /* 785 */ { X(0,1), X(0,2), }, /* 786 */ { X(0,1), X(0,2), X(9,10), }, /* 787 */ { X(0,1), X(0,2), X(-9,10), }, /* 788 */ { X(0,1), X(0,2), }, /* 789 */ { X(0,1), X(0,2), }, /* 790 */ { X(0,1), X(0,2), X(10,10), }, /* 791 */ { X(0,1), X(0,2), X(-10,10), }, /* 792 */ { X(0,1), X(0,2), X(4,8), }, /* 793 */ { X(0,1), X(0,2), X(4,8), }, /* 794 */ { X(0,1), X(0,2), X(4,8), X(0,9), }, /* 795 */ { X(0,1), X(0,2), X(4,8), X(0,9), X(0,10), }, /* 796 */ { X(0,1), X(0,2), X(-4,8), }, /* 797 */ { X(0,1), X(0,2), X(-4,8), }, /* 798 */ { X(0,1), X(0,2), X(-4,8), X(0,9), }, /* 799 */ { X(0,1), X(0,2), X(-4,8), X(0,9), X(0,10), }, /* 800 */ { X(0,1), X(0,2), X(1,6), }, /* 801 */ { X(0,1), X(0,2), X(1,6), }, /* 802 */ { X(0,1), X(0,2), X(1,6), X(1,10), }, /* 803 */ { X(0,1), X(0,2), X(1,6), X(-1,10), }, /* 804 */ { X(0,1), X(0,2), X(1,6), }, /* 805 */ { X(0,1), X(0,2), X(1,6), }, /* 806 */ { X(0,1), X(0,2), X(1,6), X(2,10), }, /* 807 */ { X(0,1), X(0,2), X(1,6), X(-2,10), }, /* 808 */ { X(0,1), X(0,2), X(1,6), X(0,7), }, /* 809 */ { X(0,1), X(0,2), X(1,6), X(0,7), }, /* 810 */ { X(0,1), X(0,2), X(1,6), X(0,7), }, /* 811 */ { X(0,1), X(0,2), X(1,6), X(0,7), }, /* 812 */ { X(0,1), X(0,2), X(1,6), X(0,7), X(0,8), }, /* 813 */ { X(0,1), X(0,2), X(1,6), X(0,7), X(0,8), }, /* 814 */ { X(0,1), X(0,2), X(1,6), X(0,7), X(0,8), X(0,9), }, /* 815 */ { X(0,1), X(0,2), X(1,6), X(0,7), X(0,8), X(0,9), X(0,10), }, /* 816 */ { X(0,1), X(0,2), X(-1,6), }, /* 817 */ { X(0,1), X(0,2), X(-1,6), }, /* 818 */ { X(0,1), X(0,2), X(-1,6), X(1,10), }, /* 819 */ { X(0,1), X(0,2), X(-1,6), X(-1,10), }, /* 820 */ { X(0,1), X(0,2), X(-1,6), }, /* 821 */ { X(0,1), X(0,2), X(-1,6), }, /* 822 */ { X(0,1), X(0,2), X(-1,6), X(2,10), }, /* 823 */ { X(0,1), X(0,2), X(-1,6), X(-2,10), }, /* 824 */ { X(0,1), X(0,2), X(-1,6), X(0,7), }, /* 825 */ { X(0,1), X(0,2), X(-1,6), X(0,7), }, /* 826 */ { X(0,1), X(0,2), X(-1,6), X(0,7), }, /* 827 */ { X(0,1), X(0,2), X(-1,6), X(0,7), }, /* 828 */ { X(0,1), X(0,2), X(-1,6), X(0,7), X(0,8), }, /* 829 */ { X(0,1), X(0,2), X(-1,6), X(0,7), X(0,8), }, /* 830 */ { X(0,1), X(0,2), X(-1,6), X(0,7), X(0,8), X(0,9), }, /* 831 */ { X(0,1), X(0,2), X(-1,6), X(0,7), X(0,8), X(0,9), X(0,10), }, /* 832 */ { X(0,1), X(0,2), }, /* 833 */ { X(0,1), X(0,2), }, /* 834 */ { X(0,1), X(0,2), X(11,10), }, /* 835 */ { X(0,1), X(0,2), X(-11,10), }, /* 836 */ { X(0,1), X(0,2), }, /* 837 */ { X(0,1), X(0,2), }, /* 838 */ { X(0,1), X(0,2), X(12,10), }, /* 839 */ { X(0,1), X(0,2), X(-12,10), }, /* 840 */ { X(0,1), X(0,2), X(5,8), }, /* 841 */ { X(0,1), X(0,2), X(5,8), }, /* 842 */ { X(0,1), X(0,2), X(5,8), X(0,9), }, /* 843 */ { X(0,1), X(0,2), X(5,8), X(0,9), X(0,10), }, /* 844 */ { X(0,1), X(0,2), X(-5,8), }, /* 845 */ { X(0,1), X(0,2), X(-5,8), }, /* 846 */ { X(0,1), X(0,2), X(-5,8), X(0,9), }, /* 847 */ { X(0,1), X(0,2), X(-5,8), X(0,9), X(0,10), }, /* 848 */ { X(0,1), X(0,2), }, /* 849 */ { X(0,1), X(0,2), }, /* 850 */ { X(0,1), X(0,2), X(13,10), }, /* 851 */ { X(0,1), X(0,2), X(-13,10), }, /* 852 */ { X(0,1), X(0,2), }, /* 853 */ { X(0,1), X(0,2), }, /* 854 */ { X(0,1), X(0,2), X(14,10), }, /* 855 */ { X(0,1), X(0,2), X(-14,10), }, /* 856 */ { X(0,1), X(0,2), X(6,8), }, /* 857 */ { X(0,1), X(0,2), X(6,8), }, /* 858 */ { X(0,1), X(0,2), X(6,8), X(0,9), }, /* 859 */ { X(0,1), X(0,2), X(6,8), X(0,9), X(0,10), }, /* 860 */ { X(0,1), X(0,2), X(-6,8), }, /* 861 */ { X(0,1), X(0,2), X(-6,8), }, /* 862 */ { X(0,1), X(0,2), X(-6,8), X(0,9), }, /* 863 */ { X(0,1), X(0,2), X(-6,8), X(0,9), X(0,10), }, /* 864 */ { X(0,1), X(0,2), X(2,6), }, /* 865 */ { X(0,1), X(0,2), X(2,6), }, /* 866 */ { X(0,1), X(0,2), X(2,6), X(1,10), }, /* 867 */ { X(0,1), X(0,2), X(2,6), X(-1,10), }, /* 868 */ { X(0,1), X(0,2), X(2,6), }, /* 869 */ { X(0,1), X(0,2), X(2,6), }, /* 870 */ { X(0,1), X(0,2), X(2,6), X(2,10), }, /* 871 */ { X(0,1), X(0,2), X(2,6), X(-2,10), }, /* 872 */ { X(0,1), X(0,2), X(2,6), X(0,7), }, /* 873 */ { X(0,1), X(0,2), X(2,6), X(0,7), }, /* 874 */ { X(0,1), X(0,2), X(2,6), X(0,7), }, /* 875 */ { X(0,1), X(0,2), X(2,6), X(0,7), }, /* 876 */ { X(0,1), X(0,2), X(2,6), X(0,7), X(0,8), }, /* 877 */ { X(0,1), X(0,2), X(2,6), X(0,7), X(0,8), }, /* 878 */ { X(0,1), X(0,2), X(2,6), X(0,7), X(0,8), X(0,9), }, /* 879 */ { X(0,1), X(0,2), X(2,6), X(0,7), X(0,8), X(0,9), X(0,10), }, /* 880 */ { X(0,1), X(0,2), X(-2,6), }, /* 881 */ { X(0,1), X(0,2), X(-2,6), }, /* 882 */ { X(0,1), X(0,2), X(-2,6), X(1,10), }, /* 883 */ { X(0,1), X(0,2), X(-2,6), X(-1,10), }, /* 884 */ { X(0,1), X(0,2), X(-2,6), }, /* 885 */ { X(0,1), X(0,2), X(-2,6), }, /* 886 */ { X(0,1), X(0,2), X(-2,6), X(2,10), }, /* 887 */ { X(0,1), X(0,2), X(-2,6), X(-2,10), }, /* 888 */ { X(0,1), X(0,2), X(-2,6), X(0,7), }, /* 889 */ { X(0,1), X(0,2), X(-2,6), X(0,7), }, /* 890 */ { X(0,1), X(0,2), X(-2,6), X(0,7), }, /* 891 */ { X(0,1), X(0,2), X(-2,6), X(0,7), }, /* 892 */ { X(0,1), X(0,2), X(-2,6), X(0,7), X(0,8), }, /* 893 */ { X(0,1), X(0,2), X(-2,6), X(0,7), X(0,8), }, /* 894 */ { X(0,1), X(0,2), X(-2,6), X(0,7), X(0,8), X(0,9), }, /* 895 */ { X(0,1), X(0,2), X(-2,6), X(0,7), X(0,8), X(0,9), X(0,10), }, /* 896 */ { X(0,1), X(0,2), X(0,3), }, /* 897 */ { X(0,1), X(0,2), X(0,3), }, /* 898 */ { X(0,1), X(0,2), X(0,3), }, /* 899 */ { X(0,1), X(0,2), X(0,3), }, /* 900 */ { X(0,1), X(0,2), X(0,3), X(3,9), }, /* 901 */ { X(0,1), X(0,2), X(0,3), X(3,9), X(0,10), }, /* 902 */ { X(0,1), X(0,2), X(0,3), X(-3,9), }, /* 903 */ { X(0,1), X(0,2), X(0,3), X(-3,9), X(0,10), }, /* 904 */ { X(0,1), X(0,2), X(0,3), }, /* 905 */ { X(0,1), X(0,2), X(0,3), }, /* 906 */ { X(0,1), X(0,2), X(0,3), }, /* 907 */ { X(0,1), X(0,2), X(0,3), }, /* 908 */ { X(0,1), X(0,2), X(0,3), X(4,9), }, /* 909 */ { X(0,1), X(0,2), X(0,3), X(4,9), X(0,10), }, /* 910 */ { X(0,1), X(0,2), X(0,3), X(-4,9), }, /* 911 */ { X(0,1), X(0,2), X(0,3), X(-4,9), X(0,10), }, /* 912 */ { X(0,1), X(0,2), X(0,3), X(1,7), }, /* 913 */ { X(0,1), X(0,2), X(0,3), X(1,7), }, /* 914 */ { X(0,1), X(0,2), X(0,3), X(1,7), }, /* 915 */ { X(0,1), X(0,2), X(0,3), X(1,7), }, /* 916 */ { X(0,1), X(0,2), X(0,3), X(1,7), X(0,8), }, /* 917 */ { X(0,1), X(0,2), X(0,3), X(1,7), X(0,8), }, /* 918 */ { X(0,1), X(0,2), X(0,3), X(1,7), X(0,8), X(0,9), }, /* 919 */ { X(0,1), X(0,2), X(0,3), X(1,7), X(0,8), X(0,9), X(0,10), }, /* 920 */ { X(0,1), X(0,2), X(0,3), X(-1,7), }, /* 921 */ { X(0,1), X(0,2), X(0,3), X(-1,7), }, /* 922 */ { X(0,1), X(0,2), X(0,3), X(-1,7), }, /* 923 */ { X(0,1), X(0,2), X(0,3), X(-1,7), }, /* 924 */ { X(0,1), X(0,2), X(0,3), X(-1,7), X(0,8), }, /* 925 */ { X(0,1), X(0,2), X(0,3), X(-1,7), X(0,8), }, /* 926 */ { X(0,1), X(0,2), X(0,3), X(-1,7), X(0,8), X(0,9), }, /* 927 */ { X(0,1), X(0,2), X(0,3), X(-1,7), X(0,8), X(0,9), X(0,10), }, /* 928 */ { X(0,1), X(0,2), X(0,3), }, /* 929 */ { X(0,1), X(0,2), X(0,3), }, /* 930 */ { X(0,1), X(0,2), X(0,3), }, /* 931 */ { X(0,1), X(0,2), X(0,3), }, /* 932 */ { X(0,1), X(0,2), X(0,3), X(5,9), }, /* 933 */ { X(0,1), X(0,2), X(0,3), X(5,9), X(0,10), }, /* 934 */ { X(0,1), X(0,2), X(0,3), X(-5,9), }, /* 935 */ { X(0,1), X(0,2), X(0,3), X(-5,9), X(0,10), }, /* 936 */ { X(0,1), X(0,2), X(0,3), }, /* 937 */ { X(0,1), X(0,2), X(0,3), }, /* 938 */ { X(0,1), X(0,2), X(0,3), }, /* 939 */ { X(0,1), X(0,2), X(0,3), }, /* 940 */ { X(0,1), X(0,2), X(0,3), X(6,9), }, /* 941 */ { X(0,1), X(0,2), X(0,3), X(6,9), X(0,10), }, /* 942 */ { X(0,1), X(0,2), X(0,3), X(-6,9), }, /* 943 */ { X(0,1), X(0,2), X(0,3), X(-6,9), X(0,10), }, /* 944 */ { X(0,1), X(0,2), X(0,3), X(2,7), }, /* 945 */ { X(0,1), X(0,2), X(0,3), X(2,7), }, /* 946 */ { X(0,1), X(0,2), X(0,3), X(2,7), }, /* 947 */ { X(0,1), X(0,2), X(0,3), X(2,7), }, /* 948 */ { X(0,1), X(0,2), X(0,3), X(2,7), X(0,8), }, /* 949 */ { X(0,1), X(0,2), X(0,3), X(2,7), X(0,8), }, /* 950 */ { X(0,1), X(0,2), X(0,3), X(2,7), X(0,8), X(0,9), }, /* 951 */ { X(0,1), X(0,2), X(0,3), X(2,7), X(0,8), X(0,9), X(0,10), }, /* 952 */ { X(0,1), X(0,2), X(0,3), X(-2,7), }, /* 953 */ { X(0,1), X(0,2), X(0,3), X(-2,7), }, /* 954 */ { X(0,1), X(0,2), X(0,3), X(-2,7), }, /* 955 */ { X(0,1), X(0,2), X(0,3), X(-2,7), }, /* 956 */ { X(0,1), X(0,2), X(0,3), X(-2,7), X(0,8), }, /* 957 */ { X(0,1), X(0,2), X(0,3), X(-2,7), X(0,8), }, /* 958 */ { X(0,1), X(0,2), X(0,3), X(-2,7), X(0,8), X(0,9), }, /* 959 */ { X(0,1), X(0,2), X(0,3), X(-2,7), X(0,8), X(0,9), X(0,10), }, /* 960 */ { X(0,1), X(0,2), X(0,3), X(0,4), }, /* 961 */ { X(0,1), X(0,2), X(0,3), X(0,4), }, /* 962 */ { X(0,1), X(0,2), X(0,3), X(0,4), X(3,10), }, /* 963 */ { X(0,1), X(0,2), X(0,3), X(0,4), X(-3,10), }, /* 964 */ { X(0,1), X(0,2), X(0,3), X(0,4), }, /* 965 */ { X(0,1), X(0,2), X(0,3), X(0,4), }, /* 966 */ { X(0,1), X(0,2), X(0,3), X(0,4), X(4,10), }, /* 967 */ { X(0,1), X(0,2), X(0,3), X(0,4), X(-4,10), }, /* 968 */ { X(0,1), X(0,2), X(0,3), X(0,4), X(1,8), }, /* 969 */ { X(0,1), X(0,2), X(0,3), X(0,4), X(1,8), }, /* 970 */ { X(0,1), X(0,2), X(0,3), X(0,4), X(1,8), X(0,9), }, /* 971 */ { X(0,1), X(0,2), X(0,3), X(0,4), X(1,8), X(0,9), X(0,10), }, /* 972 */ { X(0,1), X(0,2), X(0,3), X(0,4), X(-1,8), }, /* 973 */ { X(0,1), X(0,2), X(0,3), X(0,4), X(-1,8), }, /* 974 */ { X(0,1), X(0,2), X(0,3), X(0,4), X(-1,8), X(0,9), }, /* 975 */ { X(0,1), X(0,2), X(0,3), X(0,4), X(-1,8), X(0,9), X(0,10), }, /* 976 */ { X(0,1), X(0,2), X(0,3), X(0,4), }, /* 977 */ { X(0,1), X(0,2), X(0,3), X(0,4), }, /* 978 */ { X(0,1), X(0,2), X(0,3), X(0,4), X(5,10), }, /* 979 */ { X(0,1), X(0,2), X(0,3), X(0,4), X(-5,10), }, /* 980 */ { X(0,1), X(0,2), X(0,3), X(0,4), }, /* 981 */ { X(0,1), X(0,2), X(0,3), X(0,4), }, /* 982 */ { X(0,1), X(0,2), X(0,3), X(0,4), X(6,10), }, /* 983 */ { X(0,1), X(0,2), X(0,3), X(0,4), X(-6,10), }, /* 984 */ { X(0,1), X(0,2), X(0,3), X(0,4), X(2,8), }, /* 985 */ { X(0,1), X(0,2), X(0,3), X(0,4), X(2,8), }, /* 986 */ { X(0,1), X(0,2), X(0,3), X(0,4), X(2,8), X(0,9), }, /* 987 */ { X(0,1), X(0,2), X(0,3), X(0,4), X(2,8), X(0,9), X(0,10), }, /* 988 */ { X(0,1), X(0,2), X(0,3), X(0,4), X(-2,8), }, /* 989 */ { X(0,1), X(0,2), X(0,3), X(0,4), X(-2,8), }, /* 990 */ { X(0,1), X(0,2), X(0,3), X(0,4), X(-2,8), X(0,9), }, /* 991 */ { X(0,1), X(0,2), X(0,3), X(0,4), X(-2,8), X(0,9), X(0,10), }, /* 992 */ { X(0,1), X(0,2), X(0,3), X(0,4), X(0,5), }, /* 993 */ { X(0,1), X(0,2), X(0,3), X(0,4), X(0,5), }, /* 994 */ { X(0,1), X(0,2), X(0,3), X(0,4), X(0,5), }, /* 995 */ { X(0,1), X(0,2), X(0,3), X(0,4), X(0,5), }, /* 996 */ { X(0,1), X(0,2), X(0,3), X(0,4), X(0,5), X(1,9), }, /* 997 */ { X(0,1), X(0,2), X(0,3), X(0,4), X(0,5), X(1,9), X(0,10), }, /* 998 */ { X(0,1), X(0,2), X(0,3), X(0,4), X(0,5), X(-1,9), }, /* 999 */ { X(0,1), X(0,2), X(0,3), X(0,4), X(0,5), X(-1,9), X(0,10), }, /* 1000 */ { X(0,1), X(0,2), X(0,3), X(0,4), X(0,5), }, /* 1001 */ { X(0,1), X(0,2), X(0,3), X(0,4), X(0,5), }, /* 1002 */ { X(0,1), X(0,2), X(0,3), X(0,4), X(0,5), }, /* 1003 */ { X(0,1), X(0,2), X(0,3), X(0,4), X(0,5), }, /* 1004 */ { X(0,1), X(0,2), X(0,3), X(0,4), X(0,5), X(2,9), }, /* 1005 */ { X(0,1), X(0,2), X(0,3), X(0,4), X(0,5), X(2,9), X(0,10), }, /* 1006 */ { X(0,1), X(0,2), X(0,3), X(0,4), X(0,5), X(-2,9), }, /* 1007 */ { X(0,1), X(0,2), X(0,3), X(0,4), X(0,5), X(-2,9), X(0,10), }, /* 1008 */ { X(0,1), X(0,2), X(0,3), X(0,4), X(0,5), X(0,6), }, /* 1009 */ { X(0,1), X(0,2), X(0,3), X(0,4), X(0,5), X(0,6), }, /* 1010 */ { X(0,1), X(0,2), X(0,3), X(0,4), X(0,5), X(0,6), X(1,10), }, /* 1011 */ { X(0,1), X(0,2), X(0,3), X(0,4), X(0,5), X(0,6), X(-1,10), }, /* 1012 */ { X(0,1), X(0,2), X(0,3), X(0,4), X(0,5), X(0,6), }, /* 1013 */ { X(0,1), X(0,2), X(0,3), X(0,4), X(0,5), X(0,6), }, /* 1014 */ { X(0,1), X(0,2), X(0,3), X(0,4), X(0,5), X(0,6), X(2,10), }, /* 1015 */ { X(0,1), X(0,2), X(0,3), X(0,4), X(0,5), X(0,6), X(-2,10), }, /* 1016 */ { X(0,1), X(0,2), X(0,3), X(0,4), X(0,5), X(0,6), X(0,7), }, /* 1017 */ { X(0,1), X(0,2), X(0,3), X(0,4), X(0,5), X(0,6), X(0,7), }, /* 1018 */ { X(0,1), X(0,2), X(0,3), X(0,4), X(0,5), X(0,6), X(0,7), }, /* 1019 */ { X(0,1), X(0,2), X(0,3), X(0,4), X(0,5), X(0,6), X(0,7), }, /* 1020 */ { X(0,1), X(0,2), X(0,3), X(0,4), X(0,5), X(0,6), X(0,7), X(0,8), }, /* 1021 */ { X(0,1), X(0,2), X(0,3), X(0,4), X(0,5), X(0,6), X(0,7), X(0,8), }, /* 1022 */ { X(0,1), X(0,2), X(0,3), X(0,4), X(0,5), X(0,6), X(0,7), X(0,8), X(0,9), }, /* 1023 */ { X(0,1), X(0,2), X(0,3), X(0,4), X(0,5), X(0,6), X(0,7), X(0,8), X(0,9), }, }; schroedinger-1.0.11/schroedinger/schromotion.h0000644000175000017500000000657711556115124016400 00000000000000 #ifndef __SCHRO_MOTION_H__ #define __SCHRO_MOTION_H__ #include #include #ifdef SCHRO_ENABLE_UNSTABLE_API #include #endif SCHRO_BEGIN_DECLS typedef struct _SchroMotionVector SchroMotionVector; typedef struct _SchroMotionField SchroMotionField; typedef struct _SchroMotion SchroMotion; typedef struct _SchroMotionScan SchroMotionScan; typedef struct _SchroMotionFuncs SchroMotionFuncs; #ifdef SCHRO_ENABLE_UNSTABLE_API struct _SchroMotionVector { unsigned int pred_mode : 2; unsigned int using_global : 1; unsigned int split : 2; unsigned int unused : 3; unsigned int scan : 8; uint32_t metric; uint32_t chroma_metric; union { struct { int16_t dx[2]; int16_t dy[2]; } vec; struct { int16_t dc[3]; } dc; } u; }; struct _SchroMotionField { int x_num_blocks; int y_num_blocks; SchroMotionVector *motion_vectors; }; struct _SchroMotionFuncs { OrcProgram *block_accumulate; OrcProgram *block_accumulate_scaled; OrcProgram *block_accumulate_dc; OrcProgram *block_accumulate_avg; OrcProgram *block_accumulate_biref; }; struct _SchroMotion { SchroUpsampledFrame *src1; SchroUpsampledFrame *src2; SchroMotionVector *motion_vectors; SchroParams *params; uint8_t *tmpdata; int ref_weight_precision; int ref1_weight; int ref2_weight; int mv_precision; int xoffset; int yoffset; int xbsep; int ybsep; int xblen; int yblen; SchroFrameData block; SchroFrameData alloc_block; SchroFrameData obmc_weight; SchroFrameData alloc_block_ref[2]; SchroFrameData block_ref[2]; int weight_x[SCHRO_LIMIT_BLOCK_SIZE]; int weight_y[SCHRO_LIMIT_BLOCK_SIZE]; int width; int height; int max_fast_x; int max_fast_y; schro_bool simple_weight; schro_bool oneref_noscale; }; #define SCHRO_MOTION_GET_BLOCK(motion,x,y) \ ((motion)->motion_vectors+(y)*(motion)->params->x_num_blocks + (x)) SchroMotion * schro_motion_new (SchroParams *params, SchroUpsampledFrame *ref1, SchroUpsampledFrame *ref2); void schro_motion_free (SchroMotion *motion); int schro_motion_verify (SchroMotion *mf); void schro_motion_render_ref (SchroMotion *motion, SchroFrame *dest, SchroFrame *addframe, int add, SchroFrame *output_frame); void schro_motion_render_u8 (SchroMotion *motion, SchroFrame *dest, SchroFrame *addframe, int add, SchroFrame *output_frame); void schro_motion_render (SchroMotion *motion, SchroFrame *dest, SchroFrame *addframe, int add, SchroFrame *output_frame); void schro_motion_init_obmc_weight (SchroMotion *motion); void schro_motion_render_fast (SchroMotion *motion, SchroFrame *dest, SchroFrame *addframe, int add, SchroFrame *output_frame); int schro_motion_render_fast_allowed (SchroMotion *motion); void schro_mf_vector_prediction (SchroMotionField* mf, int x, int y, int *pred_x, int *pred_y, int mode); void schro_motion_vector_prediction (SchroMotion *motion, int x, int y, int *pred_x, int *pred_y, int mode); int schro_motion_split_prediction (SchroMotion *motion, int x, int y); int schro_motion_get_mode_prediction (SchroMotion *motion, int x, int y); void schro_motion_dc_prediction (SchroMotion *motion, int x, int y, int *pred); int schro_motion_get_global_prediction (SchroMotion *motion, int x, int y); int schro_motion_vector_is_equal (SchroMotionVector *mv1, SchroMotionVector *mv2); #endif SCHRO_END_DECLS #endif schroedinger-1.0.11/schroedinger/schromotionfast.c0000644000175000017500000002054211541755167017250 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include /* * This is a slimmed-down implementation of normal OBMC for non-overlapped * 8x8 blocks with motion vector precision of 0. */ static void get_block (SchroMotion * motion, int k, int ref, int i, int j, int dx, int dy) { int px, py; int x, y; SchroUpsampledFrame *upframe; int exp; if (k > 0) { dx >>= SCHRO_CHROMA_FORMAT_H_SHIFT (motion->params-> video_format->chroma_format); dy >>= SCHRO_CHROMA_FORMAT_V_SHIFT (motion->params-> video_format->chroma_format); } if (ref) { upframe = motion->src2; } else { upframe = motion->src1; } x = motion->xbsep * i - motion->xoffset; y = motion->ybsep * j - motion->yoffset; px = (x << motion->mv_precision) + dx; py = (y << motion->mv_precision) + dy; exp = 32 << motion->mv_precision; px = CLAMP (px, -exp, motion->max_fast_x + exp - 1); py = CLAMP (py, -exp, motion->max_fast_y + exp - 1); schro_upsampled_frame_get_subdata_prec0 (upframe, k, px, py, &motion->block_ref[ref]); } static void get_dc_block (SchroMotion * motion, int i, int j, int k, int x, int y) { SchroParams *params = motion->params; SchroMotionVector *mv; int value; int ii, jj; mv = &motion->motion_vectors[j * params->x_num_blocks + i]; memcpy (&motion->block, &motion->alloc_block, sizeof (SchroFrameData)); value = mv->u.dc.dc[k]; for (jj = 0; jj < motion->yblen; jj++) { uint8_t *data = SCHRO_FRAME_DATA_GET_LINE (&motion->block, jj); /* FIXME splat */ for (ii = 0; ii < motion->xblen; ii++) { data[ii] = value + 128; } } } static void get_ref1_block (SchroMotion * motion, int i, int j, int k, int x, int y) { SchroParams *params = motion->params; SchroMotionVector *mv; mv = &motion->motion_vectors[j * params->x_num_blocks + i]; SCHRO_ASSERT (mv->using_global == FALSE); get_block (motion, k, 0, i, j, mv->u.vec.dx[0], mv->u.vec.dy[0]); memcpy (&motion->block, &motion->block_ref[0], sizeof (SchroFrameData)); } static void get_ref2_block (SchroMotion * motion, int i, int j, int k, int x, int y) { SchroParams *params = motion->params; SchroMotionVector *mv; mv = &motion->motion_vectors[j * params->x_num_blocks + i]; SCHRO_ASSERT (mv->using_global == FALSE); get_block (motion, k, 1, i, j, mv->u.vec.dx[1], mv->u.vec.dy[1]); memcpy (&motion->block, &motion->block_ref[1], sizeof (SchroFrameData)); } static void get_biref_block (SchroMotion * motion, int i, int j, int k, int x, int y) { SchroParams *params = motion->params; SchroMotionVector *mv; mv = &motion->motion_vectors[j * params->x_num_blocks + i]; SCHRO_ASSERT (mv->using_global == FALSE); get_block (motion, k, 0, i, j, mv->u.vec.dx[0], mv->u.vec.dy[0]); get_block (motion, k, 1, i, j, mv->u.vec.dx[1], mv->u.vec.dy[1]); memcpy (&motion->block, &motion->alloc_block, sizeof (SchroFrameData)); orc_avg2_8xn_u8 (motion->block.data, motion->block.stride, motion->block_ref[0].data, motion->block_ref[0].stride, motion->block_ref[1].data, motion->block_ref[1].stride, motion->yblen); } static void schro_motion_block_predict_block (SchroMotion * motion, int x, int y, int k, int i, int j) { SchroParams *params = motion->params; SchroMotionVector *mv; mv = &motion->motion_vectors[j * params->x_num_blocks + i]; switch (mv->pred_mode) { case 0: get_dc_block (motion, i, j, k, x, y); break; case 1: get_ref1_block (motion, i, j, k, x, y); break; case 2: get_ref2_block (motion, i, j, k, x, y); break; case 3: get_biref_block (motion, i, j, k, x, y); break; default: SCHRO_ASSERT (0); break; } } static void schro_motion_block_accumulate_slow (SchroMotion * motion, SchroFrameData * comp, int x, int y) { int i, j; for (j = 0; j < motion->yblen; j++) { int16_t *dest = SCHRO_FRAME_DATA_GET_PIXEL_S16 (comp, x, y + j); uint8_t *src = SCHRO_FRAME_DATA_GET_LINE (&motion->block, j); if (y + j < 0 || y + j >= comp->height) continue; for (i = 0; i < motion->xblen; i++) { if (x + i < 0 || x + i >= comp->width) continue; dest[i] = src[i] - 128; } } } static void schro_motion_block_accumulate (SchroMotion * motion, SchroFrameData * comp, int x, int y) { int i, j; for (j = 0; j < motion->yblen; j++) { int16_t *dest = SCHRO_FRAME_DATA_GET_PIXEL_S16 (comp, x, y + j); uint8_t *src = SCHRO_FRAME_DATA_GET_LINE (&motion->block, j); for (i = 0; i < motion->xblen; i++) { dest[i] = src[i] - 128; } } } int schro_motion_render_fast_allowed (SchroMotion * motion) { SchroParams *params = motion->params; if (params->have_global_motion) return FALSE; if (params->xblen_luma != 8 || params->yblen_luma != 8 || params->xbsep_luma != 8 || params->ybsep_luma != 8) { return FALSE; } if (params->picture_weight_bits != 1 || params->picture_weight_1 != 1 || params->picture_weight_2 != 1) { return FALSE; } if (params->mv_precision != 0) { return FALSE; } return TRUE; } void schro_motion_render_fast (SchroMotion * motion, SchroFrame * dest, SchroFrame * addframe, int add, SchroFrame * output_frame) { int i, j; int x, y; int k; SchroParams *params = motion->params; int max_x_blocks; int max_y_blocks; SCHRO_ASSERT (schro_motion_render_fast_allowed (motion)); motion->ref_weight_precision = params->picture_weight_bits; motion->ref1_weight = params->picture_weight_1; motion->ref2_weight = params->picture_weight_2; motion->mv_precision = params->mv_precision; for (k = 0; k < 3; k++) { SchroFrameData *comp = dest->components + k; if (k == 0) { motion->xbsep = params->xbsep_luma; motion->ybsep = params->ybsep_luma; motion->xblen = params->xblen_luma; motion->yblen = params->yblen_luma; motion->width = comp->width; motion->height = comp->height; } else { motion->xbsep = params->xbsep_luma >> SCHRO_CHROMA_FORMAT_H_SHIFT (motion->params-> video_format->chroma_format); motion->ybsep = params->ybsep_luma >> SCHRO_CHROMA_FORMAT_V_SHIFT (motion-> params->video_format->chroma_format); motion->xblen = params->xblen_luma >> SCHRO_CHROMA_FORMAT_H_SHIFT (motion-> params->video_format->chroma_format); motion->yblen = params->yblen_luma >> SCHRO_CHROMA_FORMAT_V_SHIFT (motion-> params->video_format->chroma_format); motion->width = comp->width; motion->height = comp->height; } motion->xoffset = (motion->xblen - motion->xbsep) / 2; motion->yoffset = (motion->yblen - motion->ybsep) / 2; motion->max_fast_x = (motion->width - motion->xblen) << motion->mv_precision; motion->max_fast_y = (motion->height - motion->yblen) << motion->mv_precision; motion->alloc_block.data = schro_malloc (motion->xblen * motion->yblen * sizeof (uint8_t)); motion->alloc_block.stride = motion->xblen * sizeof (uint8_t); motion->alloc_block.width = motion->xblen; motion->alloc_block.height = motion->yblen; orc_splat_s16_2d (comp->data, comp->stride, 0, comp->width, comp->height); max_x_blocks = MIN (params->x_num_blocks, (motion->width - motion->xoffset) / motion->xbsep); max_y_blocks = MIN (params->y_num_blocks, (motion->height - motion->yoffset) / motion->ybsep); j = 0; for (j = 0; j < max_y_blocks; j++) { y = motion->ybsep * j - motion->yoffset; for (i = 0; i < max_x_blocks; i++) { x = motion->xbsep * i - motion->xoffset; schro_motion_block_predict_block (motion, x, y, k, i, j); schro_motion_block_accumulate (motion, comp, x, y); } for (; i < params->x_num_blocks; i++) { x = motion->xbsep * i - motion->xoffset; schro_motion_block_predict_block (motion, x, y, k, i, j); schro_motion_block_accumulate_slow (motion, comp, x, y); } } for (j = max_y_blocks; j < params->y_num_blocks; j++) { y = motion->ybsep * j - motion->yoffset; for (i = 0; i < params->x_num_blocks; i++) { x = motion->xbsep * i - motion->xoffset; schro_motion_block_predict_block (motion, x, y, k, i, j); schro_motion_block_accumulate_slow (motion, comp, x, y); } } schro_free (motion->alloc_block.data); } } schroedinger-1.0.11/schroedinger/schroframe.c0000664000175000017500000021762011707117074016157 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #include #include static SchroMutex *frame_mutex; /** * schro_frame_new: * * Creates a new SchroFrame object. The created frame is uninitialized * and has no data storage associated with it. The caller must fill * in the required information. * * Returns: a new SchroFrame object */ SchroFrame * schro_frame_new (void) { SchroFrame *frame; if (frame_mutex == NULL) { frame_mutex = schro_mutex_new (); } frame = schro_malloc0 (sizeof (*frame)); frame->refcount = 1; return frame; } /** * schro_frame_new_and_alloc: * * Creates a new SchroFrame object with the requested size and format. * * Returns: a new SchroFrame object */ SchroFrame * schro_frame_new_and_alloc (SchroMemoryDomain * domain, SchroFrameFormat format, int width, int height) { return schro_frame_new_and_alloc_full (domain, format, width, height, 0, FALSE); } SchroFrame * schro_frame_new_and_alloc_full (SchroMemoryDomain * domain, SchroFrameFormat format, int width, int height, int extension, int upsampled) { SchroFrame *frame = schro_frame_new (); int bytes_pp; int h_shift, v_shift; int chroma_width; int chroma_height; SCHRO_ASSERT (width > 0); SCHRO_ASSERT (height > 0); frame->format = format; frame->width = width; frame->height = height; frame->domain = domain; frame->extension = extension; frame->is_upsampled = upsampled; if (SCHRO_FRAME_IS_PACKED (format)) { SCHRO_ASSERT (extension == 0); frame->components[0].format = format; frame->components[0].width = width; frame->components[0].height = height; if (format == SCHRO_FRAME_FORMAT_AYUV) { frame->components[0].stride = width * 4; } else { frame->components[0].stride = ROUND_UP_POW2 (width, 1) * 2; } frame->components[0].length = frame->components[0].stride * height; if (domain) { frame->regions[0] = schro_memory_domain_alloc (domain, frame->components[0].length); } else { frame->regions[0] = schro_malloc (frame->components[0].length); } frame->components[0].data = frame->regions[0]; frame->components[0].v_shift = 0; frame->components[0].h_shift = 0; return frame; } switch (SCHRO_FRAME_FORMAT_DEPTH (format)) { case SCHRO_FRAME_FORMAT_DEPTH_U8: bytes_pp = 1; break; case SCHRO_FRAME_FORMAT_DEPTH_S16: bytes_pp = 2; break; case SCHRO_FRAME_FORMAT_DEPTH_S32: bytes_pp = 4; break; default: SCHRO_ASSERT (0); bytes_pp = 0; break; } h_shift = SCHRO_FRAME_FORMAT_H_SHIFT (format); v_shift = SCHRO_FRAME_FORMAT_V_SHIFT (format); chroma_width = ROUND_UP_SHIFT (width, h_shift); chroma_height = ROUND_UP_SHIFT (height, v_shift); frame->components[0].format = format; frame->components[0].width = width; frame->components[0].height = height; frame->components[0].stride = ROUND_UP_16 ((width + extension * 2) * bytes_pp); if (upsampled) { frame->components[0].stride *= 4; } frame->components[0].length = frame->components[0].stride * (frame->components[0].height + extension * 2); frame->components[0].v_shift = 0; frame->components[0].h_shift = 0; frame->components[1].format = format; frame->components[1].width = chroma_width; frame->components[1].height = chroma_height; frame->components[1].stride = ROUND_UP_16 ((chroma_width + extension * 2) * bytes_pp); if (upsampled) { frame->components[1].stride *= 4; } frame->components[1].length = frame->components[1].stride * (frame->components[1].height + extension * 2); frame->components[1].v_shift = v_shift; frame->components[1].h_shift = h_shift; frame->components[2].format = format; frame->components[2].width = chroma_width; frame->components[2].height = chroma_height; frame->components[2].stride = ROUND_UP_16 ((chroma_width + extension * 2) * bytes_pp); if (upsampled) { frame->components[2].stride *= 4; } frame->components[2].length = frame->components[2].stride * (frame->components[2].height + extension * 2); frame->components[2].v_shift = v_shift; frame->components[2].h_shift = h_shift; if (domain) { frame->regions[0] = schro_memory_domain_alloc (domain, frame->components[0].length + frame->components[1].length + frame->components[2].length); } else { frame->regions[0] = malloc (frame->components[0].length + frame->components[1].length + frame->components[2].length); } frame->components[0].data = SCHRO_OFFSET (frame->regions[0], frame->components[0].stride * extension + bytes_pp * extension); frame->components[1].data = SCHRO_OFFSET (frame->regions[0], frame->components[0].length + frame->components[1].stride * extension + bytes_pp * extension); frame->components[2].data = SCHRO_OFFSET (frame->regions[0], frame->components[0].length + frame->components[1].length + frame->components[2].stride * extension + bytes_pp * extension); return frame; } SchroFrame * schro_frame_new_and_alloc_extended (SchroMemoryDomain * domain, SchroFrameFormat format, int width, int height, int extension) { return schro_frame_new_and_alloc_full (domain, format, width, height, extension, FALSE); } /** * schro_frame_new_from_data_YUY2: * * Creates a new SchroFrame object with the requested size using * the data pointed to by @data. The data must be in YUY2 format. * The data must remain for the lifetime of the SchroFrame object. * It is recommended to use schro_frame_set_free_callback() for * notification when the data is no longer needed. * * Returns: a new SchroFrame object */ SchroFrame * schro_frame_new_from_data_YUY2 (void *data, int width, int height) { SchroFrame *frame = schro_frame_new (); frame->format = SCHRO_FRAME_FORMAT_YUYV; frame->width = width; frame->height = height; frame->components[0].format = frame->format; frame->components[0].width = width; frame->components[0].height = height; frame->components[0].stride = ROUND_UP_POW2 (width, 1) * 2; frame->components[0].data = data; frame->components[0].length = frame->components[0].stride * height; frame->components[0].v_shift = 0; frame->components[0].h_shift = 0; return frame; } /** * schro_frame_new_from_data_UYVY: * * Creates a new SchroFrame object with the requested size using * the data pointed to by @data. The data must be in UYVY format. * The data must remain for the lifetime of the SchroFrame object. * It is recommended to use schro_frame_set_free_callback() for * notification when the data is no longer needed. * * Returns: a new SchroFrame object */ SchroFrame * schro_frame_new_from_data_UYVY (void *data, int width, int height) { SchroFrame *frame = schro_frame_new (); frame->format = SCHRO_FRAME_FORMAT_UYVY; frame->width = width; frame->height = height; frame->components[0].format = frame->format; frame->components[0].width = width; frame->components[0].height = height; frame->components[0].stride = ROUND_UP_POW2 (width, 1) * 2; frame->components[0].data = data; frame->components[0].length = frame->components[0].stride * height; frame->components[0].v_shift = 0; frame->components[0].h_shift = 0; return frame; } /** * schro_frame_new_from_data_UYVY_full: * * Creates a new SchroFrame object with the requested size using * the data pointed to by @data. The data must be in UYVY format, * although the row stride is allowed to be different than what * would normally be calculated from @width. * The data must remain for the lifetime of the SchroFrame object. * It is recommended to use schro_frame_set_free_callback() for * notification when the data is no longer needed. * * Returns: a new SchroFrame object */ SchroFrame * schro_frame_new_from_data_UYVY_full (void *data, int width, int height, int stride) { SchroFrame *frame = schro_frame_new (); frame->format = SCHRO_FRAME_FORMAT_UYVY; frame->width = width; frame->height = height; frame->components[0].width = width; frame->components[0].height = height; frame->components[0].stride = stride; frame->components[0].data = data; frame->components[0].length = frame->components[0].stride * height; frame->components[0].v_shift = 0; frame->components[0].h_shift = 0; return frame; } /** * schro_frame_new_from_data_AYUV: * * Creates a new SchroFrame object with the requested size using * the data pointed to by @data. The data must be in AYUV format. * The data must remain for the lifetime of the SchroFrame object. * It is recommended to use schro_frame_set_free_callback() for * notification when the data is no longer needed. * * Returns: a new SchroFrame object */ SchroFrame * schro_frame_new_from_data_AYUV (void *data, int width, int height) { SchroFrame *frame = schro_frame_new (); frame->format = SCHRO_FRAME_FORMAT_AYUV; frame->width = width; frame->height = height; frame->components[0].format = frame->format; frame->components[0].width = width; frame->components[0].height = height; frame->components[0].stride = width * 4; frame->components[0].data = data; frame->components[0].length = frame->components[0].stride * height; frame->components[0].v_shift = 0; frame->components[0].h_shift = 0; return frame; } /** * schro_frame_new_from_data_AY64: * * Creates a new SchroFrame object with the requested size using * the data pointed to by @data. The data must be in AY64 format. * The data must remain for the lifetime of the SchroFrame object. * It is recommended to use schro_frame_set_free_callback() for * notification when the data is no longer needed. * * Returns: a new SchroFrame object */ SchroFrame * schro_frame_new_from_data_AY64 (void *data, int width, int height) { SchroFrame *frame = schro_frame_new (); frame->format = SCHRO_FRAME_FORMAT_AY64; frame->width = width; frame->height = height; frame->components[0].format = frame->format; frame->components[0].width = width; frame->components[0].height = height; frame->components[0].stride = width * 8; frame->components[0].data = data; frame->components[0].length = frame->components[0].stride * height; frame->components[0].v_shift = 0; frame->components[0].h_shift = 0; return frame; } /** * schro_frame_new_from_data_v216: * * Creates a new SchroFrame object with the requested size using * the data pointed to by @data. The data must be in v216 format. * The data must remain for the lifetime of the SchroFrame object. * It is recommended to use schro_frame_set_free_callback() for * notification when the data is no longer needed. * * Returns: a new SchroFrame object */ SchroFrame * schro_frame_new_from_data_v216 (void *data, int width, int height) { SchroFrame *frame = schro_frame_new (); frame->format = SCHRO_FRAME_FORMAT_v216; frame->width = width; frame->height = height; frame->components[0].format = frame->format; frame->components[0].width = width; frame->components[0].height = height; frame->components[0].stride = ROUND_UP_POW2 (width, 1) * 4; frame->components[0].data = data; frame->components[0].length = frame->components[0].stride * height; frame->components[0].v_shift = 0; frame->components[0].h_shift = 0; return frame; } /** * schro_frame_new_from_data_v210: * * Creates a new SchroFrame object with the requested size using * the data pointed to by @data. The data must be in v210 format. * The data must remain for the lifetime of the SchroFrame object. * It is recommended to use schro_frame_set_free_callback() for * notification when the data is no longer needed. * * Returns: a new SchroFrame object */ SchroFrame * schro_frame_new_from_data_v210 (void *data, int width, int height) { SchroFrame *frame = schro_frame_new (); frame->format = SCHRO_FRAME_FORMAT_v210; frame->width = width; frame->height = height; frame->components[0].format = frame->format; frame->components[0].width = width; frame->components[0].height = height; frame->components[0].stride = ((width + 47) / 48) * 128; frame->components[0].data = data; frame->components[0].length = frame->components[0].stride * height; frame->components[0].v_shift = 0; frame->components[0].h_shift = 0; return frame; } /** * schro_frame_new_from_data_I420: * * Creates a new SchroFrame object with the requested size using * the data pointed to by @data. The data must be in I420 format. * The data must remain for the lifetime of the SchroFrame object. * It is recommended to use schro_frame_set_free_callback() for * notification when the data is no longer needed. * * Returns: a new SchroFrame object */ SchroFrame * schro_frame_new_from_data_I420 (void *data, int width, int height) { SchroFrame *frame = schro_frame_new (); frame->format = SCHRO_FRAME_FORMAT_U8_420; frame->width = width; frame->height = height; frame->components[0].format = frame->format; frame->components[0].width = width; frame->components[0].height = height; frame->components[0].stride = ROUND_UP_POW2 (width, 2); frame->components[0].data = data; frame->components[0].length = frame->components[0].stride * ROUND_UP_POW2 (frame->components[0].height, 1); frame->components[0].v_shift = 0; frame->components[0].h_shift = 0; frame->components[1].format = frame->format; frame->components[1].width = ROUND_UP_SHIFT (width, 1); frame->components[1].height = ROUND_UP_SHIFT (height, 1); frame->components[1].stride = ROUND_UP_POW2 (frame->components[1].width, 2); frame->components[1].length = frame->components[1].stride * frame->components[1].height; frame->components[1].data = SCHRO_OFFSET (frame->components[0].data, frame->components[0].length); frame->components[1].v_shift = 1; frame->components[1].h_shift = 1; frame->components[2].format = frame->format; frame->components[2].width = ROUND_UP_SHIFT (width, 1); frame->components[2].height = ROUND_UP_SHIFT (height, 1); frame->components[2].stride = ROUND_UP_POW2 (frame->components[2].width, 2); frame->components[2].length = frame->components[2].stride * frame->components[2].height; frame->components[2].data = SCHRO_OFFSET (frame->components[1].data, frame->components[1].length); frame->components[2].v_shift = 1; frame->components[2].h_shift = 1; return frame; } /** * schro_frame_new_from_data_Y42B: * * Creates a new SchroFrame object with the requested size using * the data pointed to by @data. The data must be in Y42B format. * The data must remain for the lifetime of the SchroFrame object. * It is recommended to use schro_frame_set_free_callback() for * notification when the data is no longer needed. * * Returns: a new SchroFrame object */ SchroFrame * schro_frame_new_from_data_Y42B (void *data, int width, int height) { SchroFrame *frame = schro_frame_new (); frame->format = SCHRO_FRAME_FORMAT_U8_422; frame->width = width; frame->height = height; frame->components[0].format = frame->format; frame->components[0].width = width; frame->components[0].height = height; frame->components[0].stride = ROUND_UP_POW2 (width, 2); frame->components[0].data = data; frame->components[0].length = frame->components[0].stride * ROUND_UP_POW2 (frame->components[0].height, 1); frame->components[0].v_shift = 0; frame->components[0].h_shift = 0; frame->components[1].format = frame->format; frame->components[1].width = ROUND_UP_SHIFT (width, 1); frame->components[1].height = height; frame->components[1].stride = ROUND_UP_POW2 (frame->components[1].width, 2); frame->components[1].length = frame->components[1].stride * frame->components[1].height; frame->components[1].data = SCHRO_OFFSET (frame->components[0].data, frame->components[0].length); frame->components[1].v_shift = 0; frame->components[1].h_shift = 1; frame->components[2].format = frame->format; frame->components[2].width = ROUND_UP_SHIFT (width, 1); frame->components[2].height = height; frame->components[2].stride = ROUND_UP_POW2 (frame->components[2].width, 2); frame->components[2].length = frame->components[2].stride * frame->components[2].height; frame->components[2].data = SCHRO_OFFSET (frame->components[1].data, frame->components[1].length); frame->components[2].v_shift = 0; frame->components[2].h_shift = 1; return frame; } /** * schro_frame_new_from_data_Y444: * * Creates a new SchroFrame object with the requested size using * the data pointed to by @data. The data must be in Y444 format. * The data must remain for the lifetime of the SchroFrame object. * It is recommended to use schro_frame_set_free_callback() for * notification when the data is no longer needed. * * Returns: a new SchroFrame object */ SchroFrame * schro_frame_new_from_data_Y444 (void *data, int width, int height) { SchroFrame *frame = schro_frame_new (); frame->format = SCHRO_FRAME_FORMAT_U8_444; frame->width = width; frame->height = height; frame->components[0].format = frame->format; frame->components[0].width = width; frame->components[0].height = height; frame->components[0].stride = ROUND_UP_POW2 (width, 2); frame->components[0].data = data; frame->components[0].length = frame->components[0].stride * ROUND_UP_POW2 (frame->components[0].height, 1); frame->components[0].v_shift = 0; frame->components[0].h_shift = 0; frame->components[1].format = frame->format; frame->components[1].width = width; frame->components[1].height = height; frame->components[1].stride = ROUND_UP_POW2 (frame->components[1].width, 2); frame->components[1].length = frame->components[1].stride * frame->components[1].height; frame->components[1].data = SCHRO_OFFSET (frame->components[0].data, frame->components[0].length); frame->components[1].v_shift = 0; frame->components[1].h_shift = 0; frame->components[2].format = frame->format; frame->components[2].width = width; frame->components[2].height = height; frame->components[2].stride = ROUND_UP_POW2 (frame->components[2].width, 2); frame->components[2].length = frame->components[2].stride * frame->components[2].height; frame->components[2].data = SCHRO_OFFSET (frame->components[1].data, frame->components[1].length); frame->components[2].v_shift = 0; frame->components[2].h_shift = 0; return frame; } /** * schro_frame_new_from_data_YV12: * * Creates a new SchroFrame object with the requested size using * the data pointed to by @data. The data must be in YV12 format. * The data must remain for the lifetime of the SchroFrame object. * It is recommended to use schro_frame_set_free_callback() for * notification when the data is no longer needed. * * Returns: a new SchroFrame object */ SchroFrame * schro_frame_new_from_data_YV12 (void *data, int width, int height) { SchroFrame *frame = schro_frame_new (); frame->format = SCHRO_FRAME_FORMAT_U8_420; frame->width = width; frame->height = height; frame->components[0].format = frame->format; frame->components[0].width = width; frame->components[0].height = height; frame->components[0].stride = ROUND_UP_POW2 (width, 2); frame->components[0].data = data; frame->components[0].length = frame->components[0].stride * ROUND_UP_POW2 (frame->components[0].height, 1); frame->components[0].v_shift = 0; frame->components[0].h_shift = 0; frame->components[2].format = frame->format; frame->components[2].width = ROUND_UP_SHIFT (width, 1); frame->components[2].height = ROUND_UP_SHIFT (height, 1); frame->components[2].stride = ROUND_UP_POW2 (frame->components[2].width, 2); frame->components[2].length = frame->components[2].stride * frame->components[2].height; frame->components[2].data = SCHRO_OFFSET (frame->components[0].data, frame->components[0].length); frame->components[2].v_shift = 1; frame->components[2].h_shift = 1; frame->components[1].format = frame->format; frame->components[1].width = ROUND_UP_SHIFT (width, 1); frame->components[1].height = ROUND_UP_SHIFT (height, 1); frame->components[1].stride = ROUND_UP_POW2 (frame->components[1].width, 2); frame->components[1].length = frame->components[1].stride * frame->components[1].height; frame->components[1].data = SCHRO_OFFSET (frame->components[2].data, frame->components[2].length); frame->components[1].v_shift = 1; frame->components[1].h_shift = 1; return frame; } /** * schro_frame_dup: * * Creates a new SchroFrame object with the same dimensions and format * as @frame, and copies the data from the @frame to the new object. * * Returns: a new SchroFrame object */ SchroFrame * schro_frame_dup (SchroFrame * frame) { return schro_frame_dup_extended (frame, 0); } SchroFrame * schro_frame_dup_extended (SchroFrame * frame, int extension) { return schro_frame_dup_full (frame, extension, FALSE); } SchroFrame * schro_frame_dup_full (SchroFrame * frame, int extension, int is_upsampled) { SchroFrame *dup_frame; dup_frame = schro_frame_new_and_alloc_full (frame->domain, frame->format, frame->width, frame->height, extension, is_upsampled); schro_frame_convert (dup_frame, frame); return dup_frame; } /** * schro_frame_clone: * * Creates a new SchroFrame object with the same dimensions and format * as @frame. This function leaves the data in the new object * uninitialized. * * Returns: a new SchroFrame object */ SchroFrame * schro_frame_clone (SchroMemoryDomain * domain, SchroFrame * frame) { return schro_frame_new_and_alloc (domain, frame->format, frame->width, frame->height); } /** * schro_frame_ref: * @frame: a frame object * * Increases the reference count of @frame. * * Returns: the value of @frame */ SchroFrame * schro_frame_ref (SchroFrame * frame) { SCHRO_ASSERT (frame && frame->refcount > 0); schro_mutex_lock (frame_mutex); frame->refcount++; schro_mutex_unlock (frame_mutex); return frame; } /** * schro_frame_unref: * @frame: a frame object * * Decreases the reference count of @frame. If the new reference * count is 0, the frame is freed. If a frame free callback was * set, this function is called. * * Returns: the value of @frame */ void schro_frame_unref (SchroFrame * frame) { int i; SCHRO_ASSERT (frame->refcount > 0); schro_mutex_lock (frame_mutex); frame->refcount--; if (frame->refcount == 0) { schro_mutex_unlock (frame_mutex); if (frame->free) { frame->free (frame, frame->priv); } #ifdef HAVE_OPENGL if (SCHRO_FRAME_IS_OPENGL (frame)) { schro_opengl_frame_cleanup (frame); } #endif for (i = 0; i < 3; i++) { if (frame->regions[i]) { if (frame->domain) { schro_memory_domain_memfree (frame->domain, frame->regions[i]); } else { free (frame->regions[i]); } } } if (frame->virt_frame1) { schro_frame_unref (frame->virt_frame1); } if (frame->virt_frame2) { schro_frame_unref (frame->virt_frame2); } if (frame->virt_priv) { schro_free (frame->virt_priv); } schro_free (frame); } else { schro_mutex_unlock (frame_mutex); } } /** * schro_frame_set_free_callback: * @frame: a frame object * @free_func: the function to call when the frame is freed * @priv: callback key * * Sets a function that will be called when the object reference * count drops to zero and the object is freed. */ void schro_frame_set_free_callback (SchroFrame * frame, SchroFrameFreeFunc free_func, void *priv) { frame->free = free_func; frame->priv = priv; } static void schro_frame_component_clear (SchroFrameData * fd) { //int j; if (SCHRO_FRAME_FORMAT_DEPTH (fd->format) == SCHRO_FRAME_FORMAT_DEPTH_U8) { orc_splat_u8_2d (fd->data, fd->stride, 0, fd->width, fd->height); } else { orc_splat_s16_2d (fd->data, fd->stride, 0, fd->width, fd->height); } } void schro_frame_clear (SchroFrame * frame) { schro_frame_component_clear (frame->components + 0); schro_frame_component_clear (frame->components + 1); schro_frame_component_clear (frame->components + 2); } typedef void (*SchroFrameBinaryFunc) (SchroFrame * dest, SchroFrame * src); struct binary_struct { SchroFrameFormat from; SchroFrameFormat to; SchroFrameBinaryFunc func; }; /** * schro_frame_convert: * @dest: destination frame * @src: source frame * * Copies data from the source frame to the destination frame, converting * formats if necessary. Only a few conversions are supported. */ void schro_frame_convert (SchroFrame * dest, SchroFrame * src) { SchroFrame *frame; SchroFrameFormat dest_format; SCHRO_ASSERT (dest != NULL); SCHRO_ASSERT (src != NULL); switch (dest->format) { case SCHRO_FRAME_FORMAT_YUYV: case SCHRO_FRAME_FORMAT_UYVY: dest_format = SCHRO_FRAME_FORMAT_U8_422; break; case SCHRO_FRAME_FORMAT_AYUV: case SCHRO_FRAME_FORMAT_ARGB: dest_format = SCHRO_FRAME_FORMAT_U8_444; break; case SCHRO_FRAME_FORMAT_v210: case SCHRO_FRAME_FORMAT_v216: dest_format = SCHRO_FRAME_FORMAT_S16_422; break; case SCHRO_FRAME_FORMAT_AY64: dest_format = SCHRO_FRAME_FORMAT_S32_444; break; default: dest_format = dest->format; break; } schro_frame_ref (src); frame = schro_virt_frame_new_unpack (src); SCHRO_DEBUG ("unpack %p", frame); if (SCHRO_FRAME_FORMAT_DEPTH (dest_format) != SCHRO_FRAME_FORMAT_DEPTH (frame->format)) { if (SCHRO_FRAME_FORMAT_DEPTH (dest_format) == SCHRO_FRAME_FORMAT_DEPTH_U8) { if (SCHRO_FRAME_FORMAT_DEPTH (src->format) == SCHRO_FRAME_FORMAT_DEPTH_S16) { frame = schro_virt_frame_new_convert_u8 (frame); SCHRO_DEBUG ("convert_u8 %p", frame); } else { frame = schro_virt_frame_new_convert_u8_s32 (frame); SCHRO_DEBUG("convert u8 s32"); } } else if (SCHRO_FRAME_FORMAT_DEPTH (dest_format) == SCHRO_FRAME_FORMAT_DEPTH_S16) { frame = schro_virt_frame_new_convert_s16 (frame); SCHRO_DEBUG ("convert_s16 %p", frame); } else if (SCHRO_FRAME_FORMAT_DEPTH (dest_format) == SCHRO_FRAME_FORMAT_DEPTH_S32) { frame = schro_virt_frame_new_convert_s32 (frame); SCHRO_DEBUG ("convert_s32 %p", frame); } } if ((dest_format & 3) != (frame->format & 3)) { frame = schro_virt_frame_new_subsample (frame, dest_format); SCHRO_DEBUG ("subsample %p", frame); } if (dest->width < frame->width || dest->height < frame->height) { SCHRO_DEBUG ("crop %d %d to %d %d", frame->width, frame->height, dest->width, dest->height); frame = schro_virt_frame_new_crop (frame, dest->width, dest->height); SCHRO_DEBUG ("crop %p", frame); } if (dest->width > src->width || dest->height > src->height) { frame = schro_virt_frame_new_edgeextend (frame, dest->width, dest->height); SCHRO_DEBUG ("edgeextend %p", frame); } switch (dest->format) { case SCHRO_FRAME_FORMAT_YUYV: frame = schro_virt_frame_new_pack_YUY2 (frame); SCHRO_DEBUG ("pack_YUY2 %p", frame); break; case SCHRO_FRAME_FORMAT_UYVY: frame = schro_virt_frame_new_pack_UYVY (frame); SCHRO_DEBUG ("pack_UYVY %p", frame); break; case SCHRO_FRAME_FORMAT_AYUV: frame = schro_virt_frame_new_pack_AYUV (frame); SCHRO_DEBUG ("pack_AYUV %p", frame); break; case SCHRO_FRAME_FORMAT_v210: frame = schro_virt_frame_new_pack_v210 (frame); SCHRO_DEBUG ("pack_v210 %p", frame); break; case SCHRO_FRAME_FORMAT_v216: frame = schro_virt_frame_new_pack_v216 (frame); SCHRO_DEBUG ("pack_v216 %p", frame); break; case SCHRO_FRAME_FORMAT_AY64: frame = schro_virt_frame_new_pack_AY64 (frame); SCHRO_DEBUG ("pack_AY64 %p", frame); break; default: break; } schro_virt_frame_render (frame, dest); schro_frame_unref (frame); } static void schro_frame_add_s16_s16 (SchroFrame * dest, SchroFrame * src); static void schro_frame_add_s16_u8 (SchroFrame * dest, SchroFrame * src); static struct binary_struct schro_frame_add_func_list[] = { {SCHRO_FRAME_FORMAT_S16_444, SCHRO_FRAME_FORMAT_S16_444, schro_frame_add_s16_s16}, {SCHRO_FRAME_FORMAT_S16_422, SCHRO_FRAME_FORMAT_S16_422, schro_frame_add_s16_s16}, {SCHRO_FRAME_FORMAT_S16_420, SCHRO_FRAME_FORMAT_S16_420, schro_frame_add_s16_s16}, {SCHRO_FRAME_FORMAT_U8_444, SCHRO_FRAME_FORMAT_S16_444, schro_frame_add_s16_u8}, {SCHRO_FRAME_FORMAT_U8_422, SCHRO_FRAME_FORMAT_S16_422, schro_frame_add_s16_u8}, {SCHRO_FRAME_FORMAT_U8_420, SCHRO_FRAME_FORMAT_S16_420, schro_frame_add_s16_u8}, {0} }; /** * schro_frame_add: * @dest: destination frame * @src: source frame * * Adds data from the source frame to the destination frame. The * frames must have the same chroma subsampling, and only a few * combinations of bit depths are supported. */ void schro_frame_add (SchroFrame * dest, SchroFrame * src) { int i; SCHRO_ASSERT (dest != NULL); SCHRO_ASSERT (src != NULL); for (i = 0; schro_frame_add_func_list[i].func; i++) { if (schro_frame_add_func_list[i].from == src->format && schro_frame_add_func_list[i].to == dest->format) { schro_frame_add_func_list[i].func (dest, src); return; } } SCHRO_ERROR ("add function unimplemented"); SCHRO_ASSERT (0); } static void schro_frame_subtract_s16_s16 (SchroFrame * dest, SchroFrame * src); static void schro_frame_subtract_s16_u8 (SchroFrame * dest, SchroFrame * src); static struct binary_struct schro_frame_subtract_func_list[] = { {SCHRO_FRAME_FORMAT_S16_444, SCHRO_FRAME_FORMAT_S16_444, schro_frame_subtract_s16_s16}, {SCHRO_FRAME_FORMAT_S16_422, SCHRO_FRAME_FORMAT_S16_422, schro_frame_subtract_s16_s16}, {SCHRO_FRAME_FORMAT_S16_420, SCHRO_FRAME_FORMAT_S16_420, schro_frame_subtract_s16_s16}, {SCHRO_FRAME_FORMAT_U8_444, SCHRO_FRAME_FORMAT_S16_444, schro_frame_subtract_s16_u8}, {SCHRO_FRAME_FORMAT_U8_422, SCHRO_FRAME_FORMAT_S16_422, schro_frame_subtract_s16_u8}, {SCHRO_FRAME_FORMAT_U8_420, SCHRO_FRAME_FORMAT_S16_420, schro_frame_subtract_s16_u8}, {0} }; /** * schro_frame_subtract: * @dest: destination frame * @src: source frame * * Subtracts data from the source frame to the destination frame. The * frames must have the same chroma subsampling, and only a few * combinations of bit depths are supported. */ void schro_frame_subtract (SchroFrame * dest, SchroFrame * src) { int i; SCHRO_ASSERT (dest != NULL); SCHRO_ASSERT (src != NULL); for (i = 0; schro_frame_subtract_func_list[i].func; i++) { if (schro_frame_subtract_func_list[i].from == src->format && schro_frame_subtract_func_list[i].to == dest->format) { schro_frame_subtract_func_list[i].func (dest, src); return; } } SCHRO_ERROR (0); SCHRO_ASSERT ("subtract function unimplemented"); } static void schro_frame_add_s16_s16 (SchroFrame * dest, SchroFrame * src) { SchroFrameData *dcomp; SchroFrameData *scomp; int i; int width, height; for (i = 0; i < 3; i++) { dcomp = &dest->components[i]; scomp = &src->components[i]; width = MIN (dcomp->width, scomp->width); height = MIN (dcomp->height, scomp->height); orc_add_s16_2d (dcomp->data, dcomp->stride, scomp->data, scomp->stride, width, height); } } static void schro_frame_add_s16_u8 (SchroFrame * dest, SchroFrame * src) { SchroFrameData *dcomp; SchroFrameData *scomp; //int16_t *ddata; //uint8_t *sdata; int i; //int y; int width, height; for (i = 0; i < 3; i++) { dcomp = &dest->components[i]; scomp = &src->components[i]; width = MIN (dcomp->width, scomp->width); height = MIN (dcomp->height, scomp->height); orc_add_s16_u8_2d (dcomp->data, dcomp->stride, scomp->data, scomp->stride, width, height); #if 0 for (y = 0; y < height; y++) { sdata = SCHRO_FRAME_DATA_GET_LINE (scomp, y); ddata = SCHRO_FRAME_DATA_GET_LINE (dcomp, y); orc_add_s16_u8 (ddata, ddata, sdata, width); } #endif } } static void schro_frame_subtract_s16_s16 (SchroFrame * dest, SchroFrame * src) { SchroFrameData *dcomp; SchroFrameData *scomp; int16_t *ddata; int16_t *sdata; int i; int y; int width, height; for (i = 0; i < 3; i++) { dcomp = &dest->components[i]; scomp = &src->components[i]; width = MIN (dcomp->width, scomp->width); height = MIN (dcomp->height, scomp->height); for (y = 0; y < height; y++) { sdata = SCHRO_FRAME_DATA_GET_LINE (scomp, y); ddata = SCHRO_FRAME_DATA_GET_LINE (dcomp, y); orc_subtract_s16 (ddata, ddata, sdata, width); } } } static void schro_frame_subtract_s16_u8 (SchroFrame * dest, SchroFrame * src) { SchroFrameData *dcomp; SchroFrameData *scomp; int16_t *ddata; uint8_t *sdata; int i; int y; int width, height; for (i = 0; i < 3; i++) { dcomp = &dest->components[i]; scomp = &src->components[i]; width = MIN (dcomp->width, scomp->width); height = MIN (dcomp->height, scomp->height); for (y = 0; y < height; y++) { sdata = SCHRO_FRAME_DATA_GET_LINE (scomp, y); ddata = SCHRO_FRAME_DATA_GET_LINE (dcomp, y); orc_subtract_s16_u8 (ddata, ddata, sdata, width); } } } /** * schro_frame_iwt_transform: * @frame: frame * @params: transform parameters * * Performs an in-place integer wavelet transform on @frame. The * frame must have a bit depth of 16. */ void schro_frame_iwt_transform (SchroFrame * frame, SchroParams * params) { int component; int width; int height; int level; int16_t *tmp; tmp = schro_malloc (sizeof (int16_t) * (params->iwt_luma_width + 16)); for (component = 0; component < 3; component++) { SchroFrameData *comp = &frame->components[component]; if (component == 0) { width = params->iwt_luma_width; height = params->iwt_luma_height; } else { width = params->iwt_chroma_width; height = params->iwt_chroma_height; } for (level = 0; level < params->transform_depth; level++) { SchroFrameData fd; fd.format = frame->format; fd.data = comp->data; fd.width = width >> level; fd.height = height >> level; fd.stride = comp->stride << level; schro_wavelet_transform_2d (&fd, params->wavelet_filter_index, tmp); } } schro_free (tmp); } /** * schro_frame_shift_left: * @frame: frame * @shift: number of bits to shift * * Shifts each value in @frame to the left by @shift bits. This * operation happens in-place. */ void schro_frame_shift_left (SchroFrame * frame, int shift) { SchroFrameData *comp; int16_t *data; int i; int y; for (i = 0; i < 3; i++) { comp = &frame->components[i]; for (y = 0; y < comp->height; y++) { data = SCHRO_FRAME_DATA_GET_LINE (comp, y); orc_lshift_s16_ip (data, shift, comp->width); } } } /** * schro_frame_shift_right: * @frame: frame * @shift: number of bits to shift * * Shifts each value in @frame to the right by @shift bits. This * operation happens in-place. */ void schro_frame_shift_right (SchroFrame * frame, int shift) { SchroFrameData *comp; int i; int y; if (SCHRO_FRAME_FORMAT_DEPTH (frame->format) == SCHRO_FRAME_FORMAT_DEPTH_S16) { int16_t *data; for (i = 0; i < 3; i++) { comp = &frame->components[i]; for (y = 0; y < comp->height; y++) { data = SCHRO_FRAME_DATA_GET_LINE (comp, y); orc_add_const_rshift_s16 (data, (1 << shift) >> 1, shift, comp->width); } } } else { int32_t *data; for (i = 0; i < 3; i++) { comp = &frame->components[i]; for (y = 0; y < comp->height; y++) { data = SCHRO_FRAME_DATA_GET_LINE (comp, y); orc_add_const_rshift_s32 (data, (1 << shift) >> 1, shift, comp->width); } } } } #ifdef unused /** * schro_frame_edge_extend: * @frame: frame * @width: width of subpicture * @height: height of subpicture * * Extends the edges of the subpicture defined from 0,0 to @width,@height * to the size of @frame. */ void schro_frame_edge_extend (SchroFrame * frame, int width, int height) { SchroFrameData *comp; int i; int y; int chroma_width; int chroma_height; SCHRO_DEBUG ("extending %d %d -> %d %d", width, height, frame->width, frame->height); chroma_width = ROUND_UP_SHIFT (width, SCHRO_FRAME_FORMAT_H_SHIFT (frame->format)); chroma_height = ROUND_UP_SHIFT (height, SCHRO_FRAME_FORMAT_V_SHIFT (frame->format)); SCHRO_DEBUG ("chroma %d %d -> %d %d", chroma_width, chroma_height, frame->components[1].width, frame->components[1].height); switch (SCHRO_FRAME_FORMAT_DEPTH (frame->format)) { case SCHRO_FRAME_FORMAT_DEPTH_U8: for (i = 0; i < 3; i++) { uint8_t *data; int w, h; comp = &frame->components[i]; data = comp->data; w = (i > 0) ? chroma_width : width; h = (i > 0) ? chroma_height : height; if (w < comp->width) { for (y = 0; y < MIN (h, comp->height); y++) { data = SCHRO_FRAME_DATA_GET_LINE (comp, y); orc_splat_u8_ns (data + w, data[w - 1], comp->width - w); } } for (y = h; y < comp->height; y++) { orc_memcpy (SCHRO_FRAME_DATA_GET_LINE (comp, y), SCHRO_FRAME_DATA_GET_LINE (comp, h - 1), comp->width); } } break; case SCHRO_FRAME_FORMAT_DEPTH_S16: for (i = 0; i < 3; i++) { int16_t *data; int w, h; comp = &frame->components[i]; data = comp->data; w = (i > 0) ? chroma_width : width; h = (i > 0) ? chroma_height : height; if (w < comp->width) { for (y = 0; y < MIN (h, comp->height); y++) { data = SCHRO_FRAME_DATA_GET_LINE (comp, y); orc_splat_s16_ns (data + w, data[w - 1], comp->width - w); } } for (y = h; y < comp->height; y++) { orc_memcpy (SCHRO_FRAME_DATA_GET_LINE (comp, y), SCHRO_FRAME_DATA_GET_LINE (comp, h - 1), comp->width * 2); } } break; default: SCHRO_ERROR ("unimplemented case"); SCHRO_ASSERT (0); break; } } #endif void schro_frame_zero_extend (SchroFrame * frame, int width, int height) { SchroFrameData *comp; int i; int y; int chroma_width; int chroma_height; SCHRO_DEBUG ("extending %d %d -> %d %d", width, height, frame->width, frame->height); chroma_width = ROUND_UP_SHIFT (width, SCHRO_FRAME_FORMAT_H_SHIFT (frame->format)); chroma_height = ROUND_UP_SHIFT (height, SCHRO_FRAME_FORMAT_V_SHIFT (frame->format)); switch (SCHRO_FRAME_FORMAT_DEPTH (frame->format)) { case SCHRO_FRAME_FORMAT_DEPTH_U8: for (i = 0; i < 3; i++) { uint8_t *data; int w, h; comp = &frame->components[i]; data = comp->data; w = (i > 0) ? chroma_width : width; h = (i > 0) ? chroma_height : height; if (w < comp->width) { for (y = 0; y < h; y++) { data = SCHRO_FRAME_DATA_GET_LINE (comp, y); orc_splat_u8_ns (data + w, 0, comp->width - w); } } for (y = h; y < comp->height; y++) { orc_splat_u8_ns (SCHRO_FRAME_DATA_GET_LINE (comp, y), 0, comp->width); } } break; case SCHRO_FRAME_FORMAT_DEPTH_S16: for (i = 0; i < 3; i++) { int16_t *data; int w, h; comp = &frame->components[i]; data = comp->data; w = (i > 0) ? chroma_width : width; h = (i > 0) ? chroma_height : height; if (w < comp->width) { for (y = 0; y < h; y++) { data = SCHRO_FRAME_DATA_GET_LINE (comp, y); orc_splat_s16_ns (data + w, 0, comp->width - w); } } for (y = h; y < comp->height; y++) { orc_splat_s16_ns (SCHRO_FRAME_DATA_GET_LINE (comp, y), 0, comp->width); } } break; default: SCHRO_ERROR ("unimplemented case"); break; } } static void downsample_horiz_u8 (uint8_t * dest, int n_dest, uint8_t * src, int n_src) { int i; if (n_dest < 4) { for (i = 0; i < n_dest; i++) { int x = 0; x += 6 * src[CLAMP (i * 2 - 1, 0, n_src - 1)]; x += 26 * src[CLAMP (i * 2 + 0, 0, n_src - 1)]; x += 26 * src[CLAMP (i * 2 + 1, 0, n_src - 1)]; x += 6 * src[CLAMP (i * 2 + 2, 0, n_src - 1)]; dest[i] = CLAMP ((x + 32) >> 6, 0, 255); } } else { for (i = 0; i < 1; i++) { int x = 0; x += 6 * src[CLAMP (i * 2 - 1, 0, n_src - 1)]; x += 26 * src[CLAMP (i * 2 + 0, 0, n_src - 1)]; x += 26 * src[CLAMP (i * 2 + 1, 0, n_src - 1)]; x += 6 * src[CLAMP (i * 2 + 2, 0, n_src - 1)]; dest[i] = CLAMP ((x + 32) >> 6, 0, 255); } orc_downsample_horiz_u8 (dest + 1, src, n_src / 2 - 2); for (i = n_src / 2 - 2; i < n_dest; i++) { int x = 0; x += 6 * src[CLAMP (i * 2 - 1, 0, n_src - 1)]; x += 26 * src[CLAMP (i * 2 + 0, 0, n_src - 1)]; x += 26 * src[CLAMP (i * 2 + 1, 0, n_src - 1)]; x += 6 * src[CLAMP (i * 2 + 2, 0, n_src - 1)]; dest[i] = CLAMP ((x + 32) >> 6, 0, 255); } } } static void schro_frame_component_downsample (SchroFrameData * dest, SchroFrameData * src) { int i; uint8_t *tmp; tmp = schro_malloc (src->width); for (i = 0; i < dest->height; i++) { orc_downsample_vert_u8 (tmp, SCHRO_FRAME_DATA_GET_LINE (src, CLAMP (i * 2 - 1, 0, src->height - 1)), SCHRO_FRAME_DATA_GET_LINE (src, CLAMP (i * 2 + 0, 0, src->height - 1)), SCHRO_FRAME_DATA_GET_LINE (src, CLAMP (i * 2 + 1, 0, src->height - 1)), SCHRO_FRAME_DATA_GET_LINE (src, CLAMP (i * 2 + 2, 0, src->height - 1)), src->width); downsample_horiz_u8 (SCHRO_FRAME_DATA_GET_LINE (dest, i), dest->width, tmp, src->width); } schro_free (tmp); } void schro_frame_downsample (SchroFrame * dest, SchroFrame * src) { schro_frame_component_downsample (&dest->components[0], &src->components[0]); schro_frame_component_downsample (&dest->components[1], &src->components[1]); schro_frame_component_downsample (&dest->components[2], &src->components[2]); } static void mas8_u8_edgeextend (uint8_t * d, const uint8_t * s, const int16_t * taps, int offset, int shift, int index_offset, int n) { int i, j; int x; if (n <= 8) { for (i = 0; i < n; i++) { x = 0; for (j = 0; j < 8; j++) { x += s[CLAMP (i + j - index_offset, 0, n - 1)] * taps[j]; } d[i] = CLAMP ((x + offset) >> shift, 0, 255); } } else { for (i = 0; i < index_offset; i++) { x = 0; for (j = 0; j < 8; j++) { x += s[CLAMP (i + j - index_offset, 0, n - 1)] * taps[j]; } d[i] = CLAMP ((x + offset) >> shift, 0, 255); } for (i = index_offset; i < n - 8 + index_offset; i++) { x = 0; for (j = 0; j < 8; j++) { x += s[i + j - index_offset] * taps[j]; } d[i] = CLAMP ((x + offset) >> shift, 0, 255); } for (i = n - 8 + index_offset; i < n; i++) { x = 0; for (j = 0; j < 8; j++) { x += s[CLAMP (i + j - index_offset, 0, n - 1)] * taps[j]; } d[i] = CLAMP ((x + offset) >> shift, 0, 255); } i = n - 1; d[i] = s[i]; } } void schro_frame_upsample_horiz (SchroFrame * dest, SchroFrame * src) { int j, k; SchroFrameData *dcomp; SchroFrameData *scomp; if (SCHRO_FRAME_FORMAT_DEPTH (dest->format) != SCHRO_FRAME_FORMAT_DEPTH_U8 || SCHRO_FRAME_FORMAT_DEPTH (src->format) != SCHRO_FRAME_FORMAT_DEPTH_U8 || src->format != dest->format) { SCHRO_ERROR ("unimplemented"); return; } for (k = 0; k < 3; k++) { static const int16_t taps[8] = { -1, 3, -7, 21, 21, -7, 3, -1 }; dcomp = &dest->components[k]; scomp = &src->components[k]; for (j = 0; j < dcomp->height; j++) { mas8_u8_edgeextend (SCHRO_FRAME_DATA_GET_LINE (dcomp, j), SCHRO_FRAME_DATA_GET_LINE (scomp, j), taps, 16, 5, 3, scomp->width); } } } static void mas8_across_u8 (uint8_t * dest, const uint8_t * src, int stride, const int16_t * weights, int offset, int shift, int n) { int i; for (i = 0; i < n; i++) { int x = offset; x += ((uint8_t *) SCHRO_OFFSET (src, stride * 0))[i] * weights[0]; x += ((uint8_t *) SCHRO_OFFSET (src, stride * 1))[i] * weights[1]; x += ((uint8_t *) SCHRO_OFFSET (src, stride * 2))[i] * weights[2]; x += ((uint8_t *) SCHRO_OFFSET (src, stride * 3))[i] * weights[3]; x += ((uint8_t *) SCHRO_OFFSET (src, stride * 4))[i] * weights[4]; x += ((uint8_t *) SCHRO_OFFSET (src, stride * 5))[i] * weights[5]; x += ((uint8_t *) SCHRO_OFFSET (src, stride * 6))[i] * weights[6]; x += ((uint8_t *) SCHRO_OFFSET (src, stride * 7))[i] * weights[7]; dest[i] = CLAMP (x >> shift, 0, 255); } } static void mas8_across_u8_slow (uint8_t * d, uint8_t ** s1_a8, const int16_t * s2_8, int offset, int shift, int n) { int i; int j; int x; for (i = 0; i < n; i++) { x = 0; for (j = 0; j < 8; j++) { x += s1_a8[j][i] * s2_8[j]; } d[i] = CLAMP ((x + offset) >> shift, 0, 255); } } void schro_frame_upsample_vert (SchroFrame * dest, SchroFrame * src) { int i, j, k; SchroFrameData *dcomp; SchroFrameData *scomp; if (SCHRO_FRAME_FORMAT_DEPTH (dest->format) != SCHRO_FRAME_FORMAT_DEPTH_U8 || SCHRO_FRAME_FORMAT_DEPTH (src->format) != SCHRO_FRAME_FORMAT_DEPTH_U8 || src->format != dest->format) { SCHRO_ERROR ("unimplemented"); return; } for (k = 0; k < 3; k++) { static const int16_t taps[8] = { -1, 3, -7, 21, 21, -7, 3, -1 }; uint8_t *list[8]; dcomp = &dest->components[k]; scomp = &src->components[k]; for (j = 0; j < dcomp->height - 1; j++) { if (j < 3 || j >= scomp->height - 4) { for (i = 0; i < 8; i++) { list[i] = SCHRO_FRAME_DATA_GET_LINE (scomp, CLAMP (i + j - 3, 0, scomp->height - 1)); } mas8_across_u8_slow (SCHRO_FRAME_DATA_GET_LINE (dcomp, j), list, taps, 16, 5, scomp->width); } else { SCHRO_ASSERT (j - 3 >= 0); SCHRO_ASSERT (j - 3 + 7 < scomp->height); mas8_across_u8 (SCHRO_FRAME_DATA_GET_LINE (dcomp, j), SCHRO_FRAME_DATA_GET_LINE (scomp, j - 3), scomp->stride, taps, 16, 5, scomp->width); } } j = dcomp->height - 1; orc_memcpy (SCHRO_FRAME_DATA_GET_LINE (dcomp, j), SCHRO_FRAME_DATA_GET_LINE (scomp, j), dcomp->width); } } double schro_frame_calculate_average_luma (SchroFrame * frame) { SchroFrameData *comp; int j; int sum = 0; int n; comp = &frame->components[0]; switch (SCHRO_FRAME_FORMAT_DEPTH (frame->format)) { case SCHRO_FRAME_FORMAT_DEPTH_U8: for (j = 0; j < comp->height; j++) { int32_t linesum; orc_sum_u8 (&linesum, SCHRO_FRAME_DATA_GET_LINE (comp, j), comp->width); sum += linesum; } break; case SCHRO_FRAME_FORMAT_DEPTH_S16: for (j = 0; j < comp->height; j++) { int32_t linesum; orc_sum_s16 (&linesum, SCHRO_FRAME_DATA_GET_LINE (comp, j), comp->width); sum += linesum; } break; default: SCHRO_ERROR ("unimplemented"); break; } n = comp->height * comp->width; return (double) sum / n; } SchroFrame * schro_frame_convert_to_444 (SchroFrame * frame) { SchroFrame *dest; SCHRO_ASSERT (frame->format == SCHRO_FRAME_FORMAT_U8_420); dest = schro_frame_new_and_alloc (frame->domain, SCHRO_FRAME_FORMAT_U8_444, frame->width, frame->height); schro_frame_convert (dest, frame); return dest; } /* Copied from elsewhere */ /* * 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. */ #ifdef WORDS_BIGENDIAN #define uint32_to_host(a) \ ((((a)&0xff)<<24)|(((a)&0xff00)<<8)|(((a)&0xff0000)>>8)|(((a)>>24)&0xff)) #else #define uint32_to_host(a) (a) #endif #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)) #define MD5STEP(f,w,x,y,z,in,offset,s) \ (w += f(x,y,z) + uint32_to_host(in) + offset, w = (w<>(32-s)) + x) static void schro_md5 (uint32_t * state, uint32_t * src) { uint32_t a, b, c, d; a = state[0]; b = state[1]; c = state[2]; d = state[3]; MD5STEP (F1, a, b, c, d, src[0], 0xd76aa478, 7); MD5STEP (F1, d, a, b, c, src[1], 0xe8c7b756, 12); MD5STEP (F1, c, d, a, b, src[2], 0x242070db, 17); MD5STEP (F1, b, c, d, a, src[3], 0xc1bdceee, 22); MD5STEP (F1, a, b, c, d, src[4], 0xf57c0faf, 7); MD5STEP (F1, d, a, b, c, src[5], 0x4787c62a, 12); MD5STEP (F1, c, d, a, b, src[6], 0xa8304613, 17); MD5STEP (F1, b, c, d, a, src[7], 0xfd469501, 22); MD5STEP (F1, a, b, c, d, src[8], 0x698098d8, 7); MD5STEP (F1, d, a, b, c, src[9], 0x8b44f7af, 12); MD5STEP (F1, c, d, a, b, src[10], 0xffff5bb1, 17); MD5STEP (F1, b, c, d, a, src[11], 0x895cd7be, 22); MD5STEP (F1, a, b, c, d, src[12], 0x6b901122, 7); MD5STEP (F1, d, a, b, c, src[13], 0xfd987193, 12); MD5STEP (F1, c, d, a, b, src[14], 0xa679438e, 17); MD5STEP (F1, b, c, d, a, src[15], 0x49b40821, 22); MD5STEP (F2, a, b, c, d, src[1], 0xf61e2562, 5); MD5STEP (F2, d, a, b, c, src[6], 0xc040b340, 9); MD5STEP (F2, c, d, a, b, src[11], 0x265e5a51, 14); MD5STEP (F2, b, c, d, a, src[0], 0xe9b6c7aa, 20); MD5STEP (F2, a, b, c, d, src[5], 0xd62f105d, 5); MD5STEP (F2, d, a, b, c, src[10], 0x02441453, 9); MD5STEP (F2, c, d, a, b, src[15], 0xd8a1e681, 14); MD5STEP (F2, b, c, d, a, src[4], 0xe7d3fbc8, 20); MD5STEP (F2, a, b, c, d, src[9], 0x21e1cde6, 5); MD5STEP (F2, d, a, b, c, src[14], 0xc33707d6, 9); MD5STEP (F2, c, d, a, b, src[3], 0xf4d50d87, 14); MD5STEP (F2, b, c, d, a, src[8], 0x455a14ed, 20); MD5STEP (F2, a, b, c, d, src[13], 0xa9e3e905, 5); MD5STEP (F2, d, a, b, c, src[2], 0xfcefa3f8, 9); MD5STEP (F2, c, d, a, b, src[7], 0x676f02d9, 14); MD5STEP (F2, b, c, d, a, src[12], 0x8d2a4c8a, 20); MD5STEP (F3, a, b, c, d, src[5], 0xfffa3942, 4); MD5STEP (F3, d, a, b, c, src[8], 0x8771f681, 11); MD5STEP (F3, c, d, a, b, src[11], 0x6d9d6122, 16); MD5STEP (F3, b, c, d, a, src[14], 0xfde5380c, 23); MD5STEP (F3, a, b, c, d, src[1], 0xa4beea44, 4); MD5STEP (F3, d, a, b, c, src[4], 0x4bdecfa9, 11); MD5STEP (F3, c, d, a, b, src[7], 0xf6bb4b60, 16); MD5STEP (F3, b, c, d, a, src[10], 0xbebfbc70, 23); MD5STEP (F3, a, b, c, d, src[13], 0x289b7ec6, 4); MD5STEP (F3, d, a, b, c, src[0], 0xeaa127fa, 11); MD5STEP (F3, c, d, a, b, src[3], 0xd4ef3085, 16); MD5STEP (F3, b, c, d, a, src[6], 0x04881d05, 23); MD5STEP (F3, a, b, c, d, src[9], 0xd9d4d039, 4); MD5STEP (F3, d, a, b, c, src[12], 0xe6db99e5, 11); MD5STEP (F3, c, d, a, b, src[15], 0x1fa27cf8, 16); MD5STEP (F3, b, c, d, a, src[2], 0xc4ac5665, 23); MD5STEP (F4, a, b, c, d, src[0], 0xf4292244, 6); MD5STEP (F4, d, a, b, c, src[7], 0x432aff97, 10); MD5STEP (F4, c, d, a, b, src[14], 0xab9423a7, 15); MD5STEP (F4, b, c, d, a, src[5], 0xfc93a039, 21); MD5STEP (F4, a, b, c, d, src[12], 0x655b59c3, 6); MD5STEP (F4, d, a, b, c, src[3], 0x8f0ccc92, 10); MD5STEP (F4, c, d, a, b, src[10], 0xffeff47d, 15); MD5STEP (F4, b, c, d, a, src[1], 0x85845dd1, 21); MD5STEP (F4, a, b, c, d, src[8], 0x6fa87e4f, 6); MD5STEP (F4, d, a, b, c, src[15], 0xfe2ce6e0, 10); MD5STEP (F4, c, d, a, b, src[6], 0xa3014314, 15); MD5STEP (F4, b, c, d, a, src[13], 0x4e0811a1, 21); MD5STEP (F4, a, b, c, d, src[4], 0xf7537e82, 6); MD5STEP (F4, d, a, b, c, src[11], 0xbd3af235, 10); MD5STEP (F4, c, d, a, b, src[2], 0x2ad7d2bb, 15); MD5STEP (F4, b, c, d, a, src[9], 0xeb86d391, 21); state[0] += a; state[1] += b; state[2] += c; state[3] += d; } /* END Copied from elsewhere */ void schro_frame_md5 (SchroFrame * frame, uint32_t * state) { uint8_t *line; int x, y, k; state[0] = 0x67452301; state[1] = 0xefcdab89; state[2] = 0x98badcfe; state[3] = 0x10325476; x = 0; y = 0; k = 0; for (k = 0; k < 3; k++) { for (y = 0; y < frame->components[k].height; y++) { line = SCHRO_FRAME_DATA_GET_LINE (&frame->components[k], y); for (x = 0; x + 63 < frame->components[k].width; x += 64) { schro_md5 (state, (uint32_t *) (line + x)); } if (x < frame->components[k].width) { uint8_t tmp[64]; int left; left = frame->components[k].width - x; memcpy (tmp, line + x, left); memset (tmp + left, 0, 64 - left); schro_md5 (state, (uint32_t *) tmp); } } } state[0] = uint32_to_host(state[0]); state[1] = uint32_to_host(state[1]); state[2] = uint32_to_host(state[2]); state[3] = uint32_to_host(state[3]); SCHRO_DEBUG ("md5 %02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x", state[0] & 0xff, (state[0] >> 8) & 0xff, (state[0] >> 16) & 0xff, (state[0] >> 24) & 0xff, state[1] & 0xff, (state[1] >> 8) & 0xff, (state[1] >> 16) & 0xff, (state[1] >> 24) & 0xff, state[2] & 0xff, (state[2] >> 8) & 0xff, (state[2] >> 16) & 0xff, (state[2] >> 24) & 0xff, state[3] & 0xff, (state[3] >> 8) & 0xff, (state[3] >> 16) & 0xff, (state[3] >> 24) & 0xff); } void schro_frame_data_get_codeblock (SchroFrameData * dest, SchroFrameData * src, int x, int y, int horiz_codeblocks, int vert_codeblocks) { int xmin = (src->width * x) / horiz_codeblocks; int xmax = (src->width * (x + 1)) / horiz_codeblocks; int ymin = (src->height * y) / vert_codeblocks; int ymax = (src->height * (y + 1)) / vert_codeblocks; dest->format = src->format; if (SCHRO_FRAME_FORMAT_DEPTH (src->format) == SCHRO_FRAME_FORMAT_DEPTH_S32) { dest->data = SCHRO_FRAME_DATA_GET_PIXEL_S32 (src, xmin, ymin); } else { dest->data = SCHRO_FRAME_DATA_GET_PIXEL_S16 (src, xmin, ymin); } dest->stride = src->stride; dest->width = xmax - xmin; dest->height = ymax - ymin; dest->length = 0; dest->h_shift = src->h_shift; dest->v_shift = src->v_shift; } void schro_frame_split_fields (SchroFrame * dest1, SchroFrame * dest2, SchroFrame * src) { SchroFrame src_tmp; SCHRO_ASSERT ((src->height & 1) == 0); memcpy (&src_tmp, src, sizeof (src_tmp)); src_tmp.height = src->height / 2; src_tmp.components[0].stride *= 2; src_tmp.components[1].stride *= 2; src_tmp.components[2].stride *= 2; schro_frame_convert (dest1, &src_tmp); src_tmp.components[0].data = SCHRO_FRAME_DATA_GET_LINE (&src->components[0], 1); src_tmp.components[1].data = SCHRO_FRAME_DATA_GET_LINE (&src->components[1], 1); src_tmp.components[2].data = SCHRO_FRAME_DATA_GET_LINE (&src->components[2], 1); schro_frame_convert (dest2, &src_tmp); } /* upsampled frame */ SchroUpsampledFrame * schro_upsampled_frame_new (SchroFrame * frame) { SchroUpsampledFrame *df; df = schro_malloc0 (sizeof (SchroUpsampledFrame)); SCHRO_ASSERT (frame->is_upsampled); df->frames[0] = frame; return df; } void schro_upsampled_frame_free (SchroUpsampledFrame * df) { int i; for (i = 0; i < 4; i++) { if (df->frames[i]) { schro_frame_unref (df->frames[i]); } } schro_free (df); } static void schro_frame_mc_edgeextend_horiz (SchroFrame * frame, SchroFrame * src) { int k; int j; for (k = 0; k < 3; k++) { int width = frame->components[k].width; for (j = 0; j < frame->components[k].height; j++) { uint8_t *line = SCHRO_FRAME_DATA_GET_LINE (frame->components + k, j); uint8_t *src_line = SCHRO_FRAME_DATA_GET_LINE (src->components + k, j); memset (line - frame->extension, src_line[0], frame->extension); /* A picture of size (w,h) is upconverted to (2*w-1,2*h-1) * However, schroedinger's effective upconverted size is (2*w,2*h) * Remember to overwrite the last horizontal pel */ memset (line + width - 1, src_line[width - 1], frame->extension + 1); } } } static void schro_frame_mc_edgeextend_vert (SchroFrame * frame, SchroFrame * src) { int k; int j; for (k = 0; k < 3; k++) { int height = frame->components[k].height; int width = frame->components[k].width; for (j = 0; j < frame->extension; j++) { orc_memcpy (SCHRO_OFFSET (SCHRO_FRAME_DATA_GET_LINE (frame->components + k, -j - 1), -frame->extension), SCHRO_OFFSET (SCHRO_FRAME_DATA_GET_LINE (src->components + k, 0), -frame->extension), width + frame->extension * 2); orc_memcpy (SCHRO_OFFSET (SCHRO_FRAME_DATA_GET_LINE (frame->components + k, height + j), -frame->extension), SCHRO_OFFSET (SCHRO_FRAME_DATA_GET_LINE (src->components + k, height - 1), -frame->extension), width + frame->extension * 2); } /* A picture of size (w,h) is upconverted to (2*w-1,2*h-1) * However, schroedinger's effective upconverted size is (2*w,2*h) * Copy the src into the bottom line of frame. * NB, this assumes that orc_memcpy is safe when src == dest */ orc_memcpy (SCHRO_OFFSET (SCHRO_FRAME_DATA_GET_LINE (frame->components + k, height - 1), -frame->extension), SCHRO_OFFSET (SCHRO_FRAME_DATA_GET_LINE (src->components + k, height - 1), -frame->extension), width + frame->extension * 2); } } void schro_frame_mc_edgeextend (SchroFrame * frame) { schro_frame_mc_edgeextend_horiz (frame, frame); schro_frame_mc_edgeextend_vert (frame, frame); } void schro_upsampled_frame_upsample (SchroUpsampledFrame * df) { int i; if (df->frames[1]) return; for (i=1;i<4;i++){ df->frames[i] = schro_frame_new(); df->frames[i]->format = df->frames[0]->format; df->frames[i]->width = df->frames[0]->width; df->frames[i]->height = df->frames[0]->height; df->frames[i]->extension = df->frames[0]->extension; memcpy (df->frames[i]->components, df->frames[0]->components, sizeof (SchroFrameData) * 3); df->frames[i]->components[0].data += (df->frames[i]->components[0].stride >> 2) * i; df->frames[i]->components[1].data += (df->frames[i]->components[1].stride >> 2) * i; df->frames[i]->components[2].data += (df->frames[i]->components[2].stride >> 2) * i; } schro_frame_upsample_vert (df->frames[2], df->frames[0]); schro_frame_mc_edgeextend_horiz (df->frames[2], df->frames[2]); schro_frame_mc_edgeextend_vert (df->frames[2], df->frames[0]); schro_frame_upsample_horiz (df->frames[1], df->frames[0]); schro_frame_mc_edgeextend_horiz (df->frames[1], df->frames[0]); schro_frame_mc_edgeextend_vert (df->frames[1], df->frames[1]); schro_frame_upsample_horiz (df->frames[3], df->frames[2]); schro_frame_mc_edgeextend_horiz (df->frames[3], df->frames[2]); schro_frame_mc_edgeextend_vert (df->frames[3], df->frames[1]); } #ifdef ENABLE_MOTION_REF int schro_upsampled_frame_get_pixel_prec0 (SchroUpsampledFrame * upframe, int k, int x, int y) { SchroFrameData *comp; uint8_t *line; comp = upframe->frames[0]->components + k; x = CLAMP (x, 0, comp->width - 1); y = CLAMP (y, 0, comp->height - 1); line = SCHRO_FRAME_DATA_GET_LINE (comp, y); return line[x]; } int schro_frame_get_data (SchroFrame * frame, SchroFrameData * fd, int k, int x, int y) { SchroFrameData *comp = frame->components + k; SCHRO_ASSERT (frame && fd && !(0 > x) && !(0 > y)); /* check whether the required block lies completely outside the frame */ if (!(frame->width > x) || !(frame->height > y)) { return FALSE; } SCHRO_ASSERT (SCHRO_FRAME_FORMAT_DEPTH (comp->format) == SCHRO_FRAME_FORMAT_DEPTH_U8); fd->format = comp->format; fd->data = SCHRO_FRAME_DATA_GET_PIXEL_U8 (comp, x, y); fd->stride = comp->stride; fd->width = comp->width - x; fd->height = comp->height - y; fd->h_shift = comp->h_shift; fd->v_shift = comp->v_shift; return TRUE; } #ifdef unused void schro_upsampled_frame_get_block_prec0 (SchroUpsampledFrame * upframe, int k, int x, int y, SchroFrameData * fd) { int i, j; uint8_t *data; for (j = 0; j < fd->height; j++) { data = SCHRO_FRAME_DATA_GET_LINE (fd, j); for (i = 0; i < fd->width; i++) { data[i] = schro_upsampled_frame_get_pixel_prec0 (upframe, k, x + i, y + j); } } } #endif #endif #ifdef unused void schro_upsampled_frame_get_block_fast_prec0 (SchroUpsampledFrame * upframe, int k, int x, int y, SchroFrameData * fd) { SchroFrameData *comp; int j; comp = upframe->frames[0]->components + k; for (j = 0; j < fd->height; j++) { uint8_t *dest = SCHRO_FRAME_DATA_GET_LINE (fd, j); uint8_t *src = SCHRO_FRAME_DATA_GET_LINE (comp, y + j); memcpy (dest, src + x, fd->width); } } #endif void schro_upsampled_frame_get_subdata_prec0 (SchroUpsampledFrame * upframe, int component, int x, int y, SchroFrameData * fd) { SchroFrameData *comp = upframe->frames[0]->components + component; fd->data = SCHRO_FRAME_DATA_GET_PIXEL_U8 (comp, x, y); fd->stride = comp->stride; } #ifdef ENABLE_MOTION_REF int schro_upsampled_frame_get_pixel_prec1 (SchroUpsampledFrame * upframe, int k, int x, int y) { SchroFrameData *comp; uint8_t *line; int i; comp = upframe->frames[0]->components + k; x = CLAMP (x, 0, comp->width * 2 - 2); y = CLAMP (y, 0, comp->height * 2 - 2); i = ((y & 1) << 1) | (x & 1); x >>= 1; y >>= 1; comp = upframe->frames[i]->components + k; line = SCHRO_FRAME_DATA_GET_LINE (comp, y); return line[x]; } #ifdef unused void schro_upsampled_frame_get_block_prec1 (SchroUpsampledFrame * upframe, int k, int x, int y, SchroFrameData * fd) { int i, j; uint8_t *data; for (j = 0; j < fd->height; j++) { data = SCHRO_FRAME_DATA_GET_LINE (fd, j); for (i = 0; i < fd->width; i++) { data[i] = schro_upsampled_frame_get_pixel_prec1 (upframe, k, x + (i << 1), y + (j << 1)); } } } #endif #endif static void schro_upsampled_frame_get_block_fast_prec1 (SchroUpsampledFrame * upframe, int k, int x, int y, SchroFrameData * fd) { SchroFrameData *comp; int i; int j; i = ((y & 1) << 1) | (x & 1); x >>= 1; y >>= 1; comp = upframe->frames[i]->components + k; for (j = 0; j < fd->height; j++) { uint8_t *dest = SCHRO_FRAME_DATA_GET_LINE (fd, j); uint8_t *src = SCHRO_FRAME_DATA_GET_LINE (comp, y + j); orc_memcpy (dest, src + x, fd->width); } } static void __schro_upsampled_frame_get_subdata_prec1 (SchroUpsampledFrame * upframe, int k, int x, int y, SchroFrameData * fd) { SchroFrameData *comp; int i; i = ((y & 1) << 1) | (x & 1); x >>= 1; y >>= 1; comp = upframe->frames[i]->components + k; fd->data = SCHRO_FRAME_DATA_GET_PIXEL_U8 (comp, x, y); fd->stride = comp->stride; } void schro_upsampled_frame_get_subdata_prec1 (SchroUpsampledFrame * upframe, int k, int x, int y, SchroFrameData * fd) { __schro_upsampled_frame_get_subdata_prec1 (upframe, k, x, y, fd); } #ifdef ENABLE_MOTION_REF int schro_upsampled_frame_get_pixel_prec3 (SchroUpsampledFrame * upframe, int k, int x, int y) { int hx, hy; int rx, ry; int w00, w01, w10, w11; int value; hx = x >> 2; hy = y >> 2; rx = x & 0x3; ry = y & 0x3; w00 = (4 - ry) * (4 - rx); w01 = (4 - ry) * rx; w10 = ry * (4 - rx); w11 = ry * rx; if (hx >= 0 && hx < 2 * upframe->frames[0]->components[k].width - 2 && hy >= 0 && hy < 2 * upframe->frames[0]->components[k].height - 2) { SchroFrameData *comp; int p; int i; i = ((hy & 1) << 1) | (hx & 1); comp = upframe->frames[i]->components + k; p = *SCHRO_FRAME_DATA_GET_PIXEL_U8 (comp, hx >> 1, hy >> 1); value = w00 * p; comp = upframe->frames[i ^ 1]->components + k; p = *SCHRO_FRAME_DATA_GET_PIXEL_U8 (comp, (hx + 1) >> 1, hy >> 1); value += w01 * p; comp = upframe->frames[i ^ 2]->components + k; p = *SCHRO_FRAME_DATA_GET_PIXEL_U8 (comp, hx >> 1, (hy + 1) >> 1); value += w10 * p; comp = upframe->frames[i ^ 3]->components + k; p = *SCHRO_FRAME_DATA_GET_PIXEL_U8 (comp, (hx + 1) >> 1, (hy + 1) >> 1); value += w11 * p; } else { value = w00 * schro_upsampled_frame_get_pixel_prec1 (upframe, k, hx, hy); value += w01 * schro_upsampled_frame_get_pixel_prec1 (upframe, k, hx + 1, hy); value += w10 * schro_upsampled_frame_get_pixel_prec1 (upframe, k, hx, hy + 1); value += w11 * schro_upsampled_frame_get_pixel_prec1 (upframe, k, hx + 1, hy + 1); } return ROUND_SHIFT (value, 4); } #ifdef unused void schro_upsampled_frame_get_block_prec3 (SchroUpsampledFrame * upframe, int k, int x, int y, SchroFrameData * fd) { int i, j; uint8_t *data; for (j = 0; j < fd->height; j++) { data = SCHRO_FRAME_DATA_GET_LINE (fd, j); for (i = 0; i < fd->width; i++) { data[i] = schro_upsampled_frame_get_pixel_prec3 (upframe, k, x + (i << 3), y + (j << 3)); } } } #endif #endif static void schro_upsampled_frame_get_block_fast_prec3 (SchroUpsampledFrame * upframe, int k, int x, int y, SchroFrameData * fd) { int hx, hy; int rx, ry; int w00, w01, w10, w11; SchroFrameData fd00; SchroFrameData fd01; SchroFrameData fd10; SchroFrameData fd11; hx = x >> 2; hy = y >> 2; rx = x & 0x3; ry = y & 0x3; switch ((ry << 2) | rx) { case 0: schro_upsampled_frame_get_block_fast_prec1 (upframe, k, hx, hy, fd); break; case 2: case 8: __schro_upsampled_frame_get_subdata_prec1 (upframe, k, hx, hy, &fd00); if (rx == 0) { __schro_upsampled_frame_get_subdata_prec1 (upframe, k, hx, hy + 1, &fd10); } else { __schro_upsampled_frame_get_subdata_prec1 (upframe, k, hx + 1, hy, &fd10); } switch (fd->width) { case 8: orc_avg2_8xn_u8 (fd->data, fd->stride, fd00.data, fd00.stride, fd10.data, fd10.stride, fd->height); break; case 12: orc_avg2_12xn_u8 (fd->data, fd->stride, fd00.data, fd00.stride, fd10.data, fd10.stride, fd->height); break; case 16: orc_avg2_16xn_u8 (fd->data, fd->stride, fd00.data, fd00.stride, fd10.data, fd10.stride, fd->height); break; case 24: orc_avg2_16xn_u8 (fd->data, fd->stride, fd00.data, fd00.stride, fd10.data, fd10.stride, fd->height); orc_avg2_8xn_u8 (SCHRO_OFFSET (fd->data, 16), fd->stride, SCHRO_OFFSET (fd00.data, 16), fd00.stride, SCHRO_OFFSET (fd10.data, 16), fd10.stride, fd->height); break; case 32: orc_avg2_32xn_u8 (fd->data, fd->stride, fd00.data, fd00.stride, fd10.data, fd10.stride, fd->height); break; default: orc_avg2_nxm_u8 (fd->data, fd->stride, fd00.data, fd00.stride, fd10.data, fd10.stride, fd->width, fd->height); break; } break; default: w00 = (4 - ry) * (4 - rx); w01 = (4 - ry) * rx; w10 = ry * (4 - rx); w11 = ry * rx; __schro_upsampled_frame_get_subdata_prec1 (upframe, k, hx, hy, &fd00); __schro_upsampled_frame_get_subdata_prec1 (upframe, k, hx + 1, hy, &fd01); __schro_upsampled_frame_get_subdata_prec1 (upframe, k, hx, hy + 1, &fd10); __schro_upsampled_frame_get_subdata_prec1 (upframe, k, hx + 1, hy + 1, &fd11); switch (fd->width) { #if 0 case 8: orc_combine4_8xn_u8 (fd->data, fd->stride, fd00.data, fd00.stride, fd01.data, fd01.stride, fd10.data, fd10.stride, fd11.data, fd11.stride, w00, w01, w10, w11, fd->height); break; case 12: orc_combine4_12xn_u8 (fd->data, fd->stride, fd00.data, fd00.stride, fd01.data, fd01.stride, fd10.data, fd10.stride, fd11.data, fd11.stride, w00, w01, w10, w11, fd->height); break; case 16: orc_combine4_16xn_u8 (fd->data, fd->stride, fd00.data, fd00.stride, fd01.data, fd01.stride, fd10.data, fd10.stride, fd11.data, fd11.stride, w00, w01, w10, w11, fd->height); break; case 24: orc_combine4_24xn_u8 (fd->data, fd->stride, fd00.data, fd00.stride, fd01.data, fd01.stride, fd10.data, fd10.stride, fd11.data, fd11.stride, w00, w01, w10, w11, fd->height); break; case 32: orc_combine4_32xn_u8 (fd->data, fd->stride, fd00.data, fd00.stride, fd01.data, fd01.stride, fd10.data, fd10.stride, fd11.data, fd11.stride, w00, w01, w10, w11, fd->height); break; #endif default: orc_combine4_nxm_u8 (fd->data, fd->stride, fd00.data, fd00.stride, fd01.data, fd01.stride, fd10.data, fd10.stride, fd11.data, fd11.stride, w00, w01, w10, w11, fd->width, fd->height); break; } break; } } #ifdef ENABLE_MOTION_REF int schro_upsampled_frame_get_pixel_precN (SchroUpsampledFrame * upframe, int k, int x, int y, int prec) { switch (prec) { case 0: return schro_upsampled_frame_get_pixel_prec0 (upframe, k, x, y); case 1: return schro_upsampled_frame_get_pixel_prec1 (upframe, k, x, y); case 2: return schro_upsampled_frame_get_pixel_prec3 (upframe, k, x << 1, y << 1); case 3: return schro_upsampled_frame_get_pixel_prec3 (upframe, k, x, y); default: SCHRO_ASSERT (0); } } #ifdef unused void schro_upsampled_frame_get_block_precN (SchroUpsampledFrame * upframe, int k, int x, int y, int prec, SchroFrameData * fd) { switch (prec) { case 0: schro_upsampled_frame_get_block_prec0 (upframe, k, x, y, fd); return; case 1: schro_upsampled_frame_get_block_prec1 (upframe, k, x, y, fd); return; case 2: schro_upsampled_frame_get_block_prec3 (upframe, k, x << 1, y << 1, fd); return; case 3: schro_upsampled_frame_get_block_prec3 (upframe, k, x, y, fd); return; default: SCHRO_ASSERT (0); } } #endif #endif void schro_upsampled_frame_get_block_fast_precN (SchroUpsampledFrame * upframe, int k, int x, int y, int prec, SchroFrameData * dest, SchroFrameData * fd) { switch (prec) { case 0: schro_upsampled_frame_get_subdata_prec0 (upframe, k, x, y, dest); return; case 1: schro_upsampled_frame_get_subdata_prec1 (upframe, k, x, y, dest); return; case 2: memcpy (dest, fd, sizeof (SchroFrameData)); schro_upsampled_frame_get_block_fast_prec3 (upframe, k, x << 1, y << 1, dest); return; case 3: memcpy (dest, fd, sizeof (SchroFrameData)); schro_upsampled_frame_get_block_fast_prec3 (upframe, k, x, y, dest); return; default: SCHRO_ASSERT (0); } } void schro_frame_get_subdata (SchroFrame * frame, SchroFrameData * fd, int component, int x, int y) { SchroFrameData *comp = frame->components + component; SCHRO_ASSERT (SCHRO_FRAME_FORMAT_DEPTH (comp->format) == SCHRO_FRAME_FORMAT_DEPTH_U8); fd->format = comp->format; fd->data = SCHRO_FRAME_DATA_GET_PIXEL_U8 (comp, x, y); fd->stride = comp->stride; fd->width = MAX (0, comp->width - x); fd->height = MAX (0, comp->height - y); fd->h_shift = comp->h_shift; fd->v_shift = comp->v_shift; } void schro_frame_get_reference_subdata (SchroFrame * frame, SchroFrameData * fd, int component, int x, int y) { SchroFrameData *comp = frame->components + component; int extension = frame->extension; schro_frame_get_subdata (frame, fd, component, x, y); /* modify width and height to account for a reference block * that can be completely outside of a frame */ fd->width = MAX (0, comp->width + extension - x); fd->height = MAX (0, comp->height + extension - y); } int schro_frame_get_bit_depth (SchroFrame *frame) { if (frame->format == SCHRO_FRAME_FORMAT_v210) { return 10; } switch (SCHRO_FRAME_FORMAT_DEPTH(frame->format)) { case SCHRO_FRAME_FORMAT_DEPTH_U8: return 8; case SCHRO_FRAME_FORMAT_DEPTH_S16: return 16; case SCHRO_FRAME_FORMAT_DEPTH_S32: return 32; } return 0; } schroedinger-1.0.11/schroedinger/schrodebug.h0000644000175000017500000000354511265400145016146 00000000000000 #ifndef __SCHRO_DEBUG_H__ #define __SCHRO_DEBUG_H__ #include #include #include SCHRO_BEGIN_DECLS enum { SCHRO_LEVEL_NONE = 0, SCHRO_LEVEL_ERROR, SCHRO_LEVEL_WARNING, SCHRO_LEVEL_INFO, SCHRO_LEVEL_DEBUG, SCHRO_LEVEL_LOG }; #ifdef SCHRO_ENABLE_UNSTABLE_API enum { SCHRO_DUMP_SUBBAND_CURVE, SCHRO_DUMP_SUBBAND_EST, SCHRO_DUMP_PICTURE, SCHRO_DUMP_PSNR, SCHRO_DUMP_SSIM, SCHRO_DUMP_LAMBDA_CURVE, SCHRO_DUMP_HIST_TEST, SCHRO_DUMP_SCENE_CHANGE, SCHRO_DUMP_PHASE_CORR, SCHRO_DUMP_MOTIONEST, SCHRO_DUMP_LAST }; #endif typedef void (*SchroDebugLogFunc) (int level, const char *file, const char *func, int line, const char *format, va_list varargs); #define SCHRO_ERROR(...) \ SCHRO_DEBUG_LEVEL(SCHRO_LEVEL_ERROR, __VA_ARGS__) #define SCHRO_WARNING(...) \ SCHRO_DEBUG_LEVEL(SCHRO_LEVEL_WARNING, __VA_ARGS__) #define SCHRO_INFO(...) \ SCHRO_DEBUG_LEVEL(SCHRO_LEVEL_INFO, __VA_ARGS__) #define SCHRO_DEBUG(...) \ SCHRO_DEBUG_LEVEL(SCHRO_LEVEL_DEBUG, __VA_ARGS__) #define SCHRO_LOG(...) \ SCHRO_DEBUG_LEVEL(SCHRO_LEVEL_LOG, __VA_ARGS__) #define SCHRO_DEBUG_LEVEL(level,...) \ schro_debug_log ((level), __FILE__, __FUNCTION__, __LINE__, __VA_ARGS__) #define SCHRO_ASSERT(test) do { \ if (!(test)) { \ SCHRO_ERROR("assertion failed: " #test ); \ abort(); \ } \ } while(0) #define SCHRO_MILD_ASSERT(test) do { \ if (!(test)) { \ SCHRO_ERROR("mild assertion failed: " #test ); \ abort(); \ } \ } while(0) void schro_debug_log (int level, const char *file, const char *function, int line, const char *format, ...); void schro_debug_set_level (int level); int schro_debug_get_level (void); void schro_debug_set_log_function (SchroDebugLogFunc func); #ifdef SCHRO_ENABLE_UNSTABLE_API void schro_dump (int type, const char *format, ...); #endif SCHRO_END_DECLS #endif schroedinger-1.0.11/schroedinger/schroglobalest.c0000644000175000017500000001540011702127343017022 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include static void schro_motion_global_metric (SchroMotionField * field, SchroFrame * frame, SchroFrame * ref_frame, int ref); static void schro_motion_field_global_estimation (SchroMotionField * mf, SchroGlobalMotion * gm, int mv_precision, int ref, SchroParams * params); void schro_encoder_global_estimation (SchroEncoderFrame * frame) { SchroParams *params = &frame->params; SchroMotionField *mf, *mf_orig; int i; SCHRO_ERROR ("global motion is broken"); for (i = 0; i < params->num_refs; i++) { mf_orig = frame->rme[i]->motion_fields[1]; mf = schro_motion_field_new (mf_orig->x_num_blocks, mf_orig->y_num_blocks); SCHRO_DEBUG ("ref %d", i); memcpy (mf->motion_vectors, mf_orig->motion_vectors, sizeof (SchroMotionVector) * mf->x_num_blocks * mf->y_num_blocks); schro_motion_field_global_estimation (mf, &frame->params.global_motion[i], params->mv_precision, i, params); schro_motion_global_metric (mf, frame->filtered_frame, frame->ref_frame[i]->filtered_frame, i); } } static void schro_motion_global_metric (SchroMotionField * field, SchroFrame * frame, SchroFrame * ref_frame, int ref) { SchroMotionVector *mv; int i; int j; for (j = 0; j < field->y_num_blocks; j++) { for (i = 0; i < field->x_num_blocks; i++) { mv = field->motion_vectors + j * field->x_num_blocks + i; #if 0 x = i * 8 + mv->u.vec.dx[ref]; y = j * 8 + mv->u.vec.dy[ref]; mv->metric = schro_metric_absdiff_u8 (frame->components[0].data + x + y * frame->components[0].stride, frame->components[0].stride, ref->components[0].data + i * 8 + j * 8 * ref->components[0].stride, ref->components[0].stride, 8, 8); #endif mv->metric = 0; } } } void schro_motion_field_global_estimation (SchroMotionField * mf, SchroGlobalMotion * gm, int mv_precision, int ref, SchroParams * params) { int i; int j; int k; SchroMotionVector *mv; int xbsep = 2 * params->xbsep_luma; int ybsep = 2 * params->ybsep_luma; double a00, a01, a10, a11; double pan_x, pan_y; for (j = 0; j < mf->y_num_blocks; j++) { for (i = 0; i < mf->x_num_blocks; i++) { mv = mf->motion_vectors + j * mf->x_num_blocks + i; mv->using_global = 1; /* HACK */ if (j >= mf->y_num_blocks - 4 || i >= mf->x_num_blocks - 4) { mv->using_global = 0; } if (j < 4 || i < 4) { mv->using_global = 0; } } } for (k = 0; k < 4; k++) { double m_x, m_y; double m_f, m_g; double ave_x, ave_y; double m_fx, m_fy, m_gx, m_gy; double m_xx, m_yy; double sum2; double stddev2; int n = 0; SCHRO_DEBUG ("step %d", k); m_x = 0; m_y = 0; m_f = 0; m_g = 0; for (j = 0; j < mf->y_num_blocks; j++) { for (i = 0; i < mf->x_num_blocks; i++) { mv = mf->motion_vectors + j * mf->x_num_blocks + i; if (mv->using_global) { m_f += mv->u.vec.dx[ref]; m_g += mv->u.vec.dy[ref]; m_x += i * xbsep; m_y += j * ybsep; n++; } } } pan_x = m_f / n; pan_y = m_g / n; ave_x = m_x / n; ave_y = m_y / n; SCHRO_DEBUG ("pan %f %f ave %f %f n %d", pan_x, pan_y, ave_x, ave_y, n); m_fx = 0; m_fy = 0; m_gx = 0; m_gy = 0; m_xx = 0; m_yy = 0; n = 0; for (j = 0; j < mf->y_num_blocks; j++) { for (i = 0; i < mf->x_num_blocks; i++) { mv = mf->motion_vectors + j * mf->x_num_blocks + i; if (mv->using_global) { m_fx += (mv->u.vec.dx[ref] - pan_x) * (i * xbsep - ave_x); m_fy += (mv->u.vec.dx[ref] - pan_x) * (j * ybsep - ave_y); m_gx += (mv->u.vec.dy[ref] - pan_y) * (i * xbsep - ave_x); m_gy += (mv->u.vec.dy[ref] - pan_y) * (j * ybsep - ave_y); m_xx += (i * xbsep - ave_x) * (i * xbsep - ave_x); m_yy += (j * ybsep - ave_y) * (j * ybsep - ave_y); n++; } } } SCHRO_DEBUG ("m_fx %f m_gx %f m_xx %f n %d", m_fx, m_gx, m_xx, n); a00 = m_fx / m_xx; a01 = m_fy / m_yy; a10 = m_gx / m_xx; a11 = m_gy / m_yy; pan_x -= a00 * ave_x + a01 * ave_y; pan_y -= a10 * ave_x + a11 * ave_y; SCHRO_DEBUG ("pan %f %f a[] %f %f %f %f", pan_x, pan_y, a00, a01, a10, a11); sum2 = 0; for (j = 0; j < mf->y_num_blocks; j++) { for (i = 0; i < mf->x_num_blocks; i++) { mv = mf->motion_vectors + j * mf->x_num_blocks + i; if (mv->using_global) { double dx, dy; dx = mv->u.vec.dx[ref] - (pan_x + a00 * i + a01 * j); dy = mv->u.vec.dy[ref] - (pan_y + a10 * i + a11 * j); sum2 += dx * dx + dy * dy; } } } stddev2 = sum2 / n; SCHRO_DEBUG ("stddev %f", sqrt (sum2 / n)); if (stddev2 < 1) stddev2 = 1; n = 0; for (j = 0; j < mf->y_num_blocks; j++) { for (i = 0; i < mf->x_num_blocks; i++) { double dx, dy; mv = mf->motion_vectors + j * mf->x_num_blocks + i; dx = mv->u.vec.dx[ref] - (pan_x + a00 * i + a01 * j); dy = mv->u.vec.dy[ref] - (pan_y + a10 * i + a11 * j); mv->using_global = (dx * dx + dy * dy < stddev2 * 16); n += mv->using_global; } } SCHRO_DEBUG ("using n = %d", n); } SCHRO_DEBUG ("pan %f %f a[] %f %f %f %f", pan_x, pan_y, a00, a01, a10, a11); pan_x *= 4.0; pan_y *= 4.0; a00 *= 8; a01 *= 8; a10 *= 8; a11 *= 8; gm->b0 = rint (pan_x * (1 << mv_precision)); gm->b1 = rint (pan_y * (1 << mv_precision)); gm->a_exp = 16; gm->a00 = rint (a00 * (1 << (gm->a_exp + mv_precision))); gm->a01 = rint (a01 * (1 << (gm->a_exp + mv_precision))); gm->a10 = rint (a10 * (1 << (gm->a_exp + mv_precision))); gm->a11 = rint (a11 * (1 << (gm->a_exp + mv_precision))); for (j = 0; j < mf->y_num_blocks; j++) { for (i = 0; i < mf->x_num_blocks; i++) { mv = mf->motion_vectors + j * mf->x_num_blocks + i; mv->using_global = 1; //mv->u.vec.dx[ref] = gm->b0 + ((gm->a00 * (i*8) + gm->a01 * (j*8))>>gm->a_exp) - i*8; //mv->u.vec.dy[ref] = gm->b1 + ((gm->a10 * (i*8) + gm->a11 * (j*8))>>gm->a_exp) - j*8; mv->u.vec.dx[ref] = 0; mv->u.vec.dy[ref] = 0; } } } void schro_motionest_superblock_global (SchroMotionEst * me, int ref, SchroBlock * block, int i, int j) { SchroMotionVector *mv; mv = &block->mv[0][0]; mv->split = 0; mv->pred_mode = 1 << ref; mv->using_global = 1; mv->u.vec.dx[ref] = 0; mv->u.vec.dy[ref] = 0; //block->error = schro_motionest_superblock_get_metric (me, block, i, j); block->error = (ref == 1) ? -1000 : 1000; block->entropy = 0; schro_block_fixup (block); //block->valid = (block->error != SCHRO_METRIC_INVALID_2); block->valid = TRUE; } schroedinger-1.0.11/schroedinger/schrocuda.c0000644000175000017500000000371111541755167016000 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include void schro_cuda_init (void) { int n; int i; cudaError_t ret; ret = cudaGetDeviceCount (&n); SCHRO_DEBUG ("cudaGetDeviceCount returned %d", ret); SCHRO_DEBUG ("CUDA devices %d", n); for (i = 0; i < n; i++) { struct cudaDeviceProp prop; cudaGetDeviceProperties (&prop, i); SCHRO_DEBUG ("CUDA props: %d: %d.%d mem=%d %s", i, prop.major, prop.minor, prop.totalGlobalMem, prop.name); } } static void * schro_cuda_alloc (int size) { void *ptr; int ret; SCHRO_DEBUG ("domain is %d", schro_async_get_exec_domain ()); //SCHRO_ASSERT(schro_async_get_exec_domain () == SCHRO_EXEC_DOMAIN_CUDA); ret = cudaMalloc (&ptr, size); return ptr; } static void schro_cuda_free (void *ptr, int size) { //SCHRO_ASSERT(schro_async_get_exec_domain () == SCHRO_EXEC_DOMAIN_CUDA); if (schro_async_get_exec_domain () == SCHRO_EXEC_DOMAIN_CUDA) { cudaFree (ptr); } else { SCHRO_ERROR ("Freeing CUDA memory outside CUDA thread."); } } SchroMemoryDomain * schro_memory_domain_new_cuda (void) { SchroMemoryDomain *domain; domain = schro_memory_domain_new (); domain->flags = SCHRO_MEMORY_DOMAIN_CUDA; domain->alloc = schro_cuda_alloc; domain->free = schro_cuda_free; return domain; } void schro_motion_render_cuda (SchroMotion * motion, SchroFrame * dest) { SchroGPUMotion *gpumotion; gpumotion = schro_gpumotion_new (0); schro_gpumotion_init (gpumotion, motion); schro_gpumotion_copy (gpumotion, motion); schro_gpumotion_render (gpumotion, motion, dest); schro_gpumotion_free (gpumotion); } void schro_frame_inverse_iwt_transform_cuda (SchroFrame * frame, SchroFrame * transform_frame, SchroParams * params) { schro_frame_to_gpu (frame, transform_frame); schro_gpuframe_inverse_iwt_transform (frame, params); } schroedinger-1.0.11/schroedinger/schroengine.h0000644000175000017500000000334211541755167016336 00000000000000 #ifndef _SCHRO_ENGINE_H_ #define _SCHRO_ENGINE_H_ #include SCHRO_BEGIN_DECLS #ifdef SCHRO_ENABLE_UNSTABLE_API typedef enum { SCHRO_QUANTISER_ENGINE_SIMPLE, SCHRO_QUANTISER_ENGINE_RDO_BIT_ALLOCATION, SCHRO_QUANTISER_ENGINE_CBR, SCHRO_QUANTISER_ENGINE_LOSSLESS, SCHRO_QUANTISER_ENGINE_LOWDELAY, SCHRO_QUANTISER_ENGINE_RDO_LAMBDA, SCHRO_QUANTISER_ENGINE_CONSTANT_ERROR } SchroQuantiserEngineEnum; int schro_encoder_engine_intra_only (SchroEncoder *encoder); int schro_encoder_engine_backref (SchroEncoder *encoder); int schro_encoder_engine_test_intra (SchroEncoder *encoder); int schro_encoder_engine_lossless (SchroEncoder *encoder); int schro_encoder_engine_backtest (SchroEncoder *encoder); int schro_encoder_engine_lowdelay (SchroEncoder *encoder); int schro_encoder_handle_quants (SchroEncoder *encoder, int i); void schro_encoder_init_frame (SchroEncoderFrame *frame); void schro_encoder_handle_gop_backref (SchroEncoder *encoder, int i); int schro_encoder_setup_frame_backref (SchroEncoderFrame *frame); void schro_encoder_handle_gop_intra_only (SchroEncoder *encoder, int i); int schro_encoder_setup_frame_intra_only (SchroEncoderFrame *frame); void schro_encoder_handle_gop_tworef (SchroEncoder *encoder, int i); int schro_encoder_setup_frame_tworef (SchroEncoderFrame *frame); void schro_encoder_handle_gop_lowdelay (SchroEncoder *encoder, int i); int schro_encoder_setup_frame_lowdelay (SchroEncoderFrame *frame); void schro_encoder_handle_gop_lossless (SchroEncoder *encoder, int i); int schro_encoder_setup_frame_lossless (SchroEncoderFrame *frame); void schro_frame_set_wavelet_params (SchroEncoderFrame* frame); void init_params (SchroEncoderFrame* frame); #endif SCHRO_END_DECLS #endif schroedinger-1.0.11/schroedinger/schroencoder.c0000664000175000017500000042556511707114413016507 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #define SCHRO_ARITH_DEFINE_INLINE #include #include #include #include #include #include "schroorc.h" #if 0 /* Used for testing bitstream */ #define MARKER(pack) schro_pack_encode_uint (pack, 1234567) #else #define MARKER(pack) #endif void schro_encoder_render_picture (SchroEncoderFrame * frame); static void schro_encoder_encode_picture_prediction_parameters (SchroEncoderFrame * frame); static void schro_encoder_encode_superblock_split (SchroEncoderFrame * frame); static void schro_encoder_encode_prediction_modes (SchroEncoderFrame * frame); static void schro_encoder_encode_vector_data (SchroEncoderFrame * frame, int ref, int xy); static void schro_encoder_encode_dc_data (SchroEncoderFrame * frame, int comp); static void schro_encoder_encode_transform_parameters (SchroEncoderFrame * frame); static void schro_encoder_encode_transform_data (SchroEncoderFrame * frame); static int schro_encoder_pull_is_ready_locked (SchroEncoder * encoder); static void schro_encoder_encode_codec_comment (SchroEncoder * encoder); static void schro_encoder_encode_bitrate_comment (SchroEncoder * encoder, unsigned int bitrate); static int schro_encoder_encode_padding (SchroEncoder * encoder, int n); static void schro_encoder_clean_up_transform_subband (SchroEncoderFrame * frame, int component, int index); static void schro_encoder_fixup_offsets (SchroEncoder * encoder, SchroBuffer * buffer, schro_bool is_eos); static void schro_encoder_frame_complete (SchroAsyncStage * stage); static int schro_encoder_async_schedule (SchroEncoder * encoder, SchroExecDomain exec_domain); static void schro_encoder_init_perceptual_weighting (SchroEncoder * encoder); void schro_encoder_encode_sequence_header_header (SchroEncoder * encoder, SchroPack * pack); static schro_bool schro_frame_data_is_zero (SchroFrameData * fd); static void schro_encoder_setting_set_defaults (SchroEncoder * encoder); /* * Set a frame lambda based on the encoder lambda */ void schro_encoder_set_frame_lambda (SchroEncoderFrame * frame) { SchroEncoder *encoder = frame->encoder; SCHRO_ASSERT (frame); SCHRO_ASSERT (frame->encoder); switch (frame->encoder->rate_control) { case SCHRO_ENCODER_RATE_CONTROL_CONSTANT_BITRATE: if (frame->encoder->enable_rdo_cbr) { double q; //frame->frame_lambda = pow( 10.0 , -(12.0-frame->encoder->qf )/2.5 )/16.0; frame->frame_lambda = exp (0.921034 * encoder->qf - 13.825); q = (log (frame->frame_lambda) + 16.2826) / 1.6447; frame->frame_me_lambda = frame->encoder->magic_me_lambda_scale * sqrt (frame->frame_lambda); frame->frame_me_lambda = MIN (0.002 * exp (q * 0.2 * M_LN10), 1.0); if (frame->frame_me_lambda > 1.0) { frame->frame_me_lambda = 1.0; } frame->frame_me_lambda *= encoder->magic_me_lambda_scale; } else { /* overwritten in schro_encoder_choose_quantisers_rdo_bit_allocation */ frame->frame_lambda = 0; frame->frame_me_lambda = 0.1; /* used to be magic_mc_lambda */ } break; case SCHRO_ENCODER_RATE_CONTROL_CONSTANT_QUALITY: { double q = encoder->quality; q += -3.5 * (frame->encoder->magic_error_power - 4); q *= 1.0 + (frame->encoder->magic_error_power - 4) * 0.2; if (frame->encoder->magic_error_power < 2.5) { q += 2; } //frame->frame_lambda = exp(((q-5)/0.7 - 7.0)*M_LN10*0.5); frame->frame_lambda = exp (1.6447 * q - 16.2826); frame->frame_me_lambda = MIN (0.002 * exp (q * 0.2 * M_LN10), 1.0); if (frame->frame_me_lambda > 1.0) { frame->frame_me_lambda = 1.0; } frame->frame_me_lambda *= encoder->magic_me_lambda_scale; } break; case SCHRO_ENCODER_RATE_CONTROL_LOSSLESS: frame->frame_me_lambda = 10; break; default: /* others don't use lambda */ frame->frame_lambda = 1.0; frame->frame_me_lambda = 0.1; break; } if ((frame->num_refs != 0)) { if (schro_encoder_frame_is_B_frame (frame)) { frame->frame_lambda *= frame->encoder->magic_B_lambda_scale; } else { frame->frame_lambda *= frame->encoder->magic_P_lambda_scale; } } else { if (frame->encoder->rate_control == SCHRO_ENCODER_RATE_CONTROL_CONSTANT_BITRATE) { if (frame->encoder->intra_cbr_lambda != -1) { frame->frame_lambda = sqrt (frame->frame_lambda * frame->encoder->intra_cbr_lambda); } frame->encoder->intra_cbr_lambda = frame->frame_lambda; SCHRO_DEBUG ("Using filtered CBR value for intra lambda %g (picture %d)", frame->frame_lambda, frame->frame_number); } else { frame->frame_lambda *= frame->encoder->magic_I_lambda_scale; } } } /* * Return 1 if the last subgroup has been coded, 0 otherwise * */ #if 0 int schro_encoder_last_subgroup_coded (SchroEncoder * encoder, int picnum) { int subgroup_coded = 1; int pos, fnum; int last_P_frame = (picnum + encoder->subgroup_length - 1) / encoder->subgroup_length; last_P_frame *= encoder->subgroup_length; last_P_frame -= encoder->subgroup_length; if (picnum > encoder->subgroup_length) { for (pos = 0; pos < encoder->frame_queue->n; ++pos) { SchroEncoderFrame *frame = encoder->frame_queue->elements[pos].data; fnum = frame->frame_number; if (fnum <= last_P_frame && fnum >= last_P_frame - encoder->subgroup_length + 1) { if (!(frame->state & SCHRO_ENCODER_FRAME_STATE_ENCODING)) subgroup_coded = 0; } } } else { for (pos = 0; pos < encoder->frame_queue->n; ++pos) { SchroEncoderFrame *frame = encoder->frame_queue->elements[pos].data; fnum = frame->frame_number; if (fnum == 0 && !(frame->state & SCHRO_ENCODER_FRAME_STATE_ENCODING)) subgroup_coded = 0; } } SCHRO_DEBUG ("Last subgroup coded value %d at %d", subgroup_coded, picnum); return subgroup_coded; } #endif /* * schro_encoder_init_rc_buffer * * Initialises the buffer model for rate control * */ static void schro_encoder_init_rc_buffer (SchroEncoder * encoder) { int gop_length; SCHRO_ASSERT (encoder); gop_length = encoder->au_distance; if (encoder->buffer_size == 0) { encoder->buffer_size = 3 * encoder->bitrate; } // Set initial level at 100% if (encoder->buffer_level == 0) { encoder->buffer_level = encoder->buffer_size; } encoder->bits_per_picture = muldiv64 (encoder->bitrate, encoder->video_format.frame_rate_denominator, encoder->video_format.frame_rate_numerator); encoder->gop_target = muldiv64 (encoder->bitrate * gop_length, encoder->video_format.frame_rate_denominator, encoder->video_format.frame_rate_numerator); if (encoder->video_format.interlaced_coding) { encoder->bits_per_picture /= 2; } encoder->B_complexity_sum = 0; // Set up an initial allocation if (encoder->gop_structure == SCHRO_ENCODER_GOP_INTRA_ONLY) { encoder->I_frame_alloc = encoder->bits_per_picture; encoder->P_frame_alloc = 0; encoder->B_frame_alloc = 0; } else { int num_P_frames = encoder->au_distance / encoder->magic_subgroup_length - 1; int num_B_frames = gop_length - num_P_frames - 1; int total; encoder->I_frame_alloc = 2 ^ 24; encoder->P_frame_alloc = encoder->I_frame_alloc / 3; encoder->B_frame_alloc = encoder->P_frame_alloc / 3; total = encoder->I_frame_alloc + num_P_frames * encoder->P_frame_alloc + num_B_frames * encoder->B_frame_alloc; encoder->I_frame_alloc = (encoder->I_frame_alloc * encoder->gop_target) / total; encoder->P_frame_alloc = (encoder->P_frame_alloc * encoder->gop_target) / total; encoder->B_frame_alloc = (encoder->B_frame_alloc * encoder->gop_target) / total; } encoder->I_complexity = encoder->I_frame_alloc; encoder->P_complexity = encoder->P_frame_alloc; encoder->B_complexity = encoder->B_frame_alloc; SCHRO_DEBUG ("Initialising buffer with allocations (I, B, P) %d, %d, %d", encoder->I_frame_alloc, encoder->P_frame_alloc, encoder->B_frame_alloc); encoder->subgroup_position = 1; } /* * schro_encoder_projected_subgroup_bits * * Returns the total number of bits expected for the next subgroup * */ static int schro_encoder_projected_subgroup_bits (SchroEncoder * encoder) { // FIXME: take account of subgroups with an I instead of a P?? int bits = encoder->P_complexity + (encoder->magic_subgroup_length - 1) * encoder->B_complexity; return bits; } /* * schro_encoder_target_subgroup_bits * * Returns the target for the next subgroup * */ static int schro_encoder_target_subgroup_bits (SchroEncoder * encoder) { // FIXME: take account of subgroups with an I instead of a P?? int bits = encoder->P_frame_alloc + (encoder->magic_subgroup_length - 1) * encoder->B_frame_alloc; return bits; } /* * schro_encoder_cbr_allocate: * * TM5-style bit allocation routine * */ static void schro_encoder_cbr_allocate (SchroEncoder * encoder, int fnum) { int gop_length; int Icty; int Pcty; int Bcty; int num_I_frames; int num_P_frames; int num_B_frames; int total_gop_bits; int sg_len; double buffer_occ; int min_bits; SCHRO_ASSERT (encoder); gop_length = encoder->au_distance; Icty = encoder->I_complexity; Pcty = encoder->P_complexity; Bcty = encoder->B_complexity; num_I_frames = 1; num_P_frames = encoder->au_distance / encoder->magic_subgroup_length - 1; num_B_frames = gop_length - num_I_frames - num_P_frames; total_gop_bits = muldiv64 (encoder->bitrate * gop_length, encoder->video_format.frame_rate_denominator, encoder->video_format.frame_rate_numerator); sg_len = encoder->magic_subgroup_length; buffer_occ = ((double) encoder->buffer_level) / ((double) encoder->buffer_size); if (encoder->gop_structure != SCHRO_ENCODER_GOP_INTRA_ONLY) { double correction; if (buffer_occ < 0.9 && ((fnum + 1) % 4 * sg_len) == 0) { // If we're undershooting buffer target, correct slowly correction = MIN (0.25, 0.25 * (0.9 - buffer_occ) / 0.9); encoder->gop_target = (long int) ((double) (total_gop_bits) * (1.0 - correction)); } else if (buffer_occ > 0.9 && ((fnum + 1) % sg_len) == 0) { // If we're overshooting buffer target, correct quickly correction = MIN (0.5, 0.5 * (buffer_occ - 0.9) / 0.9); encoder->gop_target = (long int) ((double) (total_gop_bits) * (1.0 + correction)); } } min_bits = total_gop_bits / (100 * gop_length); encoder->I_frame_alloc = (long int) (encoder->gop_target / (num_I_frames + (double) (num_P_frames * Pcty) / Icty + (double) (num_B_frames * Bcty) / Icty)); encoder->I_frame_alloc = MAX (min_bits, encoder->I_frame_alloc); encoder->P_frame_alloc = (long int) (encoder->gop_target / (num_P_frames + (double) (num_I_frames * Icty) / Pcty + (double) (num_B_frames * Bcty) / Pcty)); encoder->P_frame_alloc = MAX (min_bits, encoder->P_frame_alloc); encoder->B_frame_alloc = (long int) (encoder->gop_target / (num_B_frames + (double) (num_I_frames * Icty) / Bcty + (double) (num_P_frames * Pcty) / Bcty)); encoder->B_frame_alloc = MAX (min_bits, encoder->B_frame_alloc); } /* * schro_encoder_cbr_update * * Sets the qf (and hence lambdas) for the next subgroup to be coded * */ static void schro_encoder_cbr_update (SchroEncoderFrame * frame, int num_bits) { SchroEncoder *encoder = frame->encoder; double target_ratio; double actual_ratio; double filter_tap; int P_separation; int field_factor; int emergency_realloc; int target; double tbits, pbits; // The target buffer occupancy target_ratio = 0.9; actual_ratio = (double) (encoder->buffer_level) / (double) (encoder->buffer_size); P_separation = encoder->magic_subgroup_length; // 1 is coding frames, 2 if coding fields field_factor = 1; if (encoder->video_format.interlaced_coding) field_factor = 2; emergency_realloc = 0; // Decrement the subgroup frame counter. This is zero just after the last // B frame before the next P frame i.e. before the start of a subgroup encoder->subgroup_position--; /* Determine the filter tap for adjusting lambda */ if ((frame->frame_number / field_factor) <= 3 * P_separation) { // Adjust immediately at the beginning of the sequence filter_tap = 1.0; } else { if (actual_ratio > target_ratio) filter_tap = (actual_ratio - target_ratio) / (1.0 - target_ratio); else filter_tap = (target_ratio - actual_ratio) / target_ratio; filter_tap = CLAMP (filter_tap, 0.25, 1.0); } // Now for the actual update if (encoder->gop_structure != SCHRO_ENCODER_GOP_INTRA_ONLY) { // Long-GOP coding if (frame->num_refs == 0) { encoder->I_complexity = num_bits; target = encoder->I_frame_alloc; if (num_bits < target / 2 || num_bits > 3 * target) emergency_realloc = 1; if ((frame->frame_number / field_factor) == 0) { //FIXME: needed? // We've just coded the very first frame, which is a special // case as the B frames which normally follow are missing encoder->subgroup_position = P_separation; } } if (((frame->frame_number) / field_factor) % P_separation != 0) { // Scheduled B picture encoder->B_complexity_sum += num_bits; target = encoder->B_frame_alloc; if (num_bits < target / 2 || num_bits > 3 * target) { emergency_realloc = 1; } } else if (frame->num_refs != 0) { // Scheduled P picture (if inserted I picture, don't change the complexity) encoder->P_complexity = num_bits; target = encoder->P_frame_alloc; if (num_bits < target / 2 || num_bits > 3 * target) { emergency_realloc = 1; } } if (encoder->subgroup_position == 0 || emergency_realloc == 1) { double K; double new_qf; if (emergency_realloc == 1) SCHRO_DEBUG ("Major undershoot of frame bit rate: Reallocating"); // We recompute allocations for the next subgroup if (P_separation > 1 && encoder->subgroup_position < P_separation - 1) { encoder->B_complexity = encoder->B_complexity_sum / (P_separation - 1 - encoder->subgroup_position); } schro_encoder_cbr_allocate (encoder, frame->frame_number / field_factor); // We work out what this means for the quality factor and set it tbits = (double) (schro_encoder_target_subgroup_bits (encoder)); pbits = (double) (schro_encoder_projected_subgroup_bits (encoder)); SCHRO_DEBUG ("Reallocating: target bits = %g, projected bits = %g", tbits, pbits); // Determine K value in model K = pow (pbits, 2) * pow (10.0, ((double) 2 / 5 * (12 - encoder->qf))) / 16; // Determine a new qf from K new_qf = 12 - (double) 5 / 2 * log10 (16 * K / pow (tbits, 2)); if ((abs (encoder->qf - new_qf) >= 0.25 || new_qf <= 4.0) && new_qf <= 8.0) new_qf = filter_tap * new_qf + (1.0 - filter_tap) * encoder->qf; if (new_qf <= 8.0) { if (pbits < 2 * tbits) { new_qf = MAX (new_qf, encoder->qf - 1.0); } else { new_qf = MAX (new_qf, encoder->qf - 2.0); } } new_qf = MIN (new_qf, 5 + 10 * ((double) encoder->buffer_level) / encoder->buffer_size); encoder->qf = new_qf; SCHRO_DEBUG ("Setting qf for next subgroup to %g, bits %d", encoder->qf, encoder->buffer_level); // Reset the frame counter if (encoder->subgroup_position == 0) { encoder->subgroup_position = encoder->magic_subgroup_length; encoder->B_complexity_sum = 0; } } } else { // We're doing intraonly coding double tbits = (double) encoder->bits_per_picture; double pbits = (double) num_bits; // Determine K value double K = pow (pbits, 2) * pow (10.0, ((double) 2 / 5 * (12 - encoder->qf))) / 16; // Determine a new QF double new_qf = 12 - (double) 5 / 2 * log10 (16 * K / pow (tbits, 2)); // Adjust the QF to meet the target double abs_delta = abs (new_qf - encoder->qf); if (abs_delta > 0.01) { // Rate of convergence to new QF double r; // Use an Sshaped curve to compute r // Where the qf difference is less than 1/2, r decreases to zero // exponentially, so for small differences in QF we jump straight // to the target value. For large differences in QF, r converges // exponentially to 0.75, so we converge to the target value at // a fixed rate. // Overall behaviour is to converge steadily for 2 or 3 frames until // close and then lock to the correct value. This avoids very rapid // changes in quality. // Actual parameters may be adjusted later. Some applications may // require instant lock. double lg_diff = log (abs_delta / 2.0); if (lg_diff < 0.0) r = 0.5 * exp (-lg_diff * lg_diff / 2.0); else r = 1.0 - 0.5 * exp (-lg_diff * lg_diff / 2.0); r *= 0.75; encoder->qf = r * encoder->qf + (1.0 - r) * new_qf; SCHRO_DEBUG ("Setting qf for next subgroup to %g", encoder->qf); } } } /** * schro_encoder_new: * * Create a new encoder object. * * Returns: a new encoder object */ SchroEncoder * schro_encoder_new (void) { SchroEncoder *encoder; int c, b; encoder = schro_malloc0 (sizeof (SchroEncoder)); encoder->version_major = 2; encoder->version_minor = 2; encoder->au_frame = -1; encoder->last_ref = -1; encoder->qf = 7.0; schro_encoder_setting_set_defaults (encoder); schro_video_format_set_std_video_format (&encoder->video_format, SCHRO_VIDEO_FORMAT_CUSTOM); encoder->inserted_buffers = schro_list_new_full ((SchroListFreeFunc) schro_buffer_unref, NULL); for (c = 0; c < 3; ++c) { for (b = 0; b < SCHRO_LIMIT_SUBBANDS; ++b) { encoder->average_arith_context_ratios_intra[c][b] = 1.0; encoder->average_arith_context_ratios_inter[c][b] = 1.0; } } return encoder; } static void handle_gop_enum (SchroEncoder * encoder) { switch (encoder->gop_structure) { case SCHRO_ENCODER_GOP_BACKREF: case SCHRO_ENCODER_GOP_CHAINED_BACKREF: SCHRO_DEBUG ("Setting backref\n"); encoder->init_frame = schro_encoder_init_frame; encoder->handle_gop = schro_encoder_handle_gop_backref; encoder->handle_quants = schro_encoder_handle_quants; encoder->setup_frame = schro_encoder_setup_frame_backref; break; case SCHRO_ENCODER_GOP_INTRA_ONLY: SCHRO_DEBUG ("Setting intra only\n"); encoder->init_frame = schro_encoder_init_frame; encoder->handle_gop = schro_encoder_handle_gop_intra_only; encoder->handle_quants = schro_encoder_handle_quants; encoder->setup_frame = schro_encoder_setup_frame_intra_only; break; case SCHRO_ENCODER_GOP_ADAPTIVE: case SCHRO_ENCODER_GOP_BIREF: case SCHRO_ENCODER_GOP_CHAINED_BIREF: SCHRO_DEBUG ("Setting tworef engine\n"); encoder->init_frame = schro_encoder_init_frame; encoder->handle_gop = schro_encoder_handle_gop_tworef; encoder->handle_quants = schro_encoder_handle_quants; encoder->setup_frame = schro_encoder_setup_frame_tworef; break; default: SCHRO_ASSERT (0); } } /** * schro_encoder_start: * @encoder: an encoder object * * Locks in encoder configuration and causes the encoder to start * encoding pictures. At this point, the encoder will start worker * threads to do the actual encoding. */ void schro_encoder_start (SchroEncoder * encoder) { encoder->frame_queue = schro_queue_new (encoder->queue_depth, (SchroQueueFreeFunc) schro_encoder_frame_unref); SCHRO_DEBUG ("queue depth %d", encoder->queue_depth); encoder->engine_init = 1; encoder->force_sequence_header = TRUE; /* add check on 'enable' switches */ if (encoder->enable_scene_change_detection) { encoder->magic_scene_change_threshold = 3.25; } else { encoder->magic_scene_change_threshold = 0.2; } if (encoder->enable_bigblock_estimation && encoder->enable_deep_estimation) { /* only one can be set at any one time */ encoder->enable_bigblock_estimation = FALSE; } else if (!encoder->enable_bigblock_estimation && !encoder->enable_deep_estimation) { SCHRO_ERROR ("no motion estimation selected!"); SCHRO_ASSERT (0); } if (!encoder->enable_deep_estimation && encoder->enable_chroma_me) { encoder->enable_chroma_me = FALSE; } /* Global motion is broken */ encoder->enable_global_motion = FALSE; encoder->bit_depth = schro_video_format_get_bit_depth (&encoder->video_format); if (encoder->video_format.luma_excursion >= 256 || encoder->video_format.chroma_excursion >= 256) { encoder->input_frame_depth = 16; encoder->intermediate_frame_depth = 32; } else { encoder->input_frame_depth = 8; //encoder->intermediate_frame_depth = 32; encoder->intermediate_frame_depth = 16; } encoder->video_format.interlaced_coding = encoder->interlaced_coding; schro_encoder_encode_codec_comment (encoder); schro_tables_init (); schro_encoder_init_perceptual_weighting (encoder); /* special value indicating invalid */ encoder->intra_cbr_lambda = -1; schro_encoder_init_error_tables (encoder); encoder->async = schro_async_new (0, (SchroAsyncScheduleFunc) schro_encoder_async_schedule, (SchroAsyncCompleteFunc) schro_encoder_frame_complete, encoder); if (encoder->force_profile == SCHRO_ENCODER_PROFILE_AUTO) { if (encoder->rate_control == SCHRO_ENCODER_RATE_CONTROL_LOW_DELAY) { encoder->force_profile = SCHRO_ENCODER_PROFILE_VC2_LOW_DELAY; } else if (encoder->enable_noarith) { encoder->force_profile = SCHRO_ENCODER_PROFILE_VC2_SIMPLE; } else if (encoder->gop_structure == SCHRO_ENCODER_GOP_INTRA_ONLY) { encoder->force_profile = SCHRO_ENCODER_PROFILE_VC2_MAIN; } else { encoder->force_profile = SCHRO_ENCODER_PROFILE_MAIN; } } if (encoder->bitrate == 0) { encoder->bitrate = encoder->video_format.width * encoder->video_format.height * encoder->video_format.frame_rate_numerator / encoder->video_format.frame_rate_denominator; if (encoder->force_profile == SCHRO_ENCODER_PROFILE_MAIN) { encoder->bitrate /= 10; } else { encoder->bitrate *= 2; } } switch (encoder->force_profile) { case SCHRO_ENCODER_PROFILE_VC2_LOW_DELAY: encoder->profile = SCHRO_PROFILE_LOW_DELAY; encoder->rate_control = SCHRO_ENCODER_RATE_CONTROL_LOW_DELAY; encoder->gop_structure = SCHRO_ENCODER_GOP_INTRA_ONLY; encoder->au_distance = 1; break; case SCHRO_ENCODER_PROFILE_VC2_SIMPLE: encoder->profile = SCHRO_PROFILE_SIMPLE; encoder->enable_noarith = TRUE; encoder->gop_structure = SCHRO_ENCODER_GOP_INTRA_ONLY; encoder->au_distance = 1; break; case SCHRO_ENCODER_PROFILE_VC2_MAIN: encoder->profile = SCHRO_PROFILE_MAIN_INTRA; encoder->enable_noarith = FALSE; encoder->gop_structure = SCHRO_ENCODER_GOP_INTRA_ONLY; encoder->au_distance = 1; break; case SCHRO_ENCODER_PROFILE_MAIN: encoder->profile = SCHRO_PROFILE_MAIN; encoder->enable_noarith = FALSE; break; case SCHRO_ENCODER_PROFILE_AUTO: default: SCHRO_ASSERT (0); } switch (encoder->rate_control) { case SCHRO_ENCODER_RATE_CONTROL_CONSTANT_NOISE_THRESHOLD: handle_gop_enum (encoder); encoder->quantiser_engine = SCHRO_QUANTISER_ENGINE_SIMPLE; break; case SCHRO_ENCODER_RATE_CONTROL_CONSTANT_BITRATE: handle_gop_enum (encoder); if (encoder->enable_rdo_cbr) { encoder->quantiser_engine = SCHRO_QUANTISER_ENGINE_CBR; } else { encoder->quantiser_engine = SCHRO_QUANTISER_ENGINE_RDO_BIT_ALLOCATION; } schro_encoder_init_rc_buffer (encoder); schro_encoder_encode_bitrate_comment (encoder, encoder->bitrate); break; case SCHRO_ENCODER_RATE_CONTROL_LOW_DELAY: encoder->quantiser_engine = SCHRO_QUANTISER_ENGINE_LOWDELAY; encoder->init_frame = schro_encoder_init_frame; encoder->handle_gop = schro_encoder_handle_gop_lowdelay; encoder->handle_quants = schro_encoder_handle_quants; encoder->setup_frame = schro_encoder_setup_frame_lowdelay; schro_encoder_encode_bitrate_comment (encoder, encoder->bitrate); break; case SCHRO_ENCODER_RATE_CONTROL_LOSSLESS: if (encoder->force_profile == SCHRO_ENCODER_PROFILE_MAIN) { encoder->handle_gop = schro_encoder_handle_gop_lossless; } else { encoder->handle_gop = schro_encoder_handle_gop_intra_only; } encoder->quantiser_engine = SCHRO_QUANTISER_ENGINE_LOSSLESS; encoder->init_frame = schro_encoder_init_frame; encoder->handle_quants = schro_encoder_handle_quants; encoder->setup_frame = schro_encoder_setup_frame_tworef; break; case SCHRO_ENCODER_RATE_CONTROL_CONSTANT_LAMBDA: handle_gop_enum (encoder); encoder->quantiser_engine = SCHRO_QUANTISER_ENGINE_RDO_LAMBDA; break; case SCHRO_ENCODER_RATE_CONTROL_CONSTANT_ERROR: handle_gop_enum (encoder); encoder->quantiser_engine = SCHRO_QUANTISER_ENGINE_CONSTANT_ERROR; break; case SCHRO_ENCODER_RATE_CONTROL_CONSTANT_QUALITY: handle_gop_enum (encoder); encoder->quantiser_engine = SCHRO_QUANTISER_ENGINE_RDO_LAMBDA; break; default: SCHRO_ASSERT (0); } encoder->level = 0; encoder->video_format.index = schro_video_format_get_std_video_format (&encoder->video_format); switch (encoder->profile) { case SCHRO_PROFILE_LOW_DELAY: case SCHRO_PROFILE_SIMPLE: case SCHRO_PROFILE_MAIN_INTRA: if (schro_video_format_check_VC2_DL (&encoder->video_format)) { encoder->level = 1; } break; case SCHRO_PROFILE_MAIN: if (schro_video_format_check_MP_DL (&encoder->video_format)) { encoder->level = 128; } break; default: SCHRO_ASSERT (0); } { /* 1, 3, 4, 6 have overflows at transform-depth>=5 * 5 has errors at transform-depth=any */ const int max_transform_depths[] = { 5, 4, 5, 4, 4, 3, 4 }; encoder->transform_depth = MIN (encoder->transform_depth, max_transform_depths[encoder->intra_wavelet]); if (encoder->gop_structure != SCHRO_ENCODER_GOP_INTRA_ONLY) { encoder->transform_depth = MIN (encoder->transform_depth, max_transform_depths[encoder->inter_wavelet]); } } encoder->start_time = schro_utils_get_time (); } /** * schro_encoder_free: * @encoder: an encoder object * * Frees an encoder object and all its resources. */ void schro_encoder_free (SchroEncoder * encoder) { int i; if (encoder->async) { schro_async_free (encoder->async); } if (encoder->last_frame) { schro_encoder_frame_unref (encoder->last_frame); encoder->last_frame = NULL; } for (i = 0; i < SCHRO_LIMIT_REFERENCE_FRAMES; i++) { if (encoder->reference_pictures[i]) { schro_encoder_frame_unref (encoder->reference_pictures[i]); encoder->reference_pictures[i] = NULL; } } if (encoder->frame_queue) { schro_queue_free (encoder->frame_queue); } if (encoder->inserted_buffers) { schro_list_free (encoder->inserted_buffers); } schro_free (encoder); } static void schro_encoder_init_perceptual_weighting (SchroEncoder * encoder) { encoder->cycles_per_degree_vert = 0.5 * encoder->video_format.height / (2.0 * atan (0.5 / encoder->perceptual_distance) * 180 / M_PI); encoder->cycles_per_degree_horiz = encoder->cycles_per_degree_vert * encoder->video_format.aspect_ratio_denominator / encoder->video_format.aspect_ratio_numerator; if (encoder->video_format.interlaced_coding) { encoder->cycles_per_degree_vert *= 0.5; } SCHRO_DEBUG ("cycles per degree horiz=%g vert=%g", encoder->cycles_per_degree_horiz, encoder->cycles_per_degree_vert); switch (encoder->perceptual_weighting) { default: case SCHRO_ENCODER_PERCEPTUAL_CONSTANT: schro_encoder_calculate_subband_weights (encoder, schro_encoder_perceptual_weight_constant); break; case SCHRO_ENCODER_PERCEPTUAL_CCIR959: schro_encoder_calculate_subband_weights (encoder, schro_encoder_perceptual_weight_ccir959); break; case SCHRO_ENCODER_PERCEPTUAL_MOO: schro_encoder_calculate_subband_weights (encoder, schro_encoder_perceptual_weight_moo); break; case SCHRO_ENCODER_PERCEPTUAL_MANOS_SAKRISON: schro_encoder_calculate_subband_weights (encoder, schro_encoder_perceptual_weight_manos_sakrison); break; } } /** * schro_encoder_get_video_format: * @encoder: an encoder object * * Creates a new SchroVideoFormat structure and copies the * video format information of @decoder into it. * * When no longer needed, the returned pointer should be * freed using free(). * * Returns: a pointer to a SchroVideoFormat structure */ SchroVideoFormat * schro_encoder_get_video_format (SchroEncoder * encoder) { SchroVideoFormat *format; format = malloc (sizeof (SchroVideoFormat)); memcpy (format, &encoder->video_format, sizeof (SchroVideoFormat)); return format; } /** * schro_encoder_set_video_format: * @encoder: an encoder object * @format: the video format to use * * Sets the video format used by @encoder to the values specified * in @format. This function may only be called before schro_encoder_start() * is called on the encoder. */ void schro_encoder_set_video_format (SchroEncoder * encoder, SchroVideoFormat * format) { /* FIXME check that we're in the right state to do this */ memcpy (&encoder->video_format, format, sizeof (SchroVideoFormat)); schro_video_format_validate (&encoder->video_format); } /** * schro_encoder_set_packet_assembly: * @encoder: an encoder object * @value: * * If @value is TRUE, all subsequent calls to schro_encoder_pull() * will return a buffer that contains all Dirac packets related to * a frame. If @value is FALSE, each buffer will be one Dirac packet. * * It is recommended that users always call this function with TRUE * immediately after creating an encoder object. */ void schro_encoder_set_packet_assembly (SchroEncoder * encoder, int value) { encoder->assemble_packets = value; } static int schro_encoder_push_is_ready_locked (SchroEncoder * encoder) { int n; if (encoder->end_of_stream) { return FALSE; } n = schro_queue_slots_available (encoder->frame_queue); if (encoder->video_format.interlaced_coding) { return (n >= 2); } else { return (n >= 1); } } /** * schro_encoder_push_ready: * @encoder: an encoder object * * Returns true if the encoder has available space for additional * video frames. * * Returns: TRUE if the encoder is ready for another video frame to * be pushed. */ int schro_encoder_push_ready (SchroEncoder * encoder) { int ret; schro_async_lock (encoder->async); ret = schro_encoder_push_is_ready_locked (encoder); schro_async_unlock (encoder->async); return ret; } /** * schro_encoder_force_sequence_header: * @encoder: an encoder object * * Indicates to the encoder that the next frame pushed should be * encoded with a sequence header. */ void schro_encoder_force_sequence_header (SchroEncoder * encoder) { encoder->force_sequence_header = TRUE; } /** * schro_encoder_push_frame: * @encoder: an encoder object * @frame: a frame to encode * * Provides a frame to the encoder to encode. */ void schro_encoder_push_frame (SchroEncoder * encoder, SchroFrame * frame) { schro_encoder_push_frame_full (encoder, frame, NULL); } /** * schro_encoder_push_frame_full: * @encoder: an encoder object * @frame: a frame to encode * @priv: a private tag * * Provides a frame to the encoder to encode. The value of @priv is * returned when schro_encoder_pull_full() is called for the encoded * frame. */ void schro_encoder_push_frame_full (SchroEncoder * encoder, SchroFrame * frame, void *priv) { schro_async_lock (encoder->async); if (encoder->video_format.interlaced_coding == 0) { SchroEncoderFrame *encoder_frame; SchroFrameFormat format; encoder_frame = schro_encoder_frame_new (encoder); encoder_frame->encoder = encoder; encoder_frame->priv = priv; encoder_frame->previous_frame = encoder->last_frame; schro_encoder_frame_ref (encoder_frame); encoder->last_frame = encoder_frame; format = schro_params_get_frame_format (encoder->input_frame_depth, encoder->video_format.chroma_format); if (format == frame->format) { encoder_frame->original_frame = frame; } else { encoder_frame->original_frame = schro_frame_new_and_alloc (NULL, format, encoder->video_format.width, encoder->video_format.height); schro_frame_convert (encoder_frame->original_frame, frame); schro_frame_unref (frame); frame = NULL; } encoder_frame->frame_number = encoder->next_frame_number++; if (schro_queue_is_full (encoder->frame_queue)) { SCHRO_ERROR ("push when queue full"); SCHRO_ASSERT (0); } schro_queue_add (encoder->frame_queue, encoder_frame, encoder_frame->frame_number); schro_async_signal_scheduler (encoder->async); schro_async_unlock (encoder->async); } else { SchroEncoderFrame *encoder_frame1; SchroEncoderFrame *encoder_frame2; SchroFrameFormat format; int width, height; encoder_frame1 = schro_encoder_frame_new (encoder); encoder_frame1->encoder = encoder; encoder_frame1->priv = priv; encoder_frame2 = schro_encoder_frame_new (encoder); encoder_frame2->encoder = encoder; encoder_frame1->previous_frame = encoder->last_frame; schro_encoder_frame_ref (encoder_frame1); encoder_frame2->previous_frame = encoder_frame1; schro_encoder_frame_ref (encoder_frame2); encoder->last_frame = encoder_frame2; schro_video_format_get_picture_luma_size (&encoder->video_format, &width, &height); format = schro_params_get_frame_format (encoder->input_frame_depth, encoder->video_format.chroma_format); encoder_frame1->original_frame = schro_frame_new_and_alloc (NULL, format, width, height); encoder_frame2->original_frame = schro_frame_new_and_alloc (NULL, format, width, height); schro_frame_split_fields (encoder_frame1->original_frame, encoder_frame2->original_frame, frame); schro_frame_unref (frame); frame = NULL; encoder_frame1->frame_number = encoder->next_frame_number++; encoder_frame2->frame_number = encoder->next_frame_number++; if (schro_queue_slots_available (encoder->frame_queue) < 2) { SCHRO_ERROR ("push when queue full"); SCHRO_ASSERT (0); } schro_queue_add (encoder->frame_queue, encoder_frame1, encoder_frame1->frame_number); schro_queue_add (encoder->frame_queue, encoder_frame2, encoder_frame2->frame_number); schro_async_signal_scheduler (encoder->async); schro_async_unlock (encoder->async); } } static int schro_encoder_pull_is_ready_locked (SchroEncoder * encoder) { int i; for (i = 0; i < encoder->frame_queue->n; i++) { SchroEncoderFrame *frame; frame = encoder->frame_queue->elements[i].data; if (frame->slot == encoder->output_slot && (frame->stages[SCHRO_ENCODER_FRAME_STAGE_DONE].is_done)) { return TRUE; } } if (schro_queue_is_empty (encoder->frame_queue) && encoder->end_of_stream && !encoder->end_of_stream_pulled) { return TRUE; } return FALSE; } static void schro_encoder_shift_frame_queue (SchroEncoder * encoder) { SchroEncoderFrame *frame; while (!schro_queue_is_empty (encoder->frame_queue)) { frame = encoder->frame_queue->elements[0].data; if (!(frame->stages[SCHRO_ENCODER_FRAME_STAGE_FREE].is_done)) { break; } schro_queue_pop (encoder->frame_queue); } } /** * schro_encoder_pull: * @encoder: an encoder object * @presentation_frame: (output) latest decodable frame * * Pulls a buffer of compressed video from the encoder. If * @presentation_frame is not NULL, the frame number of the * latest decodable frame is returned. * * Returns: a buffer containing compressed video */ SchroBuffer * schro_encoder_pull (SchroEncoder * encoder, int *presentation_frame) { return schro_encoder_pull_full (encoder, presentation_frame, NULL); } static int schro_encoder_frame_get_encoded_size (SchroEncoderFrame * frame) { SchroBuffer *buffer; int size = 0; int i; if (frame->sequence_header_buffer) { size += frame->sequence_header_buffer->length; } for (i = 0; i < schro_list_get_size (frame->inserted_buffers); i++) { buffer = schro_list_get (frame->inserted_buffers, i); size += buffer->length; } for (i = 0; i < schro_list_get_size (frame->encoder->inserted_buffers); i++) { buffer = schro_list_get (frame->encoder->inserted_buffers, i); size += buffer->length; } size += frame->output_buffer->length; return size; } static void schro_encoder_frame_assemble_buffer (SchroEncoderFrame * frame, SchroBuffer * buffer) { SchroBuffer *buf; int offset = 0; int i; if (frame->sequence_header_buffer) { buf = frame->sequence_header_buffer; schro_encoder_fixup_offsets (frame->encoder, buf, FALSE); orc_memcpy (buffer->data + offset, buf->data, buf->length); offset += frame->sequence_header_buffer->length; } for (i = 0; i < schro_list_get_size (frame->inserted_buffers); i++) { buf = schro_list_get (frame->inserted_buffers, i); schro_encoder_fixup_offsets (frame->encoder, buf, FALSE); orc_memcpy (buffer->data + offset, buf->data, buf->length); offset += buf->length; } while (schro_list_get_size (frame->encoder->inserted_buffers) > 0) { buf = schro_list_remove (frame->encoder->inserted_buffers, 0); schro_encoder_fixup_offsets (frame->encoder, buf, FALSE); orc_memcpy (buffer->data + offset, buf->data, buf->length); offset += buf->length; schro_buffer_unref (buf); buf = NULL; } buf = frame->output_buffer; schro_encoder_fixup_offsets (frame->encoder, buf, FALSE); orc_memcpy (buffer->data + offset, buf->data, buf->length); offset += buf->length; } int schro_encoder_get_frame_stats_size (SchroEncoder * encoder) { return 21; } void schro_encoder_get_frame_stats (SchroEncoder * encoder, double *dest, int n) { memcpy (dest, encoder->frame_stats, sizeof (double) * MIN (n, 21)); } /** * schro_encoder_pull_full: * @encoder: an encoder object * @presentation_frame: (output) latest decodable frame * @priv: (output) * * Pulls a buffer of compressed video from the encoder. If * @presentation_frame is not NULL, the frame number of the * latest decodable frame is returned. If @priv is not NULL, * the private tag attached to the pushed uncompressed frame * is returned. * * Returns: a buffer containing compressed video */ SchroBuffer * schro_encoder_pull_full (SchroEncoder * encoder, int *presentation_frame, void **priv) { SchroBuffer *buffer; int i; int done = FALSE; SCHRO_DEBUG ("pulling slot %d", encoder->output_slot); schro_async_lock (encoder->async); for (i = 0; i < encoder->frame_queue->n; i++) { SchroEncoderFrame *frame; frame = encoder->frame_queue->elements[i].data; if (frame->slot == encoder->output_slot && (frame->stages[SCHRO_ENCODER_FRAME_STAGE_DONE].is_done)) { int is_picture = FALSE; if (presentation_frame) { *presentation_frame = frame->presentation_frame; } if (encoder->assemble_packets) { int size; size = schro_encoder_frame_get_encoded_size (frame); buffer = schro_buffer_new_and_alloc (size); schro_encoder_frame_assemble_buffer (frame, buffer); if (priv) { *priv = frame->priv; } done = TRUE; } else { if (frame->sequence_header_buffer) { buffer = frame->sequence_header_buffer; frame->sequence_header_buffer = NULL; } else if (schro_list_get_size (frame->inserted_buffers) > 0) { buffer = schro_list_remove (frame->inserted_buffers, 0); } else if (schro_list_get_size (encoder->inserted_buffers) > 0) { buffer = schro_list_remove (encoder->inserted_buffers, 0); } else { if (priv) { *priv = frame->priv; } buffer = frame->output_buffer; frame->output_buffer = NULL; done = TRUE; } } if (done) { double elapsed_time; is_picture = TRUE; frame->stages[SCHRO_ENCODER_FRAME_STAGE_FREE].is_done = TRUE; encoder->output_slot++; elapsed_time = schro_utils_get_time () - encoder->start_time; if (frame->num_refs == 0) { frame->badblock_ratio = 0; frame->dcblock_ratio = 0; frame->mc_error = 0; } schro_dump (SCHRO_DUMP_PICTURE, "%d %d %d %d %d %g %d %d %d %d %g %d %g %g %g %g %g %g %g %g\n", frame->frame_number, /* 0 */ frame->num_refs, frame->is_ref, frame->allocated_mc_bits, frame->allocated_residual_bits, frame->picture_weight, /* 5 */ frame->estimated_mc_bits, frame->estimated_residual_bits, frame->actual_mc_bits, frame->actual_residual_bits, frame->scene_change_score, /* 10 */ encoder->buffer_level, frame->frame_lambda, frame->mc_error, frame->mean_squared_error_luma, frame->mean_squared_error_chroma, /* 15 */ elapsed_time, frame->badblock_ratio, frame->dcblock_ratio, frame->hist_slope); encoder->frame_stats[0] = frame->frame_number; encoder->frame_stats[1] = frame->num_refs; encoder->frame_stats[2] = frame->is_ref; encoder->frame_stats[3] = frame->allocated_mc_bits; encoder->frame_stats[4] = frame->allocated_residual_bits; encoder->frame_stats[5] = frame->picture_weight; encoder->frame_stats[6] = frame->estimated_mc_bits; encoder->frame_stats[7] = frame->estimated_residual_bits; encoder->frame_stats[8] = frame->actual_mc_bits; encoder->frame_stats[8] = frame->actual_residual_bits; encoder->frame_stats[10] = frame->scene_change_score; encoder->frame_stats[11] = encoder->buffer_level; encoder->frame_stats[12] = frame->frame_lambda; encoder->frame_stats[13] = frame->mc_error; encoder->frame_stats[14] = frame->mean_squared_error_luma; encoder->frame_stats[15] = frame->mean_squared_error_chroma; encoder->frame_stats[16] = elapsed_time; encoder->frame_stats[17] = frame->badblock_ratio; encoder->frame_stats[18] = frame->dcblock_ratio; encoder->frame_stats[19] = frame->hist_slope; encoder->frame_stats[20] = frame->mssim; schro_encoder_shift_frame_queue (encoder); } if (encoder->rate_control == SCHRO_ENCODER_RATE_CONTROL_CONSTANT_BITRATE) { encoder->buffer_level -= buffer->length * 8; if (is_picture) { if (encoder->buffer_level < 0) { SCHRO_WARNING ("buffer underrun by %d bits", -encoder->buffer_level); encoder->buffer_level = 0; } encoder->buffer_level += encoder->bits_per_picture; if (encoder->buffer_level > encoder->buffer_size) { int n; n = (encoder->buffer_level - encoder->buffer_size + 7) / 8; SCHRO_DEBUG ("buffer overrun, adding padding of %d bytes", n); n = schro_encoder_encode_padding (encoder, n); encoder->buffer_level -= n * 8; } SCHRO_DEBUG ("buffer level %d of %d bits", encoder->buffer_level, encoder->buffer_size); } } if (!encoder->assemble_packets) { schro_encoder_fixup_offsets (encoder, buffer, FALSE); } SCHRO_DEBUG ("got buffer length=%d", buffer->length); schro_async_unlock (encoder->async); return buffer; } } if (schro_queue_is_empty (encoder->frame_queue) && encoder->end_of_stream) { buffer = schro_encoder_encode_end_of_stream (encoder); schro_encoder_fixup_offsets (encoder, buffer, TRUE); encoder->end_of_stream_pulled = TRUE; schro_async_unlock (encoder->async); return buffer; } schro_async_unlock (encoder->async); SCHRO_DEBUG ("got nothing"); return NULL; } /** * schro_encoder_end_of_stream: * @encoder: an encoder object * * Tells the encoder that the end of the stream has been reached, and * no more frames are available to encode. The encoder will then * finish encoding. */ void schro_encoder_end_of_stream (SchroEncoder * encoder) { encoder->end_of_stream = TRUE; schro_async_lock (encoder->async); if (encoder->frame_queue->n > 0) { SchroEncoderFrame *encoder_frame; encoder_frame = encoder->frame_queue->elements[encoder->frame_queue->n - 1].data; encoder_frame->last_frame = TRUE; } schro_async_unlock (encoder->async); } static void schro_encoder_fixup_offsets (SchroEncoder * encoder, SchroBuffer * buffer, schro_bool is_eos) { uint8_t *data = buffer->data; unsigned int next_offset; if (buffer->length < 13) { SCHRO_ERROR ("packet too short (%d < 13)", buffer->length); } if (is_eos) { next_offset = 0; } else { next_offset = buffer->length; } data[5] = (next_offset >> 24) & 0xff; data[6] = (next_offset >> 16) & 0xff; data[7] = (next_offset >> 8) & 0xff; data[8] = (next_offset >> 0) & 0xff; data[9] = (encoder->prev_offset >> 24) & 0xff; data[10] = (encoder->prev_offset >> 16) & 0xff; data[11] = (encoder->prev_offset >> 8) & 0xff; data[12] = (encoder->prev_offset >> 0) & 0xff; encoder->prev_offset = next_offset; } static int schro_encoder_encode_padding (SchroEncoder * encoder, int n) { SchroBuffer *buffer; SchroPack *pack; if (n < SCHRO_PARSE_HEADER_SIZE) n = SCHRO_PARSE_HEADER_SIZE; buffer = schro_buffer_new_and_alloc (n); pack = schro_pack_new (); schro_pack_encode_init (pack, buffer); schro_encoder_encode_parse_info (pack, SCHRO_PARSE_CODE_PADDING); schro_pack_append_zero (pack, n - SCHRO_PARSE_HEADER_SIZE); schro_pack_free (pack); schro_encoder_insert_buffer (encoder, buffer); return n; } static void schro_encoder_encode_codec_comment (SchroEncoder * encoder) { const char *s = "Schroedinger " VERSION; SchroBuffer *buffer; buffer = schro_encoder_encode_auxiliary_data (encoder, SCHRO_AUX_DATA_ENCODER_STRING, s, strlen (s)); schro_encoder_insert_buffer (encoder, buffer); } static void schro_encoder_encode_bitrate_comment (SchroEncoder * encoder, unsigned int bitrate) { uint8_t s[4]; SchroBuffer *buffer; s[0] = (bitrate >> 24) & 0xff; s[1] = (bitrate >> 16) & 0xff; s[2] = (bitrate >> 8) & 0xff; s[3] = (bitrate >> 0) & 0xff; buffer = schro_encoder_encode_auxiliary_data (encoder, SCHRO_AUX_DATA_BITRATE, s, 4); schro_encoder_insert_buffer (encoder, buffer); } static void schro_encoder_encode_md5_checksum (SchroEncoderFrame * frame) { SchroBuffer *buffer; uint32_t checksum[4]; schro_frame_md5 (frame->reconstructed_frame->frames[0], checksum); buffer = schro_encoder_encode_auxiliary_data (frame->encoder, SCHRO_AUX_DATA_MD5_CHECKSUM, checksum, 16); schro_encoder_frame_insert_buffer (frame, buffer); } /** * schro_encoder_insert_buffer: * @encoder: an encoder object * @buffer: a buffer * * Inserts an application-provided buffer into the encoded video stream * with the next frame that is pushed. */ void schro_encoder_insert_buffer (SchroEncoder * encoder, SchroBuffer * buffer) { schro_list_append (encoder->inserted_buffers, buffer); } /** * schro_encoder_frame_insert_buffer: * @frame: an encoder frame * @buffer: a buffer * * Inserts a buffer into an encoder frame. */ void schro_encoder_frame_insert_buffer (SchroEncoderFrame * frame, SchroBuffer * buffer) { schro_list_append (frame->inserted_buffers, buffer); } /** * schro_encoder_encode_auxiliary_data: * @encoder: * @id: * @data: * @size: * * Packs data into a Dirac auxiliary data packet. * * Returns: a buffer */ SchroBuffer * schro_encoder_encode_auxiliary_data (SchroEncoder * encoder, SchroAuxiliaryDataID id, const void *data, int size) { SchroPack *pack; SchroBuffer *buffer; buffer = schro_buffer_new_and_alloc (size + SCHRO_PARSE_HEADER_SIZE + 1); pack = schro_pack_new (); schro_pack_encode_init (pack, buffer); schro_encoder_encode_parse_info (pack, SCHRO_PARSE_CODE_AUXILIARY_DATA); schro_pack_encode_bits (pack, 8, id); schro_pack_append (pack, data, size); schro_pack_free (pack); return buffer; } /** * schro_encoder_encode_sequence_header: * @encoder: an encoder object * * Creates a buffer containing a sequence header. * * Returns: a buffer */ SchroBuffer * schro_encoder_encode_sequence_header (SchroEncoder * encoder) { SchroPack *pack; SchroBuffer *buffer; SchroBuffer *subbuffer; int next_offset; buffer = schro_buffer_new_and_alloc (0x100); pack = schro_pack_new (); schro_pack_encode_init (pack, buffer); schro_encoder_encode_sequence_header_header (encoder, pack); schro_pack_flush (pack); next_offset = schro_pack_get_offset (pack); buffer->data[5] = (next_offset >> 24) & 0xff; buffer->data[6] = (next_offset >> 16) & 0xff; buffer->data[7] = (next_offset >> 8) & 0xff; buffer->data[8] = (next_offset >> 0) & 0xff; subbuffer = schro_buffer_new_subbuffer (buffer, 0, schro_pack_get_offset (pack)); schro_pack_free (pack); schro_buffer_unref (buffer); buffer = NULL; return subbuffer; } /** * schro_encoder_encode_end_of_stream: * @encoder: * * Creates an end-of-stream packet. * * Returns: a buffer */ SchroBuffer * schro_encoder_encode_end_of_stream (SchroEncoder * encoder) { SchroPack *pack; SchroBuffer *buffer; buffer = schro_buffer_new_and_alloc (SCHRO_PARSE_HEADER_SIZE); pack = schro_pack_new (); schro_pack_encode_init (pack, buffer); schro_encoder_encode_parse_info (pack, SCHRO_PARSE_CODE_END_OF_SEQUENCE); schro_pack_free (pack); return buffer; } /** * schro_encoder_wait: * @encoder: an encoder object * * Checks the state of the encoder. If the encoder requires the * application to do something, an appropriate state code is returned. * Otherwise, this function waits until the encoder requires the * application to do something. * * Returns: a state code */ SchroStateEnum schro_encoder_wait (SchroEncoder * encoder) { SchroStateEnum ret = SCHRO_STATE_AGAIN; schro_async_lock (encoder->async); while (1) { if (schro_encoder_pull_is_ready_locked (encoder)) { SCHRO_DEBUG ("have buffer"); ret = SCHRO_STATE_HAVE_BUFFER; break; } if (schro_encoder_push_is_ready_locked (encoder)) { SCHRO_DEBUG ("need frame"); ret = SCHRO_STATE_NEED_FRAME; break; } if (schro_queue_is_empty (encoder->frame_queue) && encoder->end_of_stream_pulled) { ret = SCHRO_STATE_END_OF_STREAM; break; } SCHRO_DEBUG ("encoder waiting"); ret = schro_async_wait_locked (encoder->async); if (!ret) { int i; SCHRO_WARNING ("deadlock? kicking scheduler"); for (i = 0; i < encoder->frame_queue->n; i++) { SchroEncoderFrame *frame = encoder->frame_queue->elements[i].data; SCHRO_WARNING ("%d: %d %d %d %d %04x", i, frame->frame_number, frame->picture_number_ref[0], frame->picture_number_ref[1], frame->busy, 0 /*frame->state */ ); } for (i = 0; i < SCHRO_LIMIT_REFERENCE_FRAMES; i++) { SchroEncoderFrame *frame = encoder->reference_pictures[i]; if (frame) { SCHRO_WARNING ("ref %d: %d %d %04x", i, frame->frame_number, frame->busy, 0 /*frame->state */ ); } else { SCHRO_WARNING ("ref %d: NULL", i); } } //SCHRO_ASSERT(0); schro_async_signal_scheduler (encoder->async); ret = SCHRO_STATE_AGAIN; break; } } schro_async_unlock (encoder->async); return ret; } int schro_encoder_frame_is_B_frame (SchroEncoderFrame * frame) { int is_B_frame = 0; if (frame->num_refs == 2 && ((frame->picture_number_ref[0] < frame->frame_number && frame->picture_number_ref[1] > frame->frame_number) || (frame->picture_number_ref[1] < frame->frame_number && frame->picture_number_ref[0] > frame->frame_number))) { is_B_frame = 1; } return is_B_frame; } static void schro_encoder_frame_complete (SchroAsyncStage * stage) { SchroEncoderFrame *frame = (SchroEncoderFrame *) stage->priv; int i; SCHRO_INFO ("completing task, picture %d working %02x in state %02x", frame->frame_number, frame->working, 0 /*frame->state */ ); SCHRO_ASSERT (frame->busy == TRUE); frame->busy = FALSE; stage->is_done = TRUE; frame->working = 0; if (stage == frame->stages + SCHRO_ENCODER_FRAME_STAGE_POSTANALYSE) { frame->stages[SCHRO_ENCODER_FRAME_STAGE_DONE].is_done = TRUE; SCHRO_ASSERT (frame->output_buffer_size > 0); if (frame->previous_frame) { schro_encoder_frame_unref (frame->previous_frame); frame->previous_frame = NULL; } if (frame->motion) { schro_motion_free (frame->motion); frame->motion = NULL; } if (frame->me) { schro_motionest_free (frame->me); frame->me = NULL; } if (frame->ref_frame[0]) { schro_encoder_frame_unref (frame->ref_frame[0]); frame->ref_frame[0] = NULL; } if (frame->ref_frame[1]) { schro_encoder_frame_unref (frame->ref_frame[1]); frame->ref_frame[1] = NULL; } if (frame->deep_me) { schro_me_free (frame->deep_me); frame->deep_me = NULL; } for (i = 0; 2 > i; ++i) { if (frame->hier_bm[i]) { schro_hbm_unref (frame->hier_bm[i]); frame->hier_bm[i] = NULL; } } if (!frame->is_ref) { for (i = 0; i < 5; i++) { if (frame->downsampled_frames[i]) { schro_frame_unref (frame->downsampled_frames[i]); frame->downsampled_frames[i] = NULL; } } } if (frame->start_sequence_header) { frame->sequence_header_buffer = schro_encoder_encode_sequence_header (frame->encoder); } if (frame->last_frame) { frame->encoder->completed_eos = TRUE; } } } static void schro_encoder_sc_detect_1 (SchroAsyncStage * stage) { SchroEncoderFrame *frame = stage->priv; SchroFrameData *comp1; SchroFrameData *comp2; SCHRO_ASSERT (frame->stages[SCHRO_ENCODER_FRAME_STAGE_ANALYSE].is_done && frame->previous_frame && frame->previous_frame-> stages[SCHRO_ENCODER_FRAME_STAGE_ANALYSE].is_done); comp1 = &frame->downsampled_frames[0]->components[0]; comp2 = &frame->previous_frame->downsampled_frames[0]->components[0]; frame->sc_mad = schro_metric_absdiff_u8 (comp1->data, comp1->stride, comp2->data, comp2->stride, comp1->width, comp1->height); frame->sc_mad /= (comp1->width * comp1->height); frame->have_mad = 1; } /** * run_stage: * @frame: * @state: * * Runs a stage in the encoding process. */ static void run_stage (SchroEncoderFrame * frame, int stage) { void *func; SCHRO_ASSERT (frame->stages[stage].is_done == FALSE); frame->busy = TRUE; frame->working = stage; switch (stage) { case SCHRO_ENCODER_FRAME_STAGE_ANALYSE: func = schro_encoder_analyse_picture; break; case SCHRO_ENCODER_FRAME_STAGE_PREDICT_ROUGH: func = schro_encoder_predict_rough_picture; break; case SCHRO_ENCODER_FRAME_STAGE_PREDICT_PEL: func = schro_encoder_predict_pel_picture; break; case SCHRO_ENCODER_FRAME_STAGE_PREDICT_SUBPEL: func = schro_encoder_predict_subpel_picture; break; case SCHRO_ENCODER_FRAME_STAGE_MODE_DECISION: func = schro_encoder_mode_decision; break; case SCHRO_ENCODER_FRAME_STAGE_ENCODING: func = schro_encoder_encode_picture; break; case SCHRO_ENCODER_FRAME_STAGE_RECONSTRUCT: func = schro_encoder_reconstruct_picture; break; case SCHRO_ENCODER_FRAME_STAGE_POSTANALYSE: func = schro_encoder_postanalyse_picture; break; case SCHRO_ENCODER_FRAME_STAGE_SC_DETECT_1: func = schro_encoder_sc_detect_1; break; default: SCHRO_ASSERT (0); } frame->stages[stage].task_func = func; frame->stages[stage].priv = frame; schro_async_run_stage_locked (frame->encoder->async, frame->stages + stage); } /** * check_refs: * @frame: encoder frame * * Checks whether reference pictures are available to be used for motion * rendering. */ static int check_refs (SchroEncoderFrame * frame) { if (frame->num_refs == 0) return TRUE; if (frame->num_refs > 0 && !(frame->ref_frame[0]->stages[SCHRO_ENCODER_FRAME_STAGE_DONE].is_done)) { return FALSE; } if (frame->num_refs > 1 && !(frame->ref_frame[1]->stages[SCHRO_ENCODER_FRAME_STAGE_DONE].is_done)) { return FALSE; } return TRUE; } static void calculate_sc_score (SchroEncoder * encoder) { #define SC_THRESHOLD_RANGE 2 #define MAD_ARRAY_LEN SC_THRESHOLD_RANGE * 2 + 1 #define BIG_INT 0xffffffff int i, j, end; int mad_array[MAD_ARRAY_LEN]; SchroEncoderFrame *frame, *f, *f2; /* calculate threshold first */ for (i = SC_THRESHOLD_RANGE; encoder->frame_queue->n - SC_THRESHOLD_RANGE > i; ++i) { int mad_max = 0, mad_min = BIG_INT; frame = encoder->frame_queue->elements[i].data; if (!frame->need_mad) continue; if (frame->have_scene_change_score) continue; if (0 > frame->sc_threshold) { memset (mad_array, -1, sizeof (mad_array)); mad_array[SC_THRESHOLD_RANGE] = frame->sc_mad; for (j = 0; SC_THRESHOLD_RANGE > j; ++j) { f = encoder->frame_queue->elements[i - j - 1].data; mad_array[SC_THRESHOLD_RANGE - j - 1] = f->sc_mad; f = encoder->frame_queue->elements[i + j + 1].data; mad_array[SC_THRESHOLD_RANGE + j + 1] = f->sc_mad; } for (j = 0; MAD_ARRAY_LEN > j; ++j) { if (mad_array[j] > mad_max) mad_max = mad_array[j]; if (mad_array[j] < mad_min) mad_min = mad_array[j]; } frame->sc_threshold = mad_max + 0.8 * (mad_max - mad_min); } } /* and now calculate the score */ for (i = SC_THRESHOLD_RANGE + 3; encoder->frame_queue->n - SC_THRESHOLD_RANGE - 3 > i; ++i) { frame = encoder->frame_queue->elements[i].data; if (!frame->need_mad) continue; if (frame->have_scene_change_score) continue; f = encoder->frame_queue->elements[i - 3].data; f2 = encoder->frame_queue->elements[i + 3].data; frame->scene_change_score = frame->sc_mad - (f->sc_threshold + f2->sc_threshold) / 2; frame->have_scene_change_score = 1; } /* finally we update the state of the processed items */ if (encoder->queue_depth > encoder->frame_queue->n && encoder->end_of_stream) { /* end of sequence */ end = encoder->frame_queue->n; } else { end = encoder->frame_queue->n - SC_THRESHOLD_RANGE - 3; } for (i = 0; end > i; ++i) { f = encoder->frame_queue->elements[i].data; f->stages[SCHRO_ENCODER_FRAME_STAGE_SC_DETECT_2].is_done = TRUE; SCHRO_DEBUG ("calculate sc score for i=%d picture=%d state=%d", i, f->frame_number, 0 /* f->state */ ); } } #undef BIG_INT static int schro_encoder_async_schedule (SchroEncoder * encoder, SchroExecDomain exec_domain) { SchroEncoderFrame *frame; int i; int ref; SCHRO_INFO ("iterate %d", encoder->completed_eos); for (i = 0; i < encoder->frame_queue->n; i++) { frame = encoder->frame_queue->elements[i].data; SCHRO_DEBUG ("analyse i=%d picture=%d state=%d busy=%d", i, frame->frame_number, 0 /*frame->state */ , frame->busy); if (frame->busy) continue; #define TODO(stage) (frame->stages[(stage)].is_needed && !frame->stages[(stage)].is_done) if (TODO (SCHRO_ENCODER_FRAME_STAGE_ANALYSE)) { encoder->init_frame (frame); init_params (frame); run_stage (frame, SCHRO_ENCODER_FRAME_STAGE_ANALYSE); return TRUE; } } if (encoder->enable_scene_change_detection) { /* calculate MAD for entire queue of frames */ for (i = 0; encoder->frame_queue->n > i; ++i) { SchroEncoderFrame *prev_frame; frame = encoder->frame_queue->elements[i].data; SCHRO_DEBUG ("phase I of shot change detection for i=%d picture=%d state=%d", i, frame->frame_number, 0 /* frame->state */ ); if (frame->busy) continue; if (0 == i || FALSE == frame->need_mad) { /* we can't calculate a MAD for first frame in the queue */ frame->stages[SCHRO_ENCODER_FRAME_STAGE_SC_DETECT_1].is_done = TRUE; continue; } prev_frame = frame->previous_frame; if (!frame->stages[SCHRO_ENCODER_FRAME_STAGE_SC_DETECT_1].is_done && prev_frame && prev_frame->stages[SCHRO_ENCODER_FRAME_STAGE_ANALYSE].is_done && frame->stages[SCHRO_ENCODER_FRAME_STAGE_ANALYSE].is_done) { run_stage (frame, SCHRO_ENCODER_FRAME_STAGE_SC_DETECT_1); return TRUE; } } /* calculate new scene change score */ for (i = 0; encoder->frame_queue->n > i; ++i) { frame = encoder->frame_queue->elements[i].data; if (!frame->stages[SCHRO_ENCODER_FRAME_STAGE_SC_DETECT_1].is_done) { return TRUE; } } calculate_sc_score (encoder); } else { for (i = 0; encoder->frame_queue->n > i; ++i) { frame = encoder->frame_queue->elements[i].data; if (frame->stages[SCHRO_ENCODER_FRAME_STAGE_ANALYSE].is_done) { frame->stages[SCHRO_ENCODER_FRAME_STAGE_SC_DETECT_1].is_done = TRUE; frame->stages[SCHRO_ENCODER_FRAME_STAGE_SC_DETECT_2].is_done = TRUE; } } } for (i = 0; i < encoder->frame_queue->n; i++) { frame = encoder->frame_queue->elements[i].data; if (frame->frame_number == encoder->gop_picture) { encoder->handle_gop (encoder, i); break; } } /* Reference pictures are higher priority, so we pass over the list * first for reference pictures, then for non-ref. */ for (ref = 1; ref >= 0; ref--) { for (i = 0; i < encoder->frame_queue->n; i++) { frame = encoder->frame_queue->elements[i].data; SCHRO_DEBUG ("backref i=%d picture=%d state=%d busy=%d", i, frame->frame_number, 0 /*frame->state */ , frame->busy); if (frame->busy) continue; if (frame->is_ref != ref) continue; if (TODO (SCHRO_ENCODER_FRAME_STAGE_HAVE_PARAMS) && frame->stages[SCHRO_ENCODER_FRAME_STAGE_HAVE_GOP].is_done) { if (encoder->setup_frame (frame)) { frame->stages[SCHRO_ENCODER_FRAME_STAGE_HAVE_PARAMS].is_done = TRUE; } } if (TODO (SCHRO_ENCODER_FRAME_STAGE_PREDICT_ROUGH) && frame->stages[SCHRO_ENCODER_FRAME_STAGE_HAVE_PARAMS].is_done) { if (!check_refs (frame)) continue; run_stage (frame, SCHRO_ENCODER_FRAME_STAGE_PREDICT_ROUGH); return TRUE; } if (TODO (SCHRO_ENCODER_FRAME_STAGE_PREDICT_PEL) && frame->stages[SCHRO_ENCODER_FRAME_STAGE_PREDICT_ROUGH].is_done) { schro_frame_set_wavelet_params (frame); run_stage (frame, SCHRO_ENCODER_FRAME_STAGE_PREDICT_PEL); return TRUE; } } } for (ref = 1; ref >= 0; ref--) { for (i = 0; encoder->frame_queue->n > i; ++i) { frame = encoder->frame_queue->elements[i].data; SCHRO_DEBUG ("serialised stage i=%d picture=%d state=%d slot=%d quant_slot=%d", i, frame->frame_number, 0 /* frame>state */ , frame->slot, encoder->quant_slot); if (frame->busy) continue; if (encoder->enable_deep_estimation) { if (frame->slot != encoder->quant_slot) { continue; } } else if (encoder->enable_bigblock_estimation) { if (frame->is_ref != ref) continue; } if (TODO (SCHRO_ENCODER_FRAME_STAGE_PREDICT_SUBPEL) && frame->stages[SCHRO_ENCODER_FRAME_STAGE_PREDICT_PEL].is_done) { schro_encoder_set_frame_lambda (frame); run_stage (frame, SCHRO_ENCODER_FRAME_STAGE_PREDICT_SUBPEL); return TRUE; } if (TODO (SCHRO_ENCODER_FRAME_STAGE_MODE_DECISION) && frame->stages[SCHRO_ENCODER_FRAME_STAGE_PREDICT_SUBPEL].is_done) { run_stage (frame, SCHRO_ENCODER_FRAME_STAGE_MODE_DECISION); return TRUE; } } } for (i = 0; i < encoder->frame_queue->n; i++) { frame = encoder->frame_queue->elements[i].data; if (frame->slot == encoder->quant_slot) { int ret; ret = encoder->handle_quants (encoder, i); if (!ret) break; } } for (ref = 1; ref >= 0; ref--) { for (i = 0; encoder->frame_queue->n > i; ++i) { frame = encoder->frame_queue->elements[i].data; if (frame->busy) continue; if (encoder->enable_deep_estimation) { if (frame->slot != encoder->quant_slot) continue; } else if (encoder->enable_bigblock_estimation) { if (frame->is_ref != ref) continue; } if (TODO (SCHRO_ENCODER_FRAME_STAGE_ENCODING) && frame->stages[SCHRO_ENCODER_FRAME_STAGE_HAVE_QUANTS].is_done) { run_stage (frame, SCHRO_ENCODER_FRAME_STAGE_ENCODING); return TRUE; } } } for (ref = 1; ref >= 0; ref--) { for (i = 0; i < encoder->frame_queue->n; i++) { frame = encoder->frame_queue->elements[i].data; SCHRO_DEBUG ("backref i=%d picture=%d state=%d busy=%d", i, frame->frame_number, 0 /*frame->state */ , frame->busy); if (frame->busy) continue; if (frame->is_ref != ref) continue; if (TODO (SCHRO_ENCODER_FRAME_STAGE_RECONSTRUCT) && frame->stages[SCHRO_ENCODER_FRAME_STAGE_ENCODING].is_done) { run_stage (frame, SCHRO_ENCODER_FRAME_STAGE_RECONSTRUCT); return TRUE; } if (TODO (SCHRO_ENCODER_FRAME_STAGE_POSTANALYSE) && frame->stages[SCHRO_ENCODER_FRAME_STAGE_RECONSTRUCT].is_done) { run_stage (frame, SCHRO_ENCODER_FRAME_STAGE_POSTANALYSE); return TRUE; } } } return FALSE; } void schro_encoder_analyse_picture (SchroAsyncStage * stage) { SchroEncoderFrame *frame = (SchroEncoderFrame *) stage->priv; if (frame->encoder->filtering != 0 || frame->need_extension) { if (frame->encoder->enable_deep_estimation) { frame->filtered_frame = schro_frame_dup_full (frame->original_frame, MAX (frame->params.xbsep_luma * 4, frame->params.ybsep_luma * 4), TRUE); } else if (frame->encoder->enable_bigblock_estimation) { frame->filtered_frame = schro_frame_dup_full (frame->original_frame, 32, TRUE); } else SCHRO_ASSERT (0); switch (frame->encoder->filtering) { case 1: schro_frame_filter_cwmN (frame->filtered_frame, frame->encoder->filter_value); break; case 2: schro_frame_filter_lowpass2 (frame->filtered_frame, frame->encoder->filter_value); break; case 3: schro_frame_filter_addnoise (frame->filtered_frame, frame->encoder->filter_value); break; case 4: schro_frame_filter_adaptive_lowpass (frame->filtered_frame); break; case 5: schro_frame_filter_lowpass (frame->filtered_frame, frame->encoder->filter_value); break; default: /* do nothing */ break; } schro_frame_mc_edgeextend (frame->filtered_frame); } else { frame->filtered_frame = schro_frame_dup_full (frame->original_frame, 32, TRUE); } if (frame->need_downsampling) { schro_encoder_frame_downsample (frame); frame->have_downsampling = TRUE; } schro_frame_ref (frame->filtered_frame); frame->upsampled_original_frame = schro_upsampled_frame_new (frame->filtered_frame); if (frame->need_upsampling) { schro_upsampled_frame_upsample (frame->upsampled_original_frame); frame->have_upsampling = TRUE; } if (frame->need_average_luma) { if (frame->have_downsampling) { frame->average_luma = schro_frame_calculate_average_luma (frame-> downsampled_frames[frame->encoder->downsample_levels - 1]); } else { frame->average_luma = schro_frame_calculate_average_luma (frame->filtered_frame); } frame->have_average_luma = TRUE; } } void schro_encoder_predict_rough_picture (SchroAsyncStage * stage) { SchroEncoderFrame *frame = (SchroEncoderFrame *) stage->priv; SCHRO_INFO ("predict picture %d", frame->frame_number); if (frame->params.num_refs > 0) { schro_encoder_motion_predict_rough (frame); } } /* should perform fullpel ME without "rendering", * ie without mode decision and motion compensation and DWT */ void schro_encoder_predict_pel_picture (SchroAsyncStage * stage) { SchroEncoderFrame *frame = (SchroEncoderFrame *) stage->priv; SCHRO_ASSERT (frame && frame->stages[SCHRO_ENCODER_FRAME_STAGE_PREDICT_ROUGH].is_done); SCHRO_INFO ("fullpel predict picture %d", frame->frame_number); if (frame->params.num_refs > 0) { schro_encoder_motion_predict_pel (frame); } } void schro_encoder_predict_subpel_picture (SchroAsyncStage * stage) { SchroEncoderFrame *frame = (SchroEncoderFrame *) stage->priv; if (frame->encoder->enable_bigblock_estimation) { if (frame->params.num_refs > 0 && frame->params.mv_precision > 0) { schro_encoder_motion_predict_subpel (frame); } } else if (frame->encoder->enable_deep_estimation) { int ref, xnum_blocks, ynum_blocks; SchroMotionField *mf_dest, *mf_src; if (frame->params.num_refs > 0) { xnum_blocks = frame->params.x_num_blocks; ynum_blocks = frame->params.y_num_blocks; for (ref = 0; frame->params.num_refs > ref; ++ref) { mf_dest = schro_motion_field_new (xnum_blocks, ynum_blocks); mf_src = schro_hbm_motion_field (frame->hier_bm[ref], 0); memcpy (mf_dest->motion_vectors, mf_src->motion_vectors, xnum_blocks * ynum_blocks * sizeof (SchroMotionVector)); schro_me_set_subpel_mf (frame->deep_me, mf_dest, ref); } } if (frame->params.num_refs > 0 && frame->params.mv_precision > 0) { schro_me_set_lambda (frame->deep_me, frame->frame_me_lambda); schro_encoder_motion_predict_subpel_deep (frame->deep_me); } } } /* performs mode decision and superblock splitting * finally it does DWT */ void schro_encoder_mode_decision (SchroAsyncStage * stage) { SchroEncoderFrame *frame = (SchroEncoderFrame *) stage->priv; SCHRO_ASSERT (frame->stages[SCHRO_ENCODER_FRAME_STAGE_PREDICT_PEL].is_done); SCHRO_INFO ("mode decision and superblock splitting picture %d", frame->frame_number); if (frame->encoder->enable_deep_estimation) { SchroMotionField *mf, *mf_src; int xnum_blocks, ynum_blocks, ref; if (frame->params.num_refs > 0) { xnum_blocks = frame->params.x_num_blocks; ynum_blocks = frame->params.y_num_blocks; for (ref = 0; frame->params.num_refs > ref; ++ref) { mf = schro_motion_field_new (xnum_blocks, ynum_blocks); schro_motion_field_set (mf, 2, ref + 1); /* copy split2 from subpel */ mf_src = schro_me_subpel_mf (frame->deep_me, ref); SCHRO_ASSERT (mf_src); memcpy (mf->motion_vectors, mf_src->motion_vectors, xnum_blocks * ynum_blocks * sizeof (SchroMotionVector)); schro_me_set_split2_mf (frame->deep_me, mf, ref); mf = schro_motion_field_new (xnum_blocks, ynum_blocks); schro_motion_field_set (mf, 1, ref + 1); schro_me_set_split1_mf (frame->deep_me, mf, ref); mf = schro_motion_field_new (xnum_blocks, ynum_blocks); schro_motion_field_set (mf, 0, ref + 1); schro_me_set_split0_mf (frame->deep_me, mf, ref); } SCHRO_INFO ("mode decision and superblock splitting picture %d", frame->frame_number); schro_me_set_motion (frame->deep_me, frame->motion); schro_me_set_lambda (frame->deep_me, frame->frame_me_lambda); schro_mode_decision (frame->deep_me); schro_motion_calculate_stats (frame->motion, frame); frame->estimated_mc_bits = schro_motion_estimate_entropy (frame->motion); frame->badblock_ratio = schro_me_badblocks_ratio (frame->deep_me); frame->dcblock_ratio = schro_me_dcblock_ratio (frame->deep_me); frame->mc_error = schro_me_mc_error (frame->deep_me); SCHRO_DEBUG ("DC block ratio for frame %d s %g", frame->frame_number, frame->dcblock_ratio); if (frame->dcblock_ratio > frame->encoder->magic_me_bailout_limit) { if (frame->deep_me) { /* Free the motion estimation info if we are inserting an I frame */ schro_me_free (frame->deep_me); frame->deep_me = NULL; } frame->params.num_refs = 0; frame->num_refs = 0; SCHRO_WARNING ("DC block ratio too high for frame %d, inserting an intra picture", frame->frame_number); } } } schro_encoder_render_picture (frame); } static void schro_encoder_iwt_transform (SchroFrame * frame, SchroParams * params) { int component; int width; int height; int level; int16_t *tmp; tmp = schro_malloc (sizeof (int32_t) * (params->iwt_luma_width + 8) * 2); for (component = 0; component < 3; component++) { SchroFrameData *comp = &frame->components[component]; if (component == 0) { width = params->iwt_luma_width; height = params->iwt_luma_height; } else { width = params->iwt_chroma_width; height = params->iwt_chroma_height; } for (level = 0; level < params->transform_depth; level++) { SchroFrameData fd; fd.format = frame->format; fd.data = comp->data; fd.width = width >> level; fd.height = height >> level; fd.stride = comp->stride << level; schro_wavelet_transform_2d (&fd, params->wavelet_filter_index, tmp); } } schro_free (tmp); } void schro_encoder_render_picture (SchroEncoderFrame * frame) { SCHRO_INFO ("render picture %d", frame->frame_number); if (frame->params.num_refs > 0) { frame->motion->src1 = frame->ref_frame[0]->reconstructed_frame; if (frame->params.num_refs > 1) { frame->motion->src2 = frame->ref_frame[1]->reconstructed_frame; } SCHRO_ASSERT (schro_motion_verify (frame->motion)); } if (frame->params.num_refs > 0) { schro_frame_convert (frame->iwt_frame, frame->filtered_frame); schro_motion_render (frame->motion, frame->prediction_frame, frame->iwt_frame, FALSE, NULL); schro_frame_zero_extend (frame->iwt_frame, frame->params.video_format->width, schro_video_format_get_picture_height (frame->params.video_format)); } else { schro_frame_convert (frame->iwt_frame, frame->filtered_frame); } schro_encoder_iwt_transform (frame->iwt_frame, &frame->params); schro_encoder_clean_up_transform (frame); } void schro_encoder_encode_picture (SchroAsyncStage * stage) { SchroEncoderFrame *frame = (SchroEncoderFrame *) stage->priv; SchroBuffer *subbuffer; int picture_chroma_width, picture_chroma_height; int width, height; int total_frame_bits; double factor; double est_subband_bits; SCHRO_INFO ("encode picture %d", frame->frame_number); frame->output_buffer = schro_buffer_new_and_alloc (frame->output_buffer_size); schro_video_format_get_iwt_alloc_size (&frame->encoder->video_format, &width, &height, frame->encoder->transform_depth); frame->subband_size = width * height / 4; frame->subband_buffer = schro_buffer_new_and_alloc (frame->subband_size * sizeof (int16_t)); schro_video_format_get_picture_chroma_size (&frame->encoder->video_format, &picture_chroma_width, &picture_chroma_height); /* FIXME this is only used for lowdelay, and is way too big */ frame->quant_data = schro_malloc (sizeof (int16_t) * frame->subband_size); frame->pack = schro_pack_new (); schro_pack_encode_init (frame->pack, frame->output_buffer); total_frame_bits = -schro_pack_get_offset (frame->pack) * 8; /* encode header */ schro_encoder_encode_parse_info (frame->pack, SCHRO_PARSE_CODE_PICTURE (frame->is_ref, frame->params.num_refs, frame->params.is_lowdelay, frame->params.is_noarith)); schro_encoder_encode_picture_header (frame); if (frame->params.num_refs > 0) { schro_pack_sync (frame->pack); schro_encoder_encode_picture_prediction_parameters (frame); schro_pack_sync (frame->pack); frame->actual_mc_bits = -schro_pack_get_offset (frame->pack) * 8; schro_encoder_encode_superblock_split (frame); schro_encoder_encode_prediction_modes (frame); schro_encoder_encode_vector_data (frame, 0, 0); schro_encoder_encode_vector_data (frame, 0, 1); if (frame->params.num_refs > 1) { schro_encoder_encode_vector_data (frame, 1, 0); schro_encoder_encode_vector_data (frame, 1, 1); } schro_encoder_encode_dc_data (frame, 0); schro_encoder_encode_dc_data (frame, 1); schro_encoder_encode_dc_data (frame, 2); frame->actual_mc_bits += schro_pack_get_offset (frame->pack) * 8; } if (schro_pack_get_offset (frame->pack) * 8 > frame->hard_limit_bits) { SCHRO_ERROR ("over hard_limit_bits after MC (%d>%d)", schro_pack_get_offset (frame->pack) * 8, frame->hard_limit_bits); } schro_pack_sync (frame->pack); schro_encoder_encode_transform_parameters (frame); if (schro_pack_get_offset (frame->pack) * 8 > frame->hard_limit_bits) { SCHRO_ERROR ("over hard_limit_bits after transform params (%d>%d)", schro_pack_get_offset (frame->pack) * 8, frame->hard_limit_bits); } frame->actual_residual_bits = -schro_pack_get_offset (frame->pack) * 8; schro_pack_sync (frame->pack); if (frame->params.is_lowdelay) { schro_encoder_encode_lowdelay_transform_data (frame); } else { schro_encoder_encode_transform_data (frame); } schro_pack_flush (frame->pack); frame->actual_residual_bits += schro_pack_get_offset (frame->pack) * 8; total_frame_bits += schro_pack_get_offset (frame->pack) * 8; SCHRO_DEBUG ("Actual frame %d residual bits : %d", frame->frame_number, frame->actual_residual_bits); // Update the fiddle factors for estimating entropy if (frame->num_refs == 0) { int component, b; for (component = 0; component < 3; ++component) { for (b = 0; b < 1 + 3 * frame->params.transform_depth; ++b) { est_subband_bits = frame-> est_entropy[component][b][frame->quant_indices[component][b][0]]; SCHRO_DEBUG ("Actual versus estimated band bits : %d %d %g %g", component, b, frame->actual_subband_bits[component][b], est_subband_bits); if (est_subband_bits > 200.0) { double ratio; factor = frame->actual_subband_bits[component][b] / est_subband_bits; ratio = frame->encoder->average_arith_context_ratios_intra[component][b]; ratio = ratio * 0.9 + factor * 0.1; frame->encoder->average_arith_context_ratios_intra[component][b] = ratio; } } } } else { int component, b; for (component = 0; component < 3; ++component) { for (b = 0; b < 1 + 3 * frame->params.transform_depth; ++b) { est_subband_bits = frame-> est_entropy[component][b][frame->quant_indices[component][b][0]]; SCHRO_DEBUG ("Actual versus estimated band bits : %d %d %g %g", component, b, frame->actual_subband_bits[component][b], est_subband_bits); if (est_subband_bits > 200.0) { double ratio; factor = frame->actual_subband_bits[component][b] / est_subband_bits; ratio = frame->encoder->average_arith_context_ratios_inter[component][b]; ratio = ratio * 0.9 + factor * 0.1; frame->encoder->average_arith_context_ratios_inter[component][b] = ratio; } } } } // Update the buffer model if (frame->encoder->rate_control == SCHRO_ENCODER_RATE_CONTROL_CONSTANT_BITRATE) { SchroEncoder *encoder = frame->encoder; encoder->buffer_level -= total_frame_bits; encoder->buffer_level += encoder->bits_per_picture; if (encoder->buffer_level < 0) { SCHRO_DEBUG ("buffer underrun by %d bytes", -encoder->buffer_level); encoder->buffer_level = 0; } if (encoder->buffer_level > encoder->buffer_size) { int n; n = (encoder->buffer_level - encoder->buffer_size + 7) / 8; SCHRO_DEBUG ("buffer overrun, adding padding of %d bytes", n); n = schro_encoder_encode_padding (encoder, n); encoder->buffer_level -= n * 8; } SCHRO_DEBUG ("At frame %d, buffer level %d of %d bits", frame->frame_number, encoder->buffer_level, encoder->buffer_size); schro_encoder_cbr_update (frame, total_frame_bits); } if (schro_pack_get_offset (frame->pack) * 8 > frame->hard_limit_bits) { SCHRO_ERROR ("over hard_limit_bits after residual (%d>%d)", schro_pack_get_offset (frame->pack) * 8, frame->hard_limit_bits); } subbuffer = schro_buffer_new_subbuffer (frame->output_buffer, 0, schro_pack_get_offset (frame->pack)); schro_buffer_unref (frame->output_buffer); frame->output_buffer = subbuffer; if (frame->subband_buffer) { schro_buffer_unref (frame->subband_buffer); } if (frame->quant_data) { free (frame->quant_data); } if (frame->quant_frame) { schro_frame_unref (frame->quant_frame); } if (frame->pack) { schro_pack_free (frame->pack); frame->pack = NULL; } frame->encoder->quant_slot++; } void schro_encoder_inverse_iwt_transform (SchroFrame * frame, SchroParams * params) { int width; int height; int level; int component; int16_t *tmp; tmp = schro_malloc (sizeof (int32_t) * (params->iwt_luma_width + 16)); for (component = 0; component < 3; component++) { SchroFrameData *comp = &frame->components[component]; if (component == 0) { width = params->iwt_luma_width; height = params->iwt_luma_height; } else { width = params->iwt_chroma_width; height = params->iwt_chroma_height; } for (level = params->transform_depth - 1; level >= 0; level--) { SchroFrameData fd_dest; SchroFrameData fd_src; fd_src.format = frame->format; fd_src.data = comp->data; fd_src.width = width >> level; fd_src.height = height >> level; fd_src.stride = comp->stride << level; fd_dest.format = frame->format; fd_dest.data = comp->data; fd_dest.width = width >> level; fd_dest.height = height >> level; fd_dest.stride = comp->stride << level; schro_wavelet_inverse_transform_2d (&fd_dest, &fd_src, params->wavelet_filter_index, tmp); } } schro_free (tmp); } void schro_encoder_reconstruct_picture (SchroAsyncStage * stage) { SchroEncoderFrame *encoder_frame = (SchroEncoderFrame *) stage->priv; schro_encoder_inverse_iwt_transform (encoder_frame->iwt_frame, &encoder_frame->params); if (encoder_frame->params.num_refs > 0) { schro_frame_add (encoder_frame->iwt_frame, encoder_frame->prediction_frame); } if (encoder_frame->encoder->enable_md5 || (encoder_frame->is_ref && encoder_frame->encoder->gop_structure != SCHRO_ENCODER_GOP_INTRA_ONLY)) { SchroFrameFormat frame_format; SchroFrame *frame; frame_format = schro_params_get_frame_format (encoder_frame->encoder->input_frame_depth, encoder_frame->encoder->video_format.chroma_format); frame = schro_frame_new_and_alloc_full (NULL, frame_format, encoder_frame->encoder->video_format.width, schro_video_format_get_picture_height (&encoder_frame-> encoder->video_format), 32, TRUE); schro_frame_convert (frame, encoder_frame->iwt_frame); schro_frame_mc_edgeextend (frame); encoder_frame->reconstructed_frame = schro_upsampled_frame_new (frame); } if (encoder_frame->encoder->enable_md5) { schro_encoder_encode_md5_checksum (encoder_frame); } if (encoder_frame->is_ref && encoder_frame->encoder->mv_precision > 0) { schro_upsampled_frame_upsample (encoder_frame->reconstructed_frame); } } void schro_encoder_postanalyse_picture (SchroAsyncStage * stage) { SchroEncoderFrame *frame = (SchroEncoderFrame *) stage->priv; SchroVideoFormat *video_format = frame->params.video_format; if (frame->encoder->enable_psnr) { double mse[3]; schro_frame_mean_squared_error (frame->filtered_frame, frame->reconstructed_frame->frames[0], mse); frame->mean_squared_error_luma = mse[0] / (video_format->luma_excursion * video_format->luma_excursion); frame->mean_squared_error_chroma = 0.5 * (mse[1] + mse[2]) / (video_format->chroma_excursion * video_format->chroma_excursion); } if (frame->encoder->enable_ssim) { frame->mssim = schro_frame_ssim (frame->original_frame, frame->reconstructed_frame->frames[0]); schro_dump (SCHRO_DUMP_SSIM, "%d %g\n", frame->frame_number, frame->mssim); } } static void schro_encoder_encode_picture_prediction_parameters (SchroEncoderFrame * frame) { SchroParams *params = &frame->params; int index; /* block parameters */ index = schro_params_get_block_params (params); schro_pack_encode_uint (frame->pack, index); if (index == 0) { schro_pack_encode_uint (frame->pack, params->xblen_luma); schro_pack_encode_uint (frame->pack, params->yblen_luma); schro_pack_encode_uint (frame->pack, params->xbsep_luma); schro_pack_encode_uint (frame->pack, params->xbsep_luma); } MARKER (frame->pack); /* mv precision */ schro_pack_encode_uint (frame->pack, params->mv_precision); MARKER (frame->pack); /* global motion flag */ schro_pack_encode_bit (frame->pack, params->have_global_motion); if (params->have_global_motion) { int i; for (i = 0; i < params->num_refs; i++) { SchroGlobalMotion *gm = params->global_motion + i; /* pan tilt */ if (gm->b0 == 0 && gm->b1 == 0) { schro_pack_encode_bit (frame->pack, 0); } else { schro_pack_encode_bit (frame->pack, 1); schro_pack_encode_sint (frame->pack, gm->b0); schro_pack_encode_sint (frame->pack, gm->b1); } /* zoom rotate shear */ if (gm->a_exp == 0 && gm->a00 == 1 && gm->a01 == 0 && gm->a10 == 0 && gm->a11 == 1) { schro_pack_encode_bit (frame->pack, 0); } else { schro_pack_encode_bit (frame->pack, 1); schro_pack_encode_uint (frame->pack, gm->a_exp); schro_pack_encode_sint (frame->pack, gm->a00); schro_pack_encode_sint (frame->pack, gm->a01); schro_pack_encode_sint (frame->pack, gm->a10); schro_pack_encode_sint (frame->pack, gm->a11); } /* perspective */ if (gm->c_exp == 0 && gm->c0 == 0 && gm->c1 == 0) { schro_pack_encode_bit (frame->pack, 0); } else { schro_pack_encode_bit (frame->pack, 1); schro_pack_encode_uint (frame->pack, gm->c_exp); schro_pack_encode_sint (frame->pack, gm->c0); schro_pack_encode_sint (frame->pack, gm->c1); } } } MARKER (frame->pack); /* picture prediction mode flag */ schro_pack_encode_uint (frame->pack, params->picture_pred_mode); /* non-default weights flag */ SCHRO_ASSERT (params->picture_weight_2 == 1 || params->num_refs == 2); if (params->picture_weight_bits == 1 && params->picture_weight_1 == 1 && params->picture_weight_2 == 1) { schro_pack_encode_bit (frame->pack, FALSE); } else { schro_pack_encode_bit (frame->pack, TRUE); schro_pack_encode_uint (frame->pack, params->picture_weight_bits); schro_pack_encode_sint (frame->pack, params->picture_weight_1); if (params->num_refs > 1) { schro_pack_encode_sint (frame->pack, params->picture_weight_2); } } MARKER (frame->pack); } static void schro_encoder_encode_superblock_split (SchroEncoderFrame * frame) { SchroParams *params = &frame->params; int i, j; SchroArith *arith = NULL; SchroPack b, *pack = &b; if (params->is_noarith) { schro_pack_encode_init (pack, frame->subband_buffer); } else { arith = schro_arith_new (); schro_arith_encode_init (arith, frame->subband_buffer); } for (j = 0; j < params->y_num_blocks; j += 4) { for (i = 0; i < params->x_num_blocks; i += 4) { int split_prediction; int split_residual; SchroMotionVector *mv = &frame->motion->motion_vectors[j * params->x_num_blocks + i]; SCHRO_ASSERT (mv->split < 3); split_prediction = schro_motion_split_prediction (frame->motion, i, j); split_residual = (mv->split - split_prediction + 3) % 3; if (params->is_noarith) { schro_pack_encode_uint (pack, split_residual); } else { _schro_arith_encode_uint (arith, SCHRO_CTX_SB_F1, SCHRO_CTX_SB_DATA, split_residual); } } } schro_pack_sync (frame->pack); if (params->is_noarith) { schro_pack_flush (pack); schro_pack_encode_uint (frame->pack, schro_pack_get_offset (pack)); schro_pack_sync (frame->pack); schro_pack_append (frame->pack, pack->buffer->data, schro_pack_get_offset (pack)); } else { schro_arith_flush (arith); schro_pack_encode_uint (frame->pack, arith->offset); schro_pack_sync (frame->pack); schro_pack_append (frame->pack, arith->buffer->data, arith->offset); schro_arith_free (arith); } } static void schro_encoder_encode_prediction_modes (SchroEncoderFrame * frame) { SchroParams *params = &frame->params; int i, j; SchroArith *arith = NULL; SchroPack b, *pack = &b; if (params->is_noarith) { schro_pack_encode_init (pack, frame->subband_buffer); } else { arith = schro_arith_new (); schro_arith_encode_init (arith, frame->subband_buffer); } for (j = 0; j < params->y_num_blocks; j += 4) { for (i = 0; i < params->x_num_blocks; i += 4) { int k, l; SchroMotionVector *mv1 = &frame->motion->motion_vectors[j * params->x_num_blocks + i]; for (l = 0; l < 4; l += (4 >> mv1->split)) { for (k = 0; k < 4; k += (4 >> mv1->split)) { SchroMotionVector *mv = &frame->motion->motion_vectors[(j + l) * params->x_num_blocks + i + k]; int pred_mode; pred_mode = mv->pred_mode ^ schro_motion_get_mode_prediction (frame->motion, i + k, j + l); if (params->is_noarith) { schro_pack_encode_bit (pack, pred_mode & 1); } else { _schro_arith_encode_bit (arith, SCHRO_CTX_BLOCK_MODE_REF1, pred_mode & 1); } if (params->num_refs > 1) { if (params->is_noarith) { schro_pack_encode_bit (pack, pred_mode >> 1); } else { _schro_arith_encode_bit (arith, SCHRO_CTX_BLOCK_MODE_REF2, pred_mode >> 1); } } if (mv->pred_mode != 0) { if (params->have_global_motion) { int pred; pred = schro_motion_get_global_prediction (frame->motion, i + k, j + l); if (params->is_noarith) { schro_pack_encode_bit (pack, mv->using_global ^ pred); } else { _schro_arith_encode_bit (arith, SCHRO_CTX_GLOBAL_BLOCK, mv->using_global ^ pred); } } else { SCHRO_ASSERT (mv->using_global == FALSE); } } } } } } schro_pack_sync (frame->pack); if (params->is_noarith) { schro_pack_flush (pack); schro_pack_encode_uint (frame->pack, schro_pack_get_offset (pack)); schro_pack_sync (frame->pack); schro_pack_append (frame->pack, pack->buffer->data, schro_pack_get_offset (pack)); } else { schro_arith_flush (arith); schro_pack_encode_uint (frame->pack, arith->offset); schro_pack_sync (frame->pack); schro_pack_append (frame->pack, arith->buffer->data, arith->offset); schro_arith_free (arith); } } static void schro_encoder_encode_vector_data (SchroEncoderFrame * frame, int ref, int xy) { SchroParams *params = &frame->params; int i, j; SchroArith *arith = NULL; int cont, value, sign; SchroPack b, *pack = &b; if (params->is_noarith) { schro_pack_encode_init (pack, frame->subband_buffer); } else { arith = schro_arith_new (); schro_arith_encode_init (arith, frame->subband_buffer); } if (xy == 0) { if (ref == 0) { cont = SCHRO_CTX_MV_REF1_H_CONT_BIN1; value = SCHRO_CTX_MV_REF1_H_VALUE; sign = SCHRO_CTX_MV_REF1_H_SIGN; } else { cont = SCHRO_CTX_MV_REF2_H_CONT_BIN1; value = SCHRO_CTX_MV_REF2_H_VALUE; sign = SCHRO_CTX_MV_REF2_H_SIGN; } } else { if (ref == 0) { cont = SCHRO_CTX_MV_REF1_V_CONT_BIN1; value = SCHRO_CTX_MV_REF1_V_VALUE; sign = SCHRO_CTX_MV_REF1_V_SIGN; } else { cont = SCHRO_CTX_MV_REF2_V_CONT_BIN1; value = SCHRO_CTX_MV_REF2_V_VALUE; sign = SCHRO_CTX_MV_REF2_V_SIGN; } } for (j = 0; j < params->y_num_blocks; j += 4) { for (i = 0; i < params->x_num_blocks; i += 4) { int k, l; SchroMotionVector *mv1 = &frame->motion->motion_vectors[j * params->x_num_blocks + i]; for (l = 0; l < 4; l += (4 >> mv1->split)) { for (k = 0; k < 4; k += (4 >> mv1->split)) { int pred_x, pred_y; int x, y; SchroMotionVector *mv = &frame->motion->motion_vectors[(j + l) * params->x_num_blocks + i + k]; if ((mv->pred_mode & (1 << ref)) && !mv->using_global) { schro_motion_vector_prediction (frame->motion, i + k, j + l, &pred_x, &pred_y, 1 << ref); x = mv->u.vec.dx[ref]; y = mv->u.vec.dy[ref]; if (!params->is_noarith) { if (xy == 0) { _schro_arith_encode_sint (arith, cont, value, sign, x - pred_x); } else { _schro_arith_encode_sint (arith, cont, value, sign, y - pred_y); } } else { if (xy == 0) { schro_pack_encode_sint (pack, x - pred_x); } else { schro_pack_encode_sint (pack, y - pred_y); } } } } } } } schro_pack_sync (frame->pack); if (params->is_noarith) { schro_pack_flush (pack); schro_pack_encode_uint (frame->pack, schro_pack_get_offset (pack)); schro_pack_sync (frame->pack); schro_pack_append (frame->pack, pack->buffer->data, schro_pack_get_offset (pack)); } else { schro_arith_flush (arith); schro_pack_encode_uint (frame->pack, arith->offset); schro_pack_sync (frame->pack); schro_pack_append (frame->pack, arith->buffer->data, arith->offset); schro_arith_free (arith); } } static void schro_encoder_encode_dc_data (SchroEncoderFrame * frame, int comp) { SchroParams *params = &frame->params; int i, j; SchroArith *arith = NULL; SchroPack b, *pack = &b; if (params->is_noarith) { schro_pack_encode_init (pack, frame->subband_buffer); } else { arith = schro_arith_new (); schro_arith_encode_init (arith, frame->subband_buffer); } for (j = 0; j < params->y_num_blocks; j += 4) { for (i = 0; i < params->x_num_blocks; i += 4) { int k, l; SchroMotionVector *mv1 = &frame->motion->motion_vectors[j * params->x_num_blocks + i]; for (l = 0; l < 4; l += (4 >> mv1->split)) { for (k = 0; k < 4; k += (4 >> mv1->split)) { SchroMotionVector *mv = &frame->motion->motion_vectors[(j + l) * params->x_num_blocks + i + k]; if (mv->pred_mode == 0) { int pred[3]; schro_motion_dc_prediction (frame->motion, i + k, j + l, pred); if (!params->is_noarith) { switch (comp) { case 0: _schro_arith_encode_sint (arith, SCHRO_CTX_LUMA_DC_CONT_BIN1, SCHRO_CTX_LUMA_DC_VALUE, SCHRO_CTX_LUMA_DC_SIGN, mv->u.dc.dc[0] - pred[0]); break; case 1: _schro_arith_encode_sint (arith, SCHRO_CTX_CHROMA1_DC_CONT_BIN1, SCHRO_CTX_CHROMA1_DC_VALUE, SCHRO_CTX_CHROMA1_DC_SIGN, mv->u.dc.dc[1] - pred[1]); break; case 2: _schro_arith_encode_sint (arith, SCHRO_CTX_CHROMA2_DC_CONT_BIN1, SCHRO_CTX_CHROMA2_DC_VALUE, SCHRO_CTX_CHROMA2_DC_SIGN, mv->u.dc.dc[2] - pred[2]); break; default: SCHRO_ASSERT (0); } } else { schro_pack_encode_sint (pack, mv->u.dc.dc[comp] - pred[comp]); } } } } } } schro_pack_sync (frame->pack); if (params->is_noarith) { schro_pack_flush (pack); schro_pack_encode_uint (frame->pack, schro_pack_get_offset (pack)); schro_pack_sync (frame->pack); schro_pack_append (frame->pack, pack->buffer->data, schro_pack_get_offset (pack)); } else { schro_arith_flush (arith); schro_pack_encode_uint (frame->pack, arith->offset); schro_pack_sync (frame->pack); schro_pack_append (frame->pack, arith->buffer->data, arith->offset); schro_arith_free (arith); } } void schro_encoder_encode_sequence_header_header (SchroEncoder * encoder, SchroPack * pack) { SchroVideoFormat *format = &encoder->video_format; SchroVideoFormat _std_format; SchroVideoFormat *std_format = &_std_format; int i; schro_encoder_encode_parse_info (pack, SCHRO_PARSE_CODE_SEQUENCE_HEADER); /* parse parameters */ schro_pack_encode_uint (pack, encoder->version_major); schro_pack_encode_uint (pack, encoder->version_minor); schro_pack_encode_uint (pack, encoder->profile); schro_pack_encode_uint (pack, encoder->level); /* sequence parameters */ schro_pack_encode_uint (pack, encoder->video_format.index); schro_video_format_set_std_video_format (std_format, encoder->video_format.index); if (std_format->width == format->width && std_format->height == format->height) { schro_pack_encode_bit (pack, FALSE); } else { schro_pack_encode_bit (pack, TRUE); schro_pack_encode_uint (pack, format->width); schro_pack_encode_uint (pack, format->height); } if (std_format->chroma_format == format->chroma_format) { schro_pack_encode_bit (pack, FALSE); } else { schro_pack_encode_bit (pack, TRUE); schro_pack_encode_uint (pack, format->chroma_format); } /* scan format */ if (std_format->interlaced == format->interlaced) { schro_pack_encode_bit (pack, FALSE); } else { schro_pack_encode_bit (pack, TRUE); schro_pack_encode_uint (pack, format->interlaced); } MARKER (pack); /* frame rate */ if (std_format->frame_rate_numerator == format->frame_rate_numerator && std_format->frame_rate_denominator == format->frame_rate_denominator) { schro_pack_encode_bit (pack, FALSE); } else { schro_pack_encode_bit (pack, TRUE); i = schro_video_format_get_std_frame_rate (format); schro_pack_encode_uint (pack, i); if (i == 0) { schro_pack_encode_uint (pack, format->frame_rate_numerator); schro_pack_encode_uint (pack, format->frame_rate_denominator); } } MARKER (pack); /* pixel aspect ratio */ if (std_format->aspect_ratio_numerator == format->aspect_ratio_numerator && std_format->aspect_ratio_denominator == format->aspect_ratio_denominator) { schro_pack_encode_bit (pack, FALSE); } else { schro_pack_encode_bit (pack, TRUE); i = schro_video_format_get_std_aspect_ratio (format); schro_pack_encode_uint (pack, i); if (i == 0) { schro_pack_encode_uint (pack, format->aspect_ratio_numerator); schro_pack_encode_uint (pack, format->aspect_ratio_denominator); } } MARKER (pack); /* clean area */ if (std_format->clean_width == format->clean_width && std_format->clean_height == format->clean_height && std_format->left_offset == format->left_offset && std_format->top_offset == format->top_offset) { schro_pack_encode_bit (pack, FALSE); } else { schro_pack_encode_bit (pack, TRUE); schro_pack_encode_uint (pack, format->clean_width); schro_pack_encode_uint (pack, format->clean_height); schro_pack_encode_uint (pack, format->left_offset); schro_pack_encode_uint (pack, format->top_offset); } MARKER (pack); /* signal range */ if (std_format->luma_offset == format->luma_offset && std_format->luma_excursion == format->luma_excursion && std_format->chroma_offset == format->chroma_offset && std_format->chroma_excursion == format->chroma_excursion) { schro_pack_encode_bit (pack, FALSE); } else { schro_pack_encode_bit (pack, TRUE); i = schro_video_format_get_std_signal_range (format); schro_pack_encode_uint (pack, i); if (i == 0) { schro_pack_encode_uint (pack, format->luma_offset); schro_pack_encode_uint (pack, format->luma_excursion); schro_pack_encode_uint (pack, format->chroma_offset); schro_pack_encode_uint (pack, format->chroma_excursion); } } MARKER (pack); /* colour spec */ if (std_format->colour_primaries == format->colour_primaries && std_format->colour_matrix == format->colour_matrix && std_format->transfer_function == format->transfer_function) { schro_pack_encode_bit (pack, FALSE); } else { schro_pack_encode_bit (pack, TRUE); i = schro_video_format_get_std_colour_spec (format); schro_pack_encode_uint (pack, i); if (i == 0) { schro_pack_encode_bit (pack, TRUE); schro_pack_encode_uint (pack, format->colour_primaries); schro_pack_encode_bit (pack, TRUE); schro_pack_encode_uint (pack, format->colour_matrix); schro_pack_encode_bit (pack, TRUE); schro_pack_encode_uint (pack, format->transfer_function); } } /* interlaced coding */ schro_pack_encode_uint (pack, format->interlaced_coding); MARKER (pack); schro_pack_sync (pack); } void schro_encoder_encode_parse_info (SchroPack * pack, int parse_code) { /* parse parameters */ schro_pack_encode_bits (pack, 8, 'B'); schro_pack_encode_bits (pack, 8, 'B'); schro_pack_encode_bits (pack, 8, 'C'); schro_pack_encode_bits (pack, 8, 'D'); schro_pack_encode_bits (pack, 8, parse_code); /* offsets */ schro_pack_encode_bits (pack, 32, 0); schro_pack_encode_bits (pack, 32, 0); } void schro_encoder_encode_picture_header (SchroEncoderFrame * frame) { schro_pack_sync (frame->pack); schro_pack_encode_bits (frame->pack, 32, frame->frame_number); SCHRO_DEBUG ("refs %d ref0 %d ref1 %d", frame->params.num_refs, frame->picture_number_ref[0], frame->picture_number_ref[1]); if (frame->params.num_refs > 0) { schro_pack_encode_sint (frame->pack, (int32_t) (frame->picture_number_ref[0] - frame->frame_number)); if (frame->params.num_refs > 1) { schro_pack_encode_sint (frame->pack, (int32_t) (frame->picture_number_ref[1] - frame->frame_number)); } } if (frame->is_ref) { if (frame->retired_picture_number != -1) { schro_pack_encode_sint (frame->pack, (int32_t) (frame->retired_picture_number - frame->frame_number)); } else { schro_pack_encode_sint (frame->pack, 0); } } } static void schro_encoder_encode_transform_parameters (SchroEncoderFrame * frame) { SchroParams *params = &frame->params; SchroPack *pack = frame->pack; if (params->num_refs > 0) { /* zero residual */ schro_pack_encode_bit (pack, FALSE); } /* transform */ schro_pack_encode_uint (pack, params->wavelet_filter_index); /* transform depth */ schro_pack_encode_uint (pack, params->transform_depth); /* spatial partitioning */ if (!params->is_lowdelay) { if (schro_params_is_default_codeblock (params)) { schro_pack_encode_bit (pack, FALSE); } else { int i; schro_pack_encode_bit (pack, TRUE); for (i = 0; i < params->transform_depth + 1; i++) { schro_pack_encode_uint (pack, params->horiz_codeblocks[i]); schro_pack_encode_uint (pack, params->vert_codeblocks[i]); } schro_pack_encode_uint (pack, params->codeblock_mode_index); } } else { schro_pack_encode_uint (pack, params->n_horiz_slices); schro_pack_encode_uint (pack, params->n_vert_slices); schro_pack_encode_uint (pack, params->slice_bytes_num); schro_pack_encode_uint (pack, params->slice_bytes_denom); if (schro_params_is_default_quant_matrix (params)) { schro_pack_encode_bit (pack, FALSE); } else { int i; schro_pack_encode_bit (pack, TRUE); schro_pack_encode_uint (pack, params->quant_matrix[0]); for (i = 0; i < params->transform_depth; i++) { schro_pack_encode_uint (pack, params->quant_matrix[1 + 3 * i]); schro_pack_encode_uint (pack, params->quant_matrix[2 + 3 * i]); schro_pack_encode_uint (pack, params->quant_matrix[3 + 3 * i]); } } } } void schro_encoder_clean_up_transform (SchroEncoderFrame * frame) { int i; int component; SchroParams *params = &frame->params; for (component = 0; component < 3; component++) { for (i = 0; i < 1 + 3 * params->transform_depth; i++) { schro_encoder_clean_up_transform_subband (frame, component, i); } } } static void schro_encoder_clean_up_transform_subband (SchroEncoderFrame * frame, int component, int index) { static const int wavelet_extent[SCHRO_N_WAVELETS] = { 2, 1, 2, 0, 0, 4, 2 }; SchroParams *params = &frame->params; SchroFrameData fd; int w; int h; int i, j; int position; position = schro_subband_get_position (index); schro_subband_get_frame_data (&fd, frame->iwt_frame, component, position, params); if (component == 0) { schro_video_format_get_picture_luma_size (params->video_format, &w, &h); } else { schro_video_format_get_picture_chroma_size (params->video_format, &w, &h); } h = MIN (h + wavelet_extent[params->wavelet_filter_index], fd.height); w = MIN (w + wavelet_extent[params->wavelet_filter_index], fd.width); if ((SCHRO_FRAME_FORMAT_DEPTH (fd.format) == SCHRO_FRAME_FORMAT_DEPTH_S16)) { int16_t *line; if (w < fd.width) { for (j = 0; j < h; j++) { line = SCHRO_FRAME_DATA_GET_LINE (&fd, j); for (i = w; i < fd.width; i++) { line[i] = 0; } } } for (j = h; j < fd.height; j++) { line = SCHRO_FRAME_DATA_GET_LINE (&fd, j); for (i = 0; i < fd.width; i++) { line[i] = 0; } } } else { int32_t *line; if (w < fd.width) { for (j = 0; j < h; j++) { line = SCHRO_FRAME_DATA_GET_LINE (&fd, j); for (i = w; i < fd.width; i++) { line[i] = 0; } } } for (j = h; j < fd.height; j++) { line = SCHRO_FRAME_DATA_GET_LINE (&fd, j); for (i = 0; i < fd.width; i++) { line[i] = 0; } } } } static void schro_encoder_encode_transform_data (SchroEncoderFrame * frame) { int i; int component; SchroParams *params = &frame->params; for (component = 0; component < 3; component++) { for (i = 0; i < 1 + 3 * params->transform_depth; i++) { schro_pack_sync (frame->pack); frame->actual_subband_bits[component][i] = -schro_pack_get_offset (frame->pack) * 8; if (params->is_noarith) { schro_encoder_encode_subband_noarith (frame, component, i); } else { schro_encoder_encode_subband (frame, component, i); } frame->actual_subband_bits[component][i] += schro_pack_get_offset (frame->pack) * 8; } } } static void schro_frame_data_quantise (SchroFrameData * quant_fd, SchroFrameData * fd, int quant_index, schro_bool is_intra) { int j; int16_t *line; int16_t *quant_line; int quant_factor = schro_table_quant[quant_index]; int quant_offset; int quant_shift = (quant_index >> 2) + 2; int real_quant_offset; int inv_quant = schro_table_inverse_quant[quant_index]; if (is_intra) { quant_offset = schro_table_offset_1_2[quant_index]; } else { quant_offset = schro_table_offset_3_8[quant_index]; } real_quant_offset = quant_offset; quant_offset -= quant_factor >> 1; if (SCHRO_FRAME_FORMAT_DEPTH (fd->format) == SCHRO_FRAME_FORMAT_DEPTH_S32) { for (j = 0; j < fd->height; j++) { int32_t *line = SCHRO_FRAME_DATA_GET_LINE (fd, j); int32_t *quant_line = SCHRO_FRAME_DATA_GET_LINE (quant_fd, j); schro_quantise_s32 (quant_line, line, quant_factor, real_quant_offset, fd->width); } return; } if (quant_index == 0) { for (j = 0; j < fd->height; j++) { line = SCHRO_FRAME_DATA_GET_LINE (fd, j); quant_line = SCHRO_FRAME_DATA_GET_LINE (quant_fd, j); orc_memcpy (quant_line, line, fd->width * sizeof (int16_t)); } } else if ((quant_index & 3) == 0) { for (j = 0; j < fd->height; j++) { line = SCHRO_FRAME_DATA_GET_LINE (fd, j); quant_line = SCHRO_FRAME_DATA_GET_LINE (quant_fd, j); orc_quantdequant2_s16 (quant_line, line, quant_shift, quant_offset, quant_factor, real_quant_offset + 2, fd->width); } } else if (quant_index == 3) { for (j = 0; j < fd->height; j++) { line = SCHRO_FRAME_DATA_GET_LINE (fd, j); quant_line = SCHRO_FRAME_DATA_GET_LINE (quant_fd, j); orc_quantdequant3_s16 (quant_line, line, inv_quant, quant_offset, quant_shift + 16, quant_factor, real_quant_offset + 2, 32768, fd->width); } } else { if (quant_index > 8) quant_offset--; for (j = 0; j < fd->height; j++) { line = SCHRO_FRAME_DATA_GET_LINE (fd, j); quant_line = SCHRO_FRAME_DATA_GET_LINE (quant_fd, j); orc_quantdequant1_s16 (quant_line, line, inv_quant, quant_offset, quant_shift, quant_factor, real_quant_offset + 2, fd->width); } } } #if 0 static void schro_frame_data_dequantise (SchroFrameData * fd, SchroFrameData * quant_fd, int quant_index, schro_bool is_intra) { int j; int16_t *line; int16_t *quant_line; int quant_factor = schro_table_quant[quant_index]; int quant_offset; if (is_intra) { quant_offset = schro_table_offset_1_2[quant_index]; } else { quant_offset = schro_table_offset_3_8[quant_index]; } if (quant_index == 0) { for (j = 0; j < fd->height; j++) { line = SCHRO_FRAME_DATA_GET_LINE (fd, j); quant_line = SCHRO_FRAME_DATA_GET_LINE (quant_fd, j); orc_memcpy (line, quant_line, fd->width * sizeof (int16_t)); } } else { for (j = 0; j < fd->height; j++) { line = SCHRO_FRAME_DATA_GET_LINE (fd, j); quant_line = SCHRO_FRAME_DATA_GET_LINE (quant_fd, j); orc_dequantise_s16 (line, quant_line, quant_factor, quant_offset + 2, fd->width); } } } #endif static void schro_frame_data_quantise_dc_predict (SchroFrameData * quant_fd, SchroFrameData * fd, int quant_factor, int quant_offset, int x, int y) { if (SCHRO_FRAME_FORMAT_DEPTH (fd->format) == SCHRO_FRAME_FORMAT_DEPTH_S16) { int i, j; int16_t *line; int16_t *prev_line; int16_t *quant_line; for (j = 0; j < fd->height; j++) { line = SCHRO_FRAME_DATA_GET_LINE (fd, j); prev_line = SCHRO_FRAME_DATA_GET_LINE (fd, j - 1); quant_line = SCHRO_FRAME_DATA_GET_LINE (quant_fd, j); for (i = 0; i < fd->width; i++) { int q; int pred_value; if (y + j > 0) { if (x + i > 0) { pred_value = schro_divide3 (line[i - 1] + prev_line[i] + prev_line[i - 1] + 1); } else { pred_value = prev_line[i]; } } else { if (x + i > 0) { pred_value = line[i - 1]; } else { pred_value = 0; } } q = schro_quantise (line[i] - pred_value, quant_factor, quant_offset); line[i] = schro_dequantise (q, quant_factor, quant_offset) + pred_value; quant_line[i] = q; } } } else { int i, j; int32_t *line; int32_t *prev_line; int32_t *quant_line; for (j = 0; j < fd->height; j++) { line = SCHRO_FRAME_DATA_GET_LINE (fd, j); prev_line = SCHRO_FRAME_DATA_GET_LINE (fd, j - 1); quant_line = SCHRO_FRAME_DATA_GET_LINE (quant_fd, j); for (i = 0; i < fd->width; i++) { int q; int pred_value; if (y + j > 0) { if (x + i > 0) { pred_value = schro_divide (line[i - 1] + prev_line[i] + prev_line[i - 1] + 1, 3); } else { pred_value = prev_line[i]; } } else { if (x + i > 0) { pred_value = line[i - 1]; } else { pred_value = 0; } } q = schro_quantise (line[i] - pred_value, quant_factor, quant_offset); line[i] = schro_dequantise (q, quant_factor, quant_offset) + pred_value; quant_line[i] = q; } } } } int schro_encoder_frame_get_quant_index (SchroEncoderFrame * frame, int component, int index, int x, int y) { SchroParams *params = &frame->params; int position; int horiz_codeblocks; int *codeblock_quants; position = schro_subband_get_position (index); horiz_codeblocks = params->horiz_codeblocks[SCHRO_SUBBAND_SHIFT (position) + 1]; codeblock_quants = frame->quant_indices[component][index]; SCHRO_ASSERT (codeblock_quants); return codeblock_quants[y * horiz_codeblocks + x]; } void schro_encoder_frame_set_quant_index (SchroEncoderFrame * frame, int component, int index, int x, int y, int quant_index) { SchroParams *params = &frame->params; int *codeblock_quants; int position; int horiz_codeblocks; int vert_codeblocks; int i; position = schro_subband_get_position (index); horiz_codeblocks = params->horiz_codeblocks[SCHRO_SUBBAND_SHIFT (position) + 1]; vert_codeblocks = params->vert_codeblocks[SCHRO_SUBBAND_SHIFT (position) + 1]; SCHRO_ASSERT (horiz_codeblocks > 0); SCHRO_ASSERT (vert_codeblocks > 0); SCHRO_ASSERT (x < horiz_codeblocks); SCHRO_ASSERT (y < vert_codeblocks); if (frame->quant_indices[component][index] == NULL) { frame->quant_indices[component][index] = schro_malloc (horiz_codeblocks * vert_codeblocks * sizeof (int)); x = -1; y = -1; } codeblock_quants = frame->quant_indices[component][index]; if (x < 0 || y < 0) { for (i = 0; i < horiz_codeblocks * vert_codeblocks; i++) { codeblock_quants[i] = quant_index; } } else { codeblock_quants[x + y * horiz_codeblocks] = quant_index; } } static int schro_encoder_quantise_subband (SchroEncoderFrame * frame, int component, int index) { int quant_index; int quant_factor; int quant_offset; SchroFrameData fd; SchroFrameData qd; int position; SchroParams *params = &frame->params; int horiz_codeblocks; int vert_codeblocks; int x, y; position = schro_subband_get_position (index); schro_subband_get_frame_data (&fd, frame->iwt_frame, component, position, params); schro_subband_get_frame_data (&qd, frame->quant_frame, component, position, params); horiz_codeblocks = params->horiz_codeblocks[SCHRO_SUBBAND_SHIFT (position) + 1]; vert_codeblocks = params->vert_codeblocks[SCHRO_SUBBAND_SHIFT (position) + 1]; for (y = 0; y < vert_codeblocks; y++) { for (x = 0; x < horiz_codeblocks; x++) { SchroFrameData quant_cb; SchroFrameData cb; quant_index = schro_encoder_frame_get_quant_index (frame, component, index, x, y); quant_factor = schro_table_quant[quant_index]; if (params->num_refs > 0) { quant_offset = schro_table_offset_3_8[quant_index]; } else { quant_offset = schro_table_offset_1_2[quant_index]; } schro_frame_data_get_codeblock (&cb, &fd, x, y, horiz_codeblocks, vert_codeblocks); schro_frame_data_get_codeblock (&quant_cb, &qd, x, y, horiz_codeblocks, vert_codeblocks); if (params->num_refs == 0 && index == 0) { schro_frame_data_quantise_dc_predict (&quant_cb, &cb, quant_factor, quant_offset, x, y); } else { schro_frame_data_quantise (&quant_cb, &cb, quant_index, (params->num_refs == 0)); } } } return schro_frame_data_is_zero (&qd); } static void schro_frame_data_clear (SchroFrameData * fd) { int i; for (i = 0; i < fd->height; i++) { orc_splat_s16_ns (SCHRO_FRAME_DATA_GET_LINE (fd, i), 0, fd->width); } } void schro_encoder_encode_subband (SchroEncoderFrame * frame, int component, int index) { SchroParams *params = &frame->params; SchroArith *arith; int i, j; int subband_zero_flag; int x, y; int horiz_codeblocks; int vert_codeblocks; int have_zero_flags; int have_quant_offset; int position; SchroFrameData fd; SchroFrameData qd; SchroFrameData parent_fd; int quant_index; int n_subbands_left; int first_quant_index; position = schro_subband_get_position (index); schro_subband_get_frame_data (&fd, frame->iwt_frame, component, position, params); schro_subband_get_frame_data (&qd, frame->quant_frame, component, position, params); if (position >= 4) { schro_subband_get_frame_data (&parent_fd, frame->iwt_frame, component, position - 4, params); } else { parent_fd.data = NULL; parent_fd.stride = 0; } arith = schro_arith_new (); schro_arith_encode_init (arith, frame->subband_buffer); subband_zero_flag = schro_encoder_quantise_subband (frame, component, index); if (subband_zero_flag) { SCHRO_DEBUG ("subband is zero"); schro_pack_encode_uint (frame->pack, 0); schro_arith_free (arith); return; } if (index == 0) { horiz_codeblocks = params->horiz_codeblocks[0]; vert_codeblocks = params->vert_codeblocks[0]; } else { horiz_codeblocks = params->horiz_codeblocks[SCHRO_SUBBAND_SHIFT (position) + 1]; vert_codeblocks = params->vert_codeblocks[SCHRO_SUBBAND_SHIFT (position) + 1]; } if (horiz_codeblocks > 1 || vert_codeblocks > 1) { have_zero_flags = TRUE; } else { have_zero_flags = FALSE; } if (params->codeblock_mode_index == 1) { have_quant_offset = TRUE; } else { have_quant_offset = FALSE; } first_quant_index = -1; quant_index = 0; for (y = 0; y < vert_codeblocks; y++) { int ymin = (fd.height * y) / vert_codeblocks; int ymax = (fd.height * (y + 1)) / vert_codeblocks; for (x = 0; x < horiz_codeblocks; x++) { int xmin = (fd.width * x) / horiz_codeblocks; int xmax = (fd.width * (x + 1)) / horiz_codeblocks; SchroFrameData quant_cb; SchroFrameData cb; schro_frame_data_get_codeblock (&cb, &fd, x, y, horiz_codeblocks, vert_codeblocks); schro_frame_data_get_codeblock (&quant_cb, &qd, x, y, horiz_codeblocks, vert_codeblocks); if (have_zero_flags) { int zero_codeblock = schro_frame_data_is_zero (&quant_cb); _schro_arith_encode_bit (arith, SCHRO_CTX_ZERO_CODEBLOCK, zero_codeblock); if (zero_codeblock) { continue; } } if (have_quant_offset) { int new_quant_index; new_quant_index = schro_encoder_frame_get_quant_index (frame, component, index, x, y); if (first_quant_index == -1) { quant_index = new_quant_index; first_quant_index = new_quant_index; } _schro_arith_encode_sint (arith, SCHRO_CTX_QUANTISER_CONT, SCHRO_CTX_QUANTISER_VALUE, SCHRO_CTX_QUANTISER_SIGN, new_quant_index - quant_index); quant_index = new_quant_index; } for (j = ymin; j < ymax; j++) { int16_t *prev_quant_line = SCHRO_FRAME_DATA_GET_LINE (&qd, j - 1); int16_t *quant_line = SCHRO_FRAME_DATA_GET_LINE (&qd, j); int16_t *parent_line = SCHRO_FRAME_DATA_GET_LINE (&parent_fd, (j >> 1)); #define STUFF(have_parent,is_horiz,is_vert) \ for(i=xmin;i>1)]; \ } else { \ parent = 0; \ } \ \ nhood_or = 0; \ if (j>0) { \ nhood_or |= prev_quant_line[i]; \ } \ if (i>0) { \ nhood_or |= quant_line[i - 1]; \ } \ if (i>0 && j>0) { \ nhood_or |= prev_quant_line[i - 1]; \ } \ \ previous_value = 0; \ if (is_horiz) { \ if (i > 0) { \ previous_value = quant_line[i - 1]; \ } \ } else if (is_vert) { \ if (j > 0) { \ previous_value = prev_quant_line[i]; \ } \ } \ \ if (previous_value < 0) { \ sign_context = SCHRO_CTX_SIGN_NEG; \ } else { \ if (previous_value > 0) { \ sign_context = SCHRO_CTX_SIGN_POS; \ } else { \ sign_context = SCHRO_CTX_SIGN_ZERO; \ } \ } \ \ if (parent == 0) { \ if (nhood_or == 0) { \ cont_context = SCHRO_CTX_ZPZN_F1; \ } else { \ cont_context = SCHRO_CTX_ZPNN_F1; \ } \ } else { \ if (nhood_or == 0) { \ cont_context = SCHRO_CTX_NPZN_F1; \ } else { \ cont_context = SCHRO_CTX_NPNN_F1; \ } \ } \ \ value_context = SCHRO_CTX_COEFF_DATA; \ \ _schro_arith_encode_sint (arith, cont_context, value_context, \ sign_context, quant_line[i]); \ } if (position >= 4) { if (SCHRO_SUBBAND_IS_HORIZONTALLY_ORIENTED (position)) { STUFF (TRUE, TRUE, FALSE); } else if (SCHRO_SUBBAND_IS_VERTICALLY_ORIENTED (position)) { STUFF (TRUE, FALSE, TRUE); } else { STUFF (TRUE, FALSE, FALSE); } } else { if (SCHRO_SUBBAND_IS_HORIZONTALLY_ORIENTED (position)) { STUFF (FALSE, TRUE, FALSE); } else if (SCHRO_SUBBAND_IS_VERTICALLY_ORIENTED (position)) { STUFF (FALSE, FALSE, TRUE); } else { STUFF (FALSE, FALSE, FALSE); } } } } } schro_arith_flush (arith); SCHRO_ASSERT (arith->offset < frame->subband_buffer->length); schro_dump (SCHRO_DUMP_SUBBAND_EST, "%d %d %d %g %d\n", frame->frame_number, component, index, frame-> est_entropy[component][index][frame->quant_indices[component][index][0]], arith->offset * 8); n_subbands_left = (3 - component) * (1 + 3 * params->transform_depth) - index; if ((schro_pack_get_offset (frame->pack) + arith->offset + n_subbands_left + 4) * 8 > frame->hard_limit_bits) { SCHRO_ERROR ("skipping comp=%d subband=%d, too big (%d+%d+%d+32 > %d)", component, index, schro_pack_get_offset (frame->pack) * 8, arith->offset * 8, n_subbands_left * 8, frame->hard_limit_bits); schro_pack_encode_uint (frame->pack, 0); schro_frame_data_clear (&fd); } else { SCHRO_DEBUG ("appending comp=%d subband=%d, (%d+%d+%d+32 <= %d)", component, index, schro_pack_get_offset (frame->pack) * 8, arith->offset * 8, n_subbands_left * 8, frame->hard_limit_bits); schro_pack_encode_uint (frame->pack, arith->offset); if (first_quant_index == -1) { first_quant_index = schro_encoder_frame_get_quant_index (frame, component, index, 0, 0); } if (arith->offset > 0) { schro_pack_encode_uint (frame->pack, first_quant_index); schro_pack_sync (frame->pack); schro_pack_append (frame->pack, arith->buffer->data, arith->offset); } } schro_arith_free (arith); } static schro_bool schro_frame_data_is_zero (SchroFrameData * fd) { int j; int acc; if (SCHRO_FRAME_FORMAT_DEPTH (fd->format) == SCHRO_FRAME_FORMAT_DEPTH_S32) { for (j = 0; j < fd->height; j++) { int32_t *line = SCHRO_FRAME_DATA_GET_LINE (fd, j); int i; for (i=0; i < fd->width; i++) { if (line[i] != 0) return FALSE; } } } else { for (j = 0; j < fd->height; j++) { int16_t *line = SCHRO_FRAME_DATA_GET_LINE (fd, j); /* FIXME this could theoretically cause false positives. Fix when * Orc gets an accorw opcode. */ orc_accw (&acc, line, fd->width); if (acc != 0) return FALSE; } } return TRUE; } void schro_encoder_encode_subband_noarith (SchroEncoderFrame * frame, int component, int index) { SchroParams *params = &frame->params; SchroPack b; SchroPack *pack = &b; int i, j; int subband_zero_flag; int x, y; int horiz_codeblocks; int vert_codeblocks; int have_zero_flags; int have_quant_offset; int position; SchroFrameData fd; SchroFrameData qd; schro_bool deep; position = schro_subband_get_position (index); schro_subband_get_frame_data (&fd, frame->iwt_frame, component, position, params); schro_subband_get_frame_data (&qd, frame->quant_frame, component, position, params); deep = (SCHRO_FRAME_FORMAT_DEPTH (fd.format) == SCHRO_FRAME_FORMAT_DEPTH_S32); if (deep) { subband_zero_flag = schro_encoder_quantise_subband (frame, component, index); } else { subband_zero_flag = schro_encoder_quantise_subband (frame, component, index); } if (subband_zero_flag) { SCHRO_DEBUG ("subband is zero"); schro_pack_encode_uint (frame->pack, 0); return; } schro_pack_encode_init (pack, frame->subband_buffer); if (index == 0) { horiz_codeblocks = params->horiz_codeblocks[0]; vert_codeblocks = params->vert_codeblocks[0]; } else { horiz_codeblocks = params->horiz_codeblocks[SCHRO_SUBBAND_SHIFT (position) + 1]; vert_codeblocks = params->vert_codeblocks[SCHRO_SUBBAND_SHIFT (position) + 1]; } if ((horiz_codeblocks > 1 || vert_codeblocks > 1) && index > 0) { have_zero_flags = TRUE; } else { have_zero_flags = FALSE; } if (horiz_codeblocks > 1 || vert_codeblocks > 1) { if (params->codeblock_mode_index == 1) { have_quant_offset = TRUE; } else { have_quant_offset = FALSE; } } else { have_quant_offset = FALSE; } for (y = 0; y < vert_codeblocks; y++) { for (x = 0; x < horiz_codeblocks; x++) { SchroFrameData cb; schro_frame_data_get_codeblock (&cb, &qd, x, y, horiz_codeblocks, vert_codeblocks); if (have_zero_flags) { int zero_codeblock = schro_frame_data_is_zero (&cb); schro_pack_encode_bit (pack, zero_codeblock); if (zero_codeblock) { continue; } } if (have_quant_offset) { schro_pack_encode_sint (pack, 0); } if (deep) { for (j = 0; j < cb.height; j++) { int32_t *quant_line = SCHRO_FRAME_DATA_GET_LINE (&cb, j); for (i = 0; i < cb.width; i++) { schro_pack_encode_sint (pack, quant_line[i]); } } } else { for (j = 0; j < cb.height; j++) { int16_t *quant_line = SCHRO_FRAME_DATA_GET_LINE (&cb, j); for (i = 0; i < cb.width; i++) { schro_pack_encode_sint (pack, quant_line[i]); } } } } } schro_pack_flush (pack); SCHRO_ASSERT (schro_pack_get_offset (pack) < frame->subband_buffer->length); schro_dump (SCHRO_DUMP_SUBBAND_EST, "%d %d %d %d %d\n", frame->frame_number, component, index, frame->estimated_residual_bits, schro_pack_get_offset (pack) * 8); schro_pack_encode_uint (frame->pack, schro_pack_get_offset (pack)); if (schro_pack_get_offset (pack) > 0) { schro_pack_encode_uint (frame->pack, schro_encoder_frame_get_quant_index (frame, component, index, 0, 0)); schro_pack_sync (frame->pack); schro_pack_append (frame->pack, pack->buffer->data, schro_pack_get_offset (pack)); } } /* frame queue */ SchroEncoderFrame * schro_encoder_frame_new (SchroEncoder * encoder) { SchroEncoderFrame *encoder_frame; SchroFrameFormat frame_format; int iwt_width, iwt_height; int picture_width; int picture_height; int i; encoder_frame = schro_malloc0 (sizeof (SchroEncoderFrame)); for (i = 0; i < SCHRO_ENCODER_FRAME_STAGE_LAST; i++) { encoder_frame->stages[i].is_needed = TRUE; } encoder_frame->refcount = 1; encoder_frame->sc_mad = -1; encoder_frame->sc_threshold = -1.; encoder_frame->scene_change_score = -1.; frame_format = schro_params_get_frame_format (encoder->intermediate_frame_depth, encoder->video_format.chroma_format); schro_video_format_get_iwt_alloc_size (&encoder->video_format, &iwt_width, &iwt_height, encoder->transform_depth); encoder_frame->iwt_frame = schro_frame_new_and_alloc (NULL, frame_format, iwt_width, iwt_height); encoder_frame->quant_frame = schro_frame_new_and_alloc (NULL, frame_format, iwt_width, iwt_height); schro_video_format_get_picture_luma_size (&encoder->video_format, &picture_width, &picture_height); encoder_frame->prediction_frame = schro_frame_new_and_alloc (NULL, frame_format, picture_width, picture_height); encoder_frame->inserted_buffers = schro_list_new_full ((SchroListFreeFunc) schro_buffer_unref, NULL); encoder_frame->retired_picture_number = -1; return encoder_frame; } void schro_encoder_frame_ref (SchroEncoderFrame * frame) { SCHRO_ASSERT (frame && frame->refcount > 0); frame->refcount++; } void schro_encoder_frame_unref (SchroEncoderFrame * frame) { int i; frame->refcount--; if (frame->refcount == 0) { if (frame->previous_frame) { schro_encoder_frame_unref (frame->previous_frame); } if (frame->original_frame) { schro_frame_unref (frame->original_frame); } if (frame->filtered_frame) { schro_frame_unref (frame->filtered_frame); } if (frame->reconstructed_frame) { schro_upsampled_frame_free (frame->reconstructed_frame); } if (frame->upsampled_original_frame) { schro_upsampled_frame_free (frame->upsampled_original_frame); } #if 0 for (i = 0; i < 2; i++) { if (frame->mf[i]) { schro_motion_field_free (frame->mf[i]); } } #endif for (i = 0; i < frame->encoder->downsample_levels; i++) { if (frame->downsampled_frames[i]) { schro_frame_unref (frame->downsampled_frames[i]); } } if (frame->iwt_frame) { schro_frame_unref (frame->iwt_frame); } if (frame->prediction_frame) { schro_frame_unref (frame->prediction_frame); } if (frame->motion) { schro_motion_free (frame->motion); } schro_list_free (frame->inserted_buffers); if (frame->output_buffer) { schro_buffer_unref (frame->output_buffer); } if (frame->sequence_header_buffer) { schro_buffer_unref (frame->sequence_header_buffer); } if (frame->me) { schro_motionest_free (frame->me); } if (frame->rme[0]) schro_rough_me_free (frame->rme[0]); if (frame->rme[1]) schro_rough_me_free (frame->rme[1]); if (frame->hier_bm[0]) schro_hbm_unref (frame->hier_bm[0]); frame->hier_bm[0] = NULL; if (frame->hier_bm[1]) schro_hbm_unref (frame->hier_bm[1]); frame->hier_bm[1] = NULL; if (frame->deep_me) schro_me_free (frame->deep_me); frame->deep_me = NULL; if (frame->phasecorr[0]) schro_phasecorr_free (frame->phasecorr[0]); if (frame->phasecorr[1]) schro_phasecorr_free (frame->phasecorr[1]); for (i = 0; i < SCHRO_LIMIT_SUBBANDS; i++) { if (frame->quant_indices[0][i]) schro_free (frame->quant_indices[0][i]); if (frame->quant_indices[1][i]) schro_free (frame->quant_indices[1][i]); if (frame->quant_indices[2][i]) schro_free (frame->quant_indices[2][i]); } schro_free (frame); } } #if 0 /* reference pool */ void schro_encoder_reference_add (SchroEncoder * encoder, SchroEncoderFrame * frame) { if (schro_queue_is_full (encoder->reference_queue)) { schro_queue_pop (encoder->reference_queue); } SCHRO_DEBUG ("adding reference %p %d", frame, frame->frame_number); schro_encoder_frame_ref (frame); schro_queue_add (encoder->reference_queue, frame, frame->frame_number); } #endif SchroEncoderFrame * schro_encoder_reference_get (SchroEncoder * encoder, SchroPictureNumber frame_number) { int i; for (i = 0; i < SCHRO_LIMIT_REFERENCE_FRAMES; i++) { if (encoder->reference_pictures[i] && encoder->reference_pictures[i]->frame_number == frame_number) { return encoder->reference_pictures[i]; } } return NULL; } /* settings */ #define ENUM(name,list,def) \ {{#name, SCHRO_ENCODER_SETTING_TYPE_ENUM, 0, ARRAY_SIZE(list)-1, def, list}, offsetof(SchroEncoder, name)} #define INT(name,min,max,def) \ {{#name, SCHRO_ENCODER_SETTING_TYPE_INT, min, max, def}, offsetof(SchroEncoder, name)} #define BOOL(name,def) \ {{#name, SCHRO_ENCODER_SETTING_TYPE_BOOLEAN, 0, 1, def}, offsetof(SchroEncoder, name)} #define DOUB(name,min,max,def) \ {{#name, SCHRO_ENCODER_SETTING_TYPE_DOUBLE, min, max, def}, offsetof(SchroEncoder, name)} static const char *rate_control_list[] = { "constant_noise_threshold", "constant_bitrate", "low_delay", "lossless", "constant_lambda", "constant_error", "constant_quality" }; static const char *profile_list[] = { "auto", "vc2_low_delay", "vc2_simple", "vc2_main", "main" }; static const char *gop_structure_list[] = { "adaptive", "intra_only", "backref", "chained_backref", "biref", "chained_biref" }; static const char *perceptual_weighting_list[] = { "none", "ccir959", "moo", "manos_sakrison" }; static const char *filtering_list[] = { "none", "center_weighted_median", "gaussian", "add_noise", "adaptive_gaussian", "lowpass" }; static const char *wavelet_list[] = { "desl_dubuc_9_7", "le_gall_5_3", "desl_dubuc_13_7", "haar_0", "haar_1", "fidelity", "daub_9_7" }; static const char *block_size_list[] = { "automatic", "small", "medium", "large" }; static const char *codeblock_size_list[] = { "automatic", "small", "medium", "large", "full" }; static const char *block_overlap_list[] = { "automatic", "none", "partial", "full" }; #ifndef INT_MAX #define INT_MAX 2147483647 #endif struct SchroEncoderSettings { SchroEncoderSetting s; int offset; } static const encoder_settings[] = { ENUM (rate_control, rate_control_list, 6), INT (bitrate, 0, INT_MAX, 0), INT (max_bitrate, 0, INT_MAX, 13824000), INT (min_bitrate, 0, INT_MAX, 13824000), INT (buffer_size, 0, INT_MAX, 0), INT (buffer_level, 0, INT_MAX, 0), DOUB (quality, 0, 10.0, 5.0), DOUB (noise_threshold, 0, 100.0, 25.0), ENUM (gop_structure, gop_structure_list, 0), INT (queue_depth, 1, SCHRO_LIMIT_FRAME_QUEUE_LENGTH, 20), ENUM (perceptual_weighting, perceptual_weighting_list, 1), DOUB (perceptual_distance, 0, 100.0, 4.0), ENUM (filtering, filtering_list, 0), DOUB (filter_value, 0, 100.0, 5.0), INT (profile, 0, 0, 0), ENUM (force_profile, profile_list, 0), INT (level, 0, 0, 0), INT (max_refs, 1, 4, 3), BOOL (open_gop, TRUE), INT (au_distance, 1, INT_MAX, 120), BOOL (enable_psnr, FALSE), BOOL (enable_ssim, FALSE), INT (transform_depth, 0, SCHRO_LIMIT_ENCODER_TRANSFORM_DEPTH, 3), ENUM (intra_wavelet, wavelet_list, SCHRO_WAVELET_DESLAURIERS_DUBUC_9_7), ENUM (inter_wavelet, wavelet_list, SCHRO_WAVELET_DESLAURIERS_DUBUC_9_7), INT (mv_precision, 0, 3, 0), INT (downsample_levels, 2, 8, 5), ENUM (motion_block_size, block_size_list, 0), ENUM (motion_block_overlap, block_overlap_list, 0), BOOL (interlaced_coding, FALSE), BOOL (enable_internal_testing, FALSE), BOOL (enable_noarith, FALSE), BOOL (enable_md5, FALSE), BOOL (enable_fullscan_estimation, FALSE), BOOL (enable_hierarchical_estimation, TRUE), BOOL (enable_zero_estimation, FALSE), BOOL (enable_phasecorr_estimation, FALSE), BOOL (enable_bigblock_estimation, TRUE), BOOL (enable_multiquant, FALSE), BOOL (enable_dc_multiquant, FALSE), BOOL (enable_global_motion, FALSE), BOOL (enable_scene_change_detection, TRUE), BOOL (enable_deep_estimation, TRUE), BOOL (enable_rdo_cbr, TRUE), BOOL (enable_chroma_me, FALSE), INT (horiz_slices, 0, INT_MAX, 0), INT (vert_slices, 0, INT_MAX, 0), ENUM (codeblock_size, codeblock_size_list, 0), DOUB (magic_dc_metric_offset, 0.0, 1000.0, 1.0), DOUB (magic_subband0_lambda_scale, 0.0, 1000.0, 10.0), DOUB (magic_chroma_lambda_scale, 0.0, 1000.0, 0.1), DOUB (magic_nonref_lambda_scale, 0.0, 1000.0, 0.01), DOUB (magic_me_lambda_scale, 0.0, 100.0, 1.0), DOUB (magic_I_lambda_scale, 0.0, 100.0, 1.0), DOUB (magic_P_lambda_scale, 0.0, 10.0, 0.25), DOUB (magic_B_lambda_scale, 0.0, 10.0, 0.01), DOUB (magic_allocation_scale, 0.0, 1000.0, 1.1), DOUB (magic_inter_cpd_scale, 0.0, 1.0, 1.0), DOUB (magic_keyframe_weight, 0.0, 1000.0, 7.5), DOUB (magic_scene_change_threshold, 0.0, 1000.0, 3.0), DOUB (magic_inter_p_weight, 0.0, 1000.0, 1.5), DOUB (magic_inter_b_weight, 0.0, 1000.0, 0.2), DOUB (magic_me_bailout_limit, 0.0, 1000.0, 0.33), DOUB (magic_bailout_weight, 0.0, 1000.0, 4.0), DOUB (magic_error_power, 0.0, 1000.0, 4.0), DOUB (magic_subgroup_length, 1.0, 10.0, 4.0), DOUB (magic_badblock_multiplier_nonref, 0.0, 1000.0, 4.0), DOUB (magic_badblock_multiplier_ref, 0.0, 1000.0, 8.0), DOUB (magic_block_search_threshold, 0.0, 1000.0, 15.0), DOUB (magic_scan_distance, 0.0, 1000.0, 4.0), DOUB (magic_diagonal_lambda_scale, 0.0, 1000.0, 1.0), }; int schro_encoder_get_n_settings (void) { return ARRAY_SIZE (encoder_settings); } const SchroEncoderSetting * schro_encoder_get_setting_info (int i) { if (i >= 0 && i < ARRAY_SIZE (encoder_settings)) { return &encoder_settings[i].s; } return NULL; } /** * schro_encoder_setting_set_defaults: * @encoder: an encoder structure * * set the encoder options to the defaults advertised through * schro_encoder_get_setting_info. old settings are lost. */ static void schro_encoder_setting_set_defaults (SchroEncoder * encoder) { int i; for (i = 0; i < ARRAY_SIZE (encoder_settings); i++) { switch (encoder_settings[i].s.type) { case SCHRO_ENCODER_SETTING_TYPE_BOOLEAN: case SCHRO_ENCODER_SETTING_TYPE_INT: case SCHRO_ENCODER_SETTING_TYPE_ENUM: *(int *) SCHRO_OFFSET (encoder, encoder_settings[i].offset) = encoder_settings[i].s.default_value; break; case SCHRO_ENCODER_SETTING_TYPE_DOUBLE: *(double *) SCHRO_OFFSET (encoder, encoder_settings[i].offset) = encoder_settings[i].s.default_value; break; default: break; } } } /** * schro_encoder_setting_set_double: * @encoder: an encoder object * * set the encoder option given by @name to @value. */ void schro_encoder_setting_set_double (SchroEncoder * encoder, const char *name, double value) { int i; for (i = 0; i < ARRAY_SIZE (encoder_settings); i++) { if (strcmp (name, encoder_settings[i].s.name)) { continue; } switch (encoder_settings[i].s.type) { case SCHRO_ENCODER_SETTING_TYPE_BOOLEAN: case SCHRO_ENCODER_SETTING_TYPE_INT: case SCHRO_ENCODER_SETTING_TYPE_ENUM: *(int *) SCHRO_OFFSET (encoder, encoder_settings[i].offset) = value; return; case SCHRO_ENCODER_SETTING_TYPE_DOUBLE: *(double *) SCHRO_OFFSET (encoder, encoder_settings[i].offset) = value; return; default: return; } } } /** * schro_encoder_setting_get_double: * @encoder: an encoder object * * Returns: the current value of an encoder option given by @name */ double schro_encoder_setting_get_double (SchroEncoder * encoder, const char *name) { int i; for (i = 0; i < ARRAY_SIZE (encoder_settings); i++) { if (strcmp (name, encoder_settings[i].s.name)) { continue; } switch (encoder_settings[i].s.type) { case SCHRO_ENCODER_SETTING_TYPE_BOOLEAN: case SCHRO_ENCODER_SETTING_TYPE_INT: case SCHRO_ENCODER_SETTING_TYPE_ENUM: return *(int *) SCHRO_OFFSET (encoder, encoder_settings[i].offset); case SCHRO_ENCODER_SETTING_TYPE_DOUBLE: return *(double *) SCHRO_OFFSET (encoder, encoder_settings[i].offset); default: return 0; } } return 0; } schroedinger-1.0.11/schroedinger/schrolimits.h0000644000175000017500000000267211346107320016360 00000000000000 #ifndef _SCHRO_LIMIT_H_ #define _SCHRO_LIMIT_H_ #include SCHRO_BEGIN_DECLS /** * Section:schrolimit: * * This section contains a number of arbitrary limits that are * compiled into Schroedinger. These can be changed as necessary * if they are unsuitable. */ /** * SCHRO_LIMIT_TRANSFORM_DEPTH: * * The maximum transform depth that the decoder can handle. */ #define SCHRO_LIMIT_TRANSFORM_DEPTH 6 /** * SCHRO_LIMIT_ENCODER_TRANSFORM_DEPTH: * * The maximum transform depth that the encoder can handle. Must be * less than SCHRO_LIMIT_TRANSFORM_DEPTH. */ #define SCHRO_LIMIT_ENCODER_TRANSFORM_DEPTH 6 /** * SCHRO_LIMIT_SUBBANDS: * * The maximum number of subbands. */ #define SCHRO_LIMIT_SUBBANDS (1+3*SCHRO_LIMIT_TRANSFORM_DEPTH) /** * SCHRO_LIMIT_REFERENCE_FRAMES: * * The maximum number of active reference frames. In the encoder, * the number of active reference frames may be much larger than in * the resulting stream. */ #define SCHRO_LIMIT_REFERENCE_FRAMES 8 /** * SCHRO_LIMIT_FRAME_QUEUE_LENGTH: * * The maximum number of pictures being processed by the encoder. */ #define SCHRO_LIMIT_FRAME_QUEUE_LENGTH 40 /** * SCHRO_LIMIT_WIDTH: * * Maximum picture width. */ #define SCHRO_LIMIT_WIDTH 2048 /** * SCHRO_LIMIT_BLOCK_SIZE * * Maximum block size. Both length and separation must be less than * or equal to this limit. */ #define SCHRO_LIMIT_BLOCK_SIZE 64 SCHRO_END_DECLS #endif schroedinger-1.0.11/schroedinger/schropack.c0000644000175000017500000000721211702517220015763 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include SchroPack * schro_pack_new (void) { SchroPack *pack; pack = schro_malloc0 (sizeof (*pack)); return pack; } void schro_pack_free (SchroPack * pack) { schro_free (pack); } #ifdef unused void schro_pack_copy (SchroPack * dest, SchroPack * src) { memcpy (dest, src, sizeof (SchroPack)); } #endif static void schro_pack_shift_out (SchroPack * pack) { if (pack->n < pack->buffer->length) { pack->buffer->data[pack->n] = pack->value; pack->n++; pack->shift = 7; pack->value = 0; return; } if (pack->error == FALSE) { SCHRO_ERROR ("buffer overrun"); } pack->error = TRUE; pack->shift = 7; pack->value = 0; } void schro_pack_encode_init (SchroPack * pack, SchroBuffer * buffer) { pack->buffer = buffer; pack->n = 0; pack->value = 0; pack->shift = 7; } int schro_pack_get_offset (SchroPack * pack) { return pack->n; } int schro_pack_get_bit_offset (SchroPack * pack) { return pack->n * 8 + (7 - pack->shift); } void schro_pack_flush (SchroPack * pack) { schro_pack_sync (pack); } void schro_pack_sync (SchroPack * pack) { if (pack->shift != 7) { schro_pack_shift_out (pack); } } void schro_pack_append (SchroPack * pack, const uint8_t * data, int len) { if (pack->shift != 7) { SCHRO_ERROR ("appending to unsyncronized pack"); } SCHRO_ASSERT (pack->n + len <= pack->buffer->length); orc_memcpy (pack->buffer->data + pack->n, (void *) data, len); pack->n += len; } void schro_pack_append_zero (SchroPack * pack, int len) { if (pack->shift != 7) { SCHRO_ERROR ("appending to unsyncronized pack"); } SCHRO_ASSERT (pack->n + len <= pack->buffer->length); memset (pack->buffer->data + pack->n, 0, len); pack->n += len; } void schro_pack_encode_bit (SchroPack * pack, int value) { value &= 1; pack->value |= (value << pack->shift); pack->shift--; if (pack->shift < 0) { schro_pack_shift_out (pack); } } void schro_pack_encode_bits (SchroPack * pack, int n, unsigned int value) { int i; for (i = 0; i < n; i++) { schro_pack_encode_bit (pack, (value >> (n - 1 - i)) & 1); } } static int maxbit (unsigned int x) { int i; for (i = 0; x; i++) { x >>= 1; } return i; } void schro_pack_encode_uint (SchroPack * pack, int value) { int i; int n_bits; value++; n_bits = maxbit (value); for (i = 0; i < n_bits - 1; i++) { schro_pack_encode_bit (pack, 0); schro_pack_encode_bit (pack, (value >> (n_bits - 2 - i)) & 1); } schro_pack_encode_bit (pack, 1); } static void __schro_pack_encode_sint (SchroPack * pack, int value) { int sign; if (value < 0) { sign = 1; value = -value; } else { sign = 0; } schro_pack_encode_uint (pack, value); if (value) { schro_pack_encode_bit (pack, sign); } } void schro_pack_encode_sint (SchroPack * pack, int value) { __schro_pack_encode_sint (pack, value); } void schro_pack_encode_sint_s16 (SchroPack * pack, orc_int16 *values, int n) { int i; for(i=0;i #include #include #include #include #include #include #include #include #include #include SCHRO_BEGIN_DECLS typedef struct _SchroDecoder SchroDecoder; typedef struct _SchroDecoderInstance SchroDecoderInstance; typedef struct _SchroPicture SchroPicture; #ifdef SCHRO_ENABLE_UNSTABLE_API #ifndef SCHRO_OPENGL_TYPEDEF #define SCHRO_OPENGL_TYPEDEF typedef struct _SchroOpenGL SchroOpenGL; #endif struct _SchroDecoder { /*< private >*/ SchroMemoryDomain *cpu_domain; SchroMemoryDomain *cuda_domain; SchroMemoryDomain *opengl_domain; SchroAsync *async; int use_cuda; SchroOpenGL *opengl; int use_opengl; double skip_value; double skip_ratio; int earliest_frame; /* output pictures in coded order */ int coded_order; int error; char *error_message; SchroBufferList *input_buflist; SchroParseSyncState *sps; /* private data that is supplied with the input bitstream and * is to be associated with the next picture to occur */ SchroTag *next_picture_tag; SchroDecoderInstance *instance; }; struct _SchroDecoderInstance { /*< private >*/ /* the decoder this sequence instance belongs to */ SchroDecoder *decoder; /* the next sequence instance to supercede this * - New instances should be created whenever an EOS * is detected at the input to the decoder * - Old instances should be deleted whenever their * state would cause an EOS to be emitted */ SchroDecoderInstance *next; /* the list of reference pictures */ SchroQueue *reference_queue; /* a list of frames provided by the app that we'll decode into */ /* xxx: maybe this belongs in Decoder and not per instance */ SchroQueue *output_queue; /* the last picture number to be emitted by decoder_pull(). * used to determine if a stream jumps backwards */ SchroPictureNumber last_picture_number; int last_picture_number_valid; int major_version; int minor_version; int profile; int level; SchroVideoFormat video_format; int compat_quant_offset; SchroQueue *reorder_queue; int reorder_queue_size; int end_of_stream; int flushing; int first_sequence_header; int have_sequence_header; SchroBuffer *sequence_header_buffer; int have_frame_number; int has_md5; uint8_t md5_checksum[32]; int bit_depth; }; struct _SchroPicture { int refcount; SchroDecoderInstance *decoder_instance; int busy; int skip; int error; SchroBuffer *input_buffer; SchroParams params; SchroPictureNumber picture_number; SchroPictureNumber reference1; SchroPictureNumber reference2; SchroPictureNumber retired_picture_number; SchroPicture *ref0; SchroPicture *ref1; SchroFrame *planar_output_frame; SchroFrame *ref_output_frame; SchroAsyncStage stages[9]; int is_ref; int zero_residual; SchroFrame *transform_frame; SchroFrame *frame; SchroFrame *mc_tmp_frame; SchroMotion *motion; SchroFrame *output_picture; SchroUpsampledFrame *upsampled_frame; int subband_length[3][SCHRO_LIMIT_SUBBANDS]; int subband_quant_index[3][SCHRO_LIMIT_SUBBANDS]; SchroBuffer *subband_buffer[3][SCHRO_LIMIT_SUBBANDS]; SchroFrameData subband_data[3][SCHRO_LIMIT_SUBBANDS]; SchroBuffer *motion_buffers[9]; SchroBuffer *lowdelay_buffer; int has_md5; uint8_t md5_checksum[32]; /* private data that is associated with this picture */ SchroTag *tag; }; #endif enum { SCHRO_DECODER_OK, SCHRO_DECODER_ERROR, SCHRO_DECODER_EOS, SCHRO_DECODER_FIRST_ACCESS_UNIT, SCHRO_DECODER_NEED_BITS, SCHRO_DECODER_NEED_FRAME, SCHRO_DECODER_WAIT, SCHRO_DECODER_STALLED }; enum { SCHRO_DECODER_PICTURE_ORDER_PRESENTATION = 0, SCHRO_DECODER_PICTURE_ORDER_CODED }; SchroDecoder * schro_decoder_new (void); void schro_decoder_free (SchroDecoder *decoder); void schro_decoder_reset (SchroDecoder *decoder); SchroVideoFormat * schro_decoder_get_video_format (SchroDecoder *decoder); void schro_decoder_add_output_picture (SchroDecoder *decoder, SchroFrame *frame); int schro_decoder_push_ready (SchroDecoder *decoder); int schro_decoder_push (SchroDecoder *decoder, SchroBuffer *buffer); #ifndef SCHRO_DISABLE_DEPRECATED int schro_decoder_set_flushing (SchroDecoder *decoder, int flushing) SCHRO_DEPRECATED; #endif void schro_decoder_set_picture_order (SchroDecoder *decoder, int picture_order); int schro_decoder_push_end_of_stream (SchroDecoder *decoder); SchroFrame *schro_decoder_pull (SchroDecoder *decoder); int schro_decoder_wait (SchroDecoder *decoder); void schro_decoder_set_earliest_frame (SchroDecoder *decoder, SchroPictureNumber earliest_frame); void schro_decoder_set_skip_ratio (SchroDecoder *decoder, double ratio); SchroPictureNumber schro_decoder_get_picture_number (SchroDecoder *decoder); int schro_decoder_need_output_frame (SchroDecoder *decoder); int schro_decoder_autoparse_wait (SchroDecoder *decoder); int schro_decoder_autoparse_push (SchroDecoder *decoder, SchroBuffer *buffer); int schro_decoder_autoparse_push_end_of_sequence (SchroDecoder *decoder); SchroTag* schro_decoder_get_picture_tag (SchroDecoder *decoder); #ifdef SCHRO_ENABLE_UNSTABLE_API int schro_decoder_begin_sequence (SchroDecoder *decoder); int schro_decoder_end_sequence (SchroDecoder *decoder); int schro_decoder_decode_parse_header (SchroUnpack *unpack); void schro_decoder_parse_sequence_header (SchroDecoderInstance *instance, SchroUnpack *unpack); int schro_decoder_compare_sequence_header_buffer (SchroBuffer *a, SchroBuffer *b); void schro_decoder_subband_dc_predict (SchroFrameData *fd); void schro_decoder_subband_dc_predict_s32 (SchroFrameData *fd); /* SchroPicture */ SchroPicture * schro_picture_new (SchroDecoderInstance *instance); SchroPicture * schro_picture_ref (SchroPicture *picture); void schro_picture_unref (SchroPicture *picture); int schro_decoder_iterate_picture (SchroDecoderInstance *instance, SchroBuffer *buffer, SchroUnpack *unpack, int parse_code); void schro_decoder_parse_picture (SchroPicture *picture, SchroUnpack *unpack); void schro_decoder_parse_picture_header (SchroPicture *picture, SchroUnpack *unpack); void schro_decoder_parse_picture_prediction_parameters (SchroPicture *picture, SchroUnpack *unpack); void schro_decoder_parse_block_data (SchroPicture *picture, SchroUnpack *unpack); void schro_decoder_parse_transform_parameters (SchroPicture *picture, SchroUnpack *unpack); void schro_decoder_parse_transform_data (SchroPicture *picture, SchroUnpack *unpack); void schro_decoder_parse_lowdelay_transform_data (SchroPicture *picture, SchroUnpack *unpack); void schro_decoder_init_subband_frame_data_interleaved (SchroPicture *picture); void schro_decoder_init_subband_frame_data (SchroPicture *picture); void schro_decoder_decode_block_data (SchroPicture *picture); void schro_decoder_decode_transform_data (SchroPicture *picture); void schro_decoder_decode_lowdelay_transform_data (SchroPicture *picture); void schro_decoder_decode_macroblock(SchroPicture *picture, SchroArith **arith, SchroUnpack *unpack, int i, int j); void schro_decoder_decode_prediction_unit(SchroPicture *picture, SchroArith **arith, SchroUnpack *unpack, SchroMotionVector *motion_vectors, int x, int y); #endif SCHRO_END_DECLS #endif schroedinger-1.0.11/schroedinger/schroorc-dist.c0000664000175000017500000214702411707126525016614 00000000000000 /* autogenerated from schroorc.orc */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifndef _ORC_INTEGER_TYPEDEFS_ #define _ORC_INTEGER_TYPEDEFS_ #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #include typedef int8_t orc_int8; typedef int16_t orc_int16; typedef int32_t orc_int32; typedef int64_t orc_int64; typedef uint8_t orc_uint8; typedef uint16_t orc_uint16; typedef uint32_t orc_uint32; typedef uint64_t orc_uint64; #define ORC_UINT64_C(x) UINT64_C(x) #elif defined(_MSC_VER) typedef signed __int8 orc_int8; typedef signed __int16 orc_int16; typedef signed __int32 orc_int32; typedef signed __int64 orc_int64; typedef unsigned __int8 orc_uint8; typedef unsigned __int16 orc_uint16; typedef unsigned __int32 orc_uint32; typedef unsigned __int64 orc_uint64; #define ORC_UINT64_C(x) (x##Ui64) #define inline __inline #else #include typedef signed char orc_int8; typedef short orc_int16; typedef int orc_int32; typedef unsigned char orc_uint8; typedef unsigned short orc_uint16; typedef unsigned int orc_uint32; #if INT_MAX == LONG_MAX typedef long long orc_int64; typedef unsigned long long orc_uint64; #define ORC_UINT64_C(x) (x##ULL) #else typedef long orc_int64; typedef unsigned long orc_uint64; #define ORC_UINT64_C(x) (x##UL) #endif #endif typedef union { orc_int16 i; orc_int8 x2[2]; } orc_union16; typedef union { orc_int32 i; float f; orc_int16 x2[2]; orc_int8 x4[4]; } orc_union32; typedef union { orc_int64 i; double f; orc_int32 x2[2]; float x2f[2]; orc_int16 x4[4]; } orc_union64; #endif #ifndef ORC_RESTRICT #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define ORC_RESTRICT restrict #elif defined(__GNUC__) && __GNUC__ >= 4 #define ORC_RESTRICT __restrict__ #else #define ORC_RESTRICT #endif #endif #ifndef DISABLE_ORC #include #endif void orc_add2_rshift_add_s16_22_vert (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n); void orc_add2_rshift_add_s32_22_vert (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, int n); void orc_add2_rshift_add_s16_22 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n); void orc_add2_rshift_add_s32_22 (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, int n); void orc_add2_rshift_sub_s16_22_vert (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n); void orc_add2_rshift_sub_s16_22 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n); void orc_add2_rshift_add_s16_11_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, int n); void orc_add2_rshift_add_s16_11 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n); void orc_add2_rshift_sub_s16_11_vert (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n); void orc_add2_rshift_sub_s32_11_vert (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, int n); void orc_add2_rshift_sub_s16_11 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n); void orc_add2_rshift_sub_s32_11 (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, int n); void orc_add_const_rshift_s16_11 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n); void orc_add_const_rshift_s16 (orc_int16 * ORC_RESTRICT d1, int p1, int p2, int n); void orc_add_const_rshift_s32 (orc_int32 * ORC_RESTRICT d1, int p1, int p2, int n); void orc_add_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n); void orc_add_s16_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, const orc_int16 * ORC_RESTRICT s1, int s1_stride, int n, int m); void orc_addc_rshift_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int p1, int n); void orc_lshift1_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n); void orc_lshift2_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n); void orc_lshift_s16_ip (orc_int16 * ORC_RESTRICT d1, int p1, int n); void orc_lshift_s32_ip (orc_int32 * ORC_RESTRICT d1, int p1, int n); void orc_mas2_add_s16_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, int p1, int p2, int p3, int n); void orc_mas2_add_s16_ip (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int p1, int p2, int p3, int n); void orc_mas2_sub_s16_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, int p1, int p2, int p3, int n); void orc_mas2_sub_s16_ip (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int p1, int p2, int p3, int n); void orc_mas4_vert_add_s16_1991 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, const orc_int16 * ORC_RESTRICT s4, int p1, int p2, int n); void orc_mas4_vert_add_s32_1991 (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, const orc_int32 * ORC_RESTRICT s3, const orc_int32 * ORC_RESTRICT s4, int p1, int p2, int n); void orc_mas4_horiz_add_s16_1991_ip (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int p1, int p2, int n); void orc_mas4_vert_sub_s16_1991 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, const orc_int16 * ORC_RESTRICT s4, int p1, int p2, int n); void orc_mas4_horiz_sub_s16_1991_ip (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int p1, int p2, int n); void orc_subtract_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n); void orc_add_s16_u8 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n); void orc_add_s16_u8_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, int n, int m); void orc_convert_s16_u8 (orc_int16 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, int n); void orc_convert_s16_s32 (orc_int16 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, int n); void orc_convert_u8_s16 (orc_uint8 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n); void orc_convert_s32_s16 (orc_int32 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n); void orc_offsetconvert_u8_s16 (orc_uint8 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n); void orc_offsetconvert_u8_s32 (orc_uint8 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, int n); void orc_offsetconvert_s16_u8 (orc_int16 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, int n); void orc_offsetconvert_s32_u8 (orc_int32 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, int n); void orc_offsetconvert_s32_s16 (orc_int32 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n); void orc_subtract_s16_u8 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n); void orc_multiply_and_add_s16_u8 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n); void orc_splat_s16_ns (orc_int16 * ORC_RESTRICT d1, int p1, int n); void orc_splat_s32_ns (orc_int32 * ORC_RESTRICT d1, int p1, int n); void orc_splat_s16_2d_4xn (orc_int16 * ORC_RESTRICT d1, int d1_stride, int p1, int m); void orc_splat_s16_2d_8xn (orc_int16 * ORC_RESTRICT d1, int d1_stride, int p1, int m); void orc_splat_s16_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, int p1, int n, int m); void orc_splat_u8_ns (orc_uint8 * ORC_RESTRICT d1, int p1, int n); void orc_splat_u8_2d (orc_uint8 * ORC_RESTRICT d1, int d1_stride, int p1, int n, int m); void orc_average_u8 (orc_uint8 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n); void orc_rrshift6_add_s16_2d (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_int16 * ORC_RESTRICT s1, int s1_stride, const orc_int16 * ORC_RESTRICT s2, int s2_stride, int n, int m); void orc_rrshift6_add_s32_2d (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_int32 * ORC_RESTRICT s1, int s1_stride, const orc_int16 * ORC_RESTRICT s2, int s2_stride, int n, int m); void orc_rrshift6_sub_s16_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, orc_int16 * ORC_RESTRICT d2, int d2_stride, int n, int m); void orc_rrshift6_s16_ip_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, int n, int m); void orc_rrshift6_s16_ip (orc_int16 * ORC_RESTRICT d1, int n); void orc_unpack_yuyv_y (orc_uint8 * ORC_RESTRICT d1, const orc_uint16 * ORC_RESTRICT s1, int n); void orc_unpack_yuyv_u (orc_uint8 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n); void orc_unpack_yuyv_v (orc_uint8 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n); void orc_packyuyv (orc_uint32 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, const orc_uint8 * ORC_RESTRICT s3, int n); void orc_unpack_uyvy_y (orc_uint8 * ORC_RESTRICT d1, const orc_uint16 * ORC_RESTRICT s1, int n); void orc_unpack_uyvy_u (orc_uint8 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n); void orc_unpack_uyvy_v (orc_uint8 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n); void orc_interleave2_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n); void orc_interleave2_rrshift1_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n); void orc_deinterleave2_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, int n); void orc_deinterleave2_s32 (orc_int32 * ORC_RESTRICT d1, orc_int32 * ORC_RESTRICT d2, const orc_int32 * ORC_RESTRICT s1, int n); void orc_deinterleave2_lshift1_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, int n); void orc_deinterleave2_lshift1_s32 (orc_int32 * ORC_RESTRICT d1, orc_int32 * ORC_RESTRICT d2, const orc_int32 * ORC_RESTRICT s1, int n); void orc_haar_deint_lshift1_split_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, int n); void orc_haar_deint_lshift1_split_s32 (orc_int32 * ORC_RESTRICT d1, orc_int32 * ORC_RESTRICT d2, const orc_int32 * ORC_RESTRICT s1, int n); void orc_haar_deint_split_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, int n); void orc_haar_deint_split_s32 (orc_int32 * ORC_RESTRICT d1, orc_int32 * ORC_RESTRICT d2, const orc_int32 * ORC_RESTRICT s1, int n); void orc_haar_split_s16_lo (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n); void orc_haar_split_s16_hi (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n); void orc_haar_split_s16_op (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n); void orc_haar_split_s32_op (orc_int32 * ORC_RESTRICT d1, orc_int32 * ORC_RESTRICT d2, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, int n); void orc_haar_split_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, int n); void orc_haar_synth_s16_lo (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n); void orc_haar_synth_s16_hi (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n); void orc_haar_synth_s16_op (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n); void orc_haar_synth_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, int n); void orc_haar_synth_rrshift1_int_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n); void orc_haar_synth_int_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n); void orc_haar_sub_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n); void orc_haar_add_half_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n); void orc_haar_add_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n); void orc_haar_sub_half_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n); void orc_sum_u8 (orc_int32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int n); void orc_sum_s16 (orc_int32 * ORC_RESTRICT a1, const orc_int16 * ORC_RESTRICT s1, int n); void orc_sum_square_diff_u8 (orc_int32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n); void orc_dequantise_s16_2d_4xn (orc_int16 * ORC_RESTRICT d1, int d1_stride, const orc_int16 * ORC_RESTRICT s1, int s1_stride, int p1, int p2, int m); void orc_dequantise_s16_2d_8xn (orc_int16 * ORC_RESTRICT d1, int d1_stride, const orc_int16 * ORC_RESTRICT s1, int s1_stride, int p1, int p2, int m); void orc_dequantise_s16_ip_2d_8xn (orc_int16 * ORC_RESTRICT d1, int d1_stride, int p1, int p2, int m); void orc_dequantise_s16_ip_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, int p1, int p2, int n, int m); void orc_dequantise_s16_ip (orc_int16 * ORC_RESTRICT d1, int p1, int p2, int n); void orc_dequantise_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int p1, int p2, int n); void orc_dequantise_var_s16_ip (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n); void orc_quantise1_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int p1, int p2, int p3, int n); void orc_quantise2_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int p1, int p2, int n); void orc_quantdequant1_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, int p1, int p2, int p3, int p4, int p5, int n); void orc_quantdequant3_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, int p1, int p2, int p3, int p4, int p5, int p6, int n); void orc_quantdequant2_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, int p1, int p2, int p3, int p4, int n); void orc_downsample_vert_u8 (orc_uint8 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, const orc_uint8 * ORC_RESTRICT s3, const orc_uint8 * ORC_RESTRICT s4, int n); void orc_downsample_horiz_u8 (orc_uint8 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, int n); void orc_stats_moment_s16 (orc_int32 * ORC_RESTRICT a1, const orc_int16 * ORC_RESTRICT s1, int n); void orc_stats_above_s16 (orc_int32 * ORC_RESTRICT a1, const orc_int16 * ORC_RESTRICT s1, int n); void orc_accw (int * ORC_RESTRICT a1, const orc_int16 * ORC_RESTRICT s1, int n); void orc_avg2_8xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m); void orc_avg2_12xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m); void orc_avg2_16xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m); void orc_avg2_32xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m); void orc_avg2_nxm_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int n, int m); void orc_combine4_8xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int m); void orc_combine4_12xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int m); void orc_combine4_16xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int m); void orc_combine4_24xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int m); void orc_combine4_32xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int m); void orc_combine4_nxm_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int n, int m); void orc_combine2_8xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int p1, int p2, int p3, int p4, int m); void orc_combine2_12xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int p1, int p2, int p3, int p4, int m); void orc_combine2_16xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int p1, int p2, int p3, int p4, int m); void orc_combine2_nxm_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int p1, int p2, int p3, int p4, int n, int m); void orc_sad_nxm_u8 (orc_uint32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int n, int m); void orc_sad_8x8_u8 (orc_uint32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride); void orc_sad_12x12_u8 (orc_uint32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride); void orc_sad_16xn_u8 (orc_uint32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m); void orc_sad_32xn_u8 (orc_uint32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m); void orc_add2_rshift_add_s32_22_op (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, const orc_int32 * ORC_RESTRICT s3, int n); void orc_mas4_vert_add_s32_1991_op (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, const orc_int32 * ORC_RESTRICT s3, const orc_int32 * ORC_RESTRICT s4, const orc_int32 * ORC_RESTRICT s5, int p1, int p2, int n); void orc_add2_rshift_sub_s32_22_op (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, const orc_int32 * ORC_RESTRICT s3, int n); void orc_interleave2_rrshift1_s32 (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, int n); void orc_mas4_vert_sub_s32_1991_op (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, const orc_int32 * ORC_RESTRICT s3, const orc_int32 * ORC_RESTRICT s4, const orc_int32 * ORC_RESTRICT s5, int p1, int p2, int n); void orc_mas4_vert_sub_s32_1991 (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, const orc_int32 * ORC_RESTRICT s3, const orc_int32 * ORC_RESTRICT s4, int p1, int p2, int n); void orc_mas4_horiz_add_s32_1991_ip (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, int p1, int p2, int n); void orc_add2_rshift_add_s32_11_op (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, const orc_int32 * ORC_RESTRICT s3, int n); void orc_mas4_horiz_sub_s32_1991_ip (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, int p1, int p2, int n); void orc_haar_synth_s32_lo (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, int n); void orc_haar_synth_int_s32 (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, int n); void orc_haar_synth_rrshift1_int_s32 (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, int n); void orc_interleave2_s32 (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, int n); void orc_mas2_sub_s32_ip (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, int p1, int p2, int p3, int n); void orc_mas2_add_s32_ip (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, int p1, int p2, int p3, int n); void orc_mas2_add_s32_op (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, const orc_int32 * ORC_RESTRICT s3, int p1, int p2, int p3, int n); void orc_mas2_sub_s32_op (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, const orc_int32 * ORC_RESTRICT s3, int p1, int p2, int p3, int n); void orc_add2_rshift_sub_s32_22 (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, int n); void orc_add2_rshift_add_s32_11 (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, int n); void orc_haar_synth_s32 (orc_int32 * ORC_RESTRICT d1, orc_int32 * ORC_RESTRICT d2, int n); void orc_splat_s32_2d (orc_int32 * ORC_RESTRICT d1, int d1_stride, int p1, int n, int m); void orc_dequantise_s32_ip_2d (orc_int32 * ORC_RESTRICT d1, int d1_stride, int p1, int p2, int n, int m); void schro_orc_init (void); /* begin Orc C target preamble */ #define ORC_CLAMP(x,a,b) ((x)<(a) ? (a) : ((x)>(b) ? (b) : (x))) #define ORC_ABS(a) ((a)<0 ? -(a) : (a)) #define ORC_MIN(a,b) ((a)<(b) ? (a) : (b)) #define ORC_MAX(a,b) ((a)>(b) ? (a) : (b)) #define ORC_SB_MAX 127 #define ORC_SB_MIN (-1-ORC_SB_MAX) #define ORC_UB_MAX 255 #define ORC_UB_MIN 0 #define ORC_SW_MAX 32767 #define ORC_SW_MIN (-1-ORC_SW_MAX) #define ORC_UW_MAX 65535 #define ORC_UW_MIN 0 #define ORC_SL_MAX 2147483647 #define ORC_SL_MIN (-1-ORC_SL_MAX) #define ORC_UL_MAX 4294967295U #define ORC_UL_MIN 0 #define ORC_CLAMP_SB(x) ORC_CLAMP(x,ORC_SB_MIN,ORC_SB_MAX) #define ORC_CLAMP_UB(x) ORC_CLAMP(x,ORC_UB_MIN,ORC_UB_MAX) #define ORC_CLAMP_SW(x) ORC_CLAMP(x,ORC_SW_MIN,ORC_SW_MAX) #define ORC_CLAMP_UW(x) ORC_CLAMP(x,ORC_UW_MIN,ORC_UW_MAX) #define ORC_CLAMP_SL(x) ORC_CLAMP(x,ORC_SL_MIN,ORC_SL_MAX) #define ORC_CLAMP_UL(x) ORC_CLAMP(x,ORC_UL_MIN,ORC_UL_MAX) #define ORC_SWAP_W(x) ((((x)&0xff)<<8) | (((x)&0xff00)>>8)) #define ORC_SWAP_L(x) ((((x)&0xff)<<24) | (((x)&0xff00)<<8) | (((x)&0xff0000)>>8) | (((x)&0xff000000)>>24)) #define ORC_SWAP_Q(x) ((((x)&ORC_UINT64_C(0xff))<<56) | (((x)&ORC_UINT64_C(0xff00))<<40) | (((x)&ORC_UINT64_C(0xff0000))<<24) | (((x)&ORC_UINT64_C(0xff000000))<<8) | (((x)&ORC_UINT64_C(0xff00000000))>>8) | (((x)&ORC_UINT64_C(0xff0000000000))>>24) | (((x)&ORC_UINT64_C(0xff000000000000))>>40) | (((x)&ORC_UINT64_C(0xff00000000000000))>>56)) #define ORC_PTR_OFFSET(ptr,offset) ((void *)(((unsigned char *)(ptr)) + (offset))) #define ORC_DENORMAL(x) ((x) & ((((x)&0x7f800000) == 0) ? 0xff800000 : 0xffffffff)) #define ORC_ISNAN(x) ((((x)&0x7f800000) == 0x7f800000) && (((x)&0x007fffff) != 0)) #define ORC_DENORMAL_DOUBLE(x) ((x) & ((((x)&ORC_UINT64_C(0x7ff0000000000000)) == 0) ? ORC_UINT64_C(0xfff0000000000000) : ORC_UINT64_C(0xffffffffffffffff))) #define ORC_ISNAN_DOUBLE(x) ((((x)&ORC_UINT64_C(0x7ff0000000000000)) == ORC_UINT64_C(0x7ff0000000000000)) && (((x)&ORC_UINT64_C(0x000fffffffffffff)) != 0)) #ifndef ORC_RESTRICT #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define ORC_RESTRICT restrict #elif defined(__GNUC__) && __GNUC__ >= 4 #define ORC_RESTRICT __restrict__ #else #define ORC_RESTRICT #endif #endif /* end Orc C target preamble */ /* orc_add2_rshift_add_s16_22_vert */ #ifdef DISABLE_ORC void orc_add2_rshift_add_s16_22_vert (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; /* 3: loadpw */ var35.i = (int)0x00000002; /* 2 or 9.88131e-324f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 1: loadw */ var34 = ptr5[i]; /* 2: addw */ var38.i = var33.i + var34.i; /* 4: addw */ var39.i = var38.i + var35.i; /* 5: shrsw */ var40.i = var39.i >> 2; /* 6: loadw */ var36 = ptr0[i]; /* 7: addw */ var37.i = var36.i + var40.i; /* 8: storew */ ptr0[i] = var37; } } #else static void _backup_orc_add2_rshift_add_s16_22_vert (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; /* 3: loadpw */ var35.i = (int)0x00000002; /* 2 or 9.88131e-324f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 1: loadw */ var34 = ptr5[i]; /* 2: addw */ var38.i = var33.i + var34.i; /* 4: addw */ var39.i = var38.i + var35.i; /* 5: shrsw */ var40.i = var39.i >> 2; /* 6: loadw */ var36 = ptr0[i]; /* 7: addw */ var37.i = var36.i + var40.i; /* 8: storew */ ptr0[i] = var37; } } OrcCode *_orc_code_orc_add2_rshift_add_s16_22_vert; void orc_add2_rshift_add_s16_22_vert (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add2_rshift_add_s16_22_vert; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_add2_rshift_add_s32_22_vert */ #ifdef DISABLE_ORC void orc_add2_rshift_add_s32_22_vert (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var33; orc_union32 var34; orc_union32 var35; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; ptr0 = (orc_union32 *)d1; ptr4 = (orc_union32 *)s1; ptr5 = (orc_union32 *)s2; /* 3: loadpl */ var35.i = (int)0x00000002; /* 2 or 9.88131e-324f */ for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr4[i]; /* 1: loadl */ var34 = ptr5[i]; /* 2: addl */ var38.i = var33.i + var34.i; /* 4: addl */ var39.i = var38.i + var35.i; /* 5: shrsl */ var40.i = var39.i >> 2; /* 6: loadl */ var36 = ptr0[i]; /* 7: addl */ var37.i = var36.i + var40.i; /* 8: storel */ ptr0[i] = var37; } } #else static void _backup_orc_add2_rshift_add_s32_22_vert (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var33; orc_union32 var34; orc_union32 var35; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; ptr5 = (orc_union32 *)ex->arrays[5]; /* 3: loadpl */ var35.i = (int)0x00000002; /* 2 or 9.88131e-324f */ for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr4[i]; /* 1: loadl */ var34 = ptr5[i]; /* 2: addl */ var38.i = var33.i + var34.i; /* 4: addl */ var39.i = var38.i + var35.i; /* 5: shrsl */ var40.i = var39.i >> 2; /* 6: loadl */ var36 = ptr0[i]; /* 7: addl */ var37.i = var36.i + var40.i; /* 8: storel */ ptr0[i] = var37; } } OrcCode *_orc_code_orc_add2_rshift_add_s32_22_vert; void orc_add2_rshift_add_s32_22_vert (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add2_rshift_add_s32_22_vert; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_add2_rshift_add_s16_22 */ #ifdef DISABLE_ORC void orc_add2_rshift_add_s16_22 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; /* 3: loadpw */ var34.i = (int)0x00000002; /* 2 or 9.88131e-324f */ for (i = 0; i < n; i++) { /* 0: loadoffw */ var37 = ptr4[i + 1]; /* 1: loadw */ var33 = ptr4[i]; /* 2: addw */ var38.i = var33.i + var37.i; /* 4: addw */ var39.i = var38.i + var34.i; /* 5: shrsw */ var40.i = var39.i >> 2; /* 6: loadw */ var35 = ptr0[i]; /* 7: addw */ var36.i = var35.i + var40.i; /* 8: storew */ ptr0[i] = var36; } } #else static void _backup_orc_add2_rshift_add_s16_22 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; /* 3: loadpw */ var34.i = (int)0x00000002; /* 2 or 9.88131e-324f */ for (i = 0; i < n; i++) { /* 0: loadoffw */ var37 = ptr4[i + 1]; /* 1: loadw */ var33 = ptr4[i]; /* 2: addw */ var38.i = var33.i + var37.i; /* 4: addw */ var39.i = var38.i + var34.i; /* 5: shrsw */ var40.i = var39.i >> 2; /* 6: loadw */ var35 = ptr0[i]; /* 7: addw */ var36.i = var35.i + var40.i; /* 8: storew */ ptr0[i] = var36; } } OrcCode *_orc_code_orc_add2_rshift_add_s16_22; void orc_add2_rshift_add_s16_22 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add2_rshift_add_s16_22; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_add2_rshift_add_s32_22 */ #ifdef DISABLE_ORC void orc_add2_rshift_add_s32_22 (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var33; orc_union32 var34; orc_union32 var35; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; ptr0 = (orc_union32 *)d1; ptr4 = (orc_union32 *)s1; /* 3: loadpl */ var34.i = (int)0x00000002; /* 2 or 9.88131e-324f */ for (i = 0; i < n; i++) { /* 0: loadoffl */ var37 = ptr4[i + 1]; /* 1: loadl */ var33 = ptr4[i]; /* 2: addl */ var38.i = var33.i + var37.i; /* 4: addl */ var39.i = var38.i + var34.i; /* 5: shrsl */ var40.i = var39.i >> 2; /* 6: loadl */ var35 = ptr0[i]; /* 7: addl */ var36.i = var35.i + var40.i; /* 8: storel */ ptr0[i] = var36; } } #else static void _backup_orc_add2_rshift_add_s32_22 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var33; orc_union32 var34; orc_union32 var35; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; /* 3: loadpl */ var34.i = (int)0x00000002; /* 2 or 9.88131e-324f */ for (i = 0; i < n; i++) { /* 0: loadoffl */ var37 = ptr4[i + 1]; /* 1: loadl */ var33 = ptr4[i]; /* 2: addl */ var38.i = var33.i + var37.i; /* 4: addl */ var39.i = var38.i + var34.i; /* 5: shrsl */ var40.i = var39.i >> 2; /* 6: loadl */ var35 = ptr0[i]; /* 7: addl */ var36.i = var35.i + var40.i; /* 8: storel */ ptr0[i] = var36; } } OrcCode *_orc_code_orc_add2_rshift_add_s32_22; void orc_add2_rshift_add_s32_22 (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add2_rshift_add_s32_22; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_add2_rshift_sub_s16_22_vert */ #ifdef DISABLE_ORC void orc_add2_rshift_sub_s16_22_vert (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; /* 3: loadpw */ var35.i = (int)0x00000002; /* 2 or 9.88131e-324f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 1: loadw */ var34 = ptr5[i]; /* 2: addw */ var38.i = var33.i + var34.i; /* 4: addw */ var39.i = var38.i + var35.i; /* 5: shrsw */ var40.i = var39.i >> 2; /* 6: loadw */ var36 = ptr0[i]; /* 7: subw */ var37.i = var36.i - var40.i; /* 8: storew */ ptr0[i] = var37; } } #else static void _backup_orc_add2_rshift_sub_s16_22_vert (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; /* 3: loadpw */ var35.i = (int)0x00000002; /* 2 or 9.88131e-324f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 1: loadw */ var34 = ptr5[i]; /* 2: addw */ var38.i = var33.i + var34.i; /* 4: addw */ var39.i = var38.i + var35.i; /* 5: shrsw */ var40.i = var39.i >> 2; /* 6: loadw */ var36 = ptr0[i]; /* 7: subw */ var37.i = var36.i - var40.i; /* 8: storew */ ptr0[i] = var37; } } OrcCode *_orc_code_orc_add2_rshift_sub_s16_22_vert; void orc_add2_rshift_sub_s16_22_vert (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add2_rshift_sub_s16_22_vert; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_add2_rshift_sub_s16_22 */ #ifdef DISABLE_ORC void orc_add2_rshift_sub_s16_22 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; /* 3: loadpw */ var34.i = (int)0x00000002; /* 2 or 9.88131e-324f */ for (i = 0; i < n; i++) { /* 0: loadoffw */ var37 = ptr4[i + 1]; /* 1: loadw */ var33 = ptr4[i]; /* 2: addw */ var38.i = var33.i + var37.i; /* 4: addw */ var39.i = var38.i + var34.i; /* 5: shrsw */ var40.i = var39.i >> 2; /* 6: loadw */ var35 = ptr0[i]; /* 7: subw */ var36.i = var35.i - var40.i; /* 8: storew */ ptr0[i] = var36; } } #else static void _backup_orc_add2_rshift_sub_s16_22 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; /* 3: loadpw */ var34.i = (int)0x00000002; /* 2 or 9.88131e-324f */ for (i = 0; i < n; i++) { /* 0: loadoffw */ var37 = ptr4[i + 1]; /* 1: loadw */ var33 = ptr4[i]; /* 2: addw */ var38.i = var33.i + var37.i; /* 4: addw */ var39.i = var38.i + var34.i; /* 5: shrsw */ var40.i = var39.i >> 2; /* 6: loadw */ var35 = ptr0[i]; /* 7: subw */ var36.i = var35.i - var40.i; /* 8: storew */ ptr0[i] = var36; } } OrcCode *_orc_code_orc_add2_rshift_sub_s16_22; void orc_add2_rshift_sub_s16_22 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add2_rshift_sub_s16_22; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_add2_rshift_add_s16_11_op */ #ifdef DISABLE_ORC void orc_add2_rshift_add_s16_11_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; ptr6 = (orc_union16 *)s3; for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr5[i]; /* 1: loadw */ var34 = ptr6[i]; /* 2: avgsw */ var37.i = (var33.i + var34.i + 1)>>1; /* 3: loadw */ var35 = ptr4[i]; /* 4: addw */ var36.i = var35.i + var37.i; /* 5: storew */ ptr0[i] = var36; } } #else static void _backup_orc_add2_rshift_add_s16_11_op (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; ptr6 = (orc_union16 *)ex->arrays[6]; for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr5[i]; /* 1: loadw */ var34 = ptr6[i]; /* 2: avgsw */ var37.i = (var33.i + var34.i + 1)>>1; /* 3: loadw */ var35 = ptr4[i]; /* 4: addw */ var36.i = var35.i + var37.i; /* 5: storew */ ptr0[i] = var36; } } OrcCode *_orc_code_orc_add2_rshift_add_s16_11_op; void orc_add2_rshift_add_s16_11_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add2_rshift_add_s16_11_op; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; func = c->exec; func (ex); } #endif /* orc_add2_rshift_add_s16_11 */ #ifdef DISABLE_ORC void orc_add2_rshift_add_s16_11 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; for (i = 0; i < n; i++) { /* 0: loadoffw */ var36 = ptr4[i + 1]; /* 1: loadw */ var33 = ptr4[i]; /* 2: avgsw */ var37.i = (var33.i + var36.i + 1)>>1; /* 3: loadw */ var34 = ptr0[i]; /* 4: addw */ var35.i = var34.i + var37.i; /* 5: storew */ ptr0[i] = var35; } } #else static void _backup_orc_add2_rshift_add_s16_11 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadoffw */ var36 = ptr4[i + 1]; /* 1: loadw */ var33 = ptr4[i]; /* 2: avgsw */ var37.i = (var33.i + var36.i + 1)>>1; /* 3: loadw */ var34 = ptr0[i]; /* 4: addw */ var35.i = var34.i + var37.i; /* 5: storew */ ptr0[i] = var35; } } OrcCode *_orc_code_orc_add2_rshift_add_s16_11; void orc_add2_rshift_add_s16_11 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add2_rshift_add_s16_11; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_add2_rshift_sub_s16_11_vert */ #ifdef DISABLE_ORC void orc_add2_rshift_sub_s16_11_vert (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 1: loadw */ var34 = ptr5[i]; /* 2: avgsw */ var37.i = (var33.i + var34.i + 1)>>1; /* 3: loadw */ var35 = ptr0[i]; /* 4: subw */ var36.i = var35.i - var37.i; /* 5: storew */ ptr0[i] = var36; } } #else static void _backup_orc_add2_rshift_sub_s16_11_vert (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 1: loadw */ var34 = ptr5[i]; /* 2: avgsw */ var37.i = (var33.i + var34.i + 1)>>1; /* 3: loadw */ var35 = ptr0[i]; /* 4: subw */ var36.i = var35.i - var37.i; /* 5: storew */ ptr0[i] = var36; } } OrcCode *_orc_code_orc_add2_rshift_sub_s16_11_vert; void orc_add2_rshift_sub_s16_11_vert (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add2_rshift_sub_s16_11_vert; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_add2_rshift_sub_s32_11_vert */ #ifdef DISABLE_ORC void orc_add2_rshift_sub_s32_11_vert (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var33; orc_union32 var34; orc_union32 var35; orc_union32 var36; orc_union32 var37; ptr0 = (orc_union32 *)d1; ptr4 = (orc_union32 *)s1; ptr5 = (orc_union32 *)s2; for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr4[i]; /* 1: loadl */ var34 = ptr5[i]; /* 2: avgsl */ var37.i = ((orc_int64)var33.i + (orc_int64)var34.i + 1)>>1; /* 3: loadl */ var35 = ptr0[i]; /* 4: subl */ var36.i = var35.i - var37.i; /* 5: storel */ ptr0[i] = var36; } } #else static void _backup_orc_add2_rshift_sub_s32_11_vert (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var33; orc_union32 var34; orc_union32 var35; orc_union32 var36; orc_union32 var37; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; ptr5 = (orc_union32 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr4[i]; /* 1: loadl */ var34 = ptr5[i]; /* 2: avgsl */ var37.i = ((orc_int64)var33.i + (orc_int64)var34.i + 1)>>1; /* 3: loadl */ var35 = ptr0[i]; /* 4: subl */ var36.i = var35.i - var37.i; /* 5: storel */ ptr0[i] = var36; } } OrcCode *_orc_code_orc_add2_rshift_sub_s32_11_vert; void orc_add2_rshift_sub_s32_11_vert (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add2_rshift_sub_s32_11_vert; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_add2_rshift_sub_s16_11 */ #ifdef DISABLE_ORC void orc_add2_rshift_sub_s16_11 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; for (i = 0; i < n; i++) { /* 0: loadoffw */ var36 = ptr4[i + 1]; /* 1: loadw */ var33 = ptr4[i]; /* 2: avgsw */ var37.i = (var33.i + var36.i + 1)>>1; /* 3: loadw */ var34 = ptr0[i]; /* 4: subw */ var35.i = var34.i - var37.i; /* 5: storew */ ptr0[i] = var35; } } #else static void _backup_orc_add2_rshift_sub_s16_11 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadoffw */ var36 = ptr4[i + 1]; /* 1: loadw */ var33 = ptr4[i]; /* 2: avgsw */ var37.i = (var33.i + var36.i + 1)>>1; /* 3: loadw */ var34 = ptr0[i]; /* 4: subw */ var35.i = var34.i - var37.i; /* 5: storew */ ptr0[i] = var35; } } OrcCode *_orc_code_orc_add2_rshift_sub_s16_11; void orc_add2_rshift_sub_s16_11 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add2_rshift_sub_s16_11; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_add2_rshift_sub_s32_11 */ #ifdef DISABLE_ORC void orc_add2_rshift_sub_s32_11 (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var33; orc_union32 var34; orc_union32 var35; orc_union32 var36; orc_union32 var37; ptr0 = (orc_union32 *)d1; ptr4 = (orc_union32 *)s1; for (i = 0; i < n; i++) { /* 0: loadoffl */ var36 = ptr4[i + 1]; /* 1: loadl */ var33 = ptr4[i]; /* 2: avgsl */ var37.i = ((orc_int64)var33.i + (orc_int64)var36.i + 1)>>1; /* 3: loadl */ var34 = ptr0[i]; /* 4: subl */ var35.i = var34.i - var37.i; /* 5: storel */ ptr0[i] = var35; } } #else static void _backup_orc_add2_rshift_sub_s32_11 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var33; orc_union32 var34; orc_union32 var35; orc_union32 var36; orc_union32 var37; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadoffl */ var36 = ptr4[i + 1]; /* 1: loadl */ var33 = ptr4[i]; /* 2: avgsl */ var37.i = ((orc_int64)var33.i + (orc_int64)var36.i + 1)>>1; /* 3: loadl */ var34 = ptr0[i]; /* 4: subl */ var35.i = var34.i - var37.i; /* 5: storel */ ptr0[i] = var35; } } OrcCode *_orc_code_orc_add2_rshift_sub_s32_11; void orc_add2_rshift_sub_s32_11 (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add2_rshift_sub_s32_11; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_add_const_rshift_s16_11 */ #ifdef DISABLE_ORC void orc_add_const_rshift_s16_11 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; /* 1: loadpw */ var34.i = (int)0x00000001; /* 1 or 4.94066e-324f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 2: addw */ var36.i = var33.i + var34.i; /* 3: shrsw */ var35.i = var36.i >> 1; /* 4: storew */ ptr0[i] = var35; } } #else static void _backup_orc_add_const_rshift_s16_11 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; /* 1: loadpw */ var34.i = (int)0x00000001; /* 1 or 4.94066e-324f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 2: addw */ var36.i = var33.i + var34.i; /* 3: shrsw */ var35.i = var36.i >> 1; /* 4: storew */ ptr0[i] = var35; } } OrcCode *_orc_code_orc_add_const_rshift_s16_11; void orc_add_const_rshift_s16_11 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add_const_rshift_s16_11; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_add_const_rshift_s16 */ #ifdef DISABLE_ORC void orc_add_const_rshift_s16 (orc_int16 * ORC_RESTRICT d1, int p1, int p2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; ptr0 = (orc_union16 *)d1; /* 1: loadpw */ var34.i = p1; for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr0[i]; /* 2: addw */ var36.i = var33.i + var34.i; /* 3: shrsw */ var35.i = var36.i >> p2; /* 4: storew */ ptr0[i] = var35; } } #else static void _backup_orc_add_const_rshift_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; ptr0 = (orc_union16 *)ex->arrays[0]; /* 1: loadpw */ var34.i = ex->params[24]; for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr0[i]; /* 2: addw */ var36.i = var33.i + var34.i; /* 3: shrsw */ var35.i = var36.i >> ex->params[25]; /* 4: storew */ ptr0[i] = var35; } } OrcCode *_orc_code_orc_add_const_rshift_s16; void orc_add_const_rshift_s16 (orc_int16 * ORC_RESTRICT d1, int p1, int p2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add_const_rshift_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } #endif /* orc_add_const_rshift_s32 */ #ifdef DISABLE_ORC void orc_add_const_rshift_s32 (orc_int32 * ORC_RESTRICT d1, int p1, int p2, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; orc_union32 var33; orc_union32 var34; orc_union32 var35; orc_union32 var36; ptr0 = (orc_union32 *)d1; /* 1: loadpl */ var34.i = p1; for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr0[i]; /* 2: addl */ var36.i = var33.i + var34.i; /* 3: shrsl */ var35.i = var36.i >> p2; /* 4: storel */ ptr0[i] = var35; } } #else static void _backup_orc_add_const_rshift_s32 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; orc_union32 var33; orc_union32 var34; orc_union32 var35; orc_union32 var36; ptr0 = (orc_union32 *)ex->arrays[0]; /* 1: loadpl */ var34.i = ex->params[24]; for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr0[i]; /* 2: addl */ var36.i = var33.i + var34.i; /* 3: shrsl */ var35.i = var36.i >> ex->params[25]; /* 4: storel */ ptr0[i] = var35; } } OrcCode *_orc_code_orc_add_const_rshift_s32; void orc_add_const_rshift_s32 (orc_int32 * ORC_RESTRICT d1, int p1, int p2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add_const_rshift_s32; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } #endif /* orc_add_s16 */ #ifdef DISABLE_ORC void orc_add_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: loadw */ var33 = ptr5[i]; /* 2: addw */ var34.i = var32.i + var33.i; /* 3: storew */ ptr0[i] = var34; } } #else static void _backup_orc_add_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: loadw */ var33 = ptr5[i]; /* 2: addw */ var34.i = var32.i + var33.i; /* 3: storew */ ptr0[i] = var34; } } OrcCode *_orc_code_orc_add_s16; void orc_add_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_add_s16_2d */ #ifdef DISABLE_ORC void orc_add_s16_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, const orc_int16 * ORC_RESTRICT s1, int s1_stride, int n, int m){ int i; int j; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_union16 var33; orc_union16 var34; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr0[i]; /* 1: loadw */ var33 = ptr4[i]; /* 2: addw */ var34.i = var32.i + var33.i; /* 3: storew */ ptr0[i] = var34; } } } #else static void _backup_orc_add_s16_2d (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_union16 var33; orc_union16 var34; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr0[i]; /* 1: loadw */ var33 = ptr4[i]; /* 2: addw */ var34.i = var32.i + var33.i; /* 3: storew */ ptr0[i] = var34; } } } OrcCode *_orc_code_orc_add_s16_2d; void orc_add_s16_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, const orc_int16 * ORC_RESTRICT s1, int s1_stride, int n, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add_s16_2d; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; func = c->exec; func (ex); } #endif /* orc_addc_rshift_s16 */ #ifdef DISABLE_ORC void orc_addc_rshift_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int p1, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 1: loadw */ var34 = ptr5[i]; /* 2: addw */ var36.i = var33.i + var34.i; /* 3: shrsw */ var35.i = var36.i >> p1; /* 4: storew */ ptr0[i] = var35; } } #else static void _backup_orc_addc_rshift_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 1: loadw */ var34 = ptr5[i]; /* 2: addw */ var36.i = var33.i + var34.i; /* 3: shrsw */ var35.i = var36.i >> ex->params[24]; /* 4: storew */ ptr0[i] = var35; } } OrcCode *_orc_code_orc_addc_rshift_s16; void orc_addc_rshift_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int p1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_addc_rshift_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_P1] = p1; func = c->exec; func (ex); } #endif /* orc_lshift1_s16 */ #ifdef DISABLE_ORC void orc_lshift1_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_union16 var33; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: shlw */ var33.i = var32.i << 1; /* 2: storew */ ptr0[i] = var33; } } #else static void _backup_orc_lshift1_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_union16 var33; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: shlw */ var33.i = var32.i << 1; /* 2: storew */ ptr0[i] = var33; } } OrcCode *_orc_code_orc_lshift1_s16; void orc_lshift1_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_lshift1_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_lshift2_s16 */ #ifdef DISABLE_ORC void orc_lshift2_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_union16 var33; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: shlw */ var33.i = var32.i << 2; /* 2: storew */ ptr0[i] = var33; } } #else static void _backup_orc_lshift2_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_union16 var33; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: shlw */ var33.i = var32.i << 2; /* 2: storew */ ptr0[i] = var33; } } OrcCode *_orc_code_orc_lshift2_s16; void orc_lshift2_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_lshift2_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_lshift_s16_ip */ #ifdef DISABLE_ORC void orc_lshift_s16_ip (orc_int16 * ORC_RESTRICT d1, int p1, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var32; orc_union16 var33; ptr0 = (orc_union16 *)d1; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr0[i]; /* 1: shlw */ var33.i = var32.i << p1; /* 2: storew */ ptr0[i] = var33; } } #else static void _backup_orc_lshift_s16_ip (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var32; orc_union16 var33; ptr0 = (orc_union16 *)ex->arrays[0]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr0[i]; /* 1: shlw */ var33.i = var32.i << ex->params[24]; /* 2: storew */ ptr0[i] = var33; } } OrcCode *_orc_code_orc_lshift_s16_ip; void orc_lshift_s16_ip (orc_int16 * ORC_RESTRICT d1, int p1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_lshift_s16_ip; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_P1] = p1; func = c->exec; func (ex); } #endif /* orc_lshift_s32_ip */ #ifdef DISABLE_ORC void orc_lshift_s32_ip (orc_int32 * ORC_RESTRICT d1, int p1, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; orc_union32 var32; orc_union32 var33; ptr0 = (orc_union32 *)d1; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr0[i]; /* 1: shll */ var33.i = var32.i << p1; /* 2: storel */ ptr0[i] = var33; } } #else static void _backup_orc_lshift_s32_ip (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; orc_union32 var32; orc_union32 var33; ptr0 = (orc_union32 *)ex->arrays[0]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr0[i]; /* 1: shll */ var33.i = var32.i << ex->params[24]; /* 2: storel */ ptr0[i] = var33; } } OrcCode *_orc_code_orc_lshift_s32_ip; void orc_lshift_s32_ip (orc_int32 * ORC_RESTRICT d1, int p1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_lshift_s32_ip; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_P1] = p1; func = c->exec; func (ex); } #endif /* orc_mas2_add_s16_op */ #ifdef DISABLE_ORC void orc_mas2_add_s16_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, int p1, int p2, int p3, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union32 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; orc_union16 var44; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; ptr6 = (orc_union16 *)s3; /* 3: loadpw */ var36.i = p1; /* 5: loadpl */ var37.i = p2; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr5[i]; /* 1: loadw */ var35 = ptr6[i]; /* 2: addw */ var40.i = var34.i + var35.i; /* 4: mulswl */ var41.i = var40.i * var36.i; /* 6: addl */ var42.i = var41.i + var37.i; /* 7: shrsl */ var43.i = var42.i >> p3; /* 8: convlw */ var44.i = var43.i; /* 9: loadw */ var38 = ptr4[i]; /* 10: addw */ var39.i = var38.i + var44.i; /* 11: storew */ ptr0[i] = var39; } } #else static void _backup_orc_mas2_add_s16_op (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union32 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; orc_union16 var44; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; ptr6 = (orc_union16 *)ex->arrays[6]; /* 3: loadpw */ var36.i = ex->params[24]; /* 5: loadpl */ var37.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr5[i]; /* 1: loadw */ var35 = ptr6[i]; /* 2: addw */ var40.i = var34.i + var35.i; /* 4: mulswl */ var41.i = var40.i * var36.i; /* 6: addl */ var42.i = var41.i + var37.i; /* 7: shrsl */ var43.i = var42.i >> ex->params[26]; /* 8: convlw */ var44.i = var43.i; /* 9: loadw */ var38 = ptr4[i]; /* 10: addw */ var39.i = var38.i + var44.i; /* 11: storew */ ptr0[i] = var39; } } OrcCode *_orc_code_orc_mas2_add_s16_op; void orc_mas2_add_s16_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, int p1, int p2, int p3, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_mas2_add_s16_op; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; func = c->exec; func (ex); } #endif /* orc_mas2_add_s16_ip */ #ifdef DISABLE_ORC void orc_mas2_add_s16_ip (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int p1, int p2, int p3, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var34; orc_union16 var35; orc_union32 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; orc_union16 var44; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; /* 3: loadpw */ var35.i = p1; /* 5: loadpl */ var36.i = p2; for (i = 0; i < n; i++) { /* 0: loadoffw */ var39 = ptr4[i + 1]; /* 1: loadw */ var34 = ptr4[i]; /* 2: addw */ var40.i = var34.i + var39.i; /* 4: mulswl */ var41.i = var40.i * var35.i; /* 6: addl */ var42.i = var41.i + var36.i; /* 7: shrsl */ var43.i = var42.i >> p3; /* 8: convlw */ var44.i = var43.i; /* 9: loadw */ var37 = ptr0[i]; /* 10: addw */ var38.i = var37.i + var44.i; /* 11: storew */ ptr0[i] = var38; } } #else static void _backup_orc_mas2_add_s16_ip (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var34; orc_union16 var35; orc_union32 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; orc_union16 var44; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; /* 3: loadpw */ var35.i = ex->params[24]; /* 5: loadpl */ var36.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadoffw */ var39 = ptr4[i + 1]; /* 1: loadw */ var34 = ptr4[i]; /* 2: addw */ var40.i = var34.i + var39.i; /* 4: mulswl */ var41.i = var40.i * var35.i; /* 6: addl */ var42.i = var41.i + var36.i; /* 7: shrsl */ var43.i = var42.i >> ex->params[26]; /* 8: convlw */ var44.i = var43.i; /* 9: loadw */ var37 = ptr0[i]; /* 10: addw */ var38.i = var37.i + var44.i; /* 11: storew */ ptr0[i] = var38; } } OrcCode *_orc_code_orc_mas2_add_s16_ip; void orc_mas2_add_s16_ip (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int p1, int p2, int p3, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_mas2_add_s16_ip; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; func = c->exec; func (ex); } #endif /* orc_mas2_sub_s16_op */ #ifdef DISABLE_ORC void orc_mas2_sub_s16_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, int p1, int p2, int p3, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union32 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; orc_union16 var44; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; ptr6 = (orc_union16 *)s3; /* 3: loadpw */ var36.i = p1; /* 5: loadpl */ var37.i = p2; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr5[i]; /* 1: loadw */ var35 = ptr6[i]; /* 2: addw */ var40.i = var34.i + var35.i; /* 4: mulswl */ var41.i = var40.i * var36.i; /* 6: addl */ var42.i = var41.i + var37.i; /* 7: shrsl */ var43.i = var42.i >> p3; /* 8: convlw */ var44.i = var43.i; /* 9: loadw */ var38 = ptr4[i]; /* 10: subw */ var39.i = var38.i - var44.i; /* 11: storew */ ptr0[i] = var39; } } #else static void _backup_orc_mas2_sub_s16_op (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union32 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; orc_union16 var44; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; ptr6 = (orc_union16 *)ex->arrays[6]; /* 3: loadpw */ var36.i = ex->params[24]; /* 5: loadpl */ var37.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr5[i]; /* 1: loadw */ var35 = ptr6[i]; /* 2: addw */ var40.i = var34.i + var35.i; /* 4: mulswl */ var41.i = var40.i * var36.i; /* 6: addl */ var42.i = var41.i + var37.i; /* 7: shrsl */ var43.i = var42.i >> ex->params[26]; /* 8: convlw */ var44.i = var43.i; /* 9: loadw */ var38 = ptr4[i]; /* 10: subw */ var39.i = var38.i - var44.i; /* 11: storew */ ptr0[i] = var39; } } OrcCode *_orc_code_orc_mas2_sub_s16_op; void orc_mas2_sub_s16_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, int p1, int p2, int p3, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_mas2_sub_s16_op; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; func = c->exec; func (ex); } #endif /* orc_mas2_sub_s16_ip */ #ifdef DISABLE_ORC void orc_mas2_sub_s16_ip (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int p1, int p2, int p3, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var34; orc_union16 var35; orc_union32 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; orc_union16 var44; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; /* 3: loadpw */ var35.i = p1; /* 5: loadpl */ var36.i = p2; for (i = 0; i < n; i++) { /* 0: loadoffw */ var39 = ptr4[i + 1]; /* 1: loadw */ var34 = ptr4[i]; /* 2: addw */ var40.i = var34.i + var39.i; /* 4: mulswl */ var41.i = var40.i * var35.i; /* 6: addl */ var42.i = var41.i + var36.i; /* 7: shrsl */ var43.i = var42.i >> p3; /* 8: convlw */ var44.i = var43.i; /* 9: loadw */ var37 = ptr0[i]; /* 10: subw */ var38.i = var37.i - var44.i; /* 11: storew */ ptr0[i] = var38; } } #else static void _backup_orc_mas2_sub_s16_ip (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var34; orc_union16 var35; orc_union32 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; orc_union16 var44; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; /* 3: loadpw */ var35.i = ex->params[24]; /* 5: loadpl */ var36.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadoffw */ var39 = ptr4[i + 1]; /* 1: loadw */ var34 = ptr4[i]; /* 2: addw */ var40.i = var34.i + var39.i; /* 4: mulswl */ var41.i = var40.i * var35.i; /* 6: addl */ var42.i = var41.i + var36.i; /* 7: shrsl */ var43.i = var42.i >> ex->params[26]; /* 8: convlw */ var44.i = var43.i; /* 9: loadw */ var37 = ptr0[i]; /* 10: subw */ var38.i = var37.i - var44.i; /* 11: storew */ ptr0[i] = var38; } } OrcCode *_orc_code_orc_mas2_sub_s16_ip; void orc_mas2_sub_s16_ip (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int p1, int p2, int p3, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_mas2_sub_s16_ip; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; func = c->exec; func (ex); } #endif /* orc_mas4_vert_add_s16_1991 */ #ifdef DISABLE_ORC void orc_mas4_vert_add_s16_1991 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, const orc_int16 * ORC_RESTRICT s4, int p1, int p2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; const orc_union16 * ORC_RESTRICT ptr7; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union32 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union32 var45; orc_union16 var46; orc_union32 var47; orc_union32 var48; orc_union32 var49; orc_union32 var50; orc_union16 var51; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; ptr6 = (orc_union16 *)s3; ptr7 = (orc_union16 *)s4; /* 3: loadpw */ var38.i = (int)0x00000009; /* 9 or 4.44659e-323f */ /* 10: loadpl */ var41.i = p1; for (i = 0; i < n; i++) { /* 0: loadw */ var36 = ptr5[i]; /* 1: loadw */ var37 = ptr6[i]; /* 2: addw */ var44.i = var36.i + var37.i; /* 4: mulswl */ var45.i = var44.i * var38.i; /* 5: loadw */ var39 = ptr4[i]; /* 6: loadw */ var40 = ptr7[i]; /* 7: addw */ var46.i = var39.i + var40.i; /* 8: convswl */ var47.i = var46.i; /* 9: subl */ var48.i = var45.i - var47.i; /* 11: addl */ var49.i = var48.i + var41.i; /* 12: shrsl */ var50.i = var49.i >> p2; /* 13: convlw */ var51.i = var50.i; /* 14: loadw */ var42 = ptr0[i]; /* 15: addw */ var43.i = var42.i + var51.i; /* 16: storew */ ptr0[i] = var43; } } #else static void _backup_orc_mas4_vert_add_s16_1991 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; const orc_union16 * ORC_RESTRICT ptr7; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union32 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union32 var45; orc_union16 var46; orc_union32 var47; orc_union32 var48; orc_union32 var49; orc_union32 var50; orc_union16 var51; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; ptr6 = (orc_union16 *)ex->arrays[6]; ptr7 = (orc_union16 *)ex->arrays[7]; /* 3: loadpw */ var38.i = (int)0x00000009; /* 9 or 4.44659e-323f */ /* 10: loadpl */ var41.i = ex->params[24]; for (i = 0; i < n; i++) { /* 0: loadw */ var36 = ptr5[i]; /* 1: loadw */ var37 = ptr6[i]; /* 2: addw */ var44.i = var36.i + var37.i; /* 4: mulswl */ var45.i = var44.i * var38.i; /* 5: loadw */ var39 = ptr4[i]; /* 6: loadw */ var40 = ptr7[i]; /* 7: addw */ var46.i = var39.i + var40.i; /* 8: convswl */ var47.i = var46.i; /* 9: subl */ var48.i = var45.i - var47.i; /* 11: addl */ var49.i = var48.i + var41.i; /* 12: shrsl */ var50.i = var49.i >> ex->params[25]; /* 13: convlw */ var51.i = var50.i; /* 14: loadw */ var42 = ptr0[i]; /* 15: addw */ var43.i = var42.i + var51.i; /* 16: storew */ ptr0[i] = var43; } } OrcCode *_orc_code_orc_mas4_vert_add_s16_1991; void orc_mas4_vert_add_s16_1991 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, const orc_int16 * ORC_RESTRICT s4, int p1, int p2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_mas4_vert_add_s16_1991; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->arrays[ORC_VAR_S4] = (void *)s4; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } #endif /* orc_mas4_vert_add_s32_1991 */ #ifdef DISABLE_ORC void orc_mas4_vert_add_s32_1991 (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, const orc_int32 * ORC_RESTRICT s3, const orc_int32 * ORC_RESTRICT s4, int p1, int p2, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; const orc_union32 * ORC_RESTRICT ptr6; const orc_union32 * ORC_RESTRICT ptr7; orc_union32 var35; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; orc_union32 var44; orc_union32 var45; orc_union32 var46; orc_union32 var47; orc_union32 var48; ptr0 = (orc_union32 *)d1; ptr4 = (orc_union32 *)s1; ptr5 = (orc_union32 *)s2; ptr6 = (orc_union32 *)s3; ptr7 = (orc_union32 *)s4; /* 3: loadpl */ var37.i = (int)0x00000009; /* 9 or 4.44659e-323f */ /* 9: loadpl */ var40.i = p1; for (i = 0; i < n; i++) { /* 0: loadl */ var35 = ptr5[i]; /* 1: loadl */ var36 = ptr6[i]; /* 2: addl */ var43.i = var35.i + var36.i; /* 4: mulll */ var44.i = (var43.i * var37.i) & 0xffffffff; /* 5: loadl */ var38 = ptr4[i]; /* 6: loadl */ var39 = ptr7[i]; /* 7: addl */ var45.i = var38.i + var39.i; /* 8: subl */ var46.i = var44.i - var45.i; /* 10: addl */ var47.i = var46.i + var40.i; /* 11: shrsl */ var48.i = var47.i >> p2; /* 12: loadl */ var41 = ptr0[i]; /* 13: addl */ var42.i = var41.i + var48.i; /* 14: storel */ ptr0[i] = var42; } } #else static void _backup_orc_mas4_vert_add_s32_1991 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; const orc_union32 * ORC_RESTRICT ptr6; const orc_union32 * ORC_RESTRICT ptr7; orc_union32 var35; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; orc_union32 var44; orc_union32 var45; orc_union32 var46; orc_union32 var47; orc_union32 var48; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; ptr5 = (orc_union32 *)ex->arrays[5]; ptr6 = (orc_union32 *)ex->arrays[6]; ptr7 = (orc_union32 *)ex->arrays[7]; /* 3: loadpl */ var37.i = (int)0x00000009; /* 9 or 4.44659e-323f */ /* 9: loadpl */ var40.i = ex->params[24]; for (i = 0; i < n; i++) { /* 0: loadl */ var35 = ptr5[i]; /* 1: loadl */ var36 = ptr6[i]; /* 2: addl */ var43.i = var35.i + var36.i; /* 4: mulll */ var44.i = (var43.i * var37.i) & 0xffffffff; /* 5: loadl */ var38 = ptr4[i]; /* 6: loadl */ var39 = ptr7[i]; /* 7: addl */ var45.i = var38.i + var39.i; /* 8: subl */ var46.i = var44.i - var45.i; /* 10: addl */ var47.i = var46.i + var40.i; /* 11: shrsl */ var48.i = var47.i >> ex->params[25]; /* 12: loadl */ var41 = ptr0[i]; /* 13: addl */ var42.i = var41.i + var48.i; /* 14: storel */ ptr0[i] = var42; } } OrcCode *_orc_code_orc_mas4_vert_add_s32_1991; void orc_mas4_vert_add_s32_1991 (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, const orc_int32 * ORC_RESTRICT s3, const orc_int32 * ORC_RESTRICT s4, int p1, int p2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_mas4_vert_add_s32_1991; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->arrays[ORC_VAR_S4] = (void *)s4; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } #endif /* orc_mas4_horiz_add_s16_1991_ip */ #ifdef DISABLE_ORC void orc_mas4_horiz_add_s16_1991_ip (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int p1, int p2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var36; orc_union32 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union32 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union32 var47; orc_union32 var48; orc_union32 var49; orc_union32 var50; orc_union16 var51; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; /* 3: loadpw */ var36.i = (int)0x00000009; /* 9 or 4.44659e-323f */ /* 10: loadpl */ var37.i = p1; for (i = 0; i < n; i++) { /* 0: loadoffw */ var40 = ptr4[i + 1]; /* 1: loadoffw */ var41 = ptr4[i + 2]; /* 2: addw */ var42.i = var40.i + var41.i; /* 4: mulswl */ var43.i = var42.i * var36.i; /* 5: loadw */ var44 = ptr4[i]; /* 6: loadoffw */ var45 = ptr4[i + 3]; /* 7: addw */ var46.i = var44.i + var45.i; /* 8: convswl */ var47.i = var46.i; /* 9: subl */ var48.i = var43.i - var47.i; /* 11: addl */ var49.i = var48.i + var37.i; /* 12: shrsl */ var50.i = var49.i >> p2; /* 13: convlw */ var51.i = var50.i; /* 14: loadw */ var38 = ptr0[i]; /* 15: addw */ var39.i = var38.i + var51.i; /* 16: storew */ ptr0[i] = var39; } } #else static void _backup_orc_mas4_horiz_add_s16_1991_ip (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var36; orc_union32 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union32 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union32 var47; orc_union32 var48; orc_union32 var49; orc_union32 var50; orc_union16 var51; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; /* 3: loadpw */ var36.i = (int)0x00000009; /* 9 or 4.44659e-323f */ /* 10: loadpl */ var37.i = ex->params[24]; for (i = 0; i < n; i++) { /* 0: loadoffw */ var40 = ptr4[i + 1]; /* 1: loadoffw */ var41 = ptr4[i + 2]; /* 2: addw */ var42.i = var40.i + var41.i; /* 4: mulswl */ var43.i = var42.i * var36.i; /* 5: loadw */ var44 = ptr4[i]; /* 6: loadoffw */ var45 = ptr4[i + 3]; /* 7: addw */ var46.i = var44.i + var45.i; /* 8: convswl */ var47.i = var46.i; /* 9: subl */ var48.i = var43.i - var47.i; /* 11: addl */ var49.i = var48.i + var37.i; /* 12: shrsl */ var50.i = var49.i >> ex->params[25]; /* 13: convlw */ var51.i = var50.i; /* 14: loadw */ var38 = ptr0[i]; /* 15: addw */ var39.i = var38.i + var51.i; /* 16: storew */ ptr0[i] = var39; } } OrcCode *_orc_code_orc_mas4_horiz_add_s16_1991_ip; void orc_mas4_horiz_add_s16_1991_ip (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int p1, int p2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_mas4_horiz_add_s16_1991_ip; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } #endif /* orc_mas4_vert_sub_s16_1991 */ #ifdef DISABLE_ORC void orc_mas4_vert_sub_s16_1991 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, const orc_int16 * ORC_RESTRICT s4, int p1, int p2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; const orc_union16 * ORC_RESTRICT ptr7; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union32 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union32 var45; orc_union16 var46; orc_union32 var47; orc_union32 var48; orc_union32 var49; orc_union32 var50; orc_union16 var51; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; ptr6 = (orc_union16 *)s3; ptr7 = (orc_union16 *)s4; /* 3: loadpw */ var38.i = (int)0x00000009; /* 9 or 4.44659e-323f */ /* 10: loadpl */ var41.i = p1; for (i = 0; i < n; i++) { /* 0: loadw */ var36 = ptr5[i]; /* 1: loadw */ var37 = ptr6[i]; /* 2: addw */ var44.i = var36.i + var37.i; /* 4: mulswl */ var45.i = var44.i * var38.i; /* 5: loadw */ var39 = ptr4[i]; /* 6: loadw */ var40 = ptr7[i]; /* 7: addw */ var46.i = var39.i + var40.i; /* 8: convswl */ var47.i = var46.i; /* 9: subl */ var48.i = var45.i - var47.i; /* 11: addl */ var49.i = var48.i + var41.i; /* 12: shrsl */ var50.i = var49.i >> p2; /* 13: convlw */ var51.i = var50.i; /* 14: loadw */ var42 = ptr0[i]; /* 15: subw */ var43.i = var42.i - var51.i; /* 16: storew */ ptr0[i] = var43; } } #else static void _backup_orc_mas4_vert_sub_s16_1991 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; const orc_union16 * ORC_RESTRICT ptr7; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union32 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union32 var45; orc_union16 var46; orc_union32 var47; orc_union32 var48; orc_union32 var49; orc_union32 var50; orc_union16 var51; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; ptr6 = (orc_union16 *)ex->arrays[6]; ptr7 = (orc_union16 *)ex->arrays[7]; /* 3: loadpw */ var38.i = (int)0x00000009; /* 9 or 4.44659e-323f */ /* 10: loadpl */ var41.i = ex->params[24]; for (i = 0; i < n; i++) { /* 0: loadw */ var36 = ptr5[i]; /* 1: loadw */ var37 = ptr6[i]; /* 2: addw */ var44.i = var36.i + var37.i; /* 4: mulswl */ var45.i = var44.i * var38.i; /* 5: loadw */ var39 = ptr4[i]; /* 6: loadw */ var40 = ptr7[i]; /* 7: addw */ var46.i = var39.i + var40.i; /* 8: convswl */ var47.i = var46.i; /* 9: subl */ var48.i = var45.i - var47.i; /* 11: addl */ var49.i = var48.i + var41.i; /* 12: shrsl */ var50.i = var49.i >> ex->params[25]; /* 13: convlw */ var51.i = var50.i; /* 14: loadw */ var42 = ptr0[i]; /* 15: subw */ var43.i = var42.i - var51.i; /* 16: storew */ ptr0[i] = var43; } } OrcCode *_orc_code_orc_mas4_vert_sub_s16_1991; void orc_mas4_vert_sub_s16_1991 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, const orc_int16 * ORC_RESTRICT s4, int p1, int p2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_mas4_vert_sub_s16_1991; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->arrays[ORC_VAR_S4] = (void *)s4; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } #endif /* orc_mas4_horiz_sub_s16_1991_ip */ #ifdef DISABLE_ORC void orc_mas4_horiz_sub_s16_1991_ip (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int p1, int p2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var36; orc_union32 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union32 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union32 var47; orc_union32 var48; orc_union32 var49; orc_union32 var50; orc_union16 var51; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; /* 3: loadpw */ var36.i = (int)0x00000009; /* 9 or 4.44659e-323f */ /* 10: loadpl */ var37.i = p1; for (i = 0; i < n; i++) { /* 0: loadoffw */ var40 = ptr4[i + 1]; /* 1: loadoffw */ var41 = ptr4[i + 2]; /* 2: addw */ var42.i = var40.i + var41.i; /* 4: mulswl */ var43.i = var42.i * var36.i; /* 5: loadw */ var44 = ptr4[i]; /* 6: loadoffw */ var45 = ptr4[i + 3]; /* 7: addw */ var46.i = var44.i + var45.i; /* 8: convswl */ var47.i = var46.i; /* 9: subl */ var48.i = var43.i - var47.i; /* 11: addl */ var49.i = var48.i + var37.i; /* 12: shrsl */ var50.i = var49.i >> p2; /* 13: convlw */ var51.i = var50.i; /* 14: loadw */ var38 = ptr0[i]; /* 15: subw */ var39.i = var38.i - var51.i; /* 16: storew */ ptr0[i] = var39; } } #else static void _backup_orc_mas4_horiz_sub_s16_1991_ip (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var36; orc_union32 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union32 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union32 var47; orc_union32 var48; orc_union32 var49; orc_union32 var50; orc_union16 var51; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; /* 3: loadpw */ var36.i = (int)0x00000009; /* 9 or 4.44659e-323f */ /* 10: loadpl */ var37.i = ex->params[24]; for (i = 0; i < n; i++) { /* 0: loadoffw */ var40 = ptr4[i + 1]; /* 1: loadoffw */ var41 = ptr4[i + 2]; /* 2: addw */ var42.i = var40.i + var41.i; /* 4: mulswl */ var43.i = var42.i * var36.i; /* 5: loadw */ var44 = ptr4[i]; /* 6: loadoffw */ var45 = ptr4[i + 3]; /* 7: addw */ var46.i = var44.i + var45.i; /* 8: convswl */ var47.i = var46.i; /* 9: subl */ var48.i = var43.i - var47.i; /* 11: addl */ var49.i = var48.i + var37.i; /* 12: shrsl */ var50.i = var49.i >> ex->params[25]; /* 13: convlw */ var51.i = var50.i; /* 14: loadw */ var38 = ptr0[i]; /* 15: subw */ var39.i = var38.i - var51.i; /* 16: storew */ ptr0[i] = var39; } } OrcCode *_orc_code_orc_mas4_horiz_sub_s16_1991_ip; void orc_mas4_horiz_sub_s16_1991_ip (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int p1, int p2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_mas4_horiz_sub_s16_1991_ip; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } #endif /* orc_subtract_s16 */ #ifdef DISABLE_ORC void orc_subtract_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: loadw */ var33 = ptr5[i]; /* 2: subw */ var34.i = var32.i - var33.i; /* 3: storew */ ptr0[i] = var34; } } #else static void _backup_orc_subtract_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: loadw */ var33 = ptr5[i]; /* 2: subw */ var34.i = var32.i - var33.i; /* 3: storew */ ptr0[i] = var34; } } OrcCode *_orc_code_orc_subtract_s16; void orc_subtract_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_subtract_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_add_s16_u8 */ #ifdef DISABLE_ORC void orc_add_s16_u8 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_int8 *)s2; for (i = 0; i < n; i++) { /* 0: loadb */ var33 = ptr5[i]; /* 1: convubw */ var36.i = (orc_uint8)var33; /* 2: loadw */ var34 = ptr4[i]; /* 3: addw */ var35.i = var36.i + var34.i; /* 4: storew */ ptr0[i] = var35; } } #else static void _backup_orc_add_s16_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_int8 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadb */ var33 = ptr5[i]; /* 1: convubw */ var36.i = (orc_uint8)var33; /* 2: loadw */ var34 = ptr4[i]; /* 3: addw */ var35.i = var36.i + var34.i; /* 4: storew */ ptr0[i] = var35; } } OrcCode *_orc_code_orc_add_s16_u8; void orc_add_s16_u8 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add_s16_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_add_s16_u8_2d */ #ifdef DISABLE_ORC void orc_add_s16_u8_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, int n, int m){ int i; int j; orc_union16 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); for (i = 0; i < n; i++) { /* 0: loadb */ var33 = ptr4[i]; /* 1: convubw */ var36.i = (orc_uint8)var33; /* 2: loadw */ var34 = ptr0[i]; /* 3: addw */ var35.i = var34.i + var36.i; /* 4: storew */ ptr0[i] = var35; } } } #else static void _backup_orc_add_s16_u8_2d (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); for (i = 0; i < n; i++) { /* 0: loadb */ var33 = ptr4[i]; /* 1: convubw */ var36.i = (orc_uint8)var33; /* 2: loadw */ var34 = ptr0[i]; /* 3: addw */ var35.i = var34.i + var36.i; /* 4: storew */ ptr0[i] = var35; } } } OrcCode *_orc_code_orc_add_s16_u8_2d; void orc_add_s16_u8_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, int n, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add_s16_u8_2d; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; func = c->exec; func (ex); } #endif /* orc_convert_s16_u8 */ #ifdef DISABLE_ORC void orc_convert_s16_u8 (orc_int16 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var32; orc_union16 var33; ptr0 = (orc_union16 *)d1; ptr4 = (orc_int8 *)s1; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: convubw */ var33.i = (orc_uint8)var32; /* 2: storew */ ptr0[i] = var33; } } #else static void _backup_orc_convert_s16_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var32; orc_union16 var33; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_int8 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: convubw */ var33.i = (orc_uint8)var32; /* 2: storew */ ptr0[i] = var33; } } OrcCode *_orc_code_orc_convert_s16_u8; void orc_convert_s16_u8 (orc_int16 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_convert_s16_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_convert_s16_s32 */ #ifdef DISABLE_ORC void orc_convert_s16_s32 (orc_int16 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var32; orc_union16 var33; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union32 *)s1; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: convlw */ var33.i = var32.i; /* 2: storew */ ptr0[i] = var33; } } #else static void _backup_orc_convert_s16_s32 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var32; orc_union16 var33; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: convlw */ var33.i = var32.i; /* 2: storew */ ptr0[i] = var33; } } OrcCode *_orc_code_orc_convert_s16_s32; void orc_convert_s16_s32 (orc_int16 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_convert_s16_s32; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_convert_u8_s16 */ #ifdef DISABLE_ORC void orc_convert_u8_s16 (orc_uint8 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n){ int i; orc_int8 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_int8 var33; ptr0 = (orc_int8 *)d1; ptr4 = (orc_union16 *)s1; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: convsuswb */ var33 = ORC_CLAMP_UB(var32.i); /* 2: storeb */ ptr0[i] = var33; } } #else static void _backup_orc_convert_u8_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_int8 var33; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: convsuswb */ var33 = ORC_CLAMP_UB(var32.i); /* 2: storeb */ ptr0[i] = var33; } } OrcCode *_orc_code_orc_convert_u8_s16; void orc_convert_u8_s16 (orc_uint8 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_convert_u8_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_convert_s32_s16 */ #ifdef DISABLE_ORC void orc_convert_s32_s16 (orc_int32 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_union32 var33; ptr0 = (orc_union32 *)d1; ptr4 = (orc_union16 *)s1; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: convswl */ var33.i = var32.i; /* 2: storel */ ptr0[i] = var33; } } #else static void _backup_orc_convert_s32_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_union32 var33; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: convswl */ var33.i = var32.i; /* 2: storel */ ptr0[i] = var33; } } OrcCode *_orc_code_orc_convert_s32_s16; void orc_convert_s32_s16 (orc_int32 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_convert_s32_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_offsetconvert_u8_s16 */ #ifdef DISABLE_ORC void orc_offsetconvert_u8_s16 (orc_uint8 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n){ int i; orc_int8 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var33; orc_union16 var34; orc_int8 var35; orc_union16 var36; ptr0 = (orc_int8 *)d1; ptr4 = (orc_union16 *)s1; /* 1: loadpw */ var34.i = (int)0x00000080; /* 128 or 6.32404e-322f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 2: addw */ var36.i = var33.i + var34.i; /* 3: convsuswb */ var35 = ORC_CLAMP_UB(var36.i); /* 4: storeb */ ptr0[i] = var35; } } #else static void _backup_orc_offsetconvert_u8_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var33; orc_union16 var34; orc_int8 var35; orc_union16 var36; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; /* 1: loadpw */ var34.i = (int)0x00000080; /* 128 or 6.32404e-322f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 2: addw */ var36.i = var33.i + var34.i; /* 3: convsuswb */ var35 = ORC_CLAMP_UB(var36.i); /* 4: storeb */ ptr0[i] = var35; } } OrcCode *_orc_code_orc_offsetconvert_u8_s16; void orc_offsetconvert_u8_s16 (orc_uint8 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_offsetconvert_u8_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_offsetconvert_u8_s32 */ #ifdef DISABLE_ORC void orc_offsetconvert_u8_s32 (orc_uint8 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, int n){ int i; orc_int8 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var34; orc_union32 var35; orc_int8 var36; orc_union32 var37; orc_union16 var38; ptr0 = (orc_int8 *)d1; ptr4 = (orc_union32 *)s1; /* 1: loadpl */ var35.i = (int)0x00000080; /* 128 or 6.32404e-322f */ for (i = 0; i < n; i++) { /* 0: loadl */ var34 = ptr4[i]; /* 2: addl */ var37.i = var34.i + var35.i; /* 3: convsuslw */ var38.i = ORC_CLAMP_UW(var37.i); /* 4: convsuswb */ var36 = ORC_CLAMP_UB(var38.i); /* 5: storeb */ ptr0[i] = var36; } } #else static void _backup_orc_offsetconvert_u8_s32 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var34; orc_union32 var35; orc_int8 var36; orc_union32 var37; orc_union16 var38; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; /* 1: loadpl */ var35.i = (int)0x00000080; /* 128 or 6.32404e-322f */ for (i = 0; i < n; i++) { /* 0: loadl */ var34 = ptr4[i]; /* 2: addl */ var37.i = var34.i + var35.i; /* 3: convsuslw */ var38.i = ORC_CLAMP_UW(var37.i); /* 4: convsuswb */ var36 = ORC_CLAMP_UB(var38.i); /* 5: storeb */ ptr0[i] = var36; } } OrcCode *_orc_code_orc_offsetconvert_u8_s32; void orc_offsetconvert_u8_s32 (orc_uint8 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_offsetconvert_u8_s32; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_offsetconvert_s16_u8 */ #ifdef DISABLE_ORC void orc_offsetconvert_s16_u8 (orc_int16 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; ptr0 = (orc_union16 *)d1; ptr4 = (orc_int8 *)s1; /* 2: loadpw */ var34.i = (int)0x00000080; /* 128 or 6.32404e-322f */ for (i = 0; i < n; i++) { /* 0: loadb */ var33 = ptr4[i]; /* 1: convubw */ var36.i = (orc_uint8)var33; /* 3: subw */ var35.i = var36.i - var34.i; /* 4: storew */ ptr0[i] = var35; } } #else static void _backup_orc_offsetconvert_s16_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_int8 *)ex->arrays[4]; /* 2: loadpw */ var34.i = (int)0x00000080; /* 128 or 6.32404e-322f */ for (i = 0; i < n; i++) { /* 0: loadb */ var33 = ptr4[i]; /* 1: convubw */ var36.i = (orc_uint8)var33; /* 3: subw */ var35.i = var36.i - var34.i; /* 4: storew */ ptr0[i] = var35; } } OrcCode *_orc_code_orc_offsetconvert_s16_u8; void orc_offsetconvert_s16_u8 (orc_int16 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_offsetconvert_s16_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_offsetconvert_s32_u8 */ #ifdef DISABLE_ORC void orc_offsetconvert_s32_u8 (orc_int32 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var33; orc_union16 var34; orc_union32 var35; orc_union16 var36; orc_union16 var37; ptr0 = (orc_union32 *)d1; ptr4 = (orc_int8 *)s1; /* 2: loadpw */ var34.i = (int)0x00000080; /* 128 or 6.32404e-322f */ for (i = 0; i < n; i++) { /* 0: loadb */ var33 = ptr4[i]; /* 1: convubw */ var36.i = (orc_uint8)var33; /* 3: subw */ var37.i = var36.i - var34.i; /* 4: convswl */ var35.i = var37.i; /* 5: storel */ ptr0[i] = var35; } } #else static void _backup_orc_offsetconvert_s32_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var33; orc_union16 var34; orc_union32 var35; orc_union16 var36; orc_union16 var37; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_int8 *)ex->arrays[4]; /* 2: loadpw */ var34.i = (int)0x00000080; /* 128 or 6.32404e-322f */ for (i = 0; i < n; i++) { /* 0: loadb */ var33 = ptr4[i]; /* 1: convubw */ var36.i = (orc_uint8)var33; /* 3: subw */ var37.i = var36.i - var34.i; /* 4: convswl */ var35.i = var37.i; /* 5: storel */ ptr0[i] = var35; } } OrcCode *_orc_code_orc_offsetconvert_s32_u8; void orc_offsetconvert_s32_u8 (orc_int32 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_offsetconvert_s32_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_offsetconvert_s32_s16 */ #ifdef DISABLE_ORC void orc_offsetconvert_s32_s16 (orc_int32 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var33; orc_union16 var34; orc_union32 var35; orc_union16 var36; ptr0 = (orc_union32 *)d1; ptr4 = (orc_union16 *)s1; /* 1: loadpw */ var34.i = (int)0x00000080; /* 128 or 6.32404e-322f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 2: subw */ var36.i = var33.i - var34.i; /* 3: convswl */ var35.i = var36.i; /* 4: storel */ ptr0[i] = var35; } } #else static void _backup_orc_offsetconvert_s32_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var33; orc_union16 var34; orc_union32 var35; orc_union16 var36; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; /* 1: loadpw */ var34.i = (int)0x00000080; /* 128 or 6.32404e-322f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 2: subw */ var36.i = var33.i - var34.i; /* 3: convswl */ var35.i = var36.i; /* 4: storel */ ptr0[i] = var35; } } OrcCode *_orc_code_orc_offsetconvert_s32_s16; void orc_offsetconvert_s32_s16 (orc_int32 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_offsetconvert_s32_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_subtract_s16_u8 */ #ifdef DISABLE_ORC void orc_subtract_s16_u8 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_int8 *)s2; for (i = 0; i < n; i++) { /* 0: loadb */ var33 = ptr5[i]; /* 1: convubw */ var36.i = (orc_uint8)var33; /* 2: loadw */ var34 = ptr4[i]; /* 3: subw */ var35.i = var34.i - var36.i; /* 4: storew */ ptr0[i] = var35; } } #else static void _backup_orc_subtract_s16_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_int8 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadb */ var33 = ptr5[i]; /* 1: convubw */ var36.i = (orc_uint8)var33; /* 2: loadw */ var34 = ptr4[i]; /* 3: subw */ var35.i = var34.i - var36.i; /* 4: storew */ ptr0[i] = var35; } } OrcCode *_orc_code_orc_subtract_s16_u8; void orc_subtract_s16_u8 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_subtract_s16_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_multiply_and_add_s16_u8 */ #ifdef DISABLE_ORC void orc_multiply_and_add_s16_u8 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_int8 *)s2; for (i = 0; i < n; i++) { /* 0: loadb */ var33 = ptr5[i]; /* 1: convubw */ var37.i = (orc_uint8)var33; /* 2: loadw */ var34 = ptr4[i]; /* 3: mullw */ var38.i = (var37.i * var34.i) & 0xffff; /* 4: loadw */ var35 = ptr0[i]; /* 5: addw */ var36.i = var35.i + var38.i; /* 6: storew */ ptr0[i] = var36; } } #else static void _backup_orc_multiply_and_add_s16_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_int8 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadb */ var33 = ptr5[i]; /* 1: convubw */ var37.i = (orc_uint8)var33; /* 2: loadw */ var34 = ptr4[i]; /* 3: mullw */ var38.i = (var37.i * var34.i) & 0xffff; /* 4: loadw */ var35 = ptr0[i]; /* 5: addw */ var36.i = var35.i + var38.i; /* 6: storew */ ptr0[i] = var36; } } OrcCode *_orc_code_orc_multiply_and_add_s16_u8; void orc_multiply_and_add_s16_u8 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_multiply_and_add_s16_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_splat_s16_ns */ #ifdef DISABLE_ORC void orc_splat_s16_ns (orc_int16 * ORC_RESTRICT d1, int p1, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var32; orc_union16 var33; ptr0 = (orc_union16 *)d1; /* 0: loadpw */ var32.i = p1; for (i = 0; i < n; i++) { /* 1: copyw */ var33.i = var32.i; /* 2: storew */ ptr0[i] = var33; } } #else static void _backup_orc_splat_s16_ns (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var32; orc_union16 var33; ptr0 = (orc_union16 *)ex->arrays[0]; /* 0: loadpw */ var32.i = ex->params[24]; for (i = 0; i < n; i++) { /* 1: copyw */ var33.i = var32.i; /* 2: storew */ ptr0[i] = var33; } } OrcCode *_orc_code_orc_splat_s16_ns; void orc_splat_s16_ns (orc_int16 * ORC_RESTRICT d1, int p1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_splat_s16_ns; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_P1] = p1; func = c->exec; func (ex); } #endif /* orc_splat_s32_ns */ #ifdef DISABLE_ORC void orc_splat_s32_ns (orc_int32 * ORC_RESTRICT d1, int p1, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; orc_union32 var32; orc_union32 var33; ptr0 = (orc_union32 *)d1; /* 0: loadpl */ var32.i = p1; for (i = 0; i < n; i++) { /* 1: copyl */ var33.i = var32.i; /* 2: storel */ ptr0[i] = var33; } } #else static void _backup_orc_splat_s32_ns (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; orc_union32 var32; orc_union32 var33; ptr0 = (orc_union32 *)ex->arrays[0]; /* 0: loadpl */ var32.i = ex->params[24]; for (i = 0; i < n; i++) { /* 1: copyl */ var33.i = var32.i; /* 2: storel */ ptr0[i] = var33; } } OrcCode *_orc_code_orc_splat_s32_ns; void orc_splat_s32_ns (orc_int32 * ORC_RESTRICT d1, int p1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_splat_s32_ns; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_P1] = p1; func = c->exec; func (ex); } #endif /* orc_splat_s16_2d_4xn */ #ifdef DISABLE_ORC void orc_splat_s16_2d_4xn (orc_int16 * ORC_RESTRICT d1, int d1_stride, int p1, int m){ int i; int j; int n = 4; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var32; orc_union16 var33; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); /* 0: loadpw */ var32.i = p1; for (i = 0; i < n; i++) { /* 1: copyw */ var33.i = var32.i; /* 2: storew */ ptr0[i] = var33; } } } #else static void _backup_orc_splat_s16_2d_4xn (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 4; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var32; orc_union16 var33; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); /* 0: loadpw */ var32.i = ex->params[24]; for (i = 0; i < n; i++) { /* 1: copyw */ var33.i = var32.i; /* 2: storew */ ptr0[i] = var33; } } } OrcCode *_orc_code_orc_splat_s16_2d_4xn; void orc_splat_s16_2d_4xn (orc_int16 * ORC_RESTRICT d1, int d1_stride, int p1, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_splat_s16_2d_4xn; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 4; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->params[ORC_VAR_P1] = p1; func = c->exec; func (ex); } #endif /* orc_splat_s16_2d_8xn */ #ifdef DISABLE_ORC void orc_splat_s16_2d_8xn (orc_int16 * ORC_RESTRICT d1, int d1_stride, int p1, int m){ int i; int j; int n = 8; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var32; orc_union16 var33; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); /* 0: loadpw */ var32.i = p1; for (i = 0; i < n; i++) { /* 1: copyw */ var33.i = var32.i; /* 2: storew */ ptr0[i] = var33; } } } #else static void _backup_orc_splat_s16_2d_8xn (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 8; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var32; orc_union16 var33; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); /* 0: loadpw */ var32.i = ex->params[24]; for (i = 0; i < n; i++) { /* 1: copyw */ var33.i = var32.i; /* 2: storew */ ptr0[i] = var33; } } } OrcCode *_orc_code_orc_splat_s16_2d_8xn; void orc_splat_s16_2d_8xn (orc_int16 * ORC_RESTRICT d1, int d1_stride, int p1, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_splat_s16_2d_8xn; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 8; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->params[ORC_VAR_P1] = p1; func = c->exec; func (ex); } #endif /* orc_splat_s16_2d */ #ifdef DISABLE_ORC void orc_splat_s16_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, int p1, int n, int m){ int i; int j; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var32; orc_union16 var33; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); /* 0: loadpw */ var32.i = p1; for (i = 0; i < n; i++) { /* 1: copyw */ var33.i = var32.i; /* 2: storew */ ptr0[i] = var33; } } } #else static void _backup_orc_splat_s16_2d (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var32; orc_union16 var33; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); /* 0: loadpw */ var32.i = ex->params[24]; for (i = 0; i < n; i++) { /* 1: copyw */ var33.i = var32.i; /* 2: storew */ ptr0[i] = var33; } } } OrcCode *_orc_code_orc_splat_s16_2d; void orc_splat_s16_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, int p1, int n, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_splat_s16_2d; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->params[ORC_VAR_P1] = p1; func = c->exec; func (ex); } #endif /* orc_splat_u8_ns */ #ifdef DISABLE_ORC void orc_splat_u8_ns (orc_uint8 * ORC_RESTRICT d1, int p1, int n){ int i; orc_int8 * ORC_RESTRICT ptr0; orc_int8 var32; orc_int8 var33; ptr0 = (orc_int8 *)d1; /* 0: loadpb */ var32 = p1; for (i = 0; i < n; i++) { /* 1: copyb */ var33 = var32; /* 2: storeb */ ptr0[i] = var33; } } #else static void _backup_orc_splat_u8_ns (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; orc_int8 var32; orc_int8 var33; ptr0 = (orc_int8 *)ex->arrays[0]; /* 0: loadpb */ var32 = ex->params[24]; for (i = 0; i < n; i++) { /* 1: copyb */ var33 = var32; /* 2: storeb */ ptr0[i] = var33; } } OrcCode *_orc_code_orc_splat_u8_ns; void orc_splat_u8_ns (orc_uint8 * ORC_RESTRICT d1, int p1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_splat_u8_ns; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_P1] = p1; func = c->exec; func (ex); } #endif /* orc_splat_u8_2d */ #ifdef DISABLE_ORC void orc_splat_u8_2d (orc_uint8 * ORC_RESTRICT d1, int d1_stride, int p1, int n, int m){ int i; int j; orc_int8 * ORC_RESTRICT ptr0; orc_int8 var32; orc_int8 var33; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); /* 0: loadpb */ var32 = p1; for (i = 0; i < n; i++) { /* 1: copyb */ var33 = var32; /* 2: storeb */ ptr0[i] = var33; } } } #else static void _backup_orc_splat_u8_2d (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; orc_int8 var32; orc_int8 var33; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); /* 0: loadpb */ var32 = ex->params[24]; for (i = 0; i < n; i++) { /* 1: copyb */ var33 = var32; /* 2: storeb */ ptr0[i] = var33; } } } OrcCode *_orc_code_orc_splat_u8_2d; void orc_splat_u8_2d (orc_uint8 * ORC_RESTRICT d1, int d1_stride, int p1, int n, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_splat_u8_2d; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->params[ORC_VAR_P1] = p1; func = c->exec; func (ex); } #endif /* orc_average_u8 */ #ifdef DISABLE_ORC void orc_average_u8 (orc_uint8 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n){ int i; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; ptr0 = (orc_int8 *)d1; ptr4 = (orc_int8 *)s1; ptr5 = (orc_int8 *)s2; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: avgub */ var34 = ((orc_uint8)var32 + (orc_uint8)var33 + 1)>>1; /* 3: storeb */ ptr0[i] = var34; } } #else static void _backup_orc_average_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_int8 *)ex->arrays[4]; ptr5 = (orc_int8 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: avgub */ var34 = ((orc_uint8)var32 + (orc_uint8)var33 + 1)>>1; /* 3: storeb */ ptr0[i] = var34; } } OrcCode *_orc_code_orc_average_u8; void orc_average_u8 (orc_uint8 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_average_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_rrshift6_add_s16_2d */ #ifdef DISABLE_ORC void orc_rrshift6_add_s16_2d (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_int16 * ORC_RESTRICT s1, int s1_stride, const orc_int16 * ORC_RESTRICT s2, int s2_stride, int n, int m){ int i; int j; orc_int8 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_int8 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); /* 1: loadpw */ var34.i = (int)0x00000020; /* 32 or 1.58101e-322f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr5[i]; /* 2: addw */ var37.i = var33.i + var34.i; /* 3: shrsw */ var38.i = var37.i >> 6; /* 4: loadw */ var35 = ptr4[i]; /* 5: addw */ var39.i = var35.i + var38.i; /* 6: convsuswb */ var36 = ORC_CLAMP_UB(var39.i); /* 7: storeb */ ptr0[i] = var36; } } } #else static void _backup_orc_rrshift6_add_s16_2d (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_int8 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); /* 1: loadpw */ var34.i = (int)0x00000020; /* 32 or 1.58101e-322f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr5[i]; /* 2: addw */ var37.i = var33.i + var34.i; /* 3: shrsw */ var38.i = var37.i >> 6; /* 4: loadw */ var35 = ptr4[i]; /* 5: addw */ var39.i = var35.i + var38.i; /* 6: convsuswb */ var36 = ORC_CLAMP_UB(var39.i); /* 7: storeb */ ptr0[i] = var36; } } } OrcCode *_orc_code_orc_rrshift6_add_s16_2d; void orc_rrshift6_add_s16_2d (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_int16 * ORC_RESTRICT s1, int s1_stride, const orc_int16 * ORC_RESTRICT s2, int s2_stride, int n, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_rrshift6_add_s16_2d; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; func = c->exec; func (ex); } #endif /* orc_rrshift6_add_s32_2d */ #ifdef DISABLE_ORC void orc_rrshift6_add_s32_2d (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_int32 * ORC_RESTRICT s1, int s1_stride, const orc_int16 * ORC_RESTRICT s2, int s2_stride, int n, int m){ int i; int j; orc_int8 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; orc_union16 var35; orc_union32 var36; orc_int8 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); /* 1: loadpw */ var35.i = (int)0x00000020; /* 32 or 1.58101e-322f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr5[i]; /* 2: addw */ var38.i = var34.i + var35.i; /* 3: shrsw */ var39.i = var38.i >> 6; /* 4: loadl */ var36 = ptr4[i]; /* 5: convlw */ var40.i = var36.i; /* 6: addw */ var41.i = var40.i + var39.i; /* 7: convsuswb */ var37 = ORC_CLAMP_UB(var41.i); /* 8: storeb */ ptr0[i] = var37; } } } #else static void _backup_orc_rrshift6_add_s32_2d (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; orc_union16 var35; orc_union32 var36; orc_int8 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); /* 1: loadpw */ var35.i = (int)0x00000020; /* 32 or 1.58101e-322f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr5[i]; /* 2: addw */ var38.i = var34.i + var35.i; /* 3: shrsw */ var39.i = var38.i >> 6; /* 4: loadl */ var36 = ptr4[i]; /* 5: convlw */ var40.i = var36.i; /* 6: addw */ var41.i = var40.i + var39.i; /* 7: convsuswb */ var37 = ORC_CLAMP_UB(var41.i); /* 8: storeb */ ptr0[i] = var37; } } } OrcCode *_orc_code_orc_rrshift6_add_s32_2d; void orc_rrshift6_add_s32_2d (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_int32 * ORC_RESTRICT s1, int s1_stride, const orc_int16 * ORC_RESTRICT s2, int s2_stride, int n, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_rrshift6_add_s32_2d; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; func = c->exec; func (ex); } #endif /* orc_rrshift6_sub_s16_2d */ #ifdef DISABLE_ORC void orc_rrshift6_sub_s16_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, orc_int16 * ORC_RESTRICT d2, int d2_stride, int n, int m){ int i; int j; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr1 = ORC_PTR_OFFSET(d2, d2_stride * j); /* 1: loadpw */ var34.i = (int)0x00001fe0; /* 8160 or 4.03158e-320f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr1[i]; /* 2: subw */ var38.i = var33.i - var34.i; /* 3: shrsw */ var39.i = var38.i >> 6; /* 4: copyw */ var35.i = var39.i; /* 5: storew */ ptr1[i] = var35; /* 6: loadw */ var36 = ptr0[i]; /* 7: subw */ var37.i = var36.i - var39.i; /* 8: storew */ ptr0[i] = var37; } } } #else static void _backup_orc_rrshift6_sub_s16_2d (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr1 = ORC_PTR_OFFSET(ex->arrays[1], ex->params[1] * j); /* 1: loadpw */ var34.i = (int)0x00001fe0; /* 8160 or 4.03158e-320f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr1[i]; /* 2: subw */ var38.i = var33.i - var34.i; /* 3: shrsw */ var39.i = var38.i >> 6; /* 4: copyw */ var35.i = var39.i; /* 5: storew */ ptr1[i] = var35; /* 6: loadw */ var36 = ptr0[i]; /* 7: subw */ var37.i = var36.i - var39.i; /* 8: storew */ ptr0[i] = var37; } } } OrcCode *_orc_code_orc_rrshift6_sub_s16_2d; void orc_rrshift6_sub_s16_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, orc_int16 * ORC_RESTRICT d2, int d2_stride, int n, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_rrshift6_sub_s16_2d; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_D2] = d2; ex->params[ORC_VAR_D2] = d2_stride; func = c->exec; func (ex); } #endif /* orc_rrshift6_s16_ip_2d */ #ifdef DISABLE_ORC void orc_rrshift6_s16_ip_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, int n, int m){ int i; int j; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); /* 1: loadpw */ var34.i = (int)0x00001fe0; /* 8160 or 4.03158e-320f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr0[i]; /* 2: subw */ var36.i = var33.i - var34.i; /* 3: shrsw */ var35.i = var36.i >> 6; /* 4: storew */ ptr0[i] = var35; } } } #else static void _backup_orc_rrshift6_s16_ip_2d (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); /* 1: loadpw */ var34.i = (int)0x00001fe0; /* 8160 or 4.03158e-320f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr0[i]; /* 2: subw */ var36.i = var33.i - var34.i; /* 3: shrsw */ var35.i = var36.i >> 6; /* 4: storew */ ptr0[i] = var35; } } } OrcCode *_orc_code_orc_rrshift6_s16_ip_2d; void orc_rrshift6_s16_ip_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, int n, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_rrshift6_s16_ip_2d; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; func = c->exec; func (ex); } #endif /* orc_rrshift6_s16_ip */ #ifdef DISABLE_ORC void orc_rrshift6_s16_ip (orc_int16 * ORC_RESTRICT d1, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; ptr0 = (orc_union16 *)d1; /* 1: loadpw */ var34.i = (int)0x00001fe0; /* 8160 or 4.03158e-320f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr0[i]; /* 2: subw */ var36.i = var33.i - var34.i; /* 3: shrsw */ var35.i = var36.i >> 6; /* 4: storew */ ptr0[i] = var35; } } #else static void _backup_orc_rrshift6_s16_ip (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; ptr0 = (orc_union16 *)ex->arrays[0]; /* 1: loadpw */ var34.i = (int)0x00001fe0; /* 8160 or 4.03158e-320f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr0[i]; /* 2: subw */ var36.i = var33.i - var34.i; /* 3: shrsw */ var35.i = var36.i >> 6; /* 4: storew */ ptr0[i] = var35; } } OrcCode *_orc_code_orc_rrshift6_s16_ip; void orc_rrshift6_s16_ip (orc_int16 * ORC_RESTRICT d1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_rrshift6_s16_ip; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; func = c->exec; func (ex); } #endif /* orc_unpack_yuyv_y */ #ifdef DISABLE_ORC void orc_unpack_yuyv_y (orc_uint8 * ORC_RESTRICT d1, const orc_uint16 * ORC_RESTRICT s1, int n){ int i; orc_int8 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_int8 var33; ptr0 = (orc_int8 *)d1; ptr4 = (orc_union16 *)s1; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: select0wb */ { orc_union16 _src; _src.i = var32.i; var33 = _src.x2[0]; } /* 2: storeb */ ptr0[i] = var33; } } #else static void _backup_orc_unpack_yuyv_y (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_int8 var33; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: select0wb */ { orc_union16 _src; _src.i = var32.i; var33 = _src.x2[0]; } /* 2: storeb */ ptr0[i] = var33; } } OrcCode *_orc_code_orc_unpack_yuyv_y; void orc_unpack_yuyv_y (orc_uint8 * ORC_RESTRICT d1, const orc_uint16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_unpack_yuyv_y; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_unpack_yuyv_u */ #ifdef DISABLE_ORC void orc_unpack_yuyv_u (orc_uint8 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n){ int i; orc_int8 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var33; orc_int8 var34; orc_union16 var35; ptr0 = (orc_int8 *)d1; ptr4 = (orc_union32 *)s1; for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr4[i]; /* 1: select0lw */ { orc_union32 _src; _src.i = var33.i; var35.i = _src.x2[0]; } /* 2: select1wb */ { orc_union16 _src; _src.i = var35.i; var34 = _src.x2[1]; } /* 3: storeb */ ptr0[i] = var34; } } #else static void _backup_orc_unpack_yuyv_u (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var33; orc_int8 var34; orc_union16 var35; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr4[i]; /* 1: select0lw */ { orc_union32 _src; _src.i = var33.i; var35.i = _src.x2[0]; } /* 2: select1wb */ { orc_union16 _src; _src.i = var35.i; var34 = _src.x2[1]; } /* 3: storeb */ ptr0[i] = var34; } } OrcCode *_orc_code_orc_unpack_yuyv_u; void orc_unpack_yuyv_u (orc_uint8 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_unpack_yuyv_u; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_unpack_yuyv_v */ #ifdef DISABLE_ORC void orc_unpack_yuyv_v (orc_uint8 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n){ int i; orc_int8 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var33; orc_int8 var34; orc_union16 var35; ptr0 = (orc_int8 *)d1; ptr4 = (orc_union32 *)s1; for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr4[i]; /* 1: select1lw */ { orc_union32 _src; _src.i = var33.i; var35.i = _src.x2[1]; } /* 2: select1wb */ { orc_union16 _src; _src.i = var35.i; var34 = _src.x2[1]; } /* 3: storeb */ ptr0[i] = var34; } } #else static void _backup_orc_unpack_yuyv_v (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var33; orc_int8 var34; orc_union16 var35; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr4[i]; /* 1: select1lw */ { orc_union32 _src; _src.i = var33.i; var35.i = _src.x2[1]; } /* 2: select1wb */ { orc_union16 _src; _src.i = var35.i; var34 = _src.x2[1]; } /* 3: storeb */ ptr0[i] = var34; } } OrcCode *_orc_code_orc_unpack_yuyv_v; void orc_unpack_yuyv_v (orc_uint8 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_unpack_yuyv_v; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_packyuyv */ #ifdef DISABLE_ORC void orc_packyuyv (orc_uint32 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, const orc_uint8 * ORC_RESTRICT s3, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; orc_union16 var37; orc_int8 var38; orc_int8 var39; orc_union32 var40; orc_union16 var41; orc_int8 var42; orc_int8 var43; orc_union16 var44; orc_union16 var45; ptr0 = (orc_union32 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_int8 *)s2; ptr6 = (orc_int8 *)s3; for (i = 0; i < n; i++) { /* 0: loadw */ var37 = ptr4[i]; /* 1: copyw */ var41.i = var37.i; /* 2: select0wb */ { orc_union16 _src; _src.i = var41.i; var42 = _src.x2[0]; } /* 3: select1wb */ { orc_union16 _src; _src.i = var41.i; var43 = _src.x2[1]; } /* 4: loadb */ var38 = ptr5[i]; /* 5: mergebw */ { orc_union16 _dest; _dest.x2[0] = var42; _dest.x2[1] = var38; var44.i = _dest.i; } /* 6: loadb */ var39 = ptr6[i]; /* 7: mergebw */ { orc_union16 _dest; _dest.x2[0] = var43; _dest.x2[1] = var39; var45.i = _dest.i; } /* 8: mergewl */ { orc_union32 _dest; _dest.x2[0] = var44.i; _dest.x2[1] = var45.i; var40.i = _dest.i; } /* 9: storel */ ptr0[i] = var40; } } #else static void _backup_orc_packyuyv (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; orc_union16 var37; orc_int8 var38; orc_int8 var39; orc_union32 var40; orc_union16 var41; orc_int8 var42; orc_int8 var43; orc_union16 var44; orc_union16 var45; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_int8 *)ex->arrays[5]; ptr6 = (orc_int8 *)ex->arrays[6]; for (i = 0; i < n; i++) { /* 0: loadw */ var37 = ptr4[i]; /* 1: copyw */ var41.i = var37.i; /* 2: select0wb */ { orc_union16 _src; _src.i = var41.i; var42 = _src.x2[0]; } /* 3: select1wb */ { orc_union16 _src; _src.i = var41.i; var43 = _src.x2[1]; } /* 4: loadb */ var38 = ptr5[i]; /* 5: mergebw */ { orc_union16 _dest; _dest.x2[0] = var42; _dest.x2[1] = var38; var44.i = _dest.i; } /* 6: loadb */ var39 = ptr6[i]; /* 7: mergebw */ { orc_union16 _dest; _dest.x2[0] = var43; _dest.x2[1] = var39; var45.i = _dest.i; } /* 8: mergewl */ { orc_union32 _dest; _dest.x2[0] = var44.i; _dest.x2[1] = var45.i; var40.i = _dest.i; } /* 9: storel */ ptr0[i] = var40; } } OrcCode *_orc_code_orc_packyuyv; void orc_packyuyv (orc_uint32 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, const orc_uint8 * ORC_RESTRICT s3, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_packyuyv; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; func = c->exec; func (ex); } #endif /* orc_unpack_uyvy_y */ #ifdef DISABLE_ORC void orc_unpack_uyvy_y (orc_uint8 * ORC_RESTRICT d1, const orc_uint16 * ORC_RESTRICT s1, int n){ int i; orc_int8 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_int8 var33; ptr0 = (orc_int8 *)d1; ptr4 = (orc_union16 *)s1; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: select1wb */ { orc_union16 _src; _src.i = var32.i; var33 = _src.x2[1]; } /* 2: storeb */ ptr0[i] = var33; } } #else static void _backup_orc_unpack_uyvy_y (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_int8 var33; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: select1wb */ { orc_union16 _src; _src.i = var32.i; var33 = _src.x2[1]; } /* 2: storeb */ ptr0[i] = var33; } } OrcCode *_orc_code_orc_unpack_uyvy_y; void orc_unpack_uyvy_y (orc_uint8 * ORC_RESTRICT d1, const orc_uint16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_unpack_uyvy_y; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_unpack_uyvy_u */ #ifdef DISABLE_ORC void orc_unpack_uyvy_u (orc_uint8 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n){ int i; orc_int8 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var33; orc_int8 var34; orc_union16 var35; ptr0 = (orc_int8 *)d1; ptr4 = (orc_union32 *)s1; for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr4[i]; /* 1: select0lw */ { orc_union32 _src; _src.i = var33.i; var35.i = _src.x2[0]; } /* 2: select0wb */ { orc_union16 _src; _src.i = var35.i; var34 = _src.x2[0]; } /* 3: storeb */ ptr0[i] = var34; } } #else static void _backup_orc_unpack_uyvy_u (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var33; orc_int8 var34; orc_union16 var35; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr4[i]; /* 1: select0lw */ { orc_union32 _src; _src.i = var33.i; var35.i = _src.x2[0]; } /* 2: select0wb */ { orc_union16 _src; _src.i = var35.i; var34 = _src.x2[0]; } /* 3: storeb */ ptr0[i] = var34; } } OrcCode *_orc_code_orc_unpack_uyvy_u; void orc_unpack_uyvy_u (orc_uint8 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_unpack_uyvy_u; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_unpack_uyvy_v */ #ifdef DISABLE_ORC void orc_unpack_uyvy_v (orc_uint8 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n){ int i; orc_int8 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var33; orc_int8 var34; orc_union16 var35; ptr0 = (orc_int8 *)d1; ptr4 = (orc_union32 *)s1; for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr4[i]; /* 1: select1lw */ { orc_union32 _src; _src.i = var33.i; var35.i = _src.x2[1]; } /* 2: select0wb */ { orc_union16 _src; _src.i = var35.i; var34 = _src.x2[0]; } /* 3: storeb */ ptr0[i] = var34; } } #else static void _backup_orc_unpack_uyvy_v (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var33; orc_int8 var34; orc_union16 var35; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr4[i]; /* 1: select1lw */ { orc_union32 _src; _src.i = var33.i; var35.i = _src.x2[1]; } /* 2: select0wb */ { orc_union16 _src; _src.i = var35.i; var34 = _src.x2[0]; } /* 3: storeb */ ptr0[i] = var34; } } OrcCode *_orc_code_orc_unpack_uyvy_v; void orc_unpack_uyvy_v (orc_uint8 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_unpack_uyvy_v; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_interleave2_s16 */ #ifdef DISABLE_ORC void orc_interleave2_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var32; orc_union16 var33; orc_union32 var34; ptr0 = (orc_union32 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: loadw */ var33 = ptr5[i]; /* 2: mergewl */ { orc_union32 _dest; _dest.x2[0] = var32.i; _dest.x2[1] = var33.i; var34.i = _dest.i; } /* 3: storel */ ptr0[i] = var34; } } #else static void _backup_orc_interleave2_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var32; orc_union16 var33; orc_union32 var34; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: loadw */ var33 = ptr5[i]; /* 2: mergewl */ { orc_union32 _dest; _dest.x2[0] = var32.i; _dest.x2[1] = var33.i; var34.i = _dest.i; } /* 3: storel */ ptr0[i] = var34; } } OrcCode *_orc_code_orc_interleave2_s16; void orc_interleave2_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_interleave2_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_interleave2_rrshift1_s16 */ #ifdef DISABLE_ORC void orc_interleave2_rrshift1_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union32 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; ptr0 = (orc_union32 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; /* 1: loadpw */ var35.i = (int)0x00000001; /* 1 or 4.94066e-324f */ /* 5: loadpw */ var37.i = (int)0x00000001; /* 1 or 4.94066e-324f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 2: addw */ var39.i = var34.i + var35.i; /* 3: shrsw */ var40.i = var39.i >> 1; /* 4: loadw */ var36 = ptr5[i]; /* 6: addw */ var41.i = var36.i + var37.i; /* 7: shrsw */ var42.i = var41.i >> 1; /* 8: mergewl */ { orc_union32 _dest; _dest.x2[0] = var40.i; _dest.x2[1] = var42.i; var38.i = _dest.i; } /* 9: storel */ ptr0[i] = var38; } } #else static void _backup_orc_interleave2_rrshift1_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union32 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; /* 1: loadpw */ var35.i = (int)0x00000001; /* 1 or 4.94066e-324f */ /* 5: loadpw */ var37.i = (int)0x00000001; /* 1 or 4.94066e-324f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 2: addw */ var39.i = var34.i + var35.i; /* 3: shrsw */ var40.i = var39.i >> 1; /* 4: loadw */ var36 = ptr5[i]; /* 6: addw */ var41.i = var36.i + var37.i; /* 7: shrsw */ var42.i = var41.i >> 1; /* 8: mergewl */ { orc_union32 _dest; _dest.x2[0] = var40.i; _dest.x2[1] = var42.i; var38.i = _dest.i; } /* 9: storel */ ptr0[i] = var38; } } OrcCode *_orc_code_orc_interleave2_rrshift1_s16; void orc_interleave2_rrshift1_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_interleave2_rrshift1_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_deinterleave2_s16 */ #ifdef DISABLE_ORC void orc_deinterleave2_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)d1; ptr1 = (orc_union16 *)d2; ptr4 = (orc_union32 *)s1; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: splitlw */ { orc_union32 _src; _src.i = var32.i; var33.i = _src.x2[1]; var34.i = _src.x2[0]; } /* 2: storew */ ptr1[i] = var33; /* 3: storew */ ptr0[i] = var34; } } #else static void _backup_orc_deinterleave2_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)ex->arrays[0]; ptr1 = (orc_union16 *)ex->arrays[1]; ptr4 = (orc_union32 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: splitlw */ { orc_union32 _src; _src.i = var32.i; var33.i = _src.x2[1]; var34.i = _src.x2[0]; } /* 2: storew */ ptr1[i] = var33; /* 3: storew */ ptr0[i] = var34; } } OrcCode *_orc_code_orc_deinterleave2_s16; void orc_deinterleave2_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_deinterleave2_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_deinterleave2_s32 */ #ifdef DISABLE_ORC void orc_deinterleave2_s32 (orc_int32 * ORC_RESTRICT d1, orc_int32 * ORC_RESTRICT d2, const orc_int32 * ORC_RESTRICT s1, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; orc_union32 * ORC_RESTRICT ptr1; const orc_union64 * ORC_RESTRICT ptr4; orc_union64 var32; orc_union32 var33; orc_union32 var34; ptr0 = (orc_union32 *)d1; ptr1 = (orc_union32 *)d2; ptr4 = (orc_union64 *)s1; for (i = 0; i < n; i++) { /* 0: loadq */ var32 = ptr4[i]; /* 1: splitql */ { orc_union64 _src; _src.i = var32.i; var33.i = _src.x2[1]; var34.i = _src.x2[0]; } /* 2: storel */ ptr1[i] = var33; /* 3: storel */ ptr0[i] = var34; } } #else static void _backup_orc_deinterleave2_s32 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; orc_union32 * ORC_RESTRICT ptr1; const orc_union64 * ORC_RESTRICT ptr4; orc_union64 var32; orc_union32 var33; orc_union32 var34; ptr0 = (orc_union32 *)ex->arrays[0]; ptr1 = (orc_union32 *)ex->arrays[1]; ptr4 = (orc_union64 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadq */ var32 = ptr4[i]; /* 1: splitql */ { orc_union64 _src; _src.i = var32.i; var33.i = _src.x2[1]; var34.i = _src.x2[0]; } /* 2: storel */ ptr1[i] = var33; /* 3: storel */ ptr0[i] = var34; } } OrcCode *_orc_code_orc_deinterleave2_s32; void orc_deinterleave2_s32 (orc_int32 * ORC_RESTRICT d1, orc_int32 * ORC_RESTRICT d2, const orc_int32 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_deinterleave2_s32; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_deinterleave2_lshift1_s16 */ #ifdef DISABLE_ORC void orc_deinterleave2_lshift1_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var33; orc_union16 var34; orc_union16 var35; orc_union32 var36; ptr0 = (orc_union16 *)d1; ptr1 = (orc_union16 *)d2; ptr4 = (orc_union32 *)s1; for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr4[i]; /* 1: shlw */ var36.x2[0] = var33.x2[0] << 1; var36.x2[1] = var33.x2[1] << 1; /* 2: splitlw */ { orc_union32 _src; _src.i = var36.i; var34.i = _src.x2[1]; var35.i = _src.x2[0]; } /* 3: storew */ ptr1[i] = var34; /* 4: storew */ ptr0[i] = var35; } } #else static void _backup_orc_deinterleave2_lshift1_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var33; orc_union16 var34; orc_union16 var35; orc_union32 var36; ptr0 = (orc_union16 *)ex->arrays[0]; ptr1 = (orc_union16 *)ex->arrays[1]; ptr4 = (orc_union32 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr4[i]; /* 1: shlw */ var36.x2[0] = var33.x2[0] << 1; var36.x2[1] = var33.x2[1] << 1; /* 2: splitlw */ { orc_union32 _src; _src.i = var36.i; var34.i = _src.x2[1]; var35.i = _src.x2[0]; } /* 3: storew */ ptr1[i] = var34; /* 4: storew */ ptr0[i] = var35; } } OrcCode *_orc_code_orc_deinterleave2_lshift1_s16; void orc_deinterleave2_lshift1_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_deinterleave2_lshift1_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_deinterleave2_lshift1_s32 */ #ifdef DISABLE_ORC void orc_deinterleave2_lshift1_s32 (orc_int32 * ORC_RESTRICT d1, orc_int32 * ORC_RESTRICT d2, const orc_int32 * ORC_RESTRICT s1, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; orc_union32 * ORC_RESTRICT ptr1; const orc_union64 * ORC_RESTRICT ptr4; orc_union64 var33; orc_union32 var34; orc_union32 var35; orc_union64 var36; ptr0 = (orc_union32 *)d1; ptr1 = (orc_union32 *)d2; ptr4 = (orc_union64 *)s1; for (i = 0; i < n; i++) { /* 0: loadq */ var33 = ptr4[i]; /* 1: shll */ var36.x2[0] = var33.x2[0] << 1; var36.x2[1] = var33.x2[1] << 1; /* 2: splitql */ { orc_union64 _src; _src.i = var36.i; var34.i = _src.x2[1]; var35.i = _src.x2[0]; } /* 3: storel */ ptr1[i] = var34; /* 4: storel */ ptr0[i] = var35; } } #else static void _backup_orc_deinterleave2_lshift1_s32 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; orc_union32 * ORC_RESTRICT ptr1; const orc_union64 * ORC_RESTRICT ptr4; orc_union64 var33; orc_union32 var34; orc_union32 var35; orc_union64 var36; ptr0 = (orc_union32 *)ex->arrays[0]; ptr1 = (orc_union32 *)ex->arrays[1]; ptr4 = (orc_union64 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadq */ var33 = ptr4[i]; /* 1: shll */ var36.x2[0] = var33.x2[0] << 1; var36.x2[1] = var33.x2[1] << 1; /* 2: splitql */ { orc_union64 _src; _src.i = var36.i; var34.i = _src.x2[1]; var35.i = _src.x2[0]; } /* 3: storel */ ptr1[i] = var34; /* 4: storel */ ptr0[i] = var35; } } OrcCode *_orc_code_orc_deinterleave2_lshift1_s32; void orc_deinterleave2_lshift1_s32 (orc_int32 * ORC_RESTRICT d1, orc_int32 * ORC_RESTRICT d2, const orc_int32 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_deinterleave2_lshift1_s32; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_haar_deint_lshift1_split_s16 */ #ifdef DISABLE_ORC void orc_haar_deint_lshift1_split_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union32 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; ptr0 = (orc_union16 *)d1; ptr1 = (orc_union16 *)d2; ptr4 = (orc_union32 *)s1; /* 6: loadpw */ var37.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadl */ var35 = ptr4[i]; /* 1: shlw */ var39.x2[0] = var35.x2[0] << 1; var39.x2[1] = var35.x2[1] << 1; /* 2: splitlw */ { orc_union32 _src; _src.i = var39.i; var40.i = _src.x2[1]; var41.i = _src.x2[0]; } /* 3: subw */ var42.i = var40.i - var41.i; /* 4: copyw */ var36.i = var42.i; /* 5: storew */ ptr1[i] = var36; /* 7: avgsw */ var43.i = (var42.i + var37.i + 1)>>1; /* 8: addw */ var38.i = var41.i + var43.i; /* 9: storew */ ptr0[i] = var38; } } #else static void _backup_orc_haar_deint_lshift1_split_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union32 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; ptr0 = (orc_union16 *)ex->arrays[0]; ptr1 = (orc_union16 *)ex->arrays[1]; ptr4 = (orc_union32 *)ex->arrays[4]; /* 6: loadpw */ var37.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadl */ var35 = ptr4[i]; /* 1: shlw */ var39.x2[0] = var35.x2[0] << 1; var39.x2[1] = var35.x2[1] << 1; /* 2: splitlw */ { orc_union32 _src; _src.i = var39.i; var40.i = _src.x2[1]; var41.i = _src.x2[0]; } /* 3: subw */ var42.i = var40.i - var41.i; /* 4: copyw */ var36.i = var42.i; /* 5: storew */ ptr1[i] = var36; /* 7: avgsw */ var43.i = (var42.i + var37.i + 1)>>1; /* 8: addw */ var38.i = var41.i + var43.i; /* 9: storew */ ptr0[i] = var38; } } OrcCode *_orc_code_orc_haar_deint_lshift1_split_s16; void orc_haar_deint_lshift1_split_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_deint_lshift1_split_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_haar_deint_lshift1_split_s32 */ #ifdef DISABLE_ORC void orc_haar_deint_lshift1_split_s32 (orc_int32 * ORC_RESTRICT d1, orc_int32 * ORC_RESTRICT d2, const orc_int32 * ORC_RESTRICT s1, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; orc_union32 * ORC_RESTRICT ptr1; const orc_union64 * ORC_RESTRICT ptr4; orc_union64 var35; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union64 var39; orc_union32 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; ptr0 = (orc_union32 *)d1; ptr1 = (orc_union32 *)d2; ptr4 = (orc_union64 *)s1; /* 6: loadpl */ var37.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadq */ var35 = ptr4[i]; /* 1: shll */ var39.x2[0] = var35.x2[0] << 1; var39.x2[1] = var35.x2[1] << 1; /* 2: splitql */ { orc_union64 _src; _src.i = var39.i; var40.i = _src.x2[1]; var41.i = _src.x2[0]; } /* 3: subl */ var42.i = var40.i - var41.i; /* 4: copyl */ var36.i = var42.i; /* 5: storel */ ptr1[i] = var36; /* 7: avgsl */ var43.i = ((orc_int64)var42.i + (orc_int64)var37.i + 1)>>1; /* 8: addl */ var38.i = var41.i + var43.i; /* 9: storel */ ptr0[i] = var38; } } #else static void _backup_orc_haar_deint_lshift1_split_s32 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; orc_union32 * ORC_RESTRICT ptr1; const orc_union64 * ORC_RESTRICT ptr4; orc_union64 var35; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union64 var39; orc_union32 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; ptr0 = (orc_union32 *)ex->arrays[0]; ptr1 = (orc_union32 *)ex->arrays[1]; ptr4 = (orc_union64 *)ex->arrays[4]; /* 6: loadpl */ var37.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadq */ var35 = ptr4[i]; /* 1: shll */ var39.x2[0] = var35.x2[0] << 1; var39.x2[1] = var35.x2[1] << 1; /* 2: splitql */ { orc_union64 _src; _src.i = var39.i; var40.i = _src.x2[1]; var41.i = _src.x2[0]; } /* 3: subl */ var42.i = var40.i - var41.i; /* 4: copyl */ var36.i = var42.i; /* 5: storel */ ptr1[i] = var36; /* 7: avgsl */ var43.i = ((orc_int64)var42.i + (orc_int64)var37.i + 1)>>1; /* 8: addl */ var38.i = var41.i + var43.i; /* 9: storel */ ptr0[i] = var38; } } OrcCode *_orc_code_orc_haar_deint_lshift1_split_s32; void orc_haar_deint_lshift1_split_s32 (orc_int32 * ORC_RESTRICT d1, orc_int32 * ORC_RESTRICT d2, const orc_int32 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_deint_lshift1_split_s32; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_haar_deint_split_s16 */ #ifdef DISABLE_ORC void orc_haar_deint_split_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; ptr0 = (orc_union16 *)d1; ptr1 = (orc_union16 *)d2; ptr4 = (orc_union32 *)s1; /* 5: loadpw */ var36.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadl */ var34 = ptr4[i]; /* 1: splitlw */ { orc_union32 _src; _src.i = var34.i; var38.i = _src.x2[1]; var39.i = _src.x2[0]; } /* 2: subw */ var40.i = var38.i - var39.i; /* 3: copyw */ var35.i = var40.i; /* 4: storew */ ptr1[i] = var35; /* 6: avgsw */ var41.i = (var40.i + var36.i + 1)>>1; /* 7: addw */ var37.i = var39.i + var41.i; /* 8: storew */ ptr0[i] = var37; } } #else static void _backup_orc_haar_deint_split_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; ptr0 = (orc_union16 *)ex->arrays[0]; ptr1 = (orc_union16 *)ex->arrays[1]; ptr4 = (orc_union32 *)ex->arrays[4]; /* 5: loadpw */ var36.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadl */ var34 = ptr4[i]; /* 1: splitlw */ { orc_union32 _src; _src.i = var34.i; var38.i = _src.x2[1]; var39.i = _src.x2[0]; } /* 2: subw */ var40.i = var38.i - var39.i; /* 3: copyw */ var35.i = var40.i; /* 4: storew */ ptr1[i] = var35; /* 6: avgsw */ var41.i = (var40.i + var36.i + 1)>>1; /* 7: addw */ var37.i = var39.i + var41.i; /* 8: storew */ ptr0[i] = var37; } } OrcCode *_orc_code_orc_haar_deint_split_s16; void orc_haar_deint_split_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_deint_split_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_haar_deint_split_s32 */ #ifdef DISABLE_ORC void orc_haar_deint_split_s32 (orc_int32 * ORC_RESTRICT d1, orc_int32 * ORC_RESTRICT d2, const orc_int32 * ORC_RESTRICT s1, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; orc_union32 * ORC_RESTRICT ptr1; const orc_union64 * ORC_RESTRICT ptr4; orc_union64 var34; orc_union32 var35; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; orc_union32 var41; ptr0 = (orc_union32 *)d1; ptr1 = (orc_union32 *)d2; ptr4 = (orc_union64 *)s1; /* 5: loadpl */ var36.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadq */ var34 = ptr4[i]; /* 1: splitql */ { orc_union64 _src; _src.i = var34.i; var38.i = _src.x2[1]; var39.i = _src.x2[0]; } /* 2: subl */ var40.i = var38.i - var39.i; /* 3: copyl */ var35.i = var40.i; /* 4: storel */ ptr1[i] = var35; /* 6: avgsl */ var41.i = ((orc_int64)var40.i + (orc_int64)var36.i + 1)>>1; /* 7: addl */ var37.i = var39.i + var41.i; /* 8: storel */ ptr0[i] = var37; } } #else static void _backup_orc_haar_deint_split_s32 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; orc_union32 * ORC_RESTRICT ptr1; const orc_union64 * ORC_RESTRICT ptr4; orc_union64 var34; orc_union32 var35; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; orc_union32 var41; ptr0 = (orc_union32 *)ex->arrays[0]; ptr1 = (orc_union32 *)ex->arrays[1]; ptr4 = (orc_union64 *)ex->arrays[4]; /* 5: loadpl */ var36.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadq */ var34 = ptr4[i]; /* 1: splitql */ { orc_union64 _src; _src.i = var34.i; var38.i = _src.x2[1]; var39.i = _src.x2[0]; } /* 2: subl */ var40.i = var38.i - var39.i; /* 3: copyl */ var35.i = var40.i; /* 4: storel */ ptr1[i] = var35; /* 6: avgsl */ var41.i = ((orc_int64)var40.i + (orc_int64)var36.i + 1)>>1; /* 7: addl */ var37.i = var39.i + var41.i; /* 8: storel */ ptr0[i] = var37; } } OrcCode *_orc_code_orc_haar_deint_split_s32; void orc_haar_deint_split_s32 (orc_int32 * ORC_RESTRICT d1, orc_int32 * ORC_RESTRICT d2, const orc_int32 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_deint_split_s32; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_haar_split_s16_lo */ #ifdef DISABLE_ORC void orc_haar_split_s16_lo (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; /* 4: loadpw */ var36.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: copyw */ var38.i = var34.i; /* 2: loadw */ var35 = ptr5[i]; /* 3: subw */ var39.i = var35.i - var38.i; /* 5: avgsw */ var40.i = (var39.i + var36.i + 1)>>1; /* 6: addw */ var37.i = var38.i + var40.i; /* 7: storew */ ptr0[i] = var37; } } #else static void _backup_orc_haar_split_s16_lo (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; /* 4: loadpw */ var36.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: copyw */ var38.i = var34.i; /* 2: loadw */ var35 = ptr5[i]; /* 3: subw */ var39.i = var35.i - var38.i; /* 5: avgsw */ var40.i = (var39.i + var36.i + 1)>>1; /* 6: addw */ var37.i = var38.i + var40.i; /* 7: storew */ ptr0[i] = var37; } } OrcCode *_orc_code_orc_haar_split_s16_lo; void orc_haar_split_s16_lo (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_split_s16_lo; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_haar_split_s16_hi */ #ifdef DISABLE_ORC void orc_haar_split_s16_hi (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr5[i]; /* 1: loadw */ var33 = ptr4[i]; /* 2: subw */ var34.i = var32.i - var33.i; /* 3: storew */ ptr0[i] = var34; } } #else static void _backup_orc_haar_split_s16_hi (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr5[i]; /* 1: loadw */ var33 = ptr4[i]; /* 2: subw */ var34.i = var32.i - var33.i; /* 3: storew */ ptr0[i] = var34; } } OrcCode *_orc_code_orc_haar_split_s16_hi; void orc_haar_split_s16_hi (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_split_s16_hi; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_haar_split_s16_op */ #ifdef DISABLE_ORC void orc_haar_split_s16_op (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; ptr0 = (orc_union16 *)d1; ptr1 = (orc_union16 *)d2; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; /* 6: loadpw */ var37.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: copyw */ var39.i = var34.i; /* 2: loadw */ var35 = ptr5[i]; /* 3: subw */ var40.i = var35.i - var39.i; /* 4: copyw */ var36.i = var40.i; /* 5: storew */ ptr1[i] = var36; /* 7: avgsw */ var41.i = (var40.i + var37.i + 1)>>1; /* 8: addw */ var38.i = var39.i + var41.i; /* 9: storew */ ptr0[i] = var38; } } #else static void _backup_orc_haar_split_s16_op (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; ptr0 = (orc_union16 *)ex->arrays[0]; ptr1 = (orc_union16 *)ex->arrays[1]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; /* 6: loadpw */ var37.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: copyw */ var39.i = var34.i; /* 2: loadw */ var35 = ptr5[i]; /* 3: subw */ var40.i = var35.i - var39.i; /* 4: copyw */ var36.i = var40.i; /* 5: storew */ ptr1[i] = var36; /* 7: avgsw */ var41.i = (var40.i + var37.i + 1)>>1; /* 8: addw */ var38.i = var39.i + var41.i; /* 9: storew */ ptr0[i] = var38; } } OrcCode *_orc_code_orc_haar_split_s16_op; void orc_haar_split_s16_op (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_split_s16_op; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_haar_split_s32_op */ #ifdef DISABLE_ORC void orc_haar_split_s32_op (orc_int32 * ORC_RESTRICT d1, orc_int32 * ORC_RESTRICT d2, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; orc_union32 * ORC_RESTRICT ptr1; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var34; orc_union32 var35; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; orc_union32 var41; ptr0 = (orc_union32 *)d1; ptr1 = (orc_union32 *)d2; ptr4 = (orc_union32 *)s1; ptr5 = (orc_union32 *)s2; /* 6: loadpl */ var37.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadl */ var34 = ptr4[i]; /* 1: copyl */ var39.i = var34.i; /* 2: loadl */ var35 = ptr5[i]; /* 3: subl */ var40.i = var35.i - var39.i; /* 4: copyl */ var36.i = var40.i; /* 5: storel */ ptr1[i] = var36; /* 7: avgsl */ var41.i = ((orc_int64)var40.i + (orc_int64)var37.i + 1)>>1; /* 8: addl */ var38.i = var39.i + var41.i; /* 9: storel */ ptr0[i] = var38; } } #else static void _backup_orc_haar_split_s32_op (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; orc_union32 * ORC_RESTRICT ptr1; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var34; orc_union32 var35; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; orc_union32 var41; ptr0 = (orc_union32 *)ex->arrays[0]; ptr1 = (orc_union32 *)ex->arrays[1]; ptr4 = (orc_union32 *)ex->arrays[4]; ptr5 = (orc_union32 *)ex->arrays[5]; /* 6: loadpl */ var37.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadl */ var34 = ptr4[i]; /* 1: copyl */ var39.i = var34.i; /* 2: loadl */ var35 = ptr5[i]; /* 3: subl */ var40.i = var35.i - var39.i; /* 4: copyl */ var36.i = var40.i; /* 5: storel */ ptr1[i] = var36; /* 7: avgsl */ var41.i = ((orc_int64)var40.i + (orc_int64)var37.i + 1)>>1; /* 8: addl */ var38.i = var39.i + var41.i; /* 9: storel */ ptr0[i] = var38; } } OrcCode *_orc_code_orc_haar_split_s32_op; void orc_haar_split_s32_op (orc_int32 * ORC_RESTRICT d1, orc_int32 * ORC_RESTRICT d2, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_split_s32_op; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_haar_split_s16 */ #ifdef DISABLE_ORC void orc_haar_split_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; ptr0 = (orc_union16 *)d1; ptr1 = (orc_union16 *)d2; /* 7: loadpw */ var37.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr0[i]; /* 1: copyw */ var39.i = var34.i; /* 2: loadw */ var35 = ptr1[i]; /* 3: copyw */ var40.i = var35.i; /* 4: subw */ var41.i = var40.i - var39.i; /* 5: copyw */ var36.i = var41.i; /* 6: storew */ ptr1[i] = var36; /* 8: avgsw */ var42.i = (var41.i + var37.i + 1)>>1; /* 9: addw */ var38.i = var39.i + var42.i; /* 10: storew */ ptr0[i] = var38; } } #else static void _backup_orc_haar_split_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; ptr0 = (orc_union16 *)ex->arrays[0]; ptr1 = (orc_union16 *)ex->arrays[1]; /* 7: loadpw */ var37.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr0[i]; /* 1: copyw */ var39.i = var34.i; /* 2: loadw */ var35 = ptr1[i]; /* 3: copyw */ var40.i = var35.i; /* 4: subw */ var41.i = var40.i - var39.i; /* 5: copyw */ var36.i = var41.i; /* 6: storew */ ptr1[i] = var36; /* 8: avgsw */ var42.i = (var41.i + var37.i + 1)>>1; /* 9: addw */ var38.i = var39.i + var42.i; /* 10: storew */ ptr0[i] = var38; } } OrcCode *_orc_code_orc_haar_split_s16; void orc_haar_split_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_split_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; func = c->exec; func (ex); } #endif /* orc_haar_synth_s16_lo */ #ifdef DISABLE_ORC void orc_haar_synth_s16_lo (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; /* 1: loadpw */ var34.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr5[i]; /* 2: avgsw */ var37.i = (var33.i + var34.i + 1)>>1; /* 3: loadw */ var35 = ptr4[i]; /* 4: subw */ var36.i = var35.i - var37.i; /* 5: storew */ ptr0[i] = var36; } } #else static void _backup_orc_haar_synth_s16_lo (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; /* 1: loadpw */ var34.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr5[i]; /* 2: avgsw */ var37.i = (var33.i + var34.i + 1)>>1; /* 3: loadw */ var35 = ptr4[i]; /* 4: subw */ var36.i = var35.i - var37.i; /* 5: storew */ ptr0[i] = var36; } } OrcCode *_orc_code_orc_haar_synth_s16_lo; void orc_haar_synth_s16_lo (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_synth_s16_lo; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_haar_synth_s16_hi */ #ifdef DISABLE_ORC void orc_haar_synth_s16_hi (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; /* 2: loadpw */ var36.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var35 = ptr5[i]; /* 1: copyw */ var39.i = var35.i; /* 3: avgsw */ var40.i = (var39.i + var36.i + 1)>>1; /* 4: loadw */ var37 = ptr4[i]; /* 5: subw */ var41.i = var37.i - var40.i; /* 6: addw */ var38.i = var39.i + var41.i; /* 7: storew */ ptr0[i] = var38; } } #else static void _backup_orc_haar_synth_s16_hi (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; /* 2: loadpw */ var36.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var35 = ptr5[i]; /* 1: copyw */ var39.i = var35.i; /* 3: avgsw */ var40.i = (var39.i + var36.i + 1)>>1; /* 4: loadw */ var37 = ptr4[i]; /* 5: subw */ var41.i = var37.i - var40.i; /* 6: addw */ var38.i = var39.i + var41.i; /* 7: storew */ ptr0[i] = var38; } } OrcCode *_orc_code_orc_haar_synth_s16_hi; void orc_haar_synth_s16_hi (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_synth_s16_hi; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_haar_synth_s16_op */ #ifdef DISABLE_ORC void orc_haar_synth_s16_op (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; ptr0 = (orc_union16 *)d1; ptr1 = (orc_union16 *)d2; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; /* 2: loadpw */ var36.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var35 = ptr5[i]; /* 1: copyw */ var40.i = var35.i; /* 3: avgsw */ var41.i = (var40.i + var36.i + 1)>>1; /* 4: loadw */ var37 = ptr4[i]; /* 5: subw */ var42.i = var37.i - var41.i; /* 6: copyw */ var38.i = var42.i; /* 7: storew */ ptr0[i] = var38; /* 8: addw */ var39.i = var40.i + var42.i; /* 9: storew */ ptr1[i] = var39; } } #else static void _backup_orc_haar_synth_s16_op (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; ptr0 = (orc_union16 *)ex->arrays[0]; ptr1 = (orc_union16 *)ex->arrays[1]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; /* 2: loadpw */ var36.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var35 = ptr5[i]; /* 1: copyw */ var40.i = var35.i; /* 3: avgsw */ var41.i = (var40.i + var36.i + 1)>>1; /* 4: loadw */ var37 = ptr4[i]; /* 5: subw */ var42.i = var37.i - var41.i; /* 6: copyw */ var38.i = var42.i; /* 7: storew */ ptr0[i] = var38; /* 8: addw */ var39.i = var40.i + var42.i; /* 9: storew */ ptr1[i] = var39; } } OrcCode *_orc_code_orc_haar_synth_s16_op; void orc_haar_synth_s16_op (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_synth_s16_op; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_haar_synth_s16 */ #ifdef DISABLE_ORC void orc_haar_synth_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; ptr0 = (orc_union16 *)d1; ptr1 = (orc_union16 *)d2; /* 4: loadpw */ var37.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var35 = ptr0[i]; /* 1: copyw */ var40.i = var35.i; /* 2: loadw */ var36 = ptr1[i]; /* 3: copyw */ var41.i = var36.i; /* 5: avgsw */ var42.i = (var41.i + var37.i + 1)>>1; /* 6: subw */ var43.i = var40.i - var42.i; /* 7: copyw */ var38.i = var43.i; /* 8: storew */ ptr0[i] = var38; /* 9: addw */ var39.i = var41.i + var43.i; /* 10: storew */ ptr1[i] = var39; } } #else static void _backup_orc_haar_synth_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; ptr0 = (orc_union16 *)ex->arrays[0]; ptr1 = (orc_union16 *)ex->arrays[1]; /* 4: loadpw */ var37.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var35 = ptr0[i]; /* 1: copyw */ var40.i = var35.i; /* 2: loadw */ var36 = ptr1[i]; /* 3: copyw */ var41.i = var36.i; /* 5: avgsw */ var42.i = (var41.i + var37.i + 1)>>1; /* 6: subw */ var43.i = var40.i - var42.i; /* 7: copyw */ var38.i = var43.i; /* 8: storew */ ptr0[i] = var38; /* 9: addw */ var39.i = var41.i + var43.i; /* 10: storew */ ptr1[i] = var39; } } OrcCode *_orc_code_orc_haar_synth_s16; void orc_haar_synth_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_synth_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; func = c->exec; func (ex); } #endif /* orc_haar_synth_rrshift1_int_s16 */ #ifdef DISABLE_ORC void orc_haar_synth_rrshift1_int_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union32 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; ptr0 = (orc_union32 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; /* 2: loadpw */ var35.i = (int)0x00000000; /* 0 or 0f */ /* 7: loadpw */ var37.i = (int)0x00000000; /* 0 or 0f */ /* 9: loadpw */ var38.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr5[i]; /* 1: copyw */ var40.i = var34.i; /* 3: avgsw */ var41.i = (var40.i + var35.i + 1)>>1; /* 4: loadw */ var36 = ptr4[i]; /* 5: subw */ var42.i = var36.i - var41.i; /* 6: addw */ var43.i = var40.i + var42.i; /* 8: avgsw */ var44.i = (var42.i + var37.i + 1)>>1; /* 10: avgsw */ var45.i = (var43.i + var38.i + 1)>>1; /* 11: mergewl */ { orc_union32 _dest; _dest.x2[0] = var44.i; _dest.x2[1] = var45.i; var39.i = _dest.i; } /* 12: storel */ ptr0[i] = var39; } } #else static void _backup_orc_haar_synth_rrshift1_int_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union32 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; /* 2: loadpw */ var35.i = (int)0x00000000; /* 0 or 0f */ /* 7: loadpw */ var37.i = (int)0x00000000; /* 0 or 0f */ /* 9: loadpw */ var38.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr5[i]; /* 1: copyw */ var40.i = var34.i; /* 3: avgsw */ var41.i = (var40.i + var35.i + 1)>>1; /* 4: loadw */ var36 = ptr4[i]; /* 5: subw */ var42.i = var36.i - var41.i; /* 6: addw */ var43.i = var40.i + var42.i; /* 8: avgsw */ var44.i = (var42.i + var37.i + 1)>>1; /* 10: avgsw */ var45.i = (var43.i + var38.i + 1)>>1; /* 11: mergewl */ { orc_union32 _dest; _dest.x2[0] = var44.i; _dest.x2[1] = var45.i; var39.i = _dest.i; } /* 12: storel */ ptr0[i] = var39; } } OrcCode *_orc_code_orc_haar_synth_rrshift1_int_s16; void orc_haar_synth_rrshift1_int_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_synth_rrshift1_int_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_haar_synth_int_s16 */ #ifdef DISABLE_ORC void orc_haar_synth_int_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union32 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; ptr0 = (orc_union32 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; /* 2: loadpw */ var35.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr5[i]; /* 1: copyw */ var38.i = var34.i; /* 3: avgsw */ var39.i = (var38.i + var35.i + 1)>>1; /* 4: loadw */ var36 = ptr4[i]; /* 5: subw */ var40.i = var36.i - var39.i; /* 6: addw */ var41.i = var38.i + var40.i; /* 7: mergewl */ { orc_union32 _dest; _dest.x2[0] = var40.i; _dest.x2[1] = var41.i; var37.i = _dest.i; } /* 8: storel */ ptr0[i] = var37; } } #else static void _backup_orc_haar_synth_int_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union32 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; /* 2: loadpw */ var35.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr5[i]; /* 1: copyw */ var38.i = var34.i; /* 3: avgsw */ var39.i = (var38.i + var35.i + 1)>>1; /* 4: loadw */ var36 = ptr4[i]; /* 5: subw */ var40.i = var36.i - var39.i; /* 6: addw */ var41.i = var38.i + var40.i; /* 7: mergewl */ { orc_union32 _dest; _dest.x2[0] = var40.i; _dest.x2[1] = var41.i; var37.i = _dest.i; } /* 8: storel */ ptr0[i] = var37; } } OrcCode *_orc_code_orc_haar_synth_int_s16; void orc_haar_synth_int_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_synth_int_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_haar_sub_s16 */ #ifdef DISABLE_ORC void orc_haar_sub_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr0[i]; /* 1: loadw */ var33 = ptr4[i]; /* 2: subw */ var34.i = var32.i - var33.i; /* 3: storew */ ptr0[i] = var34; } } #else static void _backup_orc_haar_sub_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr0[i]; /* 1: loadw */ var33 = ptr4[i]; /* 2: subw */ var34.i = var32.i - var33.i; /* 3: storew */ ptr0[i] = var34; } } OrcCode *_orc_code_orc_haar_sub_s16; void orc_haar_sub_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_sub_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_haar_add_half_s16 */ #ifdef DISABLE_ORC void orc_haar_add_half_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; /* 1: loadpw */ var34.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 2: avgsw */ var37.i = (var33.i + var34.i + 1)>>1; /* 3: loadw */ var35 = ptr0[i]; /* 4: addw */ var36.i = var35.i + var37.i; /* 5: storew */ ptr0[i] = var36; } } #else static void _backup_orc_haar_add_half_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; /* 1: loadpw */ var34.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 2: avgsw */ var37.i = (var33.i + var34.i + 1)>>1; /* 3: loadw */ var35 = ptr0[i]; /* 4: addw */ var36.i = var35.i + var37.i; /* 5: storew */ ptr0[i] = var36; } } OrcCode *_orc_code_orc_haar_add_half_s16; void orc_haar_add_half_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_add_half_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_haar_add_s16 */ #ifdef DISABLE_ORC void orc_haar_add_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr0[i]; /* 1: loadw */ var33 = ptr4[i]; /* 2: addw */ var34.i = var32.i + var33.i; /* 3: storew */ ptr0[i] = var34; } } #else static void _backup_orc_haar_add_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr0[i]; /* 1: loadw */ var33 = ptr4[i]; /* 2: addw */ var34.i = var32.i + var33.i; /* 3: storew */ ptr0[i] = var34; } } OrcCode *_orc_code_orc_haar_add_s16; void orc_haar_add_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_add_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_haar_sub_half_s16 */ #ifdef DISABLE_ORC void orc_haar_sub_half_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; /* 1: loadpw */ var34.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 2: avgsw */ var37.i = (var33.i + var34.i + 1)>>1; /* 3: loadw */ var35 = ptr0[i]; /* 4: subw */ var36.i = var35.i - var37.i; /* 5: storew */ ptr0[i] = var36; } } #else static void _backup_orc_haar_sub_half_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; /* 1: loadpw */ var34.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 2: avgsw */ var37.i = (var33.i + var34.i + 1)>>1; /* 3: loadw */ var35 = ptr0[i]; /* 4: subw */ var36.i = var35.i - var37.i; /* 5: storew */ ptr0[i] = var36; } } OrcCode *_orc_code_orc_haar_sub_half_s16; void orc_haar_sub_half_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_sub_half_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_sum_u8 */ #ifdef DISABLE_ORC void orc_sum_u8 (orc_int32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int n){ int i; const orc_int8 * ORC_RESTRICT ptr4; orc_union32 var12 = { 0 }; orc_int8 var34; orc_union16 var35; orc_union32 var36; ptr4 = (orc_int8 *)s1; for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var35.i = (orc_uint8)var34; /* 2: convuwl */ var36.i = (orc_uint16)var35.i; /* 3: accl */ var12.i = var12.i + var36.i; } *a1 = var12.i; } #else static void _backup_orc_sum_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; const orc_int8 * ORC_RESTRICT ptr4; orc_union32 var12 = { 0 }; orc_int8 var34; orc_union16 var35; orc_union32 var36; ptr4 = (orc_int8 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var35.i = (orc_uint8)var34; /* 2: convuwl */ var36.i = (orc_uint16)var35.i; /* 3: accl */ var12.i = var12.i + var36.i; } ex->accumulators[0] = var12.i; } OrcCode *_orc_code_orc_sum_u8; void orc_sum_u8 (orc_int32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_sum_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); *a1 = orc_executor_get_accumulator (ex, ORC_VAR_A1); } #endif /* orc_sum_s16 */ #ifdef DISABLE_ORC void orc_sum_s16 (orc_int32 * ORC_RESTRICT a1, const orc_int16 * ORC_RESTRICT s1, int n){ int i; const orc_union16 * ORC_RESTRICT ptr4; orc_union32 var12 = { 0 }; orc_union16 var33; orc_union32 var34; ptr4 = (orc_union16 *)s1; for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 1: convswl */ var34.i = var33.i; /* 2: accl */ var12.i = var12.i + var34.i; } *a1 = var12.i; } #else static void _backup_orc_sum_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; const orc_union16 * ORC_RESTRICT ptr4; orc_union32 var12 = { 0 }; orc_union16 var33; orc_union32 var34; ptr4 = (orc_union16 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 1: convswl */ var34.i = var33.i; /* 2: accl */ var12.i = var12.i + var34.i; } ex->accumulators[0] = var12.i; } OrcCode *_orc_code_orc_sum_s16; void orc_sum_s16 (orc_int32 * ORC_RESTRICT a1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_sum_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); *a1 = orc_executor_get_accumulator (ex, ORC_VAR_A1); } #endif /* orc_sum_square_diff_u8 */ #ifdef DISABLE_ORC void orc_sum_square_diff_u8 (orc_int32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n){ int i; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_union32 var12 = { 0 }; orc_int8 var35; orc_int8 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union32 var41; ptr4 = (orc_int8 *)s1; ptr5 = (orc_int8 *)s2; for (i = 0; i < n; i++) { /* 0: loadb */ var35 = ptr4[i]; /* 1: convubw */ var37.i = (orc_uint8)var35; /* 2: loadb */ var36 = ptr5[i]; /* 3: convubw */ var38.i = (orc_uint8)var36; /* 4: subw */ var39.i = var37.i - var38.i; /* 5: mullw */ var40.i = (var39.i * var39.i) & 0xffff; /* 6: convuwl */ var41.i = (orc_uint16)var40.i; /* 7: accl */ var12.i = var12.i + var41.i; } *a1 = var12.i; } #else static void _backup_orc_sum_square_diff_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_union32 var12 = { 0 }; orc_int8 var35; orc_int8 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union32 var41; ptr4 = (orc_int8 *)ex->arrays[4]; ptr5 = (orc_int8 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadb */ var35 = ptr4[i]; /* 1: convubw */ var37.i = (orc_uint8)var35; /* 2: loadb */ var36 = ptr5[i]; /* 3: convubw */ var38.i = (orc_uint8)var36; /* 4: subw */ var39.i = var37.i - var38.i; /* 5: mullw */ var40.i = (var39.i * var39.i) & 0xffff; /* 6: convuwl */ var41.i = (orc_uint16)var40.i; /* 7: accl */ var12.i = var12.i + var41.i; } ex->accumulators[0] = var12.i; } OrcCode *_orc_code_orc_sum_square_diff_u8; void orc_sum_square_diff_u8 (orc_int32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_sum_square_diff_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); *a1 = orc_executor_get_accumulator (ex, ORC_VAR_A1); } #endif /* orc_dequantise_s16_2d_4xn */ #ifdef DISABLE_ORC void orc_dequantise_s16_2d_4xn (orc_int16 * ORC_RESTRICT d1, int d1_stride, const orc_int16 * ORC_RESTRICT s1, int s1_stride, int p1, int p2, int m){ int i; int j; int n = 4; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); /* 4: loadpw */ var35.i = p1; /* 6: loadpw */ var36.i = p2; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 5: mullw */ var41.i = (var40.i * var35.i) & 0xffff; /* 7: addw */ var42.i = var41.i + var36.i; /* 8: shrsw */ var43.i = var42.i >> 2; /* 9: mullw */ var37.i = (var43.i * var39.i) & 0xffff; /* 10: storew */ ptr0[i] = var37; } } } #else static void _backup_orc_dequantise_s16_2d_4xn (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 4; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); /* 4: loadpw */ var35.i = ex->params[24]; /* 6: loadpw */ var36.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 5: mullw */ var41.i = (var40.i * var35.i) & 0xffff; /* 7: addw */ var42.i = var41.i + var36.i; /* 8: shrsw */ var43.i = var42.i >> 2; /* 9: mullw */ var37.i = (var43.i * var39.i) & 0xffff; /* 10: storew */ ptr0[i] = var37; } } } OrcCode *_orc_code_orc_dequantise_s16_2d_4xn; void orc_dequantise_s16_2d_4xn (orc_int16 * ORC_RESTRICT d1, int d1_stride, const orc_int16 * ORC_RESTRICT s1, int s1_stride, int p1, int p2, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_dequantise_s16_2d_4xn; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 4; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } #endif /* orc_dequantise_s16_2d_8xn */ #ifdef DISABLE_ORC void orc_dequantise_s16_2d_8xn (orc_int16 * ORC_RESTRICT d1, int d1_stride, const orc_int16 * ORC_RESTRICT s1, int s1_stride, int p1, int p2, int m){ int i; int j; int n = 8; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); /* 4: loadpw */ var35.i = p1; /* 6: loadpw */ var36.i = p2; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 5: mullw */ var41.i = (var40.i * var35.i) & 0xffff; /* 7: addw */ var42.i = var41.i + var36.i; /* 8: shrsw */ var43.i = var42.i >> 2; /* 9: mullw */ var37.i = (var43.i * var39.i) & 0xffff; /* 10: storew */ ptr0[i] = var37; } } } #else static void _backup_orc_dequantise_s16_2d_8xn (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 8; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); /* 4: loadpw */ var35.i = ex->params[24]; /* 6: loadpw */ var36.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 5: mullw */ var41.i = (var40.i * var35.i) & 0xffff; /* 7: addw */ var42.i = var41.i + var36.i; /* 8: shrsw */ var43.i = var42.i >> 2; /* 9: mullw */ var37.i = (var43.i * var39.i) & 0xffff; /* 10: storew */ ptr0[i] = var37; } } } OrcCode *_orc_code_orc_dequantise_s16_2d_8xn; void orc_dequantise_s16_2d_8xn (orc_int16 * ORC_RESTRICT d1, int d1_stride, const orc_int16 * ORC_RESTRICT s1, int s1_stride, int p1, int p2, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_dequantise_s16_2d_8xn; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 8; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } #endif /* orc_dequantise_s16_ip_2d_8xn */ #ifdef DISABLE_ORC void orc_dequantise_s16_ip_2d_8xn (orc_int16 * ORC_RESTRICT d1, int d1_stride, int p1, int p2, int m){ int i; int j; int n = 8; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); /* 4: loadpw */ var35.i = p1; /* 6: loadpw */ var36.i = p2; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr0[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 5: mullw */ var41.i = (var40.i * var35.i) & 0xffff; /* 7: addw */ var42.i = var41.i + var36.i; /* 8: shrsw */ var43.i = var42.i >> 2; /* 9: mullw */ var37.i = (var43.i * var39.i) & 0xffff; /* 10: storew */ ptr0[i] = var37; } } } #else static void _backup_orc_dequantise_s16_ip_2d_8xn (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 8; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); /* 4: loadpw */ var35.i = ex->params[24]; /* 6: loadpw */ var36.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr0[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 5: mullw */ var41.i = (var40.i * var35.i) & 0xffff; /* 7: addw */ var42.i = var41.i + var36.i; /* 8: shrsw */ var43.i = var42.i >> 2; /* 9: mullw */ var37.i = (var43.i * var39.i) & 0xffff; /* 10: storew */ ptr0[i] = var37; } } } OrcCode *_orc_code_orc_dequantise_s16_ip_2d_8xn; void orc_dequantise_s16_ip_2d_8xn (orc_int16 * ORC_RESTRICT d1, int d1_stride, int p1, int p2, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_dequantise_s16_ip_2d_8xn; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 8; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } #endif /* orc_dequantise_s16_ip_2d */ #ifdef DISABLE_ORC void orc_dequantise_s16_ip_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, int p1, int p2, int n, int m){ int i; int j; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); /* 4: loadpw */ var35.i = p1; /* 6: loadpw */ var36.i = p2; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr0[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 5: mullw */ var41.i = (var40.i * var35.i) & 0xffff; /* 7: addw */ var42.i = var41.i + var36.i; /* 8: shrsw */ var43.i = var42.i >> 2; /* 9: mullw */ var37.i = (var43.i * var39.i) & 0xffff; /* 10: storew */ ptr0[i] = var37; } } } #else static void _backup_orc_dequantise_s16_ip_2d (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); /* 4: loadpw */ var35.i = ex->params[24]; /* 6: loadpw */ var36.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr0[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 5: mullw */ var41.i = (var40.i * var35.i) & 0xffff; /* 7: addw */ var42.i = var41.i + var36.i; /* 8: shrsw */ var43.i = var42.i >> 2; /* 9: mullw */ var37.i = (var43.i * var39.i) & 0xffff; /* 10: storew */ ptr0[i] = var37; } } } OrcCode *_orc_code_orc_dequantise_s16_ip_2d; void orc_dequantise_s16_ip_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, int p1, int p2, int n, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_dequantise_s16_ip_2d; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } #endif /* orc_dequantise_s16_ip */ #ifdef DISABLE_ORC void orc_dequantise_s16_ip (orc_int16 * ORC_RESTRICT d1, int p1, int p2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; ptr0 = (orc_union16 *)d1; /* 4: loadpw */ var35.i = p1; /* 6: loadpw */ var36.i = p2; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr0[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 5: mullw */ var41.i = (var40.i * var35.i) & 0xffff; /* 7: addw */ var42.i = var41.i + var36.i; /* 8: shrsw */ var43.i = var42.i >> 2; /* 9: mullw */ var37.i = (var43.i * var39.i) & 0xffff; /* 10: storew */ ptr0[i] = var37; } } #else static void _backup_orc_dequantise_s16_ip (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; ptr0 = (orc_union16 *)ex->arrays[0]; /* 4: loadpw */ var35.i = ex->params[24]; /* 6: loadpw */ var36.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr0[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 5: mullw */ var41.i = (var40.i * var35.i) & 0xffff; /* 7: addw */ var42.i = var41.i + var36.i; /* 8: shrsw */ var43.i = var42.i >> 2; /* 9: mullw */ var37.i = (var43.i * var39.i) & 0xffff; /* 10: storew */ ptr0[i] = var37; } } OrcCode *_orc_code_orc_dequantise_s16_ip; void orc_dequantise_s16_ip (orc_int16 * ORC_RESTRICT d1, int p1, int p2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_dequantise_s16_ip; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } #endif /* orc_dequantise_s16 */ #ifdef DISABLE_ORC void orc_dequantise_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int p1, int p2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; /* 4: loadpw */ var35.i = p1; /* 6: loadpw */ var36.i = p2; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 5: mullw */ var41.i = (var40.i * var35.i) & 0xffff; /* 7: addw */ var42.i = var41.i + var36.i; /* 8: shrsw */ var43.i = var42.i >> 2; /* 9: mullw */ var37.i = (var43.i * var39.i) & 0xffff; /* 10: storew */ ptr0[i] = var37; } } #else static void _backup_orc_dequantise_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; /* 4: loadpw */ var35.i = ex->params[24]; /* 6: loadpw */ var36.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 5: mullw */ var41.i = (var40.i * var35.i) & 0xffff; /* 7: addw */ var42.i = var41.i + var36.i; /* 8: shrsw */ var43.i = var42.i >> 2; /* 9: mullw */ var37.i = (var43.i * var39.i) & 0xffff; /* 10: storew */ ptr0[i] = var37; } } OrcCode *_orc_code_orc_dequantise_s16; void orc_dequantise_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int p1, int p2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_dequantise_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } #endif /* orc_dequantise_var_s16_ip */ #ifdef DISABLE_ORC void orc_dequantise_var_s16_ip (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr0[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 4: loadw */ var35 = ptr4[i]; /* 5: mullw */ var41.i = (var40.i * var35.i) & 0xffff; /* 6: loadw */ var36 = ptr5[i]; /* 7: addw */ var42.i = var41.i + var36.i; /* 8: shrsw */ var43.i = var42.i >> 2; /* 9: mullw */ var37.i = (var43.i * var39.i) & 0xffff; /* 10: storew */ ptr0[i] = var37; } } #else static void _backup_orc_dequantise_var_s16_ip (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr0[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 4: loadw */ var35 = ptr4[i]; /* 5: mullw */ var41.i = (var40.i * var35.i) & 0xffff; /* 6: loadw */ var36 = ptr5[i]; /* 7: addw */ var42.i = var41.i + var36.i; /* 8: shrsw */ var43.i = var42.i >> 2; /* 9: mullw */ var37.i = (var43.i * var39.i) & 0xffff; /* 10: storew */ ptr0[i] = var37; } } OrcCode *_orc_code_orc_dequantise_var_s16_ip; void orc_dequantise_var_s16_ip (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_dequantise_var_s16_ip; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_quantise1_s16 */ #ifdef DISABLE_ORC void orc_quantise1_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int p1, int p2, int p3, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; /* 5: loadpw */ var35.i = p2; /* 7: loadpw */ var36.i = p1; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 4: shlw */ var41.i = var40.i << 2; /* 6: subw */ var42.i = var41.i - var35.i; /* 8: mulhuw */ var43.i = ((orc_uint32)((orc_uint16)var42.i) * (orc_uint32)((orc_uint16)var36.i)) >> 16; /* 9: shruw */ var44.i = ((orc_uint16)var43.i) >> p3; /* 10: mullw */ var37.i = (var44.i * var39.i) & 0xffff; /* 11: storew */ ptr0[i] = var37; } } #else static void _backup_orc_quantise1_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; /* 5: loadpw */ var35.i = ex->params[25]; /* 7: loadpw */ var36.i = ex->params[24]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 4: shlw */ var41.i = var40.i << 2; /* 6: subw */ var42.i = var41.i - var35.i; /* 8: mulhuw */ var43.i = ((orc_uint32)((orc_uint16)var42.i) * (orc_uint32)((orc_uint16)var36.i)) >> 16; /* 9: shruw */ var44.i = ((orc_uint16)var43.i) >> ex->params[26]; /* 10: mullw */ var37.i = (var44.i * var39.i) & 0xffff; /* 11: storew */ ptr0[i] = var37; } } OrcCode *_orc_code_orc_quantise1_s16; void orc_quantise1_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int p1, int p2, int p3, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_quantise1_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; func = c->exec; func (ex); } #endif /* orc_quantise2_s16 */ #ifdef DISABLE_ORC void orc_quantise2_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int p1, int p2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; /* 5: loadpw */ var35.i = p2; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: copyw */ var37.i = var34.i; /* 2: signw */ var38.i = ORC_CLAMP(var37.i,-1,1); /* 3: absw */ var39.i = ORC_ABS(var37.i); /* 4: shlw */ var40.i = var39.i << 2; /* 6: subw */ var41.i = var40.i - var35.i; /* 7: shruw */ var42.i = ((orc_uint16)var41.i) >> p1; /* 8: mullw */ var36.i = (var42.i * var38.i) & 0xffff; /* 9: storew */ ptr0[i] = var36; } } #else static void _backup_orc_quantise2_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; /* 5: loadpw */ var35.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: copyw */ var37.i = var34.i; /* 2: signw */ var38.i = ORC_CLAMP(var37.i,-1,1); /* 3: absw */ var39.i = ORC_ABS(var37.i); /* 4: shlw */ var40.i = var39.i << 2; /* 6: subw */ var41.i = var40.i - var35.i; /* 7: shruw */ var42.i = ((orc_uint16)var41.i) >> ex->params[24]; /* 8: mullw */ var36.i = (var42.i * var38.i) & 0xffff; /* 9: storew */ ptr0[i] = var36; } } OrcCode *_orc_code_orc_quantise2_s16; void orc_quantise2_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int p1, int p2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_quantise2_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } #endif /* orc_quantdequant1_s16 */ #ifdef DISABLE_ORC void orc_quantdequant1_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, int p1, int p2, int p3, int p4, int p5, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; ptr0 = (orc_union16 *)d1; ptr1 = (orc_union16 *)d2; /* 5: loadpw */ var35.i = p2; /* 7: loadpw */ var36.i = p1; /* 14: loadpw */ var38.i = p4; /* 16: loadpw */ var39.i = p5; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr1[i]; /* 1: copyw */ var41.i = var34.i; /* 2: signw */ var42.i = ORC_CLAMP(var41.i,-1,1); /* 3: absw */ var43.i = ORC_ABS(var41.i); /* 4: shlw */ var44.i = var43.i << 2; /* 6: subw */ var45.i = var44.i - var35.i; /* 8: mulhuw */ var46.i = ((orc_uint32)((orc_uint16)var45.i) * (orc_uint32)((orc_uint16)var36.i)) >> 16; /* 9: shruw */ var47.i = ((orc_uint16)var46.i) >> p3; /* 10: mullw */ var48.i = (var47.i * var42.i) & 0xffff; /* 11: copyw */ var37.i = var48.i; /* 12: storew */ ptr0[i] = var37; /* 13: signw */ var49.i = ORC_CLAMP(var48.i,-1,1); /* 15: mullw */ var50.i = (var47.i * var38.i) & 0xffff; /* 17: addw */ var51.i = var50.i + var39.i; /* 18: shrsw */ var52.i = var51.i >> 2; /* 19: mullw */ var40.i = (var52.i * var49.i) & 0xffff; /* 20: storew */ ptr1[i] = var40; } } #else static void _backup_orc_quantdequant1_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; ptr0 = (orc_union16 *)ex->arrays[0]; ptr1 = (orc_union16 *)ex->arrays[1]; /* 5: loadpw */ var35.i = ex->params[25]; /* 7: loadpw */ var36.i = ex->params[24]; /* 14: loadpw */ var38.i = ex->params[27]; /* 16: loadpw */ var39.i = ex->params[28]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr1[i]; /* 1: copyw */ var41.i = var34.i; /* 2: signw */ var42.i = ORC_CLAMP(var41.i,-1,1); /* 3: absw */ var43.i = ORC_ABS(var41.i); /* 4: shlw */ var44.i = var43.i << 2; /* 6: subw */ var45.i = var44.i - var35.i; /* 8: mulhuw */ var46.i = ((orc_uint32)((orc_uint16)var45.i) * (orc_uint32)((orc_uint16)var36.i)) >> 16; /* 9: shruw */ var47.i = ((orc_uint16)var46.i) >> ex->params[26]; /* 10: mullw */ var48.i = (var47.i * var42.i) & 0xffff; /* 11: copyw */ var37.i = var48.i; /* 12: storew */ ptr0[i] = var37; /* 13: signw */ var49.i = ORC_CLAMP(var48.i,-1,1); /* 15: mullw */ var50.i = (var47.i * var38.i) & 0xffff; /* 17: addw */ var51.i = var50.i + var39.i; /* 18: shrsw */ var52.i = var51.i >> 2; /* 19: mullw */ var40.i = (var52.i * var49.i) & 0xffff; /* 20: storew */ ptr1[i] = var40; } } OrcCode *_orc_code_orc_quantdequant1_s16; void orc_quantdequant1_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, int p1, int p2, int p3, int p4, int p5, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_quantdequant1_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; ex->params[ORC_VAR_P5] = p5; func = c->exec; func (ex); } #endif /* orc_quantdequant3_s16 */ #ifdef DISABLE_ORC void orc_quantdequant3_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, int p1, int p2, int p3, int p4, int p5, int p6, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union32 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union32 var48; orc_union32 var49; orc_union32 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union16 var54; orc_union16 var55; orc_union16 var56; ptr0 = (orc_union16 *)d1; ptr1 = (orc_union16 *)d2; /* 5: loadpw */ var36.i = p2; /* 7: loadpw */ var37.i = p1; /* 9: loadpl */ var38.i = p6; /* 17: loadpw */ var40.i = p4; /* 19: loadpw */ var41.i = p5; for (i = 0; i < n; i++) { /* 0: loadw */ var35 = ptr1[i]; /* 1: copyw */ var43.i = var35.i; /* 2: signw */ var44.i = ORC_CLAMP(var43.i,-1,1); /* 3: absw */ var45.i = ORC_ABS(var43.i); /* 4: shlw */ var46.i = var45.i << 2; /* 6: subw */ var47.i = var46.i - var36.i; /* 8: muluwl */ var48.i = ((orc_uint16)var47.i) * ((orc_uint16)var37.i); /* 10: addl */ var49.i = var48.i + var38.i; /* 11: shrul */ var50.i = ((orc_uint32)var49.i) >> p3; /* 12: convlw */ var51.i = var50.i; /* 13: mullw */ var52.i = (var51.i * var44.i) & 0xffff; /* 14: copyw */ var39.i = var52.i; /* 15: storew */ ptr0[i] = var39; /* 16: signw */ var53.i = ORC_CLAMP(var52.i,-1,1); /* 18: mullw */ var54.i = (var51.i * var40.i) & 0xffff; /* 20: addw */ var55.i = var54.i + var41.i; /* 21: shrsw */ var56.i = var55.i >> 2; /* 22: mullw */ var42.i = (var56.i * var53.i) & 0xffff; /* 23: storew */ ptr1[i] = var42; } } #else static void _backup_orc_quantdequant3_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union32 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union32 var48; orc_union32 var49; orc_union32 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union16 var54; orc_union16 var55; orc_union16 var56; ptr0 = (orc_union16 *)ex->arrays[0]; ptr1 = (orc_union16 *)ex->arrays[1]; /* 5: loadpw */ var36.i = ex->params[25]; /* 7: loadpw */ var37.i = ex->params[24]; /* 9: loadpl */ var38.i = ex->params[29]; /* 17: loadpw */ var40.i = ex->params[27]; /* 19: loadpw */ var41.i = ex->params[28]; for (i = 0; i < n; i++) { /* 0: loadw */ var35 = ptr1[i]; /* 1: copyw */ var43.i = var35.i; /* 2: signw */ var44.i = ORC_CLAMP(var43.i,-1,1); /* 3: absw */ var45.i = ORC_ABS(var43.i); /* 4: shlw */ var46.i = var45.i << 2; /* 6: subw */ var47.i = var46.i - var36.i; /* 8: muluwl */ var48.i = ((orc_uint16)var47.i) * ((orc_uint16)var37.i); /* 10: addl */ var49.i = var48.i + var38.i; /* 11: shrul */ var50.i = ((orc_uint32)var49.i) >> ex->params[26]; /* 12: convlw */ var51.i = var50.i; /* 13: mullw */ var52.i = (var51.i * var44.i) & 0xffff; /* 14: copyw */ var39.i = var52.i; /* 15: storew */ ptr0[i] = var39; /* 16: signw */ var53.i = ORC_CLAMP(var52.i,-1,1); /* 18: mullw */ var54.i = (var51.i * var40.i) & 0xffff; /* 20: addw */ var55.i = var54.i + var41.i; /* 21: shrsw */ var56.i = var55.i >> 2; /* 22: mullw */ var42.i = (var56.i * var53.i) & 0xffff; /* 23: storew */ ptr1[i] = var42; } } OrcCode *_orc_code_orc_quantdequant3_s16; void orc_quantdequant3_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, int p1, int p2, int p3, int p4, int p5, int p6, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_quantdequant3_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; ex->params[ORC_VAR_P5] = p5; ex->params[ORC_VAR_P6] = p6; func = c->exec; func (ex); } #endif /* orc_quantdequant2_s16 */ #ifdef DISABLE_ORC void orc_quantdequant2_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, int p1, int p2, int p3, int p4, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; ptr0 = (orc_union16 *)d1; ptr1 = (orc_union16 *)d2; /* 5: loadpw */ var35.i = p2; /* 12: loadpw */ var37.i = p3; /* 14: loadpw */ var38.i = p4; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr1[i]; /* 1: copyw */ var40.i = var34.i; /* 2: signw */ var41.i = ORC_CLAMP(var40.i,-1,1); /* 3: absw */ var42.i = ORC_ABS(var40.i); /* 4: shlw */ var43.i = var42.i << 2; /* 6: subw */ var44.i = var43.i - var35.i; /* 7: shruw */ var45.i = ((orc_uint16)var44.i) >> p1; /* 8: mullw */ var46.i = (var45.i * var41.i) & 0xffff; /* 9: copyw */ var36.i = var46.i; /* 10: storew */ ptr0[i] = var36; /* 11: signw */ var47.i = ORC_CLAMP(var46.i,-1,1); /* 13: mullw */ var48.i = (var45.i * var37.i) & 0xffff; /* 15: addw */ var49.i = var48.i + var38.i; /* 16: shrsw */ var50.i = var49.i >> 2; /* 17: mullw */ var39.i = (var50.i * var47.i) & 0xffff; /* 18: storew */ ptr1[i] = var39; } } #else static void _backup_orc_quantdequant2_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; ptr0 = (orc_union16 *)ex->arrays[0]; ptr1 = (orc_union16 *)ex->arrays[1]; /* 5: loadpw */ var35.i = ex->params[25]; /* 12: loadpw */ var37.i = ex->params[26]; /* 14: loadpw */ var38.i = ex->params[27]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr1[i]; /* 1: copyw */ var40.i = var34.i; /* 2: signw */ var41.i = ORC_CLAMP(var40.i,-1,1); /* 3: absw */ var42.i = ORC_ABS(var40.i); /* 4: shlw */ var43.i = var42.i << 2; /* 6: subw */ var44.i = var43.i - var35.i; /* 7: shruw */ var45.i = ((orc_uint16)var44.i) >> ex->params[24]; /* 8: mullw */ var46.i = (var45.i * var41.i) & 0xffff; /* 9: copyw */ var36.i = var46.i; /* 10: storew */ ptr0[i] = var36; /* 11: signw */ var47.i = ORC_CLAMP(var46.i,-1,1); /* 13: mullw */ var48.i = (var45.i * var37.i) & 0xffff; /* 15: addw */ var49.i = var48.i + var38.i; /* 16: shrsw */ var50.i = var49.i >> 2; /* 17: mullw */ var39.i = (var50.i * var47.i) & 0xffff; /* 18: storew */ ptr1[i] = var39; } } OrcCode *_orc_code_orc_quantdequant2_s16; void orc_quantdequant2_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, int p1, int p2, int p3, int p4, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_quantdequant2_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; func = c->exec; func (ex); } #endif /* orc_downsample_vert_u8 */ #ifdef DISABLE_ORC void orc_downsample_vert_u8 (orc_uint8 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, const orc_uint8 * ORC_RESTRICT s3, const orc_uint8 * ORC_RESTRICT s4, int n){ int i; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; const orc_int8 * ORC_RESTRICT ptr7; orc_int8 var35; orc_int8 var36; orc_union16 var37; orc_int8 var38; orc_int8 var39; orc_union16 var40; orc_union16 var41; orc_int8 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; ptr0 = (orc_int8 *)d1; ptr4 = (orc_int8 *)s1; ptr5 = (orc_int8 *)s2; ptr6 = (orc_int8 *)s3; ptr7 = (orc_int8 *)s4; /* 5: loadpw */ var37.i = (int)0x00000006; /* 6 or 2.96439e-323f */ /* 12: loadpw */ var40.i = (int)0x0000001a; /* 26 or 1.28457e-322f */ /* 15: loadpw */ var41.i = (int)0x00000020; /* 32 or 1.58101e-322f */ for (i = 0; i < n; i++) { /* 0: loadb */ var35 = ptr4[i]; /* 1: convubw */ var43.i = (orc_uint8)var35; /* 2: loadb */ var36 = ptr7[i]; /* 3: convubw */ var44.i = (orc_uint8)var36; /* 4: addw */ var45.i = var43.i + var44.i; /* 6: mullw */ var46.i = (var45.i * var37.i) & 0xffff; /* 7: loadb */ var38 = ptr5[i]; /* 8: convubw */ var47.i = (orc_uint8)var38; /* 9: loadb */ var39 = ptr6[i]; /* 10: convubw */ var48.i = (orc_uint8)var39; /* 11: addw */ var49.i = var47.i + var48.i; /* 13: mullw */ var50.i = (var49.i * var40.i) & 0xffff; /* 14: addw */ var51.i = var50.i + var46.i; /* 16: addw */ var52.i = var51.i + var41.i; /* 17: shruw */ var53.i = ((orc_uint16)var52.i) >> 6; /* 18: convwb */ var42 = var53.i; /* 19: storeb */ ptr0[i] = var42; } } #else static void _backup_orc_downsample_vert_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; const orc_int8 * ORC_RESTRICT ptr7; orc_int8 var35; orc_int8 var36; orc_union16 var37; orc_int8 var38; orc_int8 var39; orc_union16 var40; orc_union16 var41; orc_int8 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_int8 *)ex->arrays[4]; ptr5 = (orc_int8 *)ex->arrays[5]; ptr6 = (orc_int8 *)ex->arrays[6]; ptr7 = (orc_int8 *)ex->arrays[7]; /* 5: loadpw */ var37.i = (int)0x00000006; /* 6 or 2.96439e-323f */ /* 12: loadpw */ var40.i = (int)0x0000001a; /* 26 or 1.28457e-322f */ /* 15: loadpw */ var41.i = (int)0x00000020; /* 32 or 1.58101e-322f */ for (i = 0; i < n; i++) { /* 0: loadb */ var35 = ptr4[i]; /* 1: convubw */ var43.i = (orc_uint8)var35; /* 2: loadb */ var36 = ptr7[i]; /* 3: convubw */ var44.i = (orc_uint8)var36; /* 4: addw */ var45.i = var43.i + var44.i; /* 6: mullw */ var46.i = (var45.i * var37.i) & 0xffff; /* 7: loadb */ var38 = ptr5[i]; /* 8: convubw */ var47.i = (orc_uint8)var38; /* 9: loadb */ var39 = ptr6[i]; /* 10: convubw */ var48.i = (orc_uint8)var39; /* 11: addw */ var49.i = var47.i + var48.i; /* 13: mullw */ var50.i = (var49.i * var40.i) & 0xffff; /* 14: addw */ var51.i = var50.i + var46.i; /* 16: addw */ var52.i = var51.i + var41.i; /* 17: shruw */ var53.i = ((orc_uint16)var52.i) >> 6; /* 18: convwb */ var42 = var53.i; /* 19: storeb */ ptr0[i] = var42; } } OrcCode *_orc_code_orc_downsample_vert_u8; void orc_downsample_vert_u8 (orc_uint8 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, const orc_uint8 * ORC_RESTRICT s3, const orc_uint8 * ORC_RESTRICT s4, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_downsample_vert_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->arrays[ORC_VAR_S4] = (void *)s4; func = c->exec; func (ex); } #endif /* orc_downsample_horiz_u8 */ #ifdef DISABLE_ORC void orc_downsample_horiz_u8 (orc_uint8 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, int n){ int i; orc_int8 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_int8 var41; orc_union16 var42; orc_int8 var43; orc_union16 var44; orc_union16 var45; orc_int8 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_int8 var51; orc_int8 var52; orc_union16 var53; orc_union16 var54; orc_union16 var55; orc_union16 var56; orc_union16 var57; orc_union16 var58; orc_union16 var59; ptr0 = (orc_int8 *)d1; ptr4 = (orc_union16 *)s1; /* 7: loadpw */ var38.i = (int)0x00000006; /* 6 or 2.96439e-323f */ /* 14: loadpw */ var39.i = (int)0x0000001a; /* 26 or 1.28457e-322f */ /* 17: loadpw */ var40.i = (int)0x00000020; /* 32 or 1.58101e-322f */ for (i = 0; i < n; i++) { /* 0: loadw */ var42 = ptr4[i]; /* 1: select1wb */ { orc_union16 _src; _src.i = var42.i; var43 = _src.x2[1]; } /* 2: convubw */ var44.i = (orc_uint8)var43; /* 3: loadoffw */ var45 = ptr4[i + 2]; /* 4: select0wb */ { orc_union16 _src; _src.i = var45.i; var46 = _src.x2[0]; } /* 5: convubw */ var47.i = (orc_uint8)var46; /* 6: addw */ var48.i = var44.i + var47.i; /* 8: mullw */ var49.i = (var48.i * var38.i) & 0xffff; /* 9: loadoffw */ var50 = ptr4[i + 1]; /* 10: splitwb */ { orc_union16 _src; _src.i = var50.i; var51 = _src.x2[1]; var52 = _src.x2[0]; } /* 11: convubw */ var53.i = (orc_uint8)var51; /* 12: convubw */ var54.i = (orc_uint8)var52; /* 13: addw */ var55.i = var53.i + var54.i; /* 15: mullw */ var56.i = (var55.i * var39.i) & 0xffff; /* 16: addw */ var57.i = var49.i + var56.i; /* 18: addw */ var58.i = var57.i + var40.i; /* 19: shruw */ var59.i = ((orc_uint16)var58.i) >> 6; /* 20: convwb */ var41 = var59.i; /* 21: storeb */ ptr0[i] = var41; } } #else static void _backup_orc_downsample_horiz_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_int8 var41; orc_union16 var42; orc_int8 var43; orc_union16 var44; orc_union16 var45; orc_int8 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_int8 var51; orc_int8 var52; orc_union16 var53; orc_union16 var54; orc_union16 var55; orc_union16 var56; orc_union16 var57; orc_union16 var58; orc_union16 var59; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; /* 7: loadpw */ var38.i = (int)0x00000006; /* 6 or 2.96439e-323f */ /* 14: loadpw */ var39.i = (int)0x0000001a; /* 26 or 1.28457e-322f */ /* 17: loadpw */ var40.i = (int)0x00000020; /* 32 or 1.58101e-322f */ for (i = 0; i < n; i++) { /* 0: loadw */ var42 = ptr4[i]; /* 1: select1wb */ { orc_union16 _src; _src.i = var42.i; var43 = _src.x2[1]; } /* 2: convubw */ var44.i = (orc_uint8)var43; /* 3: loadoffw */ var45 = ptr4[i + 2]; /* 4: select0wb */ { orc_union16 _src; _src.i = var45.i; var46 = _src.x2[0]; } /* 5: convubw */ var47.i = (orc_uint8)var46; /* 6: addw */ var48.i = var44.i + var47.i; /* 8: mullw */ var49.i = (var48.i * var38.i) & 0xffff; /* 9: loadoffw */ var50 = ptr4[i + 1]; /* 10: splitwb */ { orc_union16 _src; _src.i = var50.i; var51 = _src.x2[1]; var52 = _src.x2[0]; } /* 11: convubw */ var53.i = (orc_uint8)var51; /* 12: convubw */ var54.i = (orc_uint8)var52; /* 13: addw */ var55.i = var53.i + var54.i; /* 15: mullw */ var56.i = (var55.i * var39.i) & 0xffff; /* 16: addw */ var57.i = var49.i + var56.i; /* 18: addw */ var58.i = var57.i + var40.i; /* 19: shruw */ var59.i = ((orc_uint16)var58.i) >> 6; /* 20: convwb */ var41 = var59.i; /* 21: storeb */ ptr0[i] = var41; } } OrcCode *_orc_code_orc_downsample_horiz_u8; void orc_downsample_horiz_u8 (orc_uint8 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_downsample_horiz_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_stats_moment_s16 */ #ifdef DISABLE_ORC void orc_stats_moment_s16 (orc_int32 * ORC_RESTRICT a1, const orc_int16 * ORC_RESTRICT s1, int n){ int i; const orc_union16 * ORC_RESTRICT ptr4; orc_union32 var12 = { 0 }; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union32 var40; ptr4 = (orc_union16 *)s1; /* 2: loadpw */ var35.i = (int)0x00000002; /* 2 or 9.88131e-324f */ /* 4: loadpw */ var36.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: absw */ var37.i = ORC_ABS(var34.i); /* 3: subw */ var38.i = var37.i - var35.i; /* 5: maxsw */ var39.i = ORC_MAX(var38.i, var36.i); /* 6: convuwl */ var40.i = (orc_uint16)var39.i; /* 7: accl */ var12.i = var12.i + var40.i; } *a1 = var12.i; } #else static void _backup_orc_stats_moment_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; const orc_union16 * ORC_RESTRICT ptr4; orc_union32 var12 = { 0 }; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union32 var40; ptr4 = (orc_union16 *)ex->arrays[4]; /* 2: loadpw */ var35.i = (int)0x00000002; /* 2 or 9.88131e-324f */ /* 4: loadpw */ var36.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: absw */ var37.i = ORC_ABS(var34.i); /* 3: subw */ var38.i = var37.i - var35.i; /* 5: maxsw */ var39.i = ORC_MAX(var38.i, var36.i); /* 6: convuwl */ var40.i = (orc_uint16)var39.i; /* 7: accl */ var12.i = var12.i + var40.i; } ex->accumulators[0] = var12.i; } OrcCode *_orc_code_orc_stats_moment_s16; void orc_stats_moment_s16 (orc_int32 * ORC_RESTRICT a1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_stats_moment_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); *a1 = orc_executor_get_accumulator (ex, ORC_VAR_A1); } #endif /* orc_stats_above_s16 */ #ifdef DISABLE_ORC void orc_stats_above_s16 (orc_int32 * ORC_RESTRICT a1, const orc_int16 * ORC_RESTRICT s1, int n){ int i; const orc_union16 * ORC_RESTRICT ptr4; orc_union32 var12 = { 0 }; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union32 var42; ptr4 = (orc_union16 *)s1; /* 2: loadpw */ var35.i = (int)0x00000001; /* 1 or 4.94066e-324f */ /* 4: loadpw */ var36.i = (int)0x00000000; /* 0 or 0f */ /* 6: loadpw */ var37.i = (int)0x00000001; /* 1 or 4.94066e-324f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: absw */ var38.i = ORC_ABS(var34.i); /* 3: subw */ var39.i = var38.i - var35.i; /* 5: maxsw */ var40.i = ORC_MAX(var39.i, var36.i); /* 7: minsw */ var41.i = ORC_MIN(var40.i, var37.i); /* 8: convuwl */ var42.i = (orc_uint16)var41.i; /* 9: accl */ var12.i = var12.i + var42.i; } *a1 = var12.i; } #else static void _backup_orc_stats_above_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; const orc_union16 * ORC_RESTRICT ptr4; orc_union32 var12 = { 0 }; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union32 var42; ptr4 = (orc_union16 *)ex->arrays[4]; /* 2: loadpw */ var35.i = (int)0x00000001; /* 1 or 4.94066e-324f */ /* 4: loadpw */ var36.i = (int)0x00000000; /* 0 or 0f */ /* 6: loadpw */ var37.i = (int)0x00000001; /* 1 or 4.94066e-324f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: absw */ var38.i = ORC_ABS(var34.i); /* 3: subw */ var39.i = var38.i - var35.i; /* 5: maxsw */ var40.i = ORC_MAX(var39.i, var36.i); /* 7: minsw */ var41.i = ORC_MIN(var40.i, var37.i); /* 8: convuwl */ var42.i = (orc_uint16)var41.i; /* 9: accl */ var12.i = var12.i + var42.i; } ex->accumulators[0] = var12.i; } OrcCode *_orc_code_orc_stats_above_s16; void orc_stats_above_s16 (orc_int32 * ORC_RESTRICT a1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_stats_above_s16; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); *a1 = orc_executor_get_accumulator (ex, ORC_VAR_A1); } #endif /* orc_accw */ #ifdef DISABLE_ORC void orc_accw (int * ORC_RESTRICT a1, const orc_int16 * ORC_RESTRICT s1, int n){ int i; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var12 = { 0 }; orc_union16 var33; orc_union16 var34; ptr4 = (orc_union16 *)s1; for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 1: absw */ var34.i = ORC_ABS(var33.i); /* 2: accw */ var12.i = var12.i + var34.i; } *a1 = (var12.i & 0xffff); } #else static void _backup_orc_accw (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var12 = { 0 }; orc_union16 var33; orc_union16 var34; ptr4 = (orc_union16 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 1: absw */ var34.i = ORC_ABS(var33.i); /* 2: accw */ var12.i = var12.i + var34.i; } ex->accumulators[0] = (var12.i & 0xffff); } OrcCode *_orc_code_orc_accw; void orc_accw (int * ORC_RESTRICT a1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_accw; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); *a1 = orc_executor_get_accumulator (ex, ORC_VAR_A1); } #endif /* orc_avg2_8xn_u8 */ #ifdef DISABLE_ORC void orc_avg2_8xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m){ int i; int j; int n = 8; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: avgub */ var34 = ((orc_uint8)var32 + (orc_uint8)var33 + 1)>>1; /* 3: storeb */ ptr0[i] = var34; } } } #else static void _backup_orc_avg2_8xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 8; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: avgub */ var34 = ((orc_uint8)var32 + (orc_uint8)var33 + 1)>>1; /* 3: storeb */ ptr0[i] = var34; } } } OrcCode *_orc_code_orc_avg2_8xn_u8; void orc_avg2_8xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_avg2_8xn_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 8; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; func = c->exec; func (ex); } #endif /* orc_avg2_12xn_u8 */ #ifdef DISABLE_ORC void orc_avg2_12xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m){ int i; int j; int n = 12; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: avgub */ var34 = ((orc_uint8)var32 + (orc_uint8)var33 + 1)>>1; /* 3: storeb */ ptr0[i] = var34; } } } #else static void _backup_orc_avg2_12xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 12; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: avgub */ var34 = ((orc_uint8)var32 + (orc_uint8)var33 + 1)>>1; /* 3: storeb */ ptr0[i] = var34; } } } OrcCode *_orc_code_orc_avg2_12xn_u8; void orc_avg2_12xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_avg2_12xn_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 12; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; func = c->exec; func (ex); } #endif /* orc_avg2_16xn_u8 */ #ifdef DISABLE_ORC void orc_avg2_16xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m){ int i; int j; int n = 16; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: avgub */ var34 = ((orc_uint8)var32 + (orc_uint8)var33 + 1)>>1; /* 3: storeb */ ptr0[i] = var34; } } } #else static void _backup_orc_avg2_16xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 16; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: avgub */ var34 = ((orc_uint8)var32 + (orc_uint8)var33 + 1)>>1; /* 3: storeb */ ptr0[i] = var34; } } } OrcCode *_orc_code_orc_avg2_16xn_u8; void orc_avg2_16xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_avg2_16xn_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 16; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; func = c->exec; func (ex); } #endif /* orc_avg2_32xn_u8 */ #ifdef DISABLE_ORC void orc_avg2_32xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m){ int i; int j; int n = 32; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: avgub */ var34 = ((orc_uint8)var32 + (orc_uint8)var33 + 1)>>1; /* 3: storeb */ ptr0[i] = var34; } } } #else static void _backup_orc_avg2_32xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 32; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: avgub */ var34 = ((orc_uint8)var32 + (orc_uint8)var33 + 1)>>1; /* 3: storeb */ ptr0[i] = var34; } } } OrcCode *_orc_code_orc_avg2_32xn_u8; void orc_avg2_32xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_avg2_32xn_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 32; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; func = c->exec; func (ex); } #endif /* orc_avg2_nxm_u8 */ #ifdef DISABLE_ORC void orc_avg2_nxm_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int n, int m){ int i; int j; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: avgub */ var34 = ((orc_uint8)var32 + (orc_uint8)var33 + 1)>>1; /* 3: storeb */ ptr0[i] = var34; } } } #else static void _backup_orc_avg2_nxm_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: avgub */ var34 = ((orc_uint8)var32 + (orc_uint8)var33 + 1)>>1; /* 3: storeb */ ptr0[i] = var34; } } } OrcCode *_orc_code_orc_avg2_nxm_u8; void orc_avg2_nxm_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int n, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_avg2_nxm_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; func = c->exec; func (ex); } #endif /* orc_combine4_8xn_u8 */ #ifdef DISABLE_ORC void orc_combine4_8xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int m){ int i; int j; int n = 8; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; const orc_int8 * ORC_RESTRICT ptr7; orc_int8 var34; orc_union16 var35; orc_int8 var36; orc_union16 var37; orc_int8 var38; orc_union16 var39; orc_int8 var40; orc_union16 var41; orc_union16 var42; orc_int8 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union16 var54; orc_union16 var55; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); ptr6 = ORC_PTR_OFFSET(s3, s3_stride * j); ptr7 = ORC_PTR_OFFSET(s4, s4_stride * j); /* 2: loadpw */ var35.i = p1; /* 6: loadpw */ var37.i = p2; /* 11: loadpw */ var39.i = p3; /* 16: loadpw */ var41.i = p4; /* 19: loadpw */ var42.i = (int)0x00000008; /* 8 or 3.95253e-323f */ for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var44.i = (orc_uint8)var34; /* 3: mullw */ var45.i = (var44.i * var35.i) & 0xffff; /* 4: loadb */ var36 = ptr5[i]; /* 5: convubw */ var46.i = (orc_uint8)var36; /* 7: mullw */ var47.i = (var46.i * var37.i) & 0xffff; /* 8: addw */ var48.i = var45.i + var47.i; /* 9: loadb */ var38 = ptr6[i]; /* 10: convubw */ var49.i = (orc_uint8)var38; /* 12: mullw */ var50.i = (var49.i * var39.i) & 0xffff; /* 13: addw */ var51.i = var48.i + var50.i; /* 14: loadb */ var40 = ptr7[i]; /* 15: convubw */ var52.i = (orc_uint8)var40; /* 17: mullw */ var53.i = (var52.i * var41.i) & 0xffff; /* 18: addw */ var54.i = var51.i + var53.i; /* 20: addw */ var55.i = var54.i + var42.i; /* 21: convsuswb */ var43 = ORC_CLAMP_UB(var55.i); /* 22: storeb */ ptr0[i] = var43; } } } #else static void _backup_orc_combine4_8xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 8; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; const orc_int8 * ORC_RESTRICT ptr7; orc_int8 var34; orc_union16 var35; orc_int8 var36; orc_union16 var37; orc_int8 var38; orc_union16 var39; orc_int8 var40; orc_union16 var41; orc_union16 var42; orc_int8 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union16 var54; orc_union16 var55; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); ptr6 = ORC_PTR_OFFSET(ex->arrays[6], ex->params[6] * j); ptr7 = ORC_PTR_OFFSET(ex->arrays[7], ex->params[7] * j); /* 2: loadpw */ var35.i = ex->params[24]; /* 6: loadpw */ var37.i = ex->params[25]; /* 11: loadpw */ var39.i = ex->params[26]; /* 16: loadpw */ var41.i = ex->params[27]; /* 19: loadpw */ var42.i = (int)0x00000008; /* 8 or 3.95253e-323f */ for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var44.i = (orc_uint8)var34; /* 3: mullw */ var45.i = (var44.i * var35.i) & 0xffff; /* 4: loadb */ var36 = ptr5[i]; /* 5: convubw */ var46.i = (orc_uint8)var36; /* 7: mullw */ var47.i = (var46.i * var37.i) & 0xffff; /* 8: addw */ var48.i = var45.i + var47.i; /* 9: loadb */ var38 = ptr6[i]; /* 10: convubw */ var49.i = (orc_uint8)var38; /* 12: mullw */ var50.i = (var49.i * var39.i) & 0xffff; /* 13: addw */ var51.i = var48.i + var50.i; /* 14: loadb */ var40 = ptr7[i]; /* 15: convubw */ var52.i = (orc_uint8)var40; /* 17: mullw */ var53.i = (var52.i * var41.i) & 0xffff; /* 18: addw */ var54.i = var51.i + var53.i; /* 20: addw */ var55.i = var54.i + var42.i; /* 21: convsuswb */ var43 = ORC_CLAMP_UB(var55.i); /* 22: storeb */ ptr0[i] = var43; } } } OrcCode *_orc_code_orc_combine4_8xn_u8; void orc_combine4_8xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_combine4_8xn_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 8; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->params[ORC_VAR_S3] = s3_stride; ex->arrays[ORC_VAR_S4] = (void *)s4; ex->params[ORC_VAR_S4] = s4_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; func = c->exec; func (ex); } #endif /* orc_combine4_12xn_u8 */ #ifdef DISABLE_ORC void orc_combine4_12xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int m){ int i; int j; int n = 12; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; const orc_int8 * ORC_RESTRICT ptr7; orc_int8 var34; orc_union16 var35; orc_int8 var36; orc_union16 var37; orc_int8 var38; orc_union16 var39; orc_int8 var40; orc_union16 var41; orc_union16 var42; orc_int8 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union16 var54; orc_union16 var55; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); ptr6 = ORC_PTR_OFFSET(s3, s3_stride * j); ptr7 = ORC_PTR_OFFSET(s4, s4_stride * j); /* 2: loadpw */ var35.i = p1; /* 6: loadpw */ var37.i = p2; /* 11: loadpw */ var39.i = p3; /* 16: loadpw */ var41.i = p4; /* 19: loadpw */ var42.i = (int)0x00000008; /* 8 or 3.95253e-323f */ for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var44.i = (orc_uint8)var34; /* 3: mullw */ var45.i = (var44.i * var35.i) & 0xffff; /* 4: loadb */ var36 = ptr5[i]; /* 5: convubw */ var46.i = (orc_uint8)var36; /* 7: mullw */ var47.i = (var46.i * var37.i) & 0xffff; /* 8: addw */ var48.i = var45.i + var47.i; /* 9: loadb */ var38 = ptr6[i]; /* 10: convubw */ var49.i = (orc_uint8)var38; /* 12: mullw */ var50.i = (var49.i * var39.i) & 0xffff; /* 13: addw */ var51.i = var48.i + var50.i; /* 14: loadb */ var40 = ptr7[i]; /* 15: convubw */ var52.i = (orc_uint8)var40; /* 17: mullw */ var53.i = (var52.i * var41.i) & 0xffff; /* 18: addw */ var54.i = var51.i + var53.i; /* 20: addw */ var55.i = var54.i + var42.i; /* 21: convsuswb */ var43 = ORC_CLAMP_UB(var55.i); /* 22: storeb */ ptr0[i] = var43; } } } #else static void _backup_orc_combine4_12xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 12; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; const orc_int8 * ORC_RESTRICT ptr7; orc_int8 var34; orc_union16 var35; orc_int8 var36; orc_union16 var37; orc_int8 var38; orc_union16 var39; orc_int8 var40; orc_union16 var41; orc_union16 var42; orc_int8 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union16 var54; orc_union16 var55; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); ptr6 = ORC_PTR_OFFSET(ex->arrays[6], ex->params[6] * j); ptr7 = ORC_PTR_OFFSET(ex->arrays[7], ex->params[7] * j); /* 2: loadpw */ var35.i = ex->params[24]; /* 6: loadpw */ var37.i = ex->params[25]; /* 11: loadpw */ var39.i = ex->params[26]; /* 16: loadpw */ var41.i = ex->params[27]; /* 19: loadpw */ var42.i = (int)0x00000008; /* 8 or 3.95253e-323f */ for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var44.i = (orc_uint8)var34; /* 3: mullw */ var45.i = (var44.i * var35.i) & 0xffff; /* 4: loadb */ var36 = ptr5[i]; /* 5: convubw */ var46.i = (orc_uint8)var36; /* 7: mullw */ var47.i = (var46.i * var37.i) & 0xffff; /* 8: addw */ var48.i = var45.i + var47.i; /* 9: loadb */ var38 = ptr6[i]; /* 10: convubw */ var49.i = (orc_uint8)var38; /* 12: mullw */ var50.i = (var49.i * var39.i) & 0xffff; /* 13: addw */ var51.i = var48.i + var50.i; /* 14: loadb */ var40 = ptr7[i]; /* 15: convubw */ var52.i = (orc_uint8)var40; /* 17: mullw */ var53.i = (var52.i * var41.i) & 0xffff; /* 18: addw */ var54.i = var51.i + var53.i; /* 20: addw */ var55.i = var54.i + var42.i; /* 21: convsuswb */ var43 = ORC_CLAMP_UB(var55.i); /* 22: storeb */ ptr0[i] = var43; } } } OrcCode *_orc_code_orc_combine4_12xn_u8; void orc_combine4_12xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_combine4_12xn_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 12; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->params[ORC_VAR_S3] = s3_stride; ex->arrays[ORC_VAR_S4] = (void *)s4; ex->params[ORC_VAR_S4] = s4_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; func = c->exec; func (ex); } #endif /* orc_combine4_16xn_u8 */ #ifdef DISABLE_ORC void orc_combine4_16xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int m){ int i; int j; int n = 16; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; const orc_int8 * ORC_RESTRICT ptr7; orc_int8 var34; orc_union16 var35; orc_int8 var36; orc_union16 var37; orc_int8 var38; orc_union16 var39; orc_int8 var40; orc_union16 var41; orc_union16 var42; orc_int8 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union16 var54; orc_union16 var55; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); ptr6 = ORC_PTR_OFFSET(s3, s3_stride * j); ptr7 = ORC_PTR_OFFSET(s4, s4_stride * j); /* 2: loadpw */ var35.i = p1; /* 6: loadpw */ var37.i = p2; /* 11: loadpw */ var39.i = p3; /* 16: loadpw */ var41.i = p4; /* 19: loadpw */ var42.i = (int)0x00000008; /* 8 or 3.95253e-323f */ for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var44.i = (orc_uint8)var34; /* 3: mullw */ var45.i = (var44.i * var35.i) & 0xffff; /* 4: loadb */ var36 = ptr5[i]; /* 5: convubw */ var46.i = (orc_uint8)var36; /* 7: mullw */ var47.i = (var46.i * var37.i) & 0xffff; /* 8: addw */ var48.i = var45.i + var47.i; /* 9: loadb */ var38 = ptr6[i]; /* 10: convubw */ var49.i = (orc_uint8)var38; /* 12: mullw */ var50.i = (var49.i * var39.i) & 0xffff; /* 13: addw */ var51.i = var48.i + var50.i; /* 14: loadb */ var40 = ptr7[i]; /* 15: convubw */ var52.i = (orc_uint8)var40; /* 17: mullw */ var53.i = (var52.i * var41.i) & 0xffff; /* 18: addw */ var54.i = var51.i + var53.i; /* 20: addw */ var55.i = var54.i + var42.i; /* 21: convsuswb */ var43 = ORC_CLAMP_UB(var55.i); /* 22: storeb */ ptr0[i] = var43; } } } #else static void _backup_orc_combine4_16xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 16; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; const orc_int8 * ORC_RESTRICT ptr7; orc_int8 var34; orc_union16 var35; orc_int8 var36; orc_union16 var37; orc_int8 var38; orc_union16 var39; orc_int8 var40; orc_union16 var41; orc_union16 var42; orc_int8 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union16 var54; orc_union16 var55; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); ptr6 = ORC_PTR_OFFSET(ex->arrays[6], ex->params[6] * j); ptr7 = ORC_PTR_OFFSET(ex->arrays[7], ex->params[7] * j); /* 2: loadpw */ var35.i = ex->params[24]; /* 6: loadpw */ var37.i = ex->params[25]; /* 11: loadpw */ var39.i = ex->params[26]; /* 16: loadpw */ var41.i = ex->params[27]; /* 19: loadpw */ var42.i = (int)0x00000008; /* 8 or 3.95253e-323f */ for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var44.i = (orc_uint8)var34; /* 3: mullw */ var45.i = (var44.i * var35.i) & 0xffff; /* 4: loadb */ var36 = ptr5[i]; /* 5: convubw */ var46.i = (orc_uint8)var36; /* 7: mullw */ var47.i = (var46.i * var37.i) & 0xffff; /* 8: addw */ var48.i = var45.i + var47.i; /* 9: loadb */ var38 = ptr6[i]; /* 10: convubw */ var49.i = (orc_uint8)var38; /* 12: mullw */ var50.i = (var49.i * var39.i) & 0xffff; /* 13: addw */ var51.i = var48.i + var50.i; /* 14: loadb */ var40 = ptr7[i]; /* 15: convubw */ var52.i = (orc_uint8)var40; /* 17: mullw */ var53.i = (var52.i * var41.i) & 0xffff; /* 18: addw */ var54.i = var51.i + var53.i; /* 20: addw */ var55.i = var54.i + var42.i; /* 21: convsuswb */ var43 = ORC_CLAMP_UB(var55.i); /* 22: storeb */ ptr0[i] = var43; } } } OrcCode *_orc_code_orc_combine4_16xn_u8; void orc_combine4_16xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_combine4_16xn_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 16; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->params[ORC_VAR_S3] = s3_stride; ex->arrays[ORC_VAR_S4] = (void *)s4; ex->params[ORC_VAR_S4] = s4_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; func = c->exec; func (ex); } #endif /* orc_combine4_24xn_u8 */ #ifdef DISABLE_ORC void orc_combine4_24xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int m){ int i; int j; int n = 24; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; const orc_int8 * ORC_RESTRICT ptr7; orc_int8 var34; orc_union16 var35; orc_int8 var36; orc_union16 var37; orc_int8 var38; orc_union16 var39; orc_int8 var40; orc_union16 var41; orc_union16 var42; orc_int8 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union16 var54; orc_union16 var55; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); ptr6 = ORC_PTR_OFFSET(s3, s3_stride * j); ptr7 = ORC_PTR_OFFSET(s4, s4_stride * j); /* 2: loadpw */ var35.i = p1; /* 6: loadpw */ var37.i = p2; /* 11: loadpw */ var39.i = p3; /* 16: loadpw */ var41.i = p4; /* 19: loadpw */ var42.i = (int)0x00000008; /* 8 or 3.95253e-323f */ for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var44.i = (orc_uint8)var34; /* 3: mullw */ var45.i = (var44.i * var35.i) & 0xffff; /* 4: loadb */ var36 = ptr5[i]; /* 5: convubw */ var46.i = (orc_uint8)var36; /* 7: mullw */ var47.i = (var46.i * var37.i) & 0xffff; /* 8: addw */ var48.i = var45.i + var47.i; /* 9: loadb */ var38 = ptr6[i]; /* 10: convubw */ var49.i = (orc_uint8)var38; /* 12: mullw */ var50.i = (var49.i * var39.i) & 0xffff; /* 13: addw */ var51.i = var48.i + var50.i; /* 14: loadb */ var40 = ptr7[i]; /* 15: convubw */ var52.i = (orc_uint8)var40; /* 17: mullw */ var53.i = (var52.i * var41.i) & 0xffff; /* 18: addw */ var54.i = var51.i + var53.i; /* 20: addw */ var55.i = var54.i + var42.i; /* 21: convsuswb */ var43 = ORC_CLAMP_UB(var55.i); /* 22: storeb */ ptr0[i] = var43; } } } #else static void _backup_orc_combine4_24xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 24; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; const orc_int8 * ORC_RESTRICT ptr7; orc_int8 var34; orc_union16 var35; orc_int8 var36; orc_union16 var37; orc_int8 var38; orc_union16 var39; orc_int8 var40; orc_union16 var41; orc_union16 var42; orc_int8 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union16 var54; orc_union16 var55; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); ptr6 = ORC_PTR_OFFSET(ex->arrays[6], ex->params[6] * j); ptr7 = ORC_PTR_OFFSET(ex->arrays[7], ex->params[7] * j); /* 2: loadpw */ var35.i = ex->params[24]; /* 6: loadpw */ var37.i = ex->params[25]; /* 11: loadpw */ var39.i = ex->params[26]; /* 16: loadpw */ var41.i = ex->params[27]; /* 19: loadpw */ var42.i = (int)0x00000008; /* 8 or 3.95253e-323f */ for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var44.i = (orc_uint8)var34; /* 3: mullw */ var45.i = (var44.i * var35.i) & 0xffff; /* 4: loadb */ var36 = ptr5[i]; /* 5: convubw */ var46.i = (orc_uint8)var36; /* 7: mullw */ var47.i = (var46.i * var37.i) & 0xffff; /* 8: addw */ var48.i = var45.i + var47.i; /* 9: loadb */ var38 = ptr6[i]; /* 10: convubw */ var49.i = (orc_uint8)var38; /* 12: mullw */ var50.i = (var49.i * var39.i) & 0xffff; /* 13: addw */ var51.i = var48.i + var50.i; /* 14: loadb */ var40 = ptr7[i]; /* 15: convubw */ var52.i = (orc_uint8)var40; /* 17: mullw */ var53.i = (var52.i * var41.i) & 0xffff; /* 18: addw */ var54.i = var51.i + var53.i; /* 20: addw */ var55.i = var54.i + var42.i; /* 21: convsuswb */ var43 = ORC_CLAMP_UB(var55.i); /* 22: storeb */ ptr0[i] = var43; } } } OrcCode *_orc_code_orc_combine4_24xn_u8; void orc_combine4_24xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_combine4_24xn_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 24; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->params[ORC_VAR_S3] = s3_stride; ex->arrays[ORC_VAR_S4] = (void *)s4; ex->params[ORC_VAR_S4] = s4_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; func = c->exec; func (ex); } #endif /* orc_combine4_32xn_u8 */ #ifdef DISABLE_ORC void orc_combine4_32xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int m){ int i; int j; int n = 32; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; const orc_int8 * ORC_RESTRICT ptr7; orc_int8 var34; orc_union16 var35; orc_int8 var36; orc_union16 var37; orc_int8 var38; orc_union16 var39; orc_int8 var40; orc_union16 var41; orc_union16 var42; orc_int8 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union16 var54; orc_union16 var55; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); ptr6 = ORC_PTR_OFFSET(s3, s3_stride * j); ptr7 = ORC_PTR_OFFSET(s4, s4_stride * j); /* 2: loadpw */ var35.i = p1; /* 6: loadpw */ var37.i = p2; /* 11: loadpw */ var39.i = p3; /* 16: loadpw */ var41.i = p4; /* 19: loadpw */ var42.i = (int)0x00000008; /* 8 or 3.95253e-323f */ for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var44.i = (orc_uint8)var34; /* 3: mullw */ var45.i = (var44.i * var35.i) & 0xffff; /* 4: loadb */ var36 = ptr5[i]; /* 5: convubw */ var46.i = (orc_uint8)var36; /* 7: mullw */ var47.i = (var46.i * var37.i) & 0xffff; /* 8: addw */ var48.i = var45.i + var47.i; /* 9: loadb */ var38 = ptr6[i]; /* 10: convubw */ var49.i = (orc_uint8)var38; /* 12: mullw */ var50.i = (var49.i * var39.i) & 0xffff; /* 13: addw */ var51.i = var48.i + var50.i; /* 14: loadb */ var40 = ptr7[i]; /* 15: convubw */ var52.i = (orc_uint8)var40; /* 17: mullw */ var53.i = (var52.i * var41.i) & 0xffff; /* 18: addw */ var54.i = var51.i + var53.i; /* 20: addw */ var55.i = var54.i + var42.i; /* 21: convsuswb */ var43 = ORC_CLAMP_UB(var55.i); /* 22: storeb */ ptr0[i] = var43; } } } #else static void _backup_orc_combine4_32xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 32; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; const orc_int8 * ORC_RESTRICT ptr7; orc_int8 var34; orc_union16 var35; orc_int8 var36; orc_union16 var37; orc_int8 var38; orc_union16 var39; orc_int8 var40; orc_union16 var41; orc_union16 var42; orc_int8 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union16 var54; orc_union16 var55; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); ptr6 = ORC_PTR_OFFSET(ex->arrays[6], ex->params[6] * j); ptr7 = ORC_PTR_OFFSET(ex->arrays[7], ex->params[7] * j); /* 2: loadpw */ var35.i = ex->params[24]; /* 6: loadpw */ var37.i = ex->params[25]; /* 11: loadpw */ var39.i = ex->params[26]; /* 16: loadpw */ var41.i = ex->params[27]; /* 19: loadpw */ var42.i = (int)0x00000008; /* 8 or 3.95253e-323f */ for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var44.i = (orc_uint8)var34; /* 3: mullw */ var45.i = (var44.i * var35.i) & 0xffff; /* 4: loadb */ var36 = ptr5[i]; /* 5: convubw */ var46.i = (orc_uint8)var36; /* 7: mullw */ var47.i = (var46.i * var37.i) & 0xffff; /* 8: addw */ var48.i = var45.i + var47.i; /* 9: loadb */ var38 = ptr6[i]; /* 10: convubw */ var49.i = (orc_uint8)var38; /* 12: mullw */ var50.i = (var49.i * var39.i) & 0xffff; /* 13: addw */ var51.i = var48.i + var50.i; /* 14: loadb */ var40 = ptr7[i]; /* 15: convubw */ var52.i = (orc_uint8)var40; /* 17: mullw */ var53.i = (var52.i * var41.i) & 0xffff; /* 18: addw */ var54.i = var51.i + var53.i; /* 20: addw */ var55.i = var54.i + var42.i; /* 21: convsuswb */ var43 = ORC_CLAMP_UB(var55.i); /* 22: storeb */ ptr0[i] = var43; } } } OrcCode *_orc_code_orc_combine4_32xn_u8; void orc_combine4_32xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_combine4_32xn_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 32; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->params[ORC_VAR_S3] = s3_stride; ex->arrays[ORC_VAR_S4] = (void *)s4; ex->params[ORC_VAR_S4] = s4_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; func = c->exec; func (ex); } #endif /* orc_combine4_nxm_u8 */ #ifdef DISABLE_ORC void orc_combine4_nxm_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int n, int m){ int i; int j; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; const orc_int8 * ORC_RESTRICT ptr7; orc_int8 var34; orc_union16 var35; orc_int8 var36; orc_union16 var37; orc_int8 var38; orc_union16 var39; orc_int8 var40; orc_union16 var41; orc_union16 var42; orc_int8 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union16 var54; orc_union16 var55; orc_union16 var56; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); ptr6 = ORC_PTR_OFFSET(s3, s3_stride * j); ptr7 = ORC_PTR_OFFSET(s4, s4_stride * j); /* 2: loadpw */ var35.i = p1; /* 6: loadpw */ var37.i = p2; /* 11: loadpw */ var39.i = p3; /* 16: loadpw */ var41.i = p4; /* 19: loadpw */ var42.i = (int)0x00000008; /* 8 or 3.95253e-323f */ for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var44.i = (orc_uint8)var34; /* 3: mullw */ var45.i = (var44.i * var35.i) & 0xffff; /* 4: loadb */ var36 = ptr5[i]; /* 5: convubw */ var46.i = (orc_uint8)var36; /* 7: mullw */ var47.i = (var46.i * var37.i) & 0xffff; /* 8: addw */ var48.i = var45.i + var47.i; /* 9: loadb */ var38 = ptr6[i]; /* 10: convubw */ var49.i = (orc_uint8)var38; /* 12: mullw */ var50.i = (var49.i * var39.i) & 0xffff; /* 13: addw */ var51.i = var48.i + var50.i; /* 14: loadb */ var40 = ptr7[i]; /* 15: convubw */ var52.i = (orc_uint8)var40; /* 17: mullw */ var53.i = (var52.i * var41.i) & 0xffff; /* 18: addw */ var54.i = var51.i + var53.i; /* 20: addw */ var55.i = var54.i + var42.i; /* 21: shrsw */ var56.i = var55.i >> 4; /* 22: convsuswb */ var43 = ORC_CLAMP_UB(var56.i); /* 23: storeb */ ptr0[i] = var43; } } } #else static void _backup_orc_combine4_nxm_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; const orc_int8 * ORC_RESTRICT ptr7; orc_int8 var34; orc_union16 var35; orc_int8 var36; orc_union16 var37; orc_int8 var38; orc_union16 var39; orc_int8 var40; orc_union16 var41; orc_union16 var42; orc_int8 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union16 var54; orc_union16 var55; orc_union16 var56; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); ptr6 = ORC_PTR_OFFSET(ex->arrays[6], ex->params[6] * j); ptr7 = ORC_PTR_OFFSET(ex->arrays[7], ex->params[7] * j); /* 2: loadpw */ var35.i = ex->params[24]; /* 6: loadpw */ var37.i = ex->params[25]; /* 11: loadpw */ var39.i = ex->params[26]; /* 16: loadpw */ var41.i = ex->params[27]; /* 19: loadpw */ var42.i = (int)0x00000008; /* 8 or 3.95253e-323f */ for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var44.i = (orc_uint8)var34; /* 3: mullw */ var45.i = (var44.i * var35.i) & 0xffff; /* 4: loadb */ var36 = ptr5[i]; /* 5: convubw */ var46.i = (orc_uint8)var36; /* 7: mullw */ var47.i = (var46.i * var37.i) & 0xffff; /* 8: addw */ var48.i = var45.i + var47.i; /* 9: loadb */ var38 = ptr6[i]; /* 10: convubw */ var49.i = (orc_uint8)var38; /* 12: mullw */ var50.i = (var49.i * var39.i) & 0xffff; /* 13: addw */ var51.i = var48.i + var50.i; /* 14: loadb */ var40 = ptr7[i]; /* 15: convubw */ var52.i = (orc_uint8)var40; /* 17: mullw */ var53.i = (var52.i * var41.i) & 0xffff; /* 18: addw */ var54.i = var51.i + var53.i; /* 20: addw */ var55.i = var54.i + var42.i; /* 21: shrsw */ var56.i = var55.i >> 4; /* 22: convsuswb */ var43 = ORC_CLAMP_UB(var56.i); /* 23: storeb */ ptr0[i] = var43; } } } OrcCode *_orc_code_orc_combine4_nxm_u8; void orc_combine4_nxm_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int n, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_combine4_nxm_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->params[ORC_VAR_S3] = s3_stride; ex->arrays[ORC_VAR_S4] = (void *)s4; ex->params[ORC_VAR_S4] = s4_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; func = c->exec; func (ex); } #endif /* orc_combine2_8xn_u8 */ #ifdef DISABLE_ORC void orc_combine2_8xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int p1, int p2, int p3, int p4, int m){ int i; int j; int n = 8; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var34; orc_int8 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_int8 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); /* 4: loadpw */ var36.i = p1; /* 6: loadpw */ var37.i = p2; /* 9: loadpw */ var38.i = p3; for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var40.i = (orc_uint8)var34; /* 2: loadb */ var35 = ptr5[i]; /* 3: convubw */ var41.i = (orc_uint8)var35; /* 5: mullw */ var42.i = (var40.i * var36.i) & 0xffff; /* 7: mullw */ var43.i = (var41.i * var37.i) & 0xffff; /* 8: addw */ var44.i = var42.i + var43.i; /* 10: addw */ var45.i = var44.i + var38.i; /* 11: shrsw */ var46.i = var45.i >> p4; /* 12: convsuswb */ var39 = ORC_CLAMP_UB(var46.i); /* 13: storeb */ ptr0[i] = var39; } } } #else static void _backup_orc_combine2_8xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 8; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var34; orc_int8 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_int8 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); /* 4: loadpw */ var36.i = ex->params[24]; /* 6: loadpw */ var37.i = ex->params[25]; /* 9: loadpw */ var38.i = ex->params[26]; for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var40.i = (orc_uint8)var34; /* 2: loadb */ var35 = ptr5[i]; /* 3: convubw */ var41.i = (orc_uint8)var35; /* 5: mullw */ var42.i = (var40.i * var36.i) & 0xffff; /* 7: mullw */ var43.i = (var41.i * var37.i) & 0xffff; /* 8: addw */ var44.i = var42.i + var43.i; /* 10: addw */ var45.i = var44.i + var38.i; /* 11: shrsw */ var46.i = var45.i >> ex->params[27]; /* 12: convsuswb */ var39 = ORC_CLAMP_UB(var46.i); /* 13: storeb */ ptr0[i] = var39; } } } OrcCode *_orc_code_orc_combine2_8xn_u8; void orc_combine2_8xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int p1, int p2, int p3, int p4, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_combine2_8xn_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 8; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; func = c->exec; func (ex); } #endif /* orc_combine2_12xn_u8 */ #ifdef DISABLE_ORC void orc_combine2_12xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int p1, int p2, int p3, int p4, int m){ int i; int j; int n = 12; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var34; orc_int8 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_int8 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); /* 4: loadpw */ var36.i = p1; /* 6: loadpw */ var37.i = p2; /* 9: loadpw */ var38.i = p3; for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var40.i = (orc_uint8)var34; /* 2: loadb */ var35 = ptr5[i]; /* 3: convubw */ var41.i = (orc_uint8)var35; /* 5: mullw */ var42.i = (var40.i * var36.i) & 0xffff; /* 7: mullw */ var43.i = (var41.i * var37.i) & 0xffff; /* 8: addw */ var44.i = var42.i + var43.i; /* 10: addw */ var45.i = var44.i + var38.i; /* 11: shrsw */ var46.i = var45.i >> p4; /* 12: convsuswb */ var39 = ORC_CLAMP_UB(var46.i); /* 13: storeb */ ptr0[i] = var39; } } } #else static void _backup_orc_combine2_12xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 12; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var34; orc_int8 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_int8 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); /* 4: loadpw */ var36.i = ex->params[24]; /* 6: loadpw */ var37.i = ex->params[25]; /* 9: loadpw */ var38.i = ex->params[26]; for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var40.i = (orc_uint8)var34; /* 2: loadb */ var35 = ptr5[i]; /* 3: convubw */ var41.i = (orc_uint8)var35; /* 5: mullw */ var42.i = (var40.i * var36.i) & 0xffff; /* 7: mullw */ var43.i = (var41.i * var37.i) & 0xffff; /* 8: addw */ var44.i = var42.i + var43.i; /* 10: addw */ var45.i = var44.i + var38.i; /* 11: shrsw */ var46.i = var45.i >> ex->params[27]; /* 12: convsuswb */ var39 = ORC_CLAMP_UB(var46.i); /* 13: storeb */ ptr0[i] = var39; } } } OrcCode *_orc_code_orc_combine2_12xn_u8; void orc_combine2_12xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int p1, int p2, int p3, int p4, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_combine2_12xn_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 12; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; func = c->exec; func (ex); } #endif /* orc_combine2_16xn_u8 */ #ifdef DISABLE_ORC void orc_combine2_16xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int p1, int p2, int p3, int p4, int m){ int i; int j; int n = 16; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var34; orc_int8 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_int8 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); /* 4: loadpw */ var36.i = p1; /* 6: loadpw */ var37.i = p2; /* 9: loadpw */ var38.i = p3; for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var40.i = (orc_uint8)var34; /* 2: loadb */ var35 = ptr5[i]; /* 3: convubw */ var41.i = (orc_uint8)var35; /* 5: mullw */ var42.i = (var40.i * var36.i) & 0xffff; /* 7: mullw */ var43.i = (var41.i * var37.i) & 0xffff; /* 8: addw */ var44.i = var42.i + var43.i; /* 10: addw */ var45.i = var44.i + var38.i; /* 11: shrsw */ var46.i = var45.i >> p4; /* 12: convsuswb */ var39 = ORC_CLAMP_UB(var46.i); /* 13: storeb */ ptr0[i] = var39; } } } #else static void _backup_orc_combine2_16xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 16; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var34; orc_int8 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_int8 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); /* 4: loadpw */ var36.i = ex->params[24]; /* 6: loadpw */ var37.i = ex->params[25]; /* 9: loadpw */ var38.i = ex->params[26]; for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var40.i = (orc_uint8)var34; /* 2: loadb */ var35 = ptr5[i]; /* 3: convubw */ var41.i = (orc_uint8)var35; /* 5: mullw */ var42.i = (var40.i * var36.i) & 0xffff; /* 7: mullw */ var43.i = (var41.i * var37.i) & 0xffff; /* 8: addw */ var44.i = var42.i + var43.i; /* 10: addw */ var45.i = var44.i + var38.i; /* 11: shrsw */ var46.i = var45.i >> ex->params[27]; /* 12: convsuswb */ var39 = ORC_CLAMP_UB(var46.i); /* 13: storeb */ ptr0[i] = var39; } } } OrcCode *_orc_code_orc_combine2_16xn_u8; void orc_combine2_16xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int p1, int p2, int p3, int p4, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_combine2_16xn_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 16; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; func = c->exec; func (ex); } #endif /* orc_combine2_nxm_u8 */ #ifdef DISABLE_ORC void orc_combine2_nxm_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int p1, int p2, int p3, int p4, int n, int m){ int i; int j; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var34; orc_int8 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_int8 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); /* 4: loadpw */ var36.i = p1; /* 6: loadpw */ var37.i = p2; /* 9: loadpw */ var38.i = p3; for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var40.i = (orc_uint8)var34; /* 2: loadb */ var35 = ptr5[i]; /* 3: convubw */ var41.i = (orc_uint8)var35; /* 5: mullw */ var42.i = (var40.i * var36.i) & 0xffff; /* 7: mullw */ var43.i = (var41.i * var37.i) & 0xffff; /* 8: addw */ var44.i = var42.i + var43.i; /* 10: addw */ var45.i = var44.i + var38.i; /* 11: shrsw */ var46.i = var45.i >> p4; /* 12: convsuswb */ var39 = ORC_CLAMP_UB(var46.i); /* 13: storeb */ ptr0[i] = var39; } } } #else static void _backup_orc_combine2_nxm_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var34; orc_int8 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_int8 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); /* 4: loadpw */ var36.i = ex->params[24]; /* 6: loadpw */ var37.i = ex->params[25]; /* 9: loadpw */ var38.i = ex->params[26]; for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var40.i = (orc_uint8)var34; /* 2: loadb */ var35 = ptr5[i]; /* 3: convubw */ var41.i = (orc_uint8)var35; /* 5: mullw */ var42.i = (var40.i * var36.i) & 0xffff; /* 7: mullw */ var43.i = (var41.i * var37.i) & 0xffff; /* 8: addw */ var44.i = var42.i + var43.i; /* 10: addw */ var45.i = var44.i + var38.i; /* 11: shrsw */ var46.i = var45.i >> ex->params[27]; /* 12: convsuswb */ var39 = ORC_CLAMP_UB(var46.i); /* 13: storeb */ ptr0[i] = var39; } } } OrcCode *_orc_code_orc_combine2_nxm_u8; void orc_combine2_nxm_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int p1, int p2, int p3, int p4, int n, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_combine2_nxm_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; func = c->exec; func (ex); } #endif /* orc_sad_nxm_u8 */ #ifdef DISABLE_ORC void orc_sad_nxm_u8 (orc_uint32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int n, int m){ int i; int j; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_union32 var12 = { 0 }; orc_int8 var32; orc_int8 var33; for (j = 0; j < m; j++) { ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: accsadubl */ var12.i = var12.i + ORC_ABS((orc_int32)(orc_uint8)var32 - (orc_int32)(orc_uint8)var33); } } *a1 = var12.i; } #else static void _backup_orc_sad_nxm_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_union32 var12 = { 0 }; orc_int8 var32; orc_int8 var33; for (j = 0; j < m; j++) { ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: accsadubl */ var12.i = var12.i + ORC_ABS((orc_int32)(orc_uint8)var32 - (orc_int32)(orc_uint8)var33); } } ex->accumulators[0] = var12.i; } OrcCode *_orc_code_orc_sad_nxm_u8; void orc_sad_nxm_u8 (orc_uint32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int n, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_sad_nxm_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; func = c->exec; func (ex); *a1 = orc_executor_get_accumulator (ex, ORC_VAR_A1); } #endif /* orc_sad_8x8_u8 */ #ifdef DISABLE_ORC void orc_sad_8x8_u8 (orc_uint32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride){ int i; int j; int n = 8; int m = 8; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_union32 var12 = { 0 }; orc_int8 var32; orc_int8 var33; for (j = 0; j < m; j++) { ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: accsadubl */ var12.i = var12.i + ORC_ABS((orc_int32)(orc_uint8)var32 - (orc_int32)(orc_uint8)var33); } } *a1 = var12.i; } #else static void _backup_orc_sad_8x8_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 8; int m = 8; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_union32 var12 = { 0 }; orc_int8 var32; orc_int8 var33; for (j = 0; j < m; j++) { ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: accsadubl */ var12.i = var12.i + ORC_ABS((orc_int32)(orc_uint8)var32 - (orc_int32)(orc_uint8)var33); } } ex->accumulators[0] = var12.i; } OrcCode *_orc_code_orc_sad_8x8_u8; void orc_sad_8x8_u8 (orc_uint32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_sad_8x8_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 8; ORC_EXECUTOR_M(ex) = 8; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; func = c->exec; func (ex); *a1 = orc_executor_get_accumulator (ex, ORC_VAR_A1); } #endif /* orc_sad_12x12_u8 */ #ifdef DISABLE_ORC void orc_sad_12x12_u8 (orc_uint32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride){ int i; int j; int n = 12; int m = 12; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_union32 var12 = { 0 }; orc_int8 var32; orc_int8 var33; for (j = 0; j < m; j++) { ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: accsadubl */ var12.i = var12.i + ORC_ABS((orc_int32)(orc_uint8)var32 - (orc_int32)(orc_uint8)var33); } } *a1 = var12.i; } #else static void _backup_orc_sad_12x12_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 12; int m = 12; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_union32 var12 = { 0 }; orc_int8 var32; orc_int8 var33; for (j = 0; j < m; j++) { ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: accsadubl */ var12.i = var12.i + ORC_ABS((orc_int32)(orc_uint8)var32 - (orc_int32)(orc_uint8)var33); } } ex->accumulators[0] = var12.i; } OrcCode *_orc_code_orc_sad_12x12_u8; void orc_sad_12x12_u8 (orc_uint32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_sad_12x12_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 12; ORC_EXECUTOR_M(ex) = 12; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; func = c->exec; func (ex); *a1 = orc_executor_get_accumulator (ex, ORC_VAR_A1); } #endif /* orc_sad_16xn_u8 */ #ifdef DISABLE_ORC void orc_sad_16xn_u8 (orc_uint32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m){ int i; int j; int n = 16; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_union32 var12 = { 0 }; orc_int8 var32; orc_int8 var33; for (j = 0; j < m; j++) { ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: accsadubl */ var12.i = var12.i + ORC_ABS((orc_int32)(orc_uint8)var32 - (orc_int32)(orc_uint8)var33); } } *a1 = var12.i; } #else static void _backup_orc_sad_16xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 16; int m = ex->params[ORC_VAR_A1]; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_union32 var12 = { 0 }; orc_int8 var32; orc_int8 var33; for (j = 0; j < m; j++) { ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: accsadubl */ var12.i = var12.i + ORC_ABS((orc_int32)(orc_uint8)var32 - (orc_int32)(orc_uint8)var33); } } ex->accumulators[0] = var12.i; } OrcCode *_orc_code_orc_sad_16xn_u8; void orc_sad_16xn_u8 (orc_uint32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_sad_16xn_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 16; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; func = c->exec; func (ex); *a1 = orc_executor_get_accumulator (ex, ORC_VAR_A1); } #endif /* orc_sad_32xn_u8 */ #ifdef DISABLE_ORC void orc_sad_32xn_u8 (orc_uint32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m){ int i; int j; int n = 32; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_union32 var12 = { 0 }; orc_int8 var32; orc_int8 var33; for (j = 0; j < m; j++) { ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: accsadubl */ var12.i = var12.i + ORC_ABS((orc_int32)(orc_uint8)var32 - (orc_int32)(orc_uint8)var33); } } *a1 = var12.i; } #else static void _backup_orc_sad_32xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 32; int m = ex->params[ORC_VAR_A1]; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_union32 var12 = { 0 }; orc_int8 var32; orc_int8 var33; for (j = 0; j < m; j++) { ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: accsadubl */ var12.i = var12.i + ORC_ABS((orc_int32)(orc_uint8)var32 - (orc_int32)(orc_uint8)var33); } } ex->accumulators[0] = var12.i; } OrcCode *_orc_code_orc_sad_32xn_u8; void orc_sad_32xn_u8 (orc_uint32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_sad_32xn_u8; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 32; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; func = c->exec; func (ex); *a1 = orc_executor_get_accumulator (ex, ORC_VAR_A1); } #endif /* orc_add2_rshift_add_s32_22_op */ #ifdef DISABLE_ORC void orc_add2_rshift_add_s32_22_op (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, const orc_int32 * ORC_RESTRICT s3, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; const orc_union32 * ORC_RESTRICT ptr6; orc_union32 var33; orc_union32 var34; orc_union32 var35; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; ptr0 = (orc_union32 *)d1; ptr4 = (orc_union32 *)s1; ptr5 = (orc_union32 *)s2; ptr6 = (orc_union32 *)s3; /* 3: loadpl */ var35.i = (int)0x00000002; /* 2 or 9.88131e-324f */ for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr5[i]; /* 1: loadl */ var34 = ptr6[i]; /* 2: addl */ var38.i = var33.i + var34.i; /* 4: addl */ var39.i = var38.i + var35.i; /* 5: shrsl */ var40.i = var39.i >> 2; /* 6: loadl */ var36 = ptr4[i]; /* 7: addl */ var37.i = var36.i + var40.i; /* 8: storel */ ptr0[i] = var37; } } #else static void _backup_orc_add2_rshift_add_s32_22_op (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; const orc_union32 * ORC_RESTRICT ptr6; orc_union32 var33; orc_union32 var34; orc_union32 var35; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; ptr5 = (orc_union32 *)ex->arrays[5]; ptr6 = (orc_union32 *)ex->arrays[6]; /* 3: loadpl */ var35.i = (int)0x00000002; /* 2 or 9.88131e-324f */ for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr5[i]; /* 1: loadl */ var34 = ptr6[i]; /* 2: addl */ var38.i = var33.i + var34.i; /* 4: addl */ var39.i = var38.i + var35.i; /* 5: shrsl */ var40.i = var39.i >> 2; /* 6: loadl */ var36 = ptr4[i]; /* 7: addl */ var37.i = var36.i + var40.i; /* 8: storel */ ptr0[i] = var37; } } OrcCode *_orc_code_orc_add2_rshift_add_s32_22_op; void orc_add2_rshift_add_s32_22_op (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, const orc_int32 * ORC_RESTRICT s3, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add2_rshift_add_s32_22_op; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; func = c->exec; func (ex); } #endif /* orc_mas4_vert_add_s32_1991_op */ #ifdef DISABLE_ORC void orc_mas4_vert_add_s32_1991_op (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, const orc_int32 * ORC_RESTRICT s3, const orc_int32 * ORC_RESTRICT s4, const orc_int32 * ORC_RESTRICT s5, int p1, int p2, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; const orc_union32 * ORC_RESTRICT ptr6; const orc_union32 * ORC_RESTRICT ptr7; const orc_union32 * ORC_RESTRICT ptr8; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; orc_union32 var44; orc_union32 var45; orc_union32 var46; orc_union32 var47; orc_union32 var48; orc_union32 var49; ptr0 = (orc_union32 *)d1; ptr4 = (orc_union32 *)s1; ptr5 = (orc_union32 *)s2; ptr6 = (orc_union32 *)s3; ptr7 = (orc_union32 *)s4; ptr8 = (orc_union32 *)s5; /* 3: loadpl */ var38.i = (int)0x00000009; /* 9 or 4.44659e-323f */ /* 9: loadpl */ var41.i = p1; for (i = 0; i < n; i++) { /* 0: loadl */ var36 = ptr6[i]; /* 1: loadl */ var37 = ptr7[i]; /* 2: addl */ var44.i = var36.i + var37.i; /* 4: mulll */ var45.i = (var44.i * var38.i) & 0xffffffff; /* 5: loadl */ var39 = ptr5[i]; /* 6: loadl */ var40 = ptr8[i]; /* 7: addl */ var46.i = var39.i + var40.i; /* 8: subl */ var47.i = var45.i - var46.i; /* 10: addl */ var48.i = var47.i + var41.i; /* 11: shrsl */ var49.i = var48.i >> p2; /* 12: loadl */ var42 = ptr4[i]; /* 13: addl */ var43.i = var42.i + var49.i; /* 14: storel */ ptr0[i] = var43; } } #else static void _backup_orc_mas4_vert_add_s32_1991_op (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; const orc_union32 * ORC_RESTRICT ptr6; const orc_union32 * ORC_RESTRICT ptr7; const orc_union32 * ORC_RESTRICT ptr8; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; orc_union32 var44; orc_union32 var45; orc_union32 var46; orc_union32 var47; orc_union32 var48; orc_union32 var49; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; ptr5 = (orc_union32 *)ex->arrays[5]; ptr6 = (orc_union32 *)ex->arrays[6]; ptr7 = (orc_union32 *)ex->arrays[7]; ptr8 = (orc_union32 *)ex->arrays[8]; /* 3: loadpl */ var38.i = (int)0x00000009; /* 9 or 4.44659e-323f */ /* 9: loadpl */ var41.i = ex->params[24]; for (i = 0; i < n; i++) { /* 0: loadl */ var36 = ptr6[i]; /* 1: loadl */ var37 = ptr7[i]; /* 2: addl */ var44.i = var36.i + var37.i; /* 4: mulll */ var45.i = (var44.i * var38.i) & 0xffffffff; /* 5: loadl */ var39 = ptr5[i]; /* 6: loadl */ var40 = ptr8[i]; /* 7: addl */ var46.i = var39.i + var40.i; /* 8: subl */ var47.i = var45.i - var46.i; /* 10: addl */ var48.i = var47.i + var41.i; /* 11: shrsl */ var49.i = var48.i >> ex->params[25]; /* 12: loadl */ var42 = ptr4[i]; /* 13: addl */ var43.i = var42.i + var49.i; /* 14: storel */ ptr0[i] = var43; } } OrcCode *_orc_code_orc_mas4_vert_add_s32_1991_op; void orc_mas4_vert_add_s32_1991_op (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, const orc_int32 * ORC_RESTRICT s3, const orc_int32 * ORC_RESTRICT s4, const orc_int32 * ORC_RESTRICT s5, int p1, int p2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_mas4_vert_add_s32_1991_op; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->arrays[ORC_VAR_S4] = (void *)s4; ex->arrays[ORC_VAR_S5] = (void *)s5; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } #endif /* orc_add2_rshift_sub_s32_22_op */ #ifdef DISABLE_ORC void orc_add2_rshift_sub_s32_22_op (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, const orc_int32 * ORC_RESTRICT s3, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; const orc_union32 * ORC_RESTRICT ptr6; orc_union32 var33; orc_union32 var34; orc_union32 var35; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; ptr0 = (orc_union32 *)d1; ptr4 = (orc_union32 *)s1; ptr5 = (orc_union32 *)s2; ptr6 = (orc_union32 *)s3; /* 3: loadpl */ var35.i = (int)0x00000002; /* 2 or 9.88131e-324f */ for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr5[i]; /* 1: loadl */ var34 = ptr6[i]; /* 2: addl */ var38.i = var33.i + var34.i; /* 4: addl */ var39.i = var38.i + var35.i; /* 5: shrsl */ var40.i = var39.i >> 2; /* 6: loadl */ var36 = ptr4[i]; /* 7: subl */ var37.i = var36.i - var40.i; /* 8: storel */ ptr0[i] = var37; } } #else static void _backup_orc_add2_rshift_sub_s32_22_op (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; const orc_union32 * ORC_RESTRICT ptr6; orc_union32 var33; orc_union32 var34; orc_union32 var35; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; ptr5 = (orc_union32 *)ex->arrays[5]; ptr6 = (orc_union32 *)ex->arrays[6]; /* 3: loadpl */ var35.i = (int)0x00000002; /* 2 or 9.88131e-324f */ for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr5[i]; /* 1: loadl */ var34 = ptr6[i]; /* 2: addl */ var38.i = var33.i + var34.i; /* 4: addl */ var39.i = var38.i + var35.i; /* 5: shrsl */ var40.i = var39.i >> 2; /* 6: loadl */ var36 = ptr4[i]; /* 7: subl */ var37.i = var36.i - var40.i; /* 8: storel */ ptr0[i] = var37; } } OrcCode *_orc_code_orc_add2_rshift_sub_s32_22_op; void orc_add2_rshift_sub_s32_22_op (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, const orc_int32 * ORC_RESTRICT s3, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add2_rshift_sub_s32_22_op; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; func = c->exec; func (ex); } #endif /* orc_interleave2_rrshift1_s32 */ #ifdef DISABLE_ORC void orc_interleave2_rrshift1_s32 (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, int n){ int i; orc_union64 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var34; orc_union32 var35; orc_union32 var36; orc_union32 var37; orc_union64 var38; orc_union32 var39; orc_union32 var40; orc_union32 var41; orc_union32 var42; ptr0 = (orc_union64 *)d1; ptr4 = (orc_union32 *)s1; ptr5 = (orc_union32 *)s2; /* 1: loadpl */ var35.i = (int)0x00000001; /* 1 or 4.94066e-324f */ /* 5: loadpl */ var37.i = (int)0x00000001; /* 1 or 4.94066e-324f */ for (i = 0; i < n; i++) { /* 0: loadl */ var34 = ptr4[i]; /* 2: addl */ var39.i = var34.i + var35.i; /* 3: shrsl */ var40.i = var39.i >> 1; /* 4: loadl */ var36 = ptr5[i]; /* 6: addl */ var41.i = var36.i + var37.i; /* 7: shrsl */ var42.i = var41.i >> 1; /* 8: mergelq */ { orc_union64 _dest; _dest.x2[0] = var40.i; _dest.x2[1] = var42.i; var38.i = _dest.i; } /* 9: storeq */ ptr0[i] = var38; } } #else static void _backup_orc_interleave2_rrshift1_s32 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union64 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var34; orc_union32 var35; orc_union32 var36; orc_union32 var37; orc_union64 var38; orc_union32 var39; orc_union32 var40; orc_union32 var41; orc_union32 var42; ptr0 = (orc_union64 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; ptr5 = (orc_union32 *)ex->arrays[5]; /* 1: loadpl */ var35.i = (int)0x00000001; /* 1 or 4.94066e-324f */ /* 5: loadpl */ var37.i = (int)0x00000001; /* 1 or 4.94066e-324f */ for (i = 0; i < n; i++) { /* 0: loadl */ var34 = ptr4[i]; /* 2: addl */ var39.i = var34.i + var35.i; /* 3: shrsl */ var40.i = var39.i >> 1; /* 4: loadl */ var36 = ptr5[i]; /* 6: addl */ var41.i = var36.i + var37.i; /* 7: shrsl */ var42.i = var41.i >> 1; /* 8: mergelq */ { orc_union64 _dest; _dest.x2[0] = var40.i; _dest.x2[1] = var42.i; var38.i = _dest.i; } /* 9: storeq */ ptr0[i] = var38; } } OrcCode *_orc_code_orc_interleave2_rrshift1_s32; void orc_interleave2_rrshift1_s32 (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_interleave2_rrshift1_s32; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_mas4_vert_sub_s32_1991_op */ #ifdef DISABLE_ORC void orc_mas4_vert_sub_s32_1991_op (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, const orc_int32 * ORC_RESTRICT s3, const orc_int32 * ORC_RESTRICT s4, const orc_int32 * ORC_RESTRICT s5, int p1, int p2, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; const orc_union32 * ORC_RESTRICT ptr6; const orc_union32 * ORC_RESTRICT ptr7; const orc_union32 * ORC_RESTRICT ptr8; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; orc_union32 var44; orc_union32 var45; orc_union32 var46; orc_union32 var47; orc_union32 var48; orc_union32 var49; ptr0 = (orc_union32 *)d1; ptr4 = (orc_union32 *)s1; ptr5 = (orc_union32 *)s2; ptr6 = (orc_union32 *)s3; ptr7 = (orc_union32 *)s4; ptr8 = (orc_union32 *)s5; /* 3: loadpl */ var38.i = (int)0x00000009; /* 9 or 4.44659e-323f */ /* 9: loadpl */ var41.i = p1; for (i = 0; i < n; i++) { /* 0: loadl */ var36 = ptr6[i]; /* 1: loadl */ var37 = ptr7[i]; /* 2: addl */ var44.i = var36.i + var37.i; /* 4: mulll */ var45.i = (var44.i * var38.i) & 0xffffffff; /* 5: loadl */ var39 = ptr5[i]; /* 6: loadl */ var40 = ptr8[i]; /* 7: addl */ var46.i = var39.i + var40.i; /* 8: subl */ var47.i = var45.i - var46.i; /* 10: addl */ var48.i = var47.i + var41.i; /* 11: shrsl */ var49.i = var48.i >> p2; /* 12: loadl */ var42 = ptr4[i]; /* 13: subl */ var43.i = var42.i - var49.i; /* 14: storel */ ptr0[i] = var43; } } #else static void _backup_orc_mas4_vert_sub_s32_1991_op (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; const orc_union32 * ORC_RESTRICT ptr6; const orc_union32 * ORC_RESTRICT ptr7; const orc_union32 * ORC_RESTRICT ptr8; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; orc_union32 var44; orc_union32 var45; orc_union32 var46; orc_union32 var47; orc_union32 var48; orc_union32 var49; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; ptr5 = (orc_union32 *)ex->arrays[5]; ptr6 = (orc_union32 *)ex->arrays[6]; ptr7 = (orc_union32 *)ex->arrays[7]; ptr8 = (orc_union32 *)ex->arrays[8]; /* 3: loadpl */ var38.i = (int)0x00000009; /* 9 or 4.44659e-323f */ /* 9: loadpl */ var41.i = ex->params[24]; for (i = 0; i < n; i++) { /* 0: loadl */ var36 = ptr6[i]; /* 1: loadl */ var37 = ptr7[i]; /* 2: addl */ var44.i = var36.i + var37.i; /* 4: mulll */ var45.i = (var44.i * var38.i) & 0xffffffff; /* 5: loadl */ var39 = ptr5[i]; /* 6: loadl */ var40 = ptr8[i]; /* 7: addl */ var46.i = var39.i + var40.i; /* 8: subl */ var47.i = var45.i - var46.i; /* 10: addl */ var48.i = var47.i + var41.i; /* 11: shrsl */ var49.i = var48.i >> ex->params[25]; /* 12: loadl */ var42 = ptr4[i]; /* 13: subl */ var43.i = var42.i - var49.i; /* 14: storel */ ptr0[i] = var43; } } OrcCode *_orc_code_orc_mas4_vert_sub_s32_1991_op; void orc_mas4_vert_sub_s32_1991_op (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, const orc_int32 * ORC_RESTRICT s3, const orc_int32 * ORC_RESTRICT s4, const orc_int32 * ORC_RESTRICT s5, int p1, int p2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_mas4_vert_sub_s32_1991_op; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->arrays[ORC_VAR_S4] = (void *)s4; ex->arrays[ORC_VAR_S5] = (void *)s5; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } #endif /* orc_mas4_vert_sub_s32_1991 */ #ifdef DISABLE_ORC void orc_mas4_vert_sub_s32_1991 (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, const orc_int32 * ORC_RESTRICT s3, const orc_int32 * ORC_RESTRICT s4, int p1, int p2, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; const orc_union32 * ORC_RESTRICT ptr6; const orc_union32 * ORC_RESTRICT ptr7; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; orc_union32 var44; orc_union32 var45; orc_union32 var46; orc_union32 var47; orc_union32 var48; orc_union32 var49; ptr0 = (orc_union32 *)d1; ptr4 = (orc_union32 *)s1; ptr5 = (orc_union32 *)s2; ptr6 = (orc_union32 *)s3; ptr7 = (orc_union32 *)s4; /* 3: loadpl */ var38.i = (int)0x00000009; /* 9 or 4.44659e-323f */ /* 9: loadpl */ var41.i = p1; for (i = 0; i < n; i++) { /* 0: loadl */ var36 = ptr5[i]; /* 1: loadl */ var37 = ptr6[i]; /* 2: addl */ var44.i = var36.i + var37.i; /* 4: mulll */ var45.i = (var44.i * var38.i) & 0xffffffff; /* 5: loadl */ var39 = ptr4[i]; /* 6: loadl */ var40 = ptr7[i]; /* 7: addl */ var46.i = var39.i + var40.i; /* 8: subl */ var47.i = var45.i - var46.i; /* 10: addl */ var48.i = var47.i + var41.i; /* 11: shrsl */ var49.i = var48.i >> p2; /* 12: loadl */ var42 = ptr0[i]; /* 13: subl */ var43.i = var42.i - var49.i; /* 14: storel */ ptr0[i] = var43; } } #else static void _backup_orc_mas4_vert_sub_s32_1991 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; const orc_union32 * ORC_RESTRICT ptr6; const orc_union32 * ORC_RESTRICT ptr7; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; orc_union32 var44; orc_union32 var45; orc_union32 var46; orc_union32 var47; orc_union32 var48; orc_union32 var49; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; ptr5 = (orc_union32 *)ex->arrays[5]; ptr6 = (orc_union32 *)ex->arrays[6]; ptr7 = (orc_union32 *)ex->arrays[7]; /* 3: loadpl */ var38.i = (int)0x00000009; /* 9 or 4.44659e-323f */ /* 9: loadpl */ var41.i = ex->params[24]; for (i = 0; i < n; i++) { /* 0: loadl */ var36 = ptr5[i]; /* 1: loadl */ var37 = ptr6[i]; /* 2: addl */ var44.i = var36.i + var37.i; /* 4: mulll */ var45.i = (var44.i * var38.i) & 0xffffffff; /* 5: loadl */ var39 = ptr4[i]; /* 6: loadl */ var40 = ptr7[i]; /* 7: addl */ var46.i = var39.i + var40.i; /* 8: subl */ var47.i = var45.i - var46.i; /* 10: addl */ var48.i = var47.i + var41.i; /* 11: shrsl */ var49.i = var48.i >> ex->params[25]; /* 12: loadl */ var42 = ptr0[i]; /* 13: subl */ var43.i = var42.i - var49.i; /* 14: storel */ ptr0[i] = var43; } } OrcCode *_orc_code_orc_mas4_vert_sub_s32_1991; void orc_mas4_vert_sub_s32_1991 (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, const orc_int32 * ORC_RESTRICT s3, const orc_int32 * ORC_RESTRICT s4, int p1, int p2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_mas4_vert_sub_s32_1991; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->arrays[ORC_VAR_S4] = (void *)s4; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } #endif /* orc_mas4_horiz_add_s32_1991_ip */ #ifdef DISABLE_ORC void orc_mas4_horiz_add_s32_1991_ip (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, int p1, int p2, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; orc_union32 var44; orc_union32 var45; orc_union32 var46; orc_union32 var47; orc_union32 var48; orc_union32 var49; ptr0 = (orc_union32 *)d1; ptr4 = (orc_union32 *)s1; /* 3: loadpl */ var36.i = (int)0x00000009; /* 9 or 4.44659e-323f */ /* 9: loadpl */ var37.i = p1; for (i = 0; i < n; i++) { /* 0: loadoffl */ var40 = ptr4[i + 1]; /* 1: loadoffl */ var41 = ptr4[i + 2]; /* 2: addl */ var42.i = var40.i + var41.i; /* 4: mulll */ var43.i = (var42.i * var36.i) & 0xffffffff; /* 5: loadl */ var44 = ptr4[i]; /* 6: loadoffl */ var45 = ptr4[i + 3]; /* 7: addl */ var46.i = var44.i + var45.i; /* 8: subl */ var47.i = var43.i - var46.i; /* 10: addl */ var48.i = var47.i + var37.i; /* 11: shrsl */ var49.i = var48.i >> p2; /* 12: loadl */ var38 = ptr0[i]; /* 13: addl */ var39.i = var38.i + var49.i; /* 14: storel */ ptr0[i] = var39; } } #else static void _backup_orc_mas4_horiz_add_s32_1991_ip (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; orc_union32 var44; orc_union32 var45; orc_union32 var46; orc_union32 var47; orc_union32 var48; orc_union32 var49; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; /* 3: loadpl */ var36.i = (int)0x00000009; /* 9 or 4.44659e-323f */ /* 9: loadpl */ var37.i = ex->params[24]; for (i = 0; i < n; i++) { /* 0: loadoffl */ var40 = ptr4[i + 1]; /* 1: loadoffl */ var41 = ptr4[i + 2]; /* 2: addl */ var42.i = var40.i + var41.i; /* 4: mulll */ var43.i = (var42.i * var36.i) & 0xffffffff; /* 5: loadl */ var44 = ptr4[i]; /* 6: loadoffl */ var45 = ptr4[i + 3]; /* 7: addl */ var46.i = var44.i + var45.i; /* 8: subl */ var47.i = var43.i - var46.i; /* 10: addl */ var48.i = var47.i + var37.i; /* 11: shrsl */ var49.i = var48.i >> ex->params[25]; /* 12: loadl */ var38 = ptr0[i]; /* 13: addl */ var39.i = var38.i + var49.i; /* 14: storel */ ptr0[i] = var39; } } OrcCode *_orc_code_orc_mas4_horiz_add_s32_1991_ip; void orc_mas4_horiz_add_s32_1991_ip (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, int p1, int p2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_mas4_horiz_add_s32_1991_ip; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } #endif /* orc_add2_rshift_add_s32_11_op */ #ifdef DISABLE_ORC void orc_add2_rshift_add_s32_11_op (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, const orc_int32 * ORC_RESTRICT s3, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; const orc_union32 * ORC_RESTRICT ptr6; orc_union32 var33; orc_union32 var34; orc_union32 var35; orc_union32 var36; orc_union32 var37; ptr0 = (orc_union32 *)d1; ptr4 = (orc_union32 *)s1; ptr5 = (orc_union32 *)s2; ptr6 = (orc_union32 *)s3; for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr5[i]; /* 1: loadl */ var34 = ptr6[i]; /* 2: avgsl */ var37.i = ((orc_int64)var33.i + (orc_int64)var34.i + 1)>>1; /* 3: loadl */ var35 = ptr4[i]; /* 4: addl */ var36.i = var35.i + var37.i; /* 5: storel */ ptr0[i] = var36; } } #else static void _backup_orc_add2_rshift_add_s32_11_op (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; const orc_union32 * ORC_RESTRICT ptr6; orc_union32 var33; orc_union32 var34; orc_union32 var35; orc_union32 var36; orc_union32 var37; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; ptr5 = (orc_union32 *)ex->arrays[5]; ptr6 = (orc_union32 *)ex->arrays[6]; for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr5[i]; /* 1: loadl */ var34 = ptr6[i]; /* 2: avgsl */ var37.i = ((orc_int64)var33.i + (orc_int64)var34.i + 1)>>1; /* 3: loadl */ var35 = ptr4[i]; /* 4: addl */ var36.i = var35.i + var37.i; /* 5: storel */ ptr0[i] = var36; } } OrcCode *_orc_code_orc_add2_rshift_add_s32_11_op; void orc_add2_rshift_add_s32_11_op (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, const orc_int32 * ORC_RESTRICT s3, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add2_rshift_add_s32_11_op; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; func = c->exec; func (ex); } #endif /* orc_mas4_horiz_sub_s32_1991_ip */ #ifdef DISABLE_ORC void orc_mas4_horiz_sub_s32_1991_ip (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, int p1, int p2, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; orc_union32 var44; orc_union32 var45; orc_union32 var46; orc_union32 var47; orc_union32 var48; orc_union32 var49; ptr0 = (orc_union32 *)d1; ptr4 = (orc_union32 *)s1; /* 3: loadpl */ var36.i = (int)0x00000009; /* 9 or 4.44659e-323f */ /* 9: loadpl */ var37.i = p1; for (i = 0; i < n; i++) { /* 0: loadoffl */ var40 = ptr4[i + 1]; /* 1: loadoffl */ var41 = ptr4[i + 2]; /* 2: addl */ var42.i = var40.i + var41.i; /* 4: mulll */ var43.i = (var42.i * var36.i) & 0xffffffff; /* 5: loadl */ var44 = ptr4[i]; /* 6: loadoffl */ var45 = ptr4[i + 3]; /* 7: addl */ var46.i = var44.i + var45.i; /* 8: subl */ var47.i = var43.i - var46.i; /* 10: addl */ var48.i = var47.i + var37.i; /* 11: shrsl */ var49.i = var48.i >> p2; /* 12: loadl */ var38 = ptr0[i]; /* 13: subl */ var39.i = var38.i - var49.i; /* 14: storel */ ptr0[i] = var39; } } #else static void _backup_orc_mas4_horiz_sub_s32_1991_ip (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; orc_union32 var44; orc_union32 var45; orc_union32 var46; orc_union32 var47; orc_union32 var48; orc_union32 var49; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; /* 3: loadpl */ var36.i = (int)0x00000009; /* 9 or 4.44659e-323f */ /* 9: loadpl */ var37.i = ex->params[24]; for (i = 0; i < n; i++) { /* 0: loadoffl */ var40 = ptr4[i + 1]; /* 1: loadoffl */ var41 = ptr4[i + 2]; /* 2: addl */ var42.i = var40.i + var41.i; /* 4: mulll */ var43.i = (var42.i * var36.i) & 0xffffffff; /* 5: loadl */ var44 = ptr4[i]; /* 6: loadoffl */ var45 = ptr4[i + 3]; /* 7: addl */ var46.i = var44.i + var45.i; /* 8: subl */ var47.i = var43.i - var46.i; /* 10: addl */ var48.i = var47.i + var37.i; /* 11: shrsl */ var49.i = var48.i >> ex->params[25]; /* 12: loadl */ var38 = ptr0[i]; /* 13: subl */ var39.i = var38.i - var49.i; /* 14: storel */ ptr0[i] = var39; } } OrcCode *_orc_code_orc_mas4_horiz_sub_s32_1991_ip; void orc_mas4_horiz_sub_s32_1991_ip (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, int p1, int p2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_mas4_horiz_sub_s32_1991_ip; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } #endif /* orc_haar_synth_s32_lo */ #ifdef DISABLE_ORC void orc_haar_synth_s32_lo (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var33; orc_union32 var34; orc_union32 var35; orc_union32 var36; orc_union32 var37; ptr0 = (orc_union32 *)d1; ptr4 = (orc_union32 *)s1; ptr5 = (orc_union32 *)s2; /* 1: loadpl */ var34.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr5[i]; /* 2: avgsl */ var37.i = ((orc_int64)var33.i + (orc_int64)var34.i + 1)>>1; /* 3: loadl */ var35 = ptr4[i]; /* 4: subl */ var36.i = var35.i - var37.i; /* 5: storel */ ptr0[i] = var36; } } #else static void _backup_orc_haar_synth_s32_lo (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var33; orc_union32 var34; orc_union32 var35; orc_union32 var36; orc_union32 var37; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; ptr5 = (orc_union32 *)ex->arrays[5]; /* 1: loadpl */ var34.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr5[i]; /* 2: avgsl */ var37.i = ((orc_int64)var33.i + (orc_int64)var34.i + 1)>>1; /* 3: loadl */ var35 = ptr4[i]; /* 4: subl */ var36.i = var35.i - var37.i; /* 5: storel */ ptr0[i] = var36; } } OrcCode *_orc_code_orc_haar_synth_s32_lo; void orc_haar_synth_s32_lo (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_synth_s32_lo; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_haar_synth_int_s32 */ #ifdef DISABLE_ORC void orc_haar_synth_int_s32 (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, int n){ int i; orc_union64 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var34; orc_union32 var35; orc_union32 var36; orc_union64 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; orc_union32 var41; ptr0 = (orc_union64 *)d1; ptr4 = (orc_union32 *)s1; ptr5 = (orc_union32 *)s2; /* 2: loadpl */ var35.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadl */ var34 = ptr5[i]; /* 1: copyl */ var38.i = var34.i; /* 3: avgsl */ var39.i = ((orc_int64)var38.i + (orc_int64)var35.i + 1)>>1; /* 4: loadl */ var36 = ptr4[i]; /* 5: subl */ var40.i = var36.i - var39.i; /* 6: addl */ var41.i = var38.i + var40.i; /* 7: mergelq */ { orc_union64 _dest; _dest.x2[0] = var40.i; _dest.x2[1] = var41.i; var37.i = _dest.i; } /* 8: storeq */ ptr0[i] = var37; } } #else static void _backup_orc_haar_synth_int_s32 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union64 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var34; orc_union32 var35; orc_union32 var36; orc_union64 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; orc_union32 var41; ptr0 = (orc_union64 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; ptr5 = (orc_union32 *)ex->arrays[5]; /* 2: loadpl */ var35.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadl */ var34 = ptr5[i]; /* 1: copyl */ var38.i = var34.i; /* 3: avgsl */ var39.i = ((orc_int64)var38.i + (orc_int64)var35.i + 1)>>1; /* 4: loadl */ var36 = ptr4[i]; /* 5: subl */ var40.i = var36.i - var39.i; /* 6: addl */ var41.i = var38.i + var40.i; /* 7: mergelq */ { orc_union64 _dest; _dest.x2[0] = var40.i; _dest.x2[1] = var41.i; var37.i = _dest.i; } /* 8: storeq */ ptr0[i] = var37; } } OrcCode *_orc_code_orc_haar_synth_int_s32; void orc_haar_synth_int_s32 (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_synth_int_s32; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_haar_synth_rrshift1_int_s32 */ #ifdef DISABLE_ORC void orc_haar_synth_rrshift1_int_s32 (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, int n){ int i; orc_union64 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var34; orc_union32 var35; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union64 var39; orc_union32 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; orc_union32 var44; orc_union32 var45; ptr0 = (orc_union64 *)d1; ptr4 = (orc_union32 *)s1; ptr5 = (orc_union32 *)s2; /* 2: loadpl */ var35.i = (int)0x00000000; /* 0 or 0f */ /* 7: loadpl */ var37.i = (int)0x00000000; /* 0 or 0f */ /* 9: loadpl */ var38.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadl */ var34 = ptr5[i]; /* 1: copyl */ var40.i = var34.i; /* 3: avgsl */ var41.i = ((orc_int64)var40.i + (orc_int64)var35.i + 1)>>1; /* 4: loadl */ var36 = ptr4[i]; /* 5: subl */ var42.i = var36.i - var41.i; /* 6: addl */ var43.i = var40.i + var42.i; /* 8: avgsl */ var44.i = ((orc_int64)var42.i + (orc_int64)var37.i + 1)>>1; /* 10: avgsl */ var45.i = ((orc_int64)var43.i + (orc_int64)var38.i + 1)>>1; /* 11: mergelq */ { orc_union64 _dest; _dest.x2[0] = var44.i; _dest.x2[1] = var45.i; var39.i = _dest.i; } /* 12: storeq */ ptr0[i] = var39; } } #else static void _backup_orc_haar_synth_rrshift1_int_s32 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union64 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var34; orc_union32 var35; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union64 var39; orc_union32 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; orc_union32 var44; orc_union32 var45; ptr0 = (orc_union64 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; ptr5 = (orc_union32 *)ex->arrays[5]; /* 2: loadpl */ var35.i = (int)0x00000000; /* 0 or 0f */ /* 7: loadpl */ var37.i = (int)0x00000000; /* 0 or 0f */ /* 9: loadpl */ var38.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadl */ var34 = ptr5[i]; /* 1: copyl */ var40.i = var34.i; /* 3: avgsl */ var41.i = ((orc_int64)var40.i + (orc_int64)var35.i + 1)>>1; /* 4: loadl */ var36 = ptr4[i]; /* 5: subl */ var42.i = var36.i - var41.i; /* 6: addl */ var43.i = var40.i + var42.i; /* 8: avgsl */ var44.i = ((orc_int64)var42.i + (orc_int64)var37.i + 1)>>1; /* 10: avgsl */ var45.i = ((orc_int64)var43.i + (orc_int64)var38.i + 1)>>1; /* 11: mergelq */ { orc_union64 _dest; _dest.x2[0] = var44.i; _dest.x2[1] = var45.i; var39.i = _dest.i; } /* 12: storeq */ ptr0[i] = var39; } } OrcCode *_orc_code_orc_haar_synth_rrshift1_int_s32; void orc_haar_synth_rrshift1_int_s32 (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_synth_rrshift1_int_s32; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_interleave2_s32 */ #ifdef DISABLE_ORC void orc_interleave2_s32 (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, int n){ int i; orc_union64 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var32; orc_union32 var33; orc_union64 var34; ptr0 = (orc_union64 *)d1; ptr4 = (orc_union32 *)s1; ptr5 = (orc_union32 *)s2; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: loadl */ var33 = ptr5[i]; /* 2: mergelq */ { orc_union64 _dest; _dest.x2[0] = var32.i; _dest.x2[1] = var33.i; var34.i = _dest.i; } /* 3: storeq */ ptr0[i] = var34; } } #else static void _backup_orc_interleave2_s32 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union64 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var32; orc_union32 var33; orc_union64 var34; ptr0 = (orc_union64 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; ptr5 = (orc_union32 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: loadl */ var33 = ptr5[i]; /* 2: mergelq */ { orc_union64 _dest; _dest.x2[0] = var32.i; _dest.x2[1] = var33.i; var34.i = _dest.i; } /* 3: storeq */ ptr0[i] = var34; } } OrcCode *_orc_code_orc_interleave2_s32; void orc_interleave2_s32 (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_interleave2_s32; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_mas2_sub_s32_ip */ #ifdef DISABLE_ORC void orc_mas2_sub_s32_ip (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, int p1, int p2, int p3, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var34; orc_union32 var35; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; ptr0 = (orc_union32 *)d1; ptr4 = (orc_union32 *)s1; /* 3: loadpl */ var35.i = p1; /* 5: loadpl */ var36.i = p2; for (i = 0; i < n; i++) { /* 0: loadoffl */ var39 = ptr4[i + 1]; /* 1: loadl */ var34 = ptr4[i]; /* 2: addl */ var40.i = var34.i + var39.i; /* 4: mulll */ var41.i = (var40.i * var35.i) & 0xffffffff; /* 6: addl */ var42.i = var41.i + var36.i; /* 7: shrsl */ var43.i = var42.i >> p3; /* 8: loadl */ var37 = ptr0[i]; /* 9: subl */ var38.i = var37.i - var43.i; /* 10: storel */ ptr0[i] = var38; } } #else static void _backup_orc_mas2_sub_s32_ip (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var34; orc_union32 var35; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; /* 3: loadpl */ var35.i = ex->params[24]; /* 5: loadpl */ var36.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadoffl */ var39 = ptr4[i + 1]; /* 1: loadl */ var34 = ptr4[i]; /* 2: addl */ var40.i = var34.i + var39.i; /* 4: mulll */ var41.i = (var40.i * var35.i) & 0xffffffff; /* 6: addl */ var42.i = var41.i + var36.i; /* 7: shrsl */ var43.i = var42.i >> ex->params[26]; /* 8: loadl */ var37 = ptr0[i]; /* 9: subl */ var38.i = var37.i - var43.i; /* 10: storel */ ptr0[i] = var38; } } OrcCode *_orc_code_orc_mas2_sub_s32_ip; void orc_mas2_sub_s32_ip (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, int p1, int p2, int p3, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_mas2_sub_s32_ip; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; func = c->exec; func (ex); } #endif /* orc_mas2_add_s32_ip */ #ifdef DISABLE_ORC void orc_mas2_add_s32_ip (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, int p1, int p2, int p3, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var34; orc_union32 var35; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; ptr0 = (orc_union32 *)d1; ptr4 = (orc_union32 *)s1; /* 3: loadpl */ var35.i = p1; /* 5: loadpl */ var36.i = p2; for (i = 0; i < n; i++) { /* 0: loadoffl */ var39 = ptr4[i + 1]; /* 1: loadl */ var34 = ptr4[i]; /* 2: addl */ var40.i = var34.i + var39.i; /* 4: mulll */ var41.i = (var40.i * var35.i) & 0xffffffff; /* 6: addl */ var42.i = var41.i + var36.i; /* 7: shrsl */ var43.i = var42.i >> p3; /* 8: loadl */ var37 = ptr0[i]; /* 9: addl */ var38.i = var37.i + var43.i; /* 10: storel */ ptr0[i] = var38; } } #else static void _backup_orc_mas2_add_s32_ip (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var34; orc_union32 var35; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; /* 3: loadpl */ var35.i = ex->params[24]; /* 5: loadpl */ var36.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadoffl */ var39 = ptr4[i + 1]; /* 1: loadl */ var34 = ptr4[i]; /* 2: addl */ var40.i = var34.i + var39.i; /* 4: mulll */ var41.i = (var40.i * var35.i) & 0xffffffff; /* 6: addl */ var42.i = var41.i + var36.i; /* 7: shrsl */ var43.i = var42.i >> ex->params[26]; /* 8: loadl */ var37 = ptr0[i]; /* 9: addl */ var38.i = var37.i + var43.i; /* 10: storel */ ptr0[i] = var38; } } OrcCode *_orc_code_orc_mas2_add_s32_ip; void orc_mas2_add_s32_ip (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, int p1, int p2, int p3, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_mas2_add_s32_ip; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; func = c->exec; func (ex); } #endif /* orc_mas2_add_s32_op */ #ifdef DISABLE_ORC void orc_mas2_add_s32_op (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, const orc_int32 * ORC_RESTRICT s3, int p1, int p2, int p3, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; const orc_union32 * ORC_RESTRICT ptr6; orc_union32 var34; orc_union32 var35; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; ptr0 = (orc_union32 *)d1; ptr4 = (orc_union32 *)s1; ptr5 = (orc_union32 *)s2; ptr6 = (orc_union32 *)s3; /* 3: loadpl */ var36.i = p1; /* 5: loadpl */ var37.i = p2; for (i = 0; i < n; i++) { /* 0: loadl */ var34 = ptr5[i]; /* 1: loadl */ var35 = ptr6[i]; /* 2: addl */ var40.i = var34.i + var35.i; /* 4: mulll */ var41.i = (var40.i * var36.i) & 0xffffffff; /* 6: addl */ var42.i = var41.i + var37.i; /* 7: shrsl */ var43.i = var42.i >> p3; /* 8: loadl */ var38 = ptr4[i]; /* 9: addl */ var39.i = var38.i + var43.i; /* 10: storel */ ptr0[i] = var39; } } #else static void _backup_orc_mas2_add_s32_op (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; const orc_union32 * ORC_RESTRICT ptr6; orc_union32 var34; orc_union32 var35; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; ptr5 = (orc_union32 *)ex->arrays[5]; ptr6 = (orc_union32 *)ex->arrays[6]; /* 3: loadpl */ var36.i = ex->params[24]; /* 5: loadpl */ var37.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadl */ var34 = ptr5[i]; /* 1: loadl */ var35 = ptr6[i]; /* 2: addl */ var40.i = var34.i + var35.i; /* 4: mulll */ var41.i = (var40.i * var36.i) & 0xffffffff; /* 6: addl */ var42.i = var41.i + var37.i; /* 7: shrsl */ var43.i = var42.i >> ex->params[26]; /* 8: loadl */ var38 = ptr4[i]; /* 9: addl */ var39.i = var38.i + var43.i; /* 10: storel */ ptr0[i] = var39; } } OrcCode *_orc_code_orc_mas2_add_s32_op; void orc_mas2_add_s32_op (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, const orc_int32 * ORC_RESTRICT s3, int p1, int p2, int p3, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_mas2_add_s32_op; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; func = c->exec; func (ex); } #endif /* orc_mas2_sub_s32_op */ #ifdef DISABLE_ORC void orc_mas2_sub_s32_op (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, const orc_int32 * ORC_RESTRICT s3, int p1, int p2, int p3, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; const orc_union32 * ORC_RESTRICT ptr6; orc_union32 var34; orc_union32 var35; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; ptr0 = (orc_union32 *)d1; ptr4 = (orc_union32 *)s1; ptr5 = (orc_union32 *)s2; ptr6 = (orc_union32 *)s3; /* 3: loadpl */ var36.i = p1; /* 5: loadpl */ var37.i = p2; for (i = 0; i < n; i++) { /* 0: loadl */ var34 = ptr5[i]; /* 1: loadl */ var35 = ptr6[i]; /* 2: addl */ var40.i = var34.i + var35.i; /* 4: mulll */ var41.i = (var40.i * var36.i) & 0xffffffff; /* 6: addl */ var42.i = var41.i + var37.i; /* 7: shrsl */ var43.i = var42.i >> p3; /* 8: loadl */ var38 = ptr4[i]; /* 9: subl */ var39.i = var38.i - var43.i; /* 10: storel */ ptr0[i] = var39; } } #else static void _backup_orc_mas2_sub_s32_op (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; const orc_union32 * ORC_RESTRICT ptr6; orc_union32 var34; orc_union32 var35; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; ptr5 = (orc_union32 *)ex->arrays[5]; ptr6 = (orc_union32 *)ex->arrays[6]; /* 3: loadpl */ var36.i = ex->params[24]; /* 5: loadpl */ var37.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadl */ var34 = ptr5[i]; /* 1: loadl */ var35 = ptr6[i]; /* 2: addl */ var40.i = var34.i + var35.i; /* 4: mulll */ var41.i = (var40.i * var36.i) & 0xffffffff; /* 6: addl */ var42.i = var41.i + var37.i; /* 7: shrsl */ var43.i = var42.i >> ex->params[26]; /* 8: loadl */ var38 = ptr4[i]; /* 9: subl */ var39.i = var38.i - var43.i; /* 10: storel */ ptr0[i] = var39; } } OrcCode *_orc_code_orc_mas2_sub_s32_op; void orc_mas2_sub_s32_op (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, const orc_int32 * ORC_RESTRICT s2, const orc_int32 * ORC_RESTRICT s3, int p1, int p2, int p3, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_mas2_sub_s32_op; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; func = c->exec; func (ex); } #endif /* orc_add2_rshift_sub_s32_22 */ #ifdef DISABLE_ORC void orc_add2_rshift_sub_s32_22 (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var33; orc_union32 var34; orc_union32 var35; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; ptr0 = (orc_union32 *)d1; ptr4 = (orc_union32 *)s1; /* 3: loadpl */ var34.i = (int)0x00000002; /* 2 or 9.88131e-324f */ for (i = 0; i < n; i++) { /* 0: loadoffl */ var37 = ptr4[i + 1]; /* 1: loadl */ var33 = ptr4[i]; /* 2: addl */ var38.i = var33.i + var37.i; /* 4: addl */ var39.i = var38.i + var34.i; /* 5: shrsl */ var40.i = var39.i >> 2; /* 6: loadl */ var35 = ptr0[i]; /* 7: subl */ var36.i = var35.i - var40.i; /* 8: storel */ ptr0[i] = var36; } } #else static void _backup_orc_add2_rshift_sub_s32_22 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var33; orc_union32 var34; orc_union32 var35; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; /* 3: loadpl */ var34.i = (int)0x00000002; /* 2 or 9.88131e-324f */ for (i = 0; i < n; i++) { /* 0: loadoffl */ var37 = ptr4[i + 1]; /* 1: loadl */ var33 = ptr4[i]; /* 2: addl */ var38.i = var33.i + var37.i; /* 4: addl */ var39.i = var38.i + var34.i; /* 5: shrsl */ var40.i = var39.i >> 2; /* 6: loadl */ var35 = ptr0[i]; /* 7: subl */ var36.i = var35.i - var40.i; /* 8: storel */ ptr0[i] = var36; } } OrcCode *_orc_code_orc_add2_rshift_sub_s32_22; void orc_add2_rshift_sub_s32_22 (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add2_rshift_sub_s32_22; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_add2_rshift_add_s32_11 */ #ifdef DISABLE_ORC void orc_add2_rshift_add_s32_11 (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var33; orc_union32 var34; orc_union32 var35; orc_union32 var36; orc_union32 var37; ptr0 = (orc_union32 *)d1; ptr4 = (orc_union32 *)s1; for (i = 0; i < n; i++) { /* 0: loadoffl */ var36 = ptr4[i + 1]; /* 1: loadl */ var33 = ptr4[i]; /* 2: avgsl */ var37.i = ((orc_int64)var33.i + (orc_int64)var36.i + 1)>>1; /* 3: loadl */ var34 = ptr0[i]; /* 4: addl */ var35.i = var34.i + var37.i; /* 5: storel */ ptr0[i] = var35; } } #else static void _backup_orc_add2_rshift_add_s32_11 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var33; orc_union32 var34; orc_union32 var35; orc_union32 var36; orc_union32 var37; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadoffl */ var36 = ptr4[i + 1]; /* 1: loadl */ var33 = ptr4[i]; /* 2: avgsl */ var37.i = ((orc_int64)var33.i + (orc_int64)var36.i + 1)>>1; /* 3: loadl */ var34 = ptr0[i]; /* 4: addl */ var35.i = var34.i + var37.i; /* 5: storel */ ptr0[i] = var35; } } OrcCode *_orc_code_orc_add2_rshift_add_s32_11; void orc_add2_rshift_add_s32_11 (orc_int32 * ORC_RESTRICT d1, const orc_int32 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_add2_rshift_add_s32_11; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_haar_synth_s32 */ #ifdef DISABLE_ORC void orc_haar_synth_s32 (orc_int32 * ORC_RESTRICT d1, orc_int32 * ORC_RESTRICT d2, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; orc_union32 * ORC_RESTRICT ptr1; orc_union32 var35; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; ptr0 = (orc_union32 *)d1; ptr1 = (orc_union32 *)d2; /* 4: loadpl */ var37.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadl */ var35 = ptr0[i]; /* 1: copyl */ var40.i = var35.i; /* 2: loadl */ var36 = ptr1[i]; /* 3: copyl */ var41.i = var36.i; /* 5: avgsl */ var42.i = ((orc_int64)var41.i + (orc_int64)var37.i + 1)>>1; /* 6: subl */ var43.i = var40.i - var42.i; /* 7: copyl */ var38.i = var43.i; /* 8: storel */ ptr0[i] = var38; /* 9: addl */ var39.i = var41.i + var43.i; /* 10: storel */ ptr1[i] = var39; } } #else static void _backup_orc_haar_synth_s32 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; orc_union32 * ORC_RESTRICT ptr1; orc_union32 var35; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; ptr0 = (orc_union32 *)ex->arrays[0]; ptr1 = (orc_union32 *)ex->arrays[1]; /* 4: loadpl */ var37.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadl */ var35 = ptr0[i]; /* 1: copyl */ var40.i = var35.i; /* 2: loadl */ var36 = ptr1[i]; /* 3: copyl */ var41.i = var36.i; /* 5: avgsl */ var42.i = ((orc_int64)var41.i + (orc_int64)var37.i + 1)>>1; /* 6: subl */ var43.i = var40.i - var42.i; /* 7: copyl */ var38.i = var43.i; /* 8: storel */ ptr0[i] = var38; /* 9: addl */ var39.i = var41.i + var43.i; /* 10: storel */ ptr1[i] = var39; } } OrcCode *_orc_code_orc_haar_synth_s32; void orc_haar_synth_s32 (orc_int32 * ORC_RESTRICT d1, orc_int32 * ORC_RESTRICT d2, int n) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_haar_synth_s32; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; func = c->exec; func (ex); } #endif /* orc_splat_s32_2d */ #ifdef DISABLE_ORC void orc_splat_s32_2d (orc_int32 * ORC_RESTRICT d1, int d1_stride, int p1, int n, int m){ int i; int j; orc_union32 * ORC_RESTRICT ptr0; orc_union32 var32; orc_union32 var33; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); /* 0: loadpl */ var32.i = p1; for (i = 0; i < n; i++) { /* 1: copyl */ var33.i = var32.i; /* 2: storel */ ptr0[i] = var33; } } } #else static void _backup_orc_splat_s32_2d (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_union32 * ORC_RESTRICT ptr0; orc_union32 var32; orc_union32 var33; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); /* 0: loadpl */ var32.i = ex->params[24]; for (i = 0; i < n; i++) { /* 1: copyl */ var33.i = var32.i; /* 2: storel */ ptr0[i] = var33; } } } OrcCode *_orc_code_orc_splat_s32_2d; void orc_splat_s32_2d (orc_int32 * ORC_RESTRICT d1, int d1_stride, int p1, int n, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_splat_s32_2d; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->params[ORC_VAR_P1] = p1; func = c->exec; func (ex); } #endif /* orc_dequantise_s32_ip_2d */ #ifdef DISABLE_ORC void orc_dequantise_s32_ip_2d (orc_int32 * ORC_RESTRICT d1, int d1_stride, int p1, int p2, int n, int m){ int i; int j; orc_union32 * ORC_RESTRICT ptr0; orc_union32 var34; orc_union32 var35; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); /* 4: loadpl */ var35.i = p1; /* 6: loadpl */ var36.i = p2; for (i = 0; i < n; i++) { /* 0: loadl */ var34 = ptr0[i]; /* 1: copyl */ var38.i = var34.i; /* 2: signl */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absl */ var40.i = ORC_ABS(var38.i); /* 5: mulll */ var41.i = (var40.i * var35.i) & 0xffffffff; /* 7: addl */ var42.i = var41.i + var36.i; /* 8: shrsl */ var43.i = var42.i >> 2; /* 9: mulll */ var37.i = (var43.i * var39.i) & 0xffffffff; /* 10: storel */ ptr0[i] = var37; } } } #else static void _backup_orc_dequantise_s32_ip_2d (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_union32 * ORC_RESTRICT ptr0; orc_union32 var34; orc_union32 var35; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); /* 4: loadpl */ var35.i = ex->params[24]; /* 6: loadpl */ var36.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadl */ var34 = ptr0[i]; /* 1: copyl */ var38.i = var34.i; /* 2: signl */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absl */ var40.i = ORC_ABS(var38.i); /* 5: mulll */ var41.i = (var40.i * var35.i) & 0xffffffff; /* 7: addl */ var42.i = var41.i + var36.i; /* 8: shrsl */ var43.i = var42.i >> 2; /* 9: mulll */ var37.i = (var43.i * var39.i) & 0xffffffff; /* 10: storel */ ptr0[i] = var37; } } } OrcCode *_orc_code_orc_dequantise_s32_ip_2d; void orc_dequantise_s32_ip_2d (orc_int32 * ORC_RESTRICT d1, int d1_stride, int p1, int p2, int n, int m) { OrcExecutor _ex, *ex = &_ex; OrcCode *c = _orc_code_orc_dequantise_s32_ip_2d; void (*func) (OrcExecutor *); ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } #endif void schro_orc_init (void) { #ifndef DISABLE_ORC { /* orc_add2_rshift_add_s16_22_vert */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_add2_rshift_add_s16_22_vert"); orc_program_set_backup_function (p, _backup_orc_add2_rshift_add_s16_22_vert); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_constant (p, 4, 0x00000002, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_add2_rshift_add_s16_22_vert = orc_program_take_code (p); orc_program_free (p); } { /* orc_add2_rshift_add_s32_22_vert */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_add2_rshift_add_s32_22_vert"); orc_program_set_backup_function (p, _backup_orc_add2_rshift_add_s32_22_vert); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_add_source (p, 4, "s2"); orc_program_add_constant (p, 4, 0x00000002, "c1"); orc_program_add_temporary (p, 4, "t1"); orc_program_append_2 (p, "addl", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "shrsl", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_add2_rshift_add_s32_22_vert = orc_program_take_code (p); orc_program_free (p); } { /* orc_add2_rshift_add_s16_22 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_add2_rshift_add_s16_22"); orc_program_set_backup_function (p, _backup_orc_add2_rshift_add_s16_22); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_constant (p, 4, 0x00000001, "c1"); orc_program_add_constant (p, 4, 0x00000002, "c2"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "loadoffw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C2, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_add2_rshift_add_s16_22 = orc_program_take_code (p); orc_program_free (p); } { /* orc_add2_rshift_add_s32_22 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_add2_rshift_add_s32_22"); orc_program_set_backup_function (p, _backup_orc_add2_rshift_add_s32_22); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_add_constant (p, 4, 0x00000001, "c1"); orc_program_add_constant (p, 4, 0x00000002, "c2"); orc_program_add_temporary (p, 4, "t1"); orc_program_append_2 (p, "loadoffl", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C2, ORC_VAR_D1); orc_program_append_2 (p, "shrsl", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C2, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_add2_rshift_add_s32_22 = orc_program_take_code (p); orc_program_free (p); } { /* orc_add2_rshift_sub_s16_22_vert */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_add2_rshift_sub_s16_22_vert"); orc_program_set_backup_function (p, _backup_orc_add2_rshift_sub_s16_22_vert); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_constant (p, 4, 0x00000002, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_add2_rshift_sub_s16_22_vert = orc_program_take_code (p); orc_program_free (p); } { /* orc_add2_rshift_sub_s16_22 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_add2_rshift_sub_s16_22"); orc_program_set_backup_function (p, _backup_orc_add2_rshift_sub_s16_22); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_constant (p, 4, 0x00000001, "c1"); orc_program_add_constant (p, 4, 0x00000002, "c2"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "loadoffw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C2, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C2, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_add2_rshift_sub_s16_22 = orc_program_take_code (p); orc_program_free (p); } { /* orc_add2_rshift_add_s16_11_op */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_add2_rshift_add_s16_11_op"); orc_program_set_backup_function (p, _backup_orc_add2_rshift_add_s16_11_op); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_source (p, 2, "s3"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "avgsw", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_S3, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_add2_rshift_add_s16_11_op = orc_program_take_code (p); orc_program_free (p); } { /* orc_add2_rshift_add_s16_11 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_add2_rshift_add_s16_11"); orc_program_set_backup_function (p, _backup_orc_add2_rshift_add_s16_11); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_constant (p, 4, 0x00000001, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "loadoffw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "avgsw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_add2_rshift_add_s16_11 = orc_program_take_code (p); orc_program_free (p); } { /* orc_add2_rshift_sub_s16_11_vert */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_add2_rshift_sub_s16_11_vert"); orc_program_set_backup_function (p, _backup_orc_add2_rshift_sub_s16_11_vert); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "avgsw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_add2_rshift_sub_s16_11_vert = orc_program_take_code (p); orc_program_free (p); } { /* orc_add2_rshift_sub_s32_11_vert */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_add2_rshift_sub_s32_11_vert"); orc_program_set_backup_function (p, _backup_orc_add2_rshift_sub_s32_11_vert); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_add_source (p, 4, "s2"); orc_program_add_temporary (p, 4, "t1"); orc_program_append_2 (p, "avgsl", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); orc_program_append_2 (p, "subl", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_add2_rshift_sub_s32_11_vert = orc_program_take_code (p); orc_program_free (p); } { /* orc_add2_rshift_sub_s16_11 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_add2_rshift_sub_s16_11"); orc_program_set_backup_function (p, _backup_orc_add2_rshift_sub_s16_11); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_constant (p, 4, 0x00000001, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "loadoffw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "avgsw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_add2_rshift_sub_s16_11 = orc_program_take_code (p); orc_program_free (p); } { /* orc_add2_rshift_sub_s32_11 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_add2_rshift_sub_s32_11"); orc_program_set_backup_function (p, _backup_orc_add2_rshift_sub_s32_11); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_add_constant (p, 4, 0x00000001, "c1"); orc_program_add_temporary (p, 4, "t1"); orc_program_append_2 (p, "loadoffl", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "avgsl", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "subl", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_add2_rshift_sub_s32_11 = orc_program_take_code (p); orc_program_free (p); } { /* orc_add_const_rshift_s16_11 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_add_const_rshift_s16_11"); orc_program_set_backup_function (p, _backup_orc_add_const_rshift_s16_11); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_constant (p, 4, 0x00000001, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_add_const_rshift_s16_11 = orc_program_take_code (p); orc_program_free (p); } { /* orc_add_const_rshift_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_add_const_rshift_s16"); orc_program_set_backup_function (p, _backup_orc_add_const_rshift_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_P2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_add_const_rshift_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_add_const_rshift_s32 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_add_const_rshift_s32"); orc_program_set_backup_function (p, _backup_orc_add_const_rshift_s32); orc_program_add_destination (p, 4, "d1"); orc_program_add_parameter (p, 4, "p1"); orc_program_add_parameter (p, 4, "p2"); orc_program_add_temporary (p, 4, "t1"); orc_program_append_2 (p, "addl", 0, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "shrsl", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_P2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_add_const_rshift_s32 = orc_program_take_code (p); orc_program_free (p); } { /* orc_add_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_add_s16"); orc_program_set_backup_function (p, _backup_orc_add_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_add_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_add_s16_2d */ OrcProgram *p; p = orc_program_new (); orc_program_set_2d (p); orc_program_set_name (p, "orc_add_s16_2d"); orc_program_set_backup_function (p, _backup_orc_add_s16_2d); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_add_s16_2d = orc_program_take_code (p); orc_program_free (p); } { /* orc_addc_rshift_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_addc_rshift_s16"); orc_program_set_backup_function (p, _backup_orc_addc_rshift_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_addc_rshift_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_lshift1_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_lshift1_s16"); orc_program_set_backup_function (p, _backup_orc_lshift1_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_constant (p, 4, 0x00000001, "c1"); orc_program_append_2 (p, "shlw", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_C1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_lshift1_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_lshift2_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_lshift2_s16"); orc_program_set_backup_function (p, _backup_orc_lshift2_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_constant (p, 4, 0x00000002, "c1"); orc_program_append_2 (p, "shlw", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_C1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_lshift2_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_lshift_s16_ip */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_lshift_s16_ip"); orc_program_set_backup_function (p, _backup_orc_lshift_s16_ip); orc_program_add_destination (p, 2, "d1"); orc_program_add_parameter (p, 2, "p1"); orc_program_append_2 (p, "shlw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_P1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_lshift_s16_ip = orc_program_take_code (p); orc_program_free (p); } { /* orc_lshift_s32_ip */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_lshift_s32_ip"); orc_program_set_backup_function (p, _backup_orc_lshift_s32_ip); orc_program_add_destination (p, 4, "d1"); orc_program_add_parameter (p, 4, "p1"); orc_program_append_2 (p, "shll", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_P1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_lshift_s32_ip = orc_program_take_code (p); orc_program_free (p); } { /* orc_mas2_add_s16_op */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_mas2_add_s16_op"); orc_program_set_backup_function (p, _backup_orc_mas2_add_s16_op); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_source (p, 2, "s3"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 4, "p2"); orc_program_add_parameter (p, 4, "p3"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 4, "t2"); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_S3, ORC_VAR_D1); orc_program_append_2 (p, "mulswl", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "shrsl", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P3, ORC_VAR_D1); orc_program_append_2 (p, "convlw", 0, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_mas2_add_s16_op = orc_program_take_code (p); orc_program_free (p); } { /* orc_mas2_add_s16_ip */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_mas2_add_s16_ip"); orc_program_set_backup_function (p, _backup_orc_mas2_add_s16_ip); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_constant (p, 4, 0x00000001, "c1"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 4, "p2"); orc_program_add_parameter (p, 4, "p3"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 4, "t2"); orc_program_append_2 (p, "loadoffw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "mulswl", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "shrsl", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P3, ORC_VAR_D1); orc_program_append_2 (p, "convlw", 0, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_mas2_add_s16_ip = orc_program_take_code (p); orc_program_free (p); } { /* orc_mas2_sub_s16_op */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_mas2_sub_s16_op"); orc_program_set_backup_function (p, _backup_orc_mas2_sub_s16_op); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_source (p, 2, "s3"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 4, "p2"); orc_program_add_parameter (p, 4, "p3"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 4, "t2"); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_S3, ORC_VAR_D1); orc_program_append_2 (p, "mulswl", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "shrsl", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P3, ORC_VAR_D1); orc_program_append_2 (p, "convlw", 0, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_mas2_sub_s16_op = orc_program_take_code (p); orc_program_free (p); } { /* orc_mas2_sub_s16_ip */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_mas2_sub_s16_ip"); orc_program_set_backup_function (p, _backup_orc_mas2_sub_s16_ip); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_constant (p, 4, 0x00000001, "c1"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 4, "p2"); orc_program_add_parameter (p, 4, "p3"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 4, "t2"); orc_program_append_2 (p, "loadoffw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "mulswl", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "shrsl", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P3, ORC_VAR_D1); orc_program_append_2 (p, "convlw", 0, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_mas2_sub_s16_ip = orc_program_take_code (p); orc_program_free (p); } { /* orc_mas4_vert_add_s16_1991 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_mas4_vert_add_s16_1991"); orc_program_set_backup_function (p, _backup_orc_mas4_vert_add_s16_1991); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_source (p, 2, "s3"); orc_program_add_source (p, 2, "s4"); orc_program_add_constant (p, 4, 0x00000009, "c1"); orc_program_add_parameter (p, 4, "p1"); orc_program_add_parameter (p, 4, "p2"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_add_temporary (p, 4, "t3"); orc_program_add_temporary (p, 4, "t4"); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_S3, ORC_VAR_D1); orc_program_append_2 (p, "mulswl", 0, ORC_VAR_T3, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_S1, ORC_VAR_S4, ORC_VAR_D1); orc_program_append_2 (p, "convswl", 0, ORC_VAR_T4, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "subl", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_T4, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "shrsl", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "convlw", 0, ORC_VAR_T1, ORC_VAR_T3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_mas4_vert_add_s16_1991 = orc_program_take_code (p); orc_program_free (p); } { /* orc_mas4_vert_add_s32_1991 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_mas4_vert_add_s32_1991"); orc_program_set_backup_function (p, _backup_orc_mas4_vert_add_s32_1991); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_add_source (p, 4, "s2"); orc_program_add_source (p, 4, "s3"); orc_program_add_source (p, 4, "s4"); orc_program_add_constant (p, 4, 0x00000009, "c1"); orc_program_add_parameter (p, 4, "p1"); orc_program_add_parameter (p, 4, "p2"); orc_program_add_temporary (p, 4, "t1"); orc_program_add_temporary (p, 4, "t2"); orc_program_add_temporary (p, 4, "t3"); orc_program_append_2 (p, "addl", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_S3, ORC_VAR_D1); orc_program_append_2 (p, "mulll", 0, ORC_VAR_T3, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_T2, ORC_VAR_S1, ORC_VAR_S4, ORC_VAR_D1); orc_program_append_2 (p, "subl", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_T2, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "shrsl", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T3, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_mas4_vert_add_s32_1991 = orc_program_take_code (p); orc_program_free (p); } { /* orc_mas4_horiz_add_s16_1991_ip */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_mas4_horiz_add_s16_1991_ip"); orc_program_set_backup_function (p, _backup_orc_mas4_horiz_add_s16_1991_ip); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_constant (p, 4, 0x00000001, "c1"); orc_program_add_constant (p, 4, 0x00000002, "c2"); orc_program_add_constant (p, 4, 0x00000009, "c3"); orc_program_add_constant (p, 4, 0x00000003, "c4"); orc_program_add_parameter (p, 4, "p1"); orc_program_add_parameter (p, 4, "p2"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_add_temporary (p, 4, "t3"); orc_program_add_temporary (p, 4, "t4"); orc_program_append_2 (p, "loadoffw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "loadoffw", 0, ORC_VAR_T2, ORC_VAR_S1, ORC_VAR_C2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_append_2 (p, "mulswl", 0, ORC_VAR_T3, ORC_VAR_T1, ORC_VAR_C3, ORC_VAR_D1); orc_program_append_2 (p, "loadw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "loadoffw", 0, ORC_VAR_T2, ORC_VAR_S1, ORC_VAR_C4, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_append_2 (p, "convswl", 0, ORC_VAR_T4, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "subl", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_T4, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "shrsl", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "convlw", 0, ORC_VAR_T1, ORC_VAR_T3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_mas4_horiz_add_s16_1991_ip = orc_program_take_code (p); orc_program_free (p); } { /* orc_mas4_vert_sub_s16_1991 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_mas4_vert_sub_s16_1991"); orc_program_set_backup_function (p, _backup_orc_mas4_vert_sub_s16_1991); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_source (p, 2, "s3"); orc_program_add_source (p, 2, "s4"); orc_program_add_constant (p, 4, 0x00000009, "c1"); orc_program_add_parameter (p, 4, "p1"); orc_program_add_parameter (p, 4, "p2"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_add_temporary (p, 4, "t3"); orc_program_add_temporary (p, 4, "t4"); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_S3, ORC_VAR_D1); orc_program_append_2 (p, "mulswl", 0, ORC_VAR_T3, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_S1, ORC_VAR_S4, ORC_VAR_D1); orc_program_append_2 (p, "convswl", 0, ORC_VAR_T4, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "subl", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_T4, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "shrsl", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "convlw", 0, ORC_VAR_T1, ORC_VAR_T3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_mas4_vert_sub_s16_1991 = orc_program_take_code (p); orc_program_free (p); } { /* orc_mas4_horiz_sub_s16_1991_ip */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_mas4_horiz_sub_s16_1991_ip"); orc_program_set_backup_function (p, _backup_orc_mas4_horiz_sub_s16_1991_ip); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_constant (p, 4, 0x00000001, "c1"); orc_program_add_constant (p, 4, 0x00000002, "c2"); orc_program_add_constant (p, 4, 0x00000009, "c3"); orc_program_add_constant (p, 4, 0x00000003, "c4"); orc_program_add_parameter (p, 4, "p1"); orc_program_add_parameter (p, 4, "p2"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_add_temporary (p, 4, "t3"); orc_program_add_temporary (p, 4, "t4"); orc_program_append_2 (p, "loadoffw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "loadoffw", 0, ORC_VAR_T2, ORC_VAR_S1, ORC_VAR_C2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_append_2 (p, "mulswl", 0, ORC_VAR_T3, ORC_VAR_T1, ORC_VAR_C3, ORC_VAR_D1); orc_program_append_2 (p, "loadw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "loadoffw", 0, ORC_VAR_T2, ORC_VAR_S1, ORC_VAR_C4, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_append_2 (p, "convswl", 0, ORC_VAR_T4, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "subl", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_T4, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "shrsl", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "convlw", 0, ORC_VAR_T1, ORC_VAR_T3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_mas4_horiz_sub_s16_1991_ip = orc_program_take_code (p); orc_program_free (p); } { /* orc_subtract_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_subtract_s16"); orc_program_set_backup_function (p, _backup_orc_subtract_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_append_2 (p, "subw", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_subtract_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_add_s16_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_add_s16_u8"); orc_program_set_backup_function (p, _backup_orc_add_s16_u8); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_add_s16_u8 = orc_program_take_code (p); orc_program_free (p); } { /* orc_add_s16_u8_2d */ OrcProgram *p; p = orc_program_new (); orc_program_set_2d (p); orc_program_set_name (p, "orc_add_s16_u8_2d"); orc_program_set_backup_function (p, _backup_orc_add_s16_u8_2d); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_add_s16_u8_2d = orc_program_take_code (p); orc_program_free (p); } { /* orc_convert_s16_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_convert_s16_u8"); orc_program_set_backup_function (p, _backup_orc_convert_s16_u8); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_append_2 (p, "convubw", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_convert_s16_u8 = orc_program_take_code (p); orc_program_free (p); } { /* orc_convert_s16_s32 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_convert_s16_s32"); orc_program_set_backup_function (p, _backup_orc_convert_s16_s32); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_append_2 (p, "convlw", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_convert_s16_s32 = orc_program_take_code (p); orc_program_free (p); } { /* orc_convert_u8_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_convert_u8_s16"); orc_program_set_backup_function (p, _backup_orc_convert_u8_s16); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_convert_u8_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_convert_s32_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_convert_s32_s16"); orc_program_set_backup_function (p, _backup_orc_convert_s32_s16); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_append_2 (p, "convswl", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_convert_s32_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_offsetconvert_u8_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_offsetconvert_u8_s16"); orc_program_set_backup_function (p, _backup_orc_offsetconvert_u8_s16); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_constant (p, 4, 0x00000080, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_offsetconvert_u8_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_offsetconvert_u8_s32 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_offsetconvert_u8_s32"); orc_program_set_backup_function (p, _backup_orc_offsetconvert_u8_s32); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_add_constant (p, 4, 0x00000080, "c1"); orc_program_add_temporary (p, 4, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "addl", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "convsuslw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_offsetconvert_u8_s32 = orc_program_take_code (p); orc_program_free (p); } { /* orc_offsetconvert_s16_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_offsetconvert_s16_u8"); orc_program_set_backup_function (p, _backup_orc_offsetconvert_s16_u8); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_constant (p, 4, 0x00000080, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_offsetconvert_s16_u8 = orc_program_take_code (p); orc_program_free (p); } { /* orc_offsetconvert_s32_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_offsetconvert_s32_u8"); orc_program_set_backup_function (p, _backup_orc_offsetconvert_s32_u8); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_constant (p, 4, 0x00000080, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "convswl", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_offsetconvert_s32_u8 = orc_program_take_code (p); orc_program_free (p); } { /* orc_offsetconvert_s32_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_offsetconvert_s32_s16"); orc_program_set_backup_function (p, _backup_orc_offsetconvert_s32_s16); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_constant (p, 4, 0x00000080, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "convswl", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_offsetconvert_s32_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_subtract_s16_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_subtract_s16_u8"); orc_program_set_backup_function (p, _backup_orc_subtract_s16_u8); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_subtract_s16_u8 = orc_program_take_code (p); orc_program_free (p); } { /* orc_multiply_and_add_s16_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_multiply_and_add_s16_u8"); orc_program_set_backup_function (p, _backup_orc_multiply_and_add_s16_u8); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_multiply_and_add_s16_u8 = orc_program_take_code (p); orc_program_free (p); } { /* orc_splat_s16_ns */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_splat_s16_ns"); orc_program_set_backup_function (p, _backup_orc_splat_s16_ns); orc_program_add_destination (p, 2, "d1"); orc_program_add_parameter (p, 2, "p1"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_D1, ORC_VAR_P1, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_splat_s16_ns = orc_program_take_code (p); orc_program_free (p); } { /* orc_splat_s32_ns */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_splat_s32_ns"); orc_program_set_backup_function (p, _backup_orc_splat_s32_ns); orc_program_add_destination (p, 4, "d1"); orc_program_add_parameter (p, 4, "p1"); orc_program_append_2 (p, "copyl", 0, ORC_VAR_D1, ORC_VAR_P1, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_splat_s32_ns = orc_program_take_code (p); orc_program_free (p); } { /* orc_splat_s16_2d_4xn */ OrcProgram *p; p = orc_program_new (); orc_program_set_constant_n (p, 4); orc_program_set_2d (p); orc_program_set_name (p, "orc_splat_s16_2d_4xn"); orc_program_set_backup_function (p, _backup_orc_splat_s16_2d_4xn); orc_program_add_destination (p, 2, "d1"); orc_program_add_parameter (p, 2, "p1"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_D1, ORC_VAR_P1, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_splat_s16_2d_4xn = orc_program_take_code (p); orc_program_free (p); } { /* orc_splat_s16_2d_8xn */ OrcProgram *p; p = orc_program_new (); orc_program_set_constant_n (p, 8); orc_program_set_2d (p); orc_program_set_name (p, "orc_splat_s16_2d_8xn"); orc_program_set_backup_function (p, _backup_orc_splat_s16_2d_8xn); orc_program_add_destination (p, 2, "d1"); orc_program_add_parameter (p, 2, "p1"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_D1, ORC_VAR_P1, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_splat_s16_2d_8xn = orc_program_take_code (p); orc_program_free (p); } { /* orc_splat_s16_2d */ OrcProgram *p; p = orc_program_new (); orc_program_set_2d (p); orc_program_set_name (p, "orc_splat_s16_2d"); orc_program_set_backup_function (p, _backup_orc_splat_s16_2d); orc_program_add_destination (p, 2, "d1"); orc_program_add_parameter (p, 2, "p1"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_D1, ORC_VAR_P1, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_splat_s16_2d = orc_program_take_code (p); orc_program_free (p); } { /* orc_splat_u8_ns */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_splat_u8_ns"); orc_program_set_backup_function (p, _backup_orc_splat_u8_ns); orc_program_add_destination (p, 1, "d1"); orc_program_add_parameter (p, 1, "p1"); orc_program_append_2 (p, "copyb", 0, ORC_VAR_D1, ORC_VAR_P1, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_splat_u8_ns = orc_program_take_code (p); orc_program_free (p); } { /* orc_splat_u8_2d */ OrcProgram *p; p = orc_program_new (); orc_program_set_2d (p); orc_program_set_name (p, "orc_splat_u8_2d"); orc_program_set_backup_function (p, _backup_orc_splat_u8_2d); orc_program_add_destination (p, 1, "d1"); orc_program_add_parameter (p, 1, "p1"); orc_program_append_2 (p, "copyb", 0, ORC_VAR_D1, ORC_VAR_P1, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_splat_u8_2d = orc_program_take_code (p); orc_program_free (p); } { /* orc_average_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_average_u8"); orc_program_set_backup_function (p, _backup_orc_average_u8); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_append_2 (p, "avgub", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_average_u8 = orc_program_take_code (p); orc_program_free (p); } { /* orc_rrshift6_add_s16_2d */ OrcProgram *p; p = orc_program_new (); orc_program_set_2d (p); orc_program_set_name (p, "orc_rrshift6_add_s16_2d"); orc_program_set_backup_function (p, _backup_orc_rrshift6_add_s16_2d); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_constant (p, 4, 0x00000020, "c1"); orc_program_add_constant (p, 4, 0x00000006, "c2"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_rrshift6_add_s16_2d = orc_program_take_code (p); orc_program_free (p); } { /* orc_rrshift6_add_s32_2d */ OrcProgram *p; p = orc_program_new (); orc_program_set_2d (p); orc_program_set_name (p, "orc_rrshift6_add_s32_2d"); orc_program_set_backup_function (p, _backup_orc_rrshift6_add_s32_2d); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_constant (p, 4, 0x00000020, "c1"); orc_program_add_constant (p, 4, 0x00000006, "c2"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C2, ORC_VAR_D1); orc_program_append_2 (p, "convlw", 0, ORC_VAR_T2, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_rrshift6_add_s32_2d = orc_program_take_code (p); orc_program_free (p); } { /* orc_rrshift6_sub_s16_2d */ OrcProgram *p; p = orc_program_new (); orc_program_set_2d (p); orc_program_set_name (p, "orc_rrshift6_sub_s16_2d"); orc_program_set_backup_function (p, _backup_orc_rrshift6_sub_s16_2d); orc_program_add_destination (p, 2, "d1"); orc_program_add_destination (p, 2, "d2"); orc_program_add_constant (p, 4, 0x00001fe0, "c1"); orc_program_add_constant (p, 4, 0x00000006, "c2"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_D2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C2, ORC_VAR_D1); orc_program_append_2 (p, "copyw", 0, ORC_VAR_D2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_rrshift6_sub_s16_2d = orc_program_take_code (p); orc_program_free (p); } { /* orc_rrshift6_s16_ip_2d */ OrcProgram *p; p = orc_program_new (); orc_program_set_2d (p); orc_program_set_name (p, "orc_rrshift6_s16_ip_2d"); orc_program_set_backup_function (p, _backup_orc_rrshift6_s16_ip_2d); orc_program_add_destination (p, 2, "d1"); orc_program_add_constant (p, 4, 0x00001fe0, "c1"); orc_program_add_constant (p, 4, 0x00000006, "c2"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_C2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_rrshift6_s16_ip_2d = orc_program_take_code (p); orc_program_free (p); } { /* orc_rrshift6_s16_ip */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_rrshift6_s16_ip"); orc_program_set_backup_function (p, _backup_orc_rrshift6_s16_ip); orc_program_add_destination (p, 2, "d1"); orc_program_add_constant (p, 4, 0x00001fe0, "c1"); orc_program_add_constant (p, 4, 0x00000006, "c2"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_C2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_rrshift6_s16_ip = orc_program_take_code (p); orc_program_free (p); } { /* orc_unpack_yuyv_y */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_unpack_yuyv_y"); orc_program_set_backup_function (p, _backup_orc_unpack_yuyv_y); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_append_2 (p, "select0wb", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_unpack_yuyv_y = orc_program_take_code (p); orc_program_free (p); } { /* orc_unpack_yuyv_u */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_unpack_yuyv_u"); orc_program_set_backup_function (p, _backup_orc_unpack_yuyv_u); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "select0lw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "select1wb", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_unpack_yuyv_u = orc_program_take_code (p); orc_program_free (p); } { /* orc_unpack_yuyv_v */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_unpack_yuyv_v"); orc_program_set_backup_function (p, _backup_orc_unpack_yuyv_v); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "select1lw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "select1wb", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_unpack_yuyv_v = orc_program_take_code (p); orc_program_free (p); } { /* orc_packyuyv */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_packyuyv"); orc_program_set_backup_function (p, _backup_orc_packyuyv); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_source (p, 1, "s3"); orc_program_add_temporary (p, 1, "t1"); orc_program_add_temporary (p, 1, "t2"); orc_program_add_temporary (p, 2, "t3"); orc_program_add_temporary (p, 2, "t4"); orc_program_add_temporary (p, 2, "t5"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T5, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "select0wb", 0, ORC_VAR_T1, ORC_VAR_T5, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "select1wb", 0, ORC_VAR_T2, ORC_VAR_T5, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mergebw", 0, ORC_VAR_T3, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_D1); orc_program_append_2 (p, "mergebw", 0, ORC_VAR_T4, ORC_VAR_T2, ORC_VAR_S3, ORC_VAR_D1); orc_program_append_2 (p, "mergewl", 0, ORC_VAR_D1, ORC_VAR_T3, ORC_VAR_T4, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_packyuyv = orc_program_take_code (p); orc_program_free (p); } { /* orc_unpack_uyvy_y */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_unpack_uyvy_y"); orc_program_set_backup_function (p, _backup_orc_unpack_uyvy_y); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_append_2 (p, "select1wb", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_unpack_uyvy_y = orc_program_take_code (p); orc_program_free (p); } { /* orc_unpack_uyvy_u */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_unpack_uyvy_u"); orc_program_set_backup_function (p, _backup_orc_unpack_uyvy_u); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "select0lw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "select0wb", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_unpack_uyvy_u = orc_program_take_code (p); orc_program_free (p); } { /* orc_unpack_uyvy_v */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_unpack_uyvy_v"); orc_program_set_backup_function (p, _backup_orc_unpack_uyvy_v); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "select1lw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "select0wb", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_unpack_uyvy_v = orc_program_take_code (p); orc_program_free (p); } { /* orc_interleave2_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_interleave2_s16"); orc_program_set_backup_function (p, _backup_orc_interleave2_s16); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_append_2 (p, "mergewl", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_interleave2_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_interleave2_rrshift1_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_interleave2_rrshift1_s16"); orc_program_set_backup_function (p, _backup_orc_interleave2_rrshift1_s16); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_constant (p, 4, 0x00000001, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "mergewl", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_interleave2_rrshift1_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_deinterleave2_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_deinterleave2_s16"); orc_program_set_backup_function (p, _backup_orc_deinterleave2_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_destination (p, 2, "d2"); orc_program_add_source (p, 4, "s1"); orc_program_append_2 (p, "splitlw", 0, ORC_VAR_D2, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_deinterleave2_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_deinterleave2_s32 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_deinterleave2_s32"); orc_program_set_backup_function (p, _backup_orc_deinterleave2_s32); orc_program_add_destination (p, 4, "d1"); orc_program_add_destination (p, 4, "d2"); orc_program_add_source (p, 8, "s1"); orc_program_append_2 (p, "splitql", 0, ORC_VAR_D2, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_deinterleave2_s32 = orc_program_take_code (p); orc_program_free (p); } { /* orc_deinterleave2_lshift1_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_deinterleave2_lshift1_s16"); orc_program_set_backup_function (p, _backup_orc_deinterleave2_lshift1_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_destination (p, 2, "d2"); orc_program_add_source (p, 4, "s1"); orc_program_add_constant (p, 4, 0x00000001, "c1"); orc_program_add_temporary (p, 4, "t1"); orc_program_append_2 (p, "shlw", 1, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "splitlw", 0, ORC_VAR_D2, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_deinterleave2_lshift1_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_deinterleave2_lshift1_s32 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_deinterleave2_lshift1_s32"); orc_program_set_backup_function (p, _backup_orc_deinterleave2_lshift1_s32); orc_program_add_destination (p, 4, "d1"); orc_program_add_destination (p, 4, "d2"); orc_program_add_source (p, 8, "s1"); orc_program_add_constant (p, 4, 0x00000001, "c1"); orc_program_add_temporary (p, 8, "t1"); orc_program_append_2 (p, "shll", 1, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "splitql", 0, ORC_VAR_D2, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_deinterleave2_lshift1_s32 = orc_program_take_code (p); orc_program_free (p); } { /* orc_haar_deint_lshift1_split_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_haar_deint_lshift1_split_s16"); orc_program_set_backup_function (p, _backup_orc_haar_deint_lshift1_split_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_destination (p, 2, "d2"); orc_program_add_source (p, 4, "s1"); orc_program_add_constant (p, 4, 0x00000001, "c1"); orc_program_add_constant (p, 4, 0x00000000, "c2"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_add_temporary (p, 4, "t3"); orc_program_append_2 (p, "shlw", 1, ORC_VAR_T3, ORC_VAR_S1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "splitlw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_T3, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "copyw", 0, ORC_VAR_D2, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "avgsw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_haar_deint_lshift1_split_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_haar_deint_lshift1_split_s32 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_haar_deint_lshift1_split_s32"); orc_program_set_backup_function (p, _backup_orc_haar_deint_lshift1_split_s32); orc_program_add_destination (p, 4, "d1"); orc_program_add_destination (p, 4, "d2"); orc_program_add_source (p, 8, "s1"); orc_program_add_constant (p, 4, 0x00000001, "c1"); orc_program_add_constant (p, 4, 0x00000000, "c2"); orc_program_add_temporary (p, 4, "t1"); orc_program_add_temporary (p, 4, "t2"); orc_program_add_temporary (p, 8, "t3"); orc_program_append_2 (p, "shll", 1, ORC_VAR_T3, ORC_VAR_S1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "splitql", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_T3, ORC_VAR_D1); orc_program_append_2 (p, "subl", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "copyl", 0, ORC_VAR_D2, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "avgsl", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C2, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_haar_deint_lshift1_split_s32 = orc_program_take_code (p); orc_program_free (p); } { /* orc_haar_deint_split_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_haar_deint_split_s16"); orc_program_set_backup_function (p, _backup_orc_haar_deint_split_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_destination (p, 2, "d2"); orc_program_add_source (p, 4, "s1"); orc_program_add_constant (p, 4, 0x00000000, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "splitlw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "copyw", 0, ORC_VAR_D2, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "avgsw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_haar_deint_split_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_haar_deint_split_s32 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_haar_deint_split_s32"); orc_program_set_backup_function (p, _backup_orc_haar_deint_split_s32); orc_program_add_destination (p, 4, "d1"); orc_program_add_destination (p, 4, "d2"); orc_program_add_source (p, 8, "s1"); orc_program_add_constant (p, 4, 0x00000000, "c1"); orc_program_add_temporary (p, 4, "t1"); orc_program_add_temporary (p, 4, "t2"); orc_program_append_2 (p, "splitql", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1); orc_program_append_2 (p, "subl", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "copyl", 0, ORC_VAR_D2, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "avgsl", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_haar_deint_split_s32 = orc_program_take_code (p); orc_program_free (p); } { /* orc_haar_split_s16_lo */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_haar_split_s16_lo"); orc_program_set_backup_function (p, _backup_orc_haar_split_s16_lo); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_constant (p, 4, 0x00000000, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "avgsw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_haar_split_s16_lo = orc_program_take_code (p); orc_program_free (p); } { /* orc_haar_split_s16_hi */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_haar_split_s16_hi"); orc_program_set_backup_function (p, _backup_orc_haar_split_s16_hi); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_append_2 (p, "subw", 0, ORC_VAR_D1, ORC_VAR_S2, ORC_VAR_S1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_haar_split_s16_hi = orc_program_take_code (p); orc_program_free (p); } { /* orc_haar_split_s16_op */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_haar_split_s16_op"); orc_program_set_backup_function (p, _backup_orc_haar_split_s16_op); orc_program_add_destination (p, 2, "d1"); orc_program_add_destination (p, 2, "d2"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_constant (p, 4, 0x00000000, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "copyw", 0, ORC_VAR_D2, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "avgsw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_haar_split_s16_op = orc_program_take_code (p); orc_program_free (p); } { /* orc_haar_split_s32_op */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_haar_split_s32_op"); orc_program_set_backup_function (p, _backup_orc_haar_split_s32_op); orc_program_add_destination (p, 4, "d1"); orc_program_add_destination (p, 4, "d2"); orc_program_add_source (p, 4, "s1"); orc_program_add_source (p, 4, "s2"); orc_program_add_constant (p, 4, 0x00000000, "c1"); orc_program_add_temporary (p, 4, "t1"); orc_program_add_temporary (p, 4, "t2"); orc_program_append_2 (p, "copyl", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "subl", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "copyl", 0, ORC_VAR_D2, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "avgsl", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_haar_split_s32_op = orc_program_take_code (p); orc_program_free (p); } { /* orc_haar_split_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_haar_split_s16"); orc_program_set_backup_function (p, _backup_orc_haar_split_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_destination (p, 2, "d2"); orc_program_add_constant (p, 4, 0x00000000, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T2, ORC_VAR_D2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "copyw", 0, ORC_VAR_D2, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "avgsw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_haar_split_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_haar_synth_s16_lo */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_haar_synth_s16_lo"); orc_program_set_backup_function (p, _backup_orc_haar_synth_s16_lo); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_constant (p, 4, 0x00000000, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "avgsw", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_haar_synth_s16_lo = orc_program_take_code (p); orc_program_free (p); } { /* orc_haar_synth_s16_hi */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_haar_synth_s16_hi"); orc_program_set_backup_function (p, _backup_orc_haar_synth_s16_hi); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_constant (p, 4, 0x00000000, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_add_temporary (p, 2, "t3"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "avgsw", 0, ORC_VAR_T3, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_T3, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_haar_synth_s16_hi = orc_program_take_code (p); orc_program_free (p); } { /* orc_haar_synth_s16_op */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_haar_synth_s16_op"); orc_program_set_backup_function (p, _backup_orc_haar_synth_s16_op); orc_program_add_destination (p, 2, "d1"); orc_program_add_destination (p, 2, "d2"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_constant (p, 4, 0x00000000, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_add_temporary (p, 2, "t3"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "avgsw", 0, ORC_VAR_T3, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_T3, ORC_VAR_D1); orc_program_append_2 (p, "copyw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_D2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_haar_synth_s16_op = orc_program_take_code (p); orc_program_free (p); } { /* orc_haar_synth_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_haar_synth_s16"); orc_program_set_backup_function (p, _backup_orc_haar_synth_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_destination (p, 2, "d2"); orc_program_add_constant (p, 4, 0x00000000, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_add_temporary (p, 2, "t3"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T2, ORC_VAR_D2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "avgsw", 0, ORC_VAR_T3, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T3, ORC_VAR_D1); orc_program_append_2 (p, "copyw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_D2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_haar_synth_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_haar_synth_rrshift1_int_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_haar_synth_rrshift1_int_s16"); orc_program_set_backup_function (p, _backup_orc_haar_synth_rrshift1_int_s16); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_constant (p, 4, 0x00000000, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "avgsw", 0, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "avgsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "avgsw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "mergewl", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_haar_synth_rrshift1_int_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_haar_synth_int_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_haar_synth_int_s16"); orc_program_set_backup_function (p, _backup_orc_haar_synth_int_s16); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_constant (p, 4, 0x00000000, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "avgsw", 0, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "mergewl", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_haar_synth_int_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_haar_sub_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_haar_sub_s16"); orc_program_set_backup_function (p, _backup_orc_haar_sub_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_append_2 (p, "subw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_haar_sub_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_haar_add_half_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_haar_add_half_s16"); orc_program_set_backup_function (p, _backup_orc_haar_add_half_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_constant (p, 4, 0x00000000, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "avgsw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_haar_add_half_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_haar_add_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_haar_add_s16"); orc_program_set_backup_function (p, _backup_orc_haar_add_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_haar_add_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_haar_sub_half_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_haar_sub_half_s16"); orc_program_set_backup_function (p, _backup_orc_haar_sub_half_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_constant (p, 4, 0x00000000, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "avgsw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_haar_sub_half_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_sum_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_sum_u8"); orc_program_set_backup_function (p, _backup_orc_sum_u8); orc_program_add_source (p, 1, "s1"); orc_program_add_accumulator (p, 4, "a1"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 4, "t2"); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convuwl", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "accl", 0, ORC_VAR_A1, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_sum_u8 = orc_program_take_code (p); orc_program_free (p); } { /* orc_sum_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_sum_s16"); orc_program_set_backup_function (p, _backup_orc_sum_s16); orc_program_add_source (p, 2, "s1"); orc_program_add_accumulator (p, 4, "a1"); orc_program_add_temporary (p, 4, "t1"); orc_program_append_2 (p, "convswl", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "accl", 0, ORC_VAR_A1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_sum_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_sum_square_diff_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_sum_square_diff_u8"); orc_program_set_backup_function (p, _backup_orc_sum_square_diff_u8); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_accumulator (p, 4, "a1"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_add_temporary (p, 4, "t3"); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "convuwl", 0, ORC_VAR_T3, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "accl", 0, ORC_VAR_A1, ORC_VAR_T3, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_sum_square_diff_u8 = orc_program_take_code (p); orc_program_free (p); } { /* orc_dequantise_s16_2d_4xn */ OrcProgram *p; p = orc_program_new (); orc_program_set_constant_n (p, 4); orc_program_set_2d (p); orc_program_set_name (p, "orc_dequantise_s16_2d_4xn"); orc_program_set_backup_function (p, _backup_orc_dequantise_s16_2d_4xn); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_constant (p, 4, 0x00000002, "c1"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "signw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "absw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_dequantise_s16_2d_4xn = orc_program_take_code (p); orc_program_free (p); } { /* orc_dequantise_s16_2d_8xn */ OrcProgram *p; p = orc_program_new (); orc_program_set_constant_n (p, 8); orc_program_set_2d (p); orc_program_set_name (p, "orc_dequantise_s16_2d_8xn"); orc_program_set_backup_function (p, _backup_orc_dequantise_s16_2d_8xn); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_constant (p, 4, 0x00000002, "c1"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "signw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "absw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_dequantise_s16_2d_8xn = orc_program_take_code (p); orc_program_free (p); } { /* orc_dequantise_s16_ip_2d_8xn */ OrcProgram *p; p = orc_program_new (); orc_program_set_constant_n (p, 8); orc_program_set_2d (p); orc_program_set_name (p, "orc_dequantise_s16_ip_2d_8xn"); orc_program_set_backup_function (p, _backup_orc_dequantise_s16_ip_2d_8xn); orc_program_add_destination (p, 2, "d1"); orc_program_add_constant (p, 4, 0x00000002, "c1"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "signw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "absw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_dequantise_s16_ip_2d_8xn = orc_program_take_code (p); orc_program_free (p); } { /* orc_dequantise_s16_ip_2d */ OrcProgram *p; p = orc_program_new (); orc_program_set_2d (p); orc_program_set_name (p, "orc_dequantise_s16_ip_2d"); orc_program_set_backup_function (p, _backup_orc_dequantise_s16_ip_2d); orc_program_add_destination (p, 2, "d1"); orc_program_add_constant (p, 4, 0x00000002, "c1"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "signw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "absw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_dequantise_s16_ip_2d = orc_program_take_code (p); orc_program_free (p); } { /* orc_dequantise_s16_ip */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_dequantise_s16_ip"); orc_program_set_backup_function (p, _backup_orc_dequantise_s16_ip); orc_program_add_destination (p, 2, "d1"); orc_program_add_constant (p, 4, 0x00000002, "c1"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "signw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "absw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_dequantise_s16_ip = orc_program_take_code (p); orc_program_free (p); } { /* orc_dequantise_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_dequantise_s16"); orc_program_set_backup_function (p, _backup_orc_dequantise_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_constant (p, 4, 0x00000002, "c1"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "signw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "absw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_dequantise_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_dequantise_var_s16_ip */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_dequantise_var_s16_ip"); orc_program_set_backup_function (p, _backup_orc_dequantise_var_s16_ip); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_constant (p, 4, 0x00000002, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "signw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "absw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_dequantise_var_s16_ip = orc_program_take_code (p); orc_program_free (p); } { /* orc_quantise1_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_quantise1_s16"); orc_program_set_backup_function (p, _backup_orc_quantise1_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_constant (p, 4, 0x00000002, "c1"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_parameter (p, 2, "p3"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "signw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "absw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "shlw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "mulhuw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "shruw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P3, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_quantise1_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_quantise2_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_quantise2_s16"); orc_program_set_backup_function (p, _backup_orc_quantise2_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_constant (p, 4, 0x00000002, "c1"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "signw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "absw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "shlw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "shruw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_quantise2_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_quantdequant1_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_quantdequant1_s16"); orc_program_set_backup_function (p, _backup_orc_quantdequant1_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_destination (p, 2, "d2"); orc_program_add_constant (p, 4, 0x00000002, "c1"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_parameter (p, 2, "p3"); orc_program_add_parameter (p, 2, "p4"); orc_program_add_parameter (p, 2, "p5"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T1, ORC_VAR_D2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "signw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "absw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "shlw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "mulhuw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "shruw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P3, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_append_2 (p, "copyw", 0, ORC_VAR_D1, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "signw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P4, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P5, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_D2, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_quantdequant1_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_quantdequant3_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_quantdequant3_s16"); orc_program_set_backup_function (p, _backup_orc_quantdequant3_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_destination (p, 2, "d2"); orc_program_add_constant (p, 4, 0x00000002, "c1"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_parameter (p, 2, "p3"); orc_program_add_parameter (p, 2, "p4"); orc_program_add_parameter (p, 2, "p5"); orc_program_add_parameter (p, 4, "p6"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_add_temporary (p, 4, "t3"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T1, ORC_VAR_D2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "signw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "absw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "shlw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "muluwl", 0, ORC_VAR_T3, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_P6, ORC_VAR_D1); orc_program_append_2 (p, "shrul", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_P3, ORC_VAR_D1); orc_program_append_2 (p, "convlw", 0, ORC_VAR_T1, ORC_VAR_T3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_append_2 (p, "copyw", 0, ORC_VAR_D1, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "signw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P4, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P5, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_D2, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_quantdequant3_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_quantdequant2_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_quantdequant2_s16"); orc_program_set_backup_function (p, _backup_orc_quantdequant2_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_destination (p, 2, "d2"); orc_program_add_constant (p, 4, 0x00000002, "c1"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_parameter (p, 2, "p3"); orc_program_add_parameter (p, 2, "p4"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T1, ORC_VAR_D2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "signw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "absw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "shlw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "shruw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_append_2 (p, "copyw", 0, ORC_VAR_D1, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "signw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P3, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P4, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_D2, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_quantdequant2_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_downsample_vert_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_downsample_vert_u8"); orc_program_set_backup_function (p, _backup_orc_downsample_vert_u8); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_source (p, 1, "s3"); orc_program_add_source (p, 1, "s4"); orc_program_add_constant (p, 4, 0x00000006, "c1"); orc_program_add_constant (p, 4, 0x0000001a, "c2"); orc_program_add_constant (p, 4, 0x00000020, "c3"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_add_temporary (p, 2, "t3"); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_S4, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T3, ORC_VAR_S3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T3, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C3, ORC_VAR_D1); orc_program_append_2 (p, "shruw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "convwb", 0, ORC_VAR_D1, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_downsample_vert_u8 = orc_program_take_code (p); orc_program_free (p); } { /* orc_downsample_horiz_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_downsample_horiz_u8"); orc_program_set_backup_function (p, _backup_orc_downsample_horiz_u8); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_constant (p, 4, 0x00000002, "c1"); orc_program_add_constant (p, 4, 0x00000006, "c2"); orc_program_add_constant (p, 4, 0x00000001, "c3"); orc_program_add_constant (p, 4, 0x0000001a, "c4"); orc_program_add_constant (p, 4, 0x00000020, "c5"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_add_temporary (p, 2, "t3"); orc_program_add_temporary (p, 1, "t4"); orc_program_add_temporary (p, 1, "t5"); orc_program_add_temporary (p, 2, "t6"); orc_program_append_2 (p, "loadw", 0, ORC_VAR_T3, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "select1wb", 0, ORC_VAR_T4, ORC_VAR_T3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_T4, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "loadoffw", 0, ORC_VAR_T3, ORC_VAR_S1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "select0wb", 0, ORC_VAR_T4, ORC_VAR_T3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_T4, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T6, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T6, ORC_VAR_T6, ORC_VAR_C2, ORC_VAR_D1); orc_program_append_2 (p, "loadoffw", 0, ORC_VAR_T3, ORC_VAR_S1, ORC_VAR_C3, ORC_VAR_D1); orc_program_append_2 (p, "splitwb", 0, ORC_VAR_T4, ORC_VAR_T5, ORC_VAR_T3, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_T4, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_T5, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C4, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T6, ORC_VAR_T6, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T6, ORC_VAR_T6, ORC_VAR_C5, ORC_VAR_D1); orc_program_append_2 (p, "shruw", 0, ORC_VAR_T6, ORC_VAR_T6, ORC_VAR_C2, ORC_VAR_D1); orc_program_append_2 (p, "convwb", 0, ORC_VAR_D1, ORC_VAR_T6, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_downsample_horiz_u8 = orc_program_take_code (p); orc_program_free (p); } { /* orc_stats_moment_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_stats_moment_s16"); orc_program_set_backup_function (p, _backup_orc_stats_moment_s16); orc_program_add_source (p, 2, "s1"); orc_program_add_accumulator (p, 4, "a1"); orc_program_add_constant (p, 4, 0x00000002, "c1"); orc_program_add_constant (p, 4, 0x00000000, "c2"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 4, "t2"); orc_program_append_2 (p, "absw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "maxsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C2, ORC_VAR_D1); orc_program_append_2 (p, "convuwl", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "accl", 0, ORC_VAR_A1, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_stats_moment_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_stats_above_s16 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_stats_above_s16"); orc_program_set_backup_function (p, _backup_orc_stats_above_s16); orc_program_add_source (p, 2, "s1"); orc_program_add_accumulator (p, 4, "a1"); orc_program_add_constant (p, 4, 0x00000001, "c1"); orc_program_add_constant (p, 4, 0x00000000, "c2"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 4, "t2"); orc_program_append_2 (p, "absw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "maxsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C2, ORC_VAR_D1); orc_program_append_2 (p, "minsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "convuwl", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "accl", 0, ORC_VAR_A1, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_stats_above_s16 = orc_program_take_code (p); orc_program_free (p); } { /* orc_accw */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_accw"); orc_program_set_backup_function (p, _backup_orc_accw); orc_program_add_source (p, 2, "s1"); orc_program_add_accumulator (p, 2, "a1"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "absw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "accw", 0, ORC_VAR_A1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_accw = orc_program_take_code (p); orc_program_free (p); } { /* orc_avg2_8xn_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_constant_n (p, 8); orc_program_set_2d (p); orc_program_set_name (p, "orc_avg2_8xn_u8"); orc_program_set_backup_function (p, _backup_orc_avg2_8xn_u8); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_append_2 (p, "avgub", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_avg2_8xn_u8 = orc_program_take_code (p); orc_program_free (p); } { /* orc_avg2_12xn_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_constant_n (p, 12); orc_program_set_2d (p); orc_program_set_name (p, "orc_avg2_12xn_u8"); orc_program_set_backup_function (p, _backup_orc_avg2_12xn_u8); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_append_2 (p, "avgub", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_avg2_12xn_u8 = orc_program_take_code (p); orc_program_free (p); } { /* orc_avg2_16xn_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_constant_n (p, 16); orc_program_set_2d (p); orc_program_set_name (p, "orc_avg2_16xn_u8"); orc_program_set_backup_function (p, _backup_orc_avg2_16xn_u8); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_append_2 (p, "avgub", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_avg2_16xn_u8 = orc_program_take_code (p); orc_program_free (p); } { /* orc_avg2_32xn_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_constant_n (p, 32); orc_program_set_2d (p); orc_program_set_name (p, "orc_avg2_32xn_u8"); orc_program_set_backup_function (p, _backup_orc_avg2_32xn_u8); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_append_2 (p, "avgub", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_avg2_32xn_u8 = orc_program_take_code (p); orc_program_free (p); } { /* orc_avg2_nxm_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_2d (p); orc_program_set_name (p, "orc_avg2_nxm_u8"); orc_program_set_backup_function (p, _backup_orc_avg2_nxm_u8); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_append_2 (p, "avgub", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_avg2_nxm_u8 = orc_program_take_code (p); orc_program_free (p); } { /* orc_combine4_8xn_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_constant_n (p, 8); orc_program_set_2d (p); orc_program_set_name (p, "orc_combine4_8xn_u8"); orc_program_set_backup_function (p, _backup_orc_combine4_8xn_u8); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_source (p, 1, "s3"); orc_program_add_source (p, 1, "s4"); orc_program_add_constant (p, 4, 0x00000008, "c1"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_parameter (p, 2, "p3"); orc_program_add_parameter (p, 2, "p4"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P3, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S4, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P4, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_combine4_8xn_u8 = orc_program_take_code (p); orc_program_free (p); } { /* orc_combine4_12xn_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_constant_n (p, 12); orc_program_set_2d (p); orc_program_set_name (p, "orc_combine4_12xn_u8"); orc_program_set_backup_function (p, _backup_orc_combine4_12xn_u8); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_source (p, 1, "s3"); orc_program_add_source (p, 1, "s4"); orc_program_add_constant (p, 4, 0x00000008, "c1"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_parameter (p, 2, "p3"); orc_program_add_parameter (p, 2, "p4"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P3, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S4, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P4, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_combine4_12xn_u8 = orc_program_take_code (p); orc_program_free (p); } { /* orc_combine4_16xn_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_constant_n (p, 16); orc_program_set_2d (p); orc_program_set_name (p, "orc_combine4_16xn_u8"); orc_program_set_backup_function (p, _backup_orc_combine4_16xn_u8); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_source (p, 1, "s3"); orc_program_add_source (p, 1, "s4"); orc_program_add_constant (p, 4, 0x00000008, "c1"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_parameter (p, 2, "p3"); orc_program_add_parameter (p, 2, "p4"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P3, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S4, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P4, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_combine4_16xn_u8 = orc_program_take_code (p); orc_program_free (p); } { /* orc_combine4_24xn_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_constant_n (p, 24); orc_program_set_2d (p); orc_program_set_name (p, "orc_combine4_24xn_u8"); orc_program_set_backup_function (p, _backup_orc_combine4_24xn_u8); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_source (p, 1, "s3"); orc_program_add_source (p, 1, "s4"); orc_program_add_constant (p, 4, 0x00000008, "c1"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_parameter (p, 2, "p3"); orc_program_add_parameter (p, 2, "p4"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P3, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S4, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P4, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_combine4_24xn_u8 = orc_program_take_code (p); orc_program_free (p); } { /* orc_combine4_32xn_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_constant_n (p, 32); orc_program_set_2d (p); orc_program_set_name (p, "orc_combine4_32xn_u8"); orc_program_set_backup_function (p, _backup_orc_combine4_32xn_u8); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_source (p, 1, "s3"); orc_program_add_source (p, 1, "s4"); orc_program_add_constant (p, 4, 0x00000008, "c1"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_parameter (p, 2, "p3"); orc_program_add_parameter (p, 2, "p4"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P3, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S4, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P4, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_combine4_32xn_u8 = orc_program_take_code (p); orc_program_free (p); } { /* orc_combine4_nxm_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_2d (p); orc_program_set_name (p, "orc_combine4_nxm_u8"); orc_program_set_backup_function (p, _backup_orc_combine4_nxm_u8); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_source (p, 1, "s3"); orc_program_add_source (p, 1, "s4"); orc_program_add_constant (p, 4, 0x00000008, "c1"); orc_program_add_constant (p, 4, 0x00000004, "c2"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_parameter (p, 2, "p3"); orc_program_add_parameter (p, 2, "p4"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P3, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S4, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P4, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C2, ORC_VAR_D1); orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_combine4_nxm_u8 = orc_program_take_code (p); orc_program_free (p); } { /* orc_combine2_8xn_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_constant_n (p, 8); orc_program_set_2d (p); orc_program_set_name (p, "orc_combine2_8xn_u8"); orc_program_set_backup_function (p, _backup_orc_combine2_8xn_u8); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_parameter (p, 2, "p3"); orc_program_add_parameter (p, 2, "p4"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P3, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P4, ORC_VAR_D1); orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_combine2_8xn_u8 = orc_program_take_code (p); orc_program_free (p); } { /* orc_combine2_12xn_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_constant_n (p, 12); orc_program_set_2d (p); orc_program_set_name (p, "orc_combine2_12xn_u8"); orc_program_set_backup_function (p, _backup_orc_combine2_12xn_u8); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_parameter (p, 2, "p3"); orc_program_add_parameter (p, 2, "p4"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P3, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P4, ORC_VAR_D1); orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_combine2_12xn_u8 = orc_program_take_code (p); orc_program_free (p); } { /* orc_combine2_16xn_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_constant_n (p, 16); orc_program_set_2d (p); orc_program_set_name (p, "orc_combine2_16xn_u8"); orc_program_set_backup_function (p, _backup_orc_combine2_16xn_u8); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_parameter (p, 2, "p3"); orc_program_add_parameter (p, 2, "p4"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P3, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P4, ORC_VAR_D1); orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_combine2_16xn_u8 = orc_program_take_code (p); orc_program_free (p); } { /* orc_combine2_nxm_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_2d (p); orc_program_set_name (p, "orc_combine2_nxm_u8"); orc_program_set_backup_function (p, _backup_orc_combine2_nxm_u8); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_parameter (p, 2, "p3"); orc_program_add_parameter (p, 2, "p4"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P3, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P4, ORC_VAR_D1); orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_combine2_nxm_u8 = orc_program_take_code (p); orc_program_free (p); } { /* orc_sad_nxm_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_2d (p); orc_program_set_name (p, "orc_sad_nxm_u8"); orc_program_set_backup_function (p, _backup_orc_sad_nxm_u8); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_accumulator (p, 4, "a1"); orc_program_append_2 (p, "accsadubl", 0, ORC_VAR_A1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_sad_nxm_u8 = orc_program_take_code (p); orc_program_free (p); } { /* orc_sad_8x8_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_constant_n (p, 8); orc_program_set_2d (p); orc_program_set_constant_m (p, 8); orc_program_set_name (p, "orc_sad_8x8_u8"); orc_program_set_backup_function (p, _backup_orc_sad_8x8_u8); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_accumulator (p, 4, "a1"); orc_program_append_2 (p, "accsadubl", 0, ORC_VAR_A1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_sad_8x8_u8 = orc_program_take_code (p); orc_program_free (p); } { /* orc_sad_12x12_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_constant_n (p, 12); orc_program_set_2d (p); orc_program_set_constant_m (p, 12); orc_program_set_name (p, "orc_sad_12x12_u8"); orc_program_set_backup_function (p, _backup_orc_sad_12x12_u8); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_accumulator (p, 4, "a1"); orc_program_append_2 (p, "accsadubl", 0, ORC_VAR_A1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_sad_12x12_u8 = orc_program_take_code (p); orc_program_free (p); } { /* orc_sad_16xn_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_constant_n (p, 16); orc_program_set_2d (p); orc_program_set_name (p, "orc_sad_16xn_u8"); orc_program_set_backup_function (p, _backup_orc_sad_16xn_u8); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_accumulator (p, 4, "a1"); orc_program_append_2 (p, "accsadubl", 0, ORC_VAR_A1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_sad_16xn_u8 = orc_program_take_code (p); orc_program_free (p); } { /* orc_sad_32xn_u8 */ OrcProgram *p; p = orc_program_new (); orc_program_set_constant_n (p, 32); orc_program_set_2d (p); orc_program_set_name (p, "orc_sad_32xn_u8"); orc_program_set_backup_function (p, _backup_orc_sad_32xn_u8); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_accumulator (p, 4, "a1"); orc_program_append_2 (p, "accsadubl", 0, ORC_VAR_A1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_sad_32xn_u8 = orc_program_take_code (p); orc_program_free (p); } { /* orc_add2_rshift_add_s32_22_op */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_add2_rshift_add_s32_22_op"); orc_program_set_backup_function (p, _backup_orc_add2_rshift_add_s32_22_op); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_add_source (p, 4, "s2"); orc_program_add_source (p, 4, "s3"); orc_program_add_constant (p, 4, 0x00000002, "c1"); orc_program_add_temporary (p, 4, "t1"); orc_program_append_2 (p, "addl", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_S3, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "shrsl", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_add2_rshift_add_s32_22_op = orc_program_take_code (p); orc_program_free (p); } { /* orc_mas4_vert_add_s32_1991_op */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_mas4_vert_add_s32_1991_op"); orc_program_set_backup_function (p, _backup_orc_mas4_vert_add_s32_1991_op); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_add_source (p, 4, "s2"); orc_program_add_source (p, 4, "s3"); orc_program_add_source (p, 4, "s4"); orc_program_add_source (p, 4, "s5"); orc_program_add_constant (p, 4, 0x00000009, "c1"); orc_program_add_parameter (p, 4, "p1"); orc_program_add_parameter (p, 4, "p2"); orc_program_add_temporary (p, 4, "t1"); orc_program_add_temporary (p, 4, "t2"); orc_program_add_temporary (p, 4, "t3"); orc_program_add_temporary (p, 4, "t4"); orc_program_append_2 (p, "addl", 0, ORC_VAR_T1, ORC_VAR_S3, ORC_VAR_S4, ORC_VAR_D1); orc_program_append_2 (p, "mulll", 0, ORC_VAR_T3, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_S5, ORC_VAR_D1); orc_program_append_2 (p, "subl", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_T2, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "shrsl", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_T3, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_mas4_vert_add_s32_1991_op = orc_program_take_code (p); orc_program_free (p); } { /* orc_add2_rshift_sub_s32_22_op */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_add2_rshift_sub_s32_22_op"); orc_program_set_backup_function (p, _backup_orc_add2_rshift_sub_s32_22_op); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_add_source (p, 4, "s2"); orc_program_add_source (p, 4, "s3"); orc_program_add_constant (p, 4, 0x00000002, "c1"); orc_program_add_temporary (p, 4, "t1"); orc_program_append_2 (p, "addl", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_S3, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "shrsl", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "subl", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_add2_rshift_sub_s32_22_op = orc_program_take_code (p); orc_program_free (p); } { /* orc_interleave2_rrshift1_s32 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_interleave2_rrshift1_s32"); orc_program_set_backup_function (p, _backup_orc_interleave2_rrshift1_s32); orc_program_add_destination (p, 8, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_add_source (p, 4, "s2"); orc_program_add_constant (p, 4, 0x00000001, "c1"); orc_program_add_temporary (p, 4, "t1"); orc_program_add_temporary (p, 4, "t2"); orc_program_append_2 (p, "addl", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "shrsl", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "shrsl", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "mergelq", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_interleave2_rrshift1_s32 = orc_program_take_code (p); orc_program_free (p); } { /* orc_mas4_vert_sub_s32_1991_op */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_mas4_vert_sub_s32_1991_op"); orc_program_set_backup_function (p, _backup_orc_mas4_vert_sub_s32_1991_op); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_add_source (p, 4, "s2"); orc_program_add_source (p, 4, "s3"); orc_program_add_source (p, 4, "s4"); orc_program_add_source (p, 4, "s5"); orc_program_add_constant (p, 4, 0x00000009, "c1"); orc_program_add_parameter (p, 4, "p1"); orc_program_add_parameter (p, 4, "p2"); orc_program_add_temporary (p, 4, "t1"); orc_program_add_temporary (p, 4, "t2"); orc_program_add_temporary (p, 4, "t3"); orc_program_add_temporary (p, 4, "t4"); orc_program_append_2 (p, "addl", 0, ORC_VAR_T1, ORC_VAR_S3, ORC_VAR_S4, ORC_VAR_D1); orc_program_append_2 (p, "mulll", 0, ORC_VAR_T3, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_S5, ORC_VAR_D1); orc_program_append_2 (p, "subl", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_T2, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "shrsl", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "subl", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_T3, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_mas4_vert_sub_s32_1991_op = orc_program_take_code (p); orc_program_free (p); } { /* orc_mas4_vert_sub_s32_1991 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_mas4_vert_sub_s32_1991"); orc_program_set_backup_function (p, _backup_orc_mas4_vert_sub_s32_1991); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_add_source (p, 4, "s2"); orc_program_add_source (p, 4, "s3"); orc_program_add_source (p, 4, "s4"); orc_program_add_constant (p, 4, 0x00000009, "c1"); orc_program_add_parameter (p, 4, "p1"); orc_program_add_parameter (p, 4, "p2"); orc_program_add_temporary (p, 4, "t1"); orc_program_add_temporary (p, 4, "t2"); orc_program_add_temporary (p, 4, "t3"); orc_program_add_temporary (p, 4, "t4"); orc_program_append_2 (p, "addl", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_S3, ORC_VAR_D1); orc_program_append_2 (p, "mulll", 0, ORC_VAR_T3, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_T2, ORC_VAR_S1, ORC_VAR_S4, ORC_VAR_D1); orc_program_append_2 (p, "subl", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_T2, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "shrsl", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "subl", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T3, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_mas4_vert_sub_s32_1991 = orc_program_take_code (p); orc_program_free (p); } { /* orc_mas4_horiz_add_s32_1991_ip */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_mas4_horiz_add_s32_1991_ip"); orc_program_set_backup_function (p, _backup_orc_mas4_horiz_add_s32_1991_ip); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_add_constant (p, 4, 0x00000001, "c1"); orc_program_add_constant (p, 4, 0x00000002, "c2"); orc_program_add_constant (p, 4, 0x00000009, "c3"); orc_program_add_constant (p, 4, 0x00000003, "c4"); orc_program_add_parameter (p, 4, "p1"); orc_program_add_parameter (p, 4, "p2"); orc_program_add_temporary (p, 4, "t1"); orc_program_add_temporary (p, 4, "t2"); orc_program_add_temporary (p, 4, "t3"); orc_program_add_temporary (p, 4, "t4"); orc_program_append_2 (p, "loadoffl", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "loadoffl", 0, ORC_VAR_T2, ORC_VAR_S1, ORC_VAR_C2, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_append_2 (p, "mulll", 0, ORC_VAR_T3, ORC_VAR_T1, ORC_VAR_C3, ORC_VAR_D1); orc_program_append_2 (p, "loadl", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "loadoffl", 0, ORC_VAR_T2, ORC_VAR_S1, ORC_VAR_C4, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_append_2 (p, "subl", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_T2, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "shrsl", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T3, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_mas4_horiz_add_s32_1991_ip = orc_program_take_code (p); orc_program_free (p); } { /* orc_add2_rshift_add_s32_11_op */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_add2_rshift_add_s32_11_op"); orc_program_set_backup_function (p, _backup_orc_add2_rshift_add_s32_11_op); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_add_source (p, 4, "s2"); orc_program_add_source (p, 4, "s3"); orc_program_add_temporary (p, 4, "t1"); orc_program_append_2 (p, "avgsl", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_S3, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_add2_rshift_add_s32_11_op = orc_program_take_code (p); orc_program_free (p); } { /* orc_mas4_horiz_sub_s32_1991_ip */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_mas4_horiz_sub_s32_1991_ip"); orc_program_set_backup_function (p, _backup_orc_mas4_horiz_sub_s32_1991_ip); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_add_constant (p, 4, 0x00000001, "c1"); orc_program_add_constant (p, 4, 0x00000002, "c2"); orc_program_add_constant (p, 4, 0x00000009, "c3"); orc_program_add_constant (p, 4, 0x00000003, "c4"); orc_program_add_parameter (p, 4, "p1"); orc_program_add_parameter (p, 4, "p2"); orc_program_add_temporary (p, 4, "t1"); orc_program_add_temporary (p, 4, "t2"); orc_program_add_temporary (p, 4, "t3"); orc_program_add_temporary (p, 4, "t4"); orc_program_append_2 (p, "loadoffl", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "loadoffl", 0, ORC_VAR_T2, ORC_VAR_S1, ORC_VAR_C2, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_append_2 (p, "mulll", 0, ORC_VAR_T3, ORC_VAR_T1, ORC_VAR_C3, ORC_VAR_D1); orc_program_append_2 (p, "loadl", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "loadoffl", 0, ORC_VAR_T2, ORC_VAR_S1, ORC_VAR_C4, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_append_2 (p, "subl", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_T2, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "shrsl", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "subl", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T3, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_mas4_horiz_sub_s32_1991_ip = orc_program_take_code (p); orc_program_free (p); } { /* orc_haar_synth_s32_lo */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_haar_synth_s32_lo"); orc_program_set_backup_function (p, _backup_orc_haar_synth_s32_lo); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_add_source (p, 4, "s2"); orc_program_add_constant (p, 4, 0x00000000, "c1"); orc_program_add_temporary (p, 4, "t1"); orc_program_append_2 (p, "avgsl", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "subl", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_haar_synth_s32_lo = orc_program_take_code (p); orc_program_free (p); } { /* orc_haar_synth_int_s32 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_haar_synth_int_s32"); orc_program_set_backup_function (p, _backup_orc_haar_synth_int_s32); orc_program_add_destination (p, 8, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_add_source (p, 4, "s2"); orc_program_add_constant (p, 4, 0x00000000, "c1"); orc_program_add_temporary (p, 4, "t1"); orc_program_add_temporary (p, 4, "t2"); orc_program_append_2 (p, "copyl", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "avgsl", 0, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "subl", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "mergelq", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_haar_synth_int_s32 = orc_program_take_code (p); orc_program_free (p); } { /* orc_haar_synth_rrshift1_int_s32 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_haar_synth_rrshift1_int_s32"); orc_program_set_backup_function (p, _backup_orc_haar_synth_rrshift1_int_s32); orc_program_add_destination (p, 8, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_add_source (p, 4, "s2"); orc_program_add_constant (p, 4, 0x00000000, "c1"); orc_program_add_temporary (p, 4, "t1"); orc_program_add_temporary (p, 4, "t2"); orc_program_append_2 (p, "copyl", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "avgsl", 0, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "subl", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "avgsl", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "avgsl", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "mergelq", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_haar_synth_rrshift1_int_s32 = orc_program_take_code (p); orc_program_free (p); } { /* orc_interleave2_s32 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_interleave2_s32"); orc_program_set_backup_function (p, _backup_orc_interleave2_s32); orc_program_add_destination (p, 8, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_add_source (p, 4, "s2"); orc_program_append_2 (p, "mergelq", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_interleave2_s32 = orc_program_take_code (p); orc_program_free (p); } { /* orc_mas2_sub_s32_ip */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_mas2_sub_s32_ip"); orc_program_set_backup_function (p, _backup_orc_mas2_sub_s32_ip); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_add_constant (p, 4, 0x00000001, "c1"); orc_program_add_parameter (p, 4, "p1"); orc_program_add_parameter (p, 4, "p2"); orc_program_add_parameter (p, 4, "p3"); orc_program_add_temporary (p, 4, "t1"); orc_program_add_temporary (p, 4, "t2"); orc_program_append_2 (p, "loadoffl", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "mulll", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "shrsl", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P3, ORC_VAR_D1); orc_program_append_2 (p, "subl", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_mas2_sub_s32_ip = orc_program_take_code (p); orc_program_free (p); } { /* orc_mas2_add_s32_ip */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_mas2_add_s32_ip"); orc_program_set_backup_function (p, _backup_orc_mas2_add_s32_ip); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_add_constant (p, 4, 0x00000001, "c1"); orc_program_add_parameter (p, 4, "p1"); orc_program_add_parameter (p, 4, "p2"); orc_program_add_parameter (p, 4, "p3"); orc_program_add_temporary (p, 4, "t1"); orc_program_add_temporary (p, 4, "t2"); orc_program_append_2 (p, "loadoffl", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "mulll", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "shrsl", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P3, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_mas2_add_s32_ip = orc_program_take_code (p); orc_program_free (p); } { /* orc_mas2_add_s32_op */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_mas2_add_s32_op"); orc_program_set_backup_function (p, _backup_orc_mas2_add_s32_op); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_add_source (p, 4, "s2"); orc_program_add_source (p, 4, "s3"); orc_program_add_parameter (p, 4, "p1"); orc_program_add_parameter (p, 4, "p2"); orc_program_add_parameter (p, 4, "p3"); orc_program_add_temporary (p, 4, "t1"); orc_program_add_temporary (p, 4, "t2"); orc_program_append_2 (p, "addl", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_S3, ORC_VAR_D1); orc_program_append_2 (p, "mulll", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "shrsl", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P3, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_T2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_mas2_add_s32_op = orc_program_take_code (p); orc_program_free (p); } { /* orc_mas2_sub_s32_op */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_mas2_sub_s32_op"); orc_program_set_backup_function (p, _backup_orc_mas2_sub_s32_op); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_add_source (p, 4, "s2"); orc_program_add_source (p, 4, "s3"); orc_program_add_parameter (p, 4, "p1"); orc_program_add_parameter (p, 4, "p2"); orc_program_add_parameter (p, 4, "p3"); orc_program_add_temporary (p, 4, "t1"); orc_program_add_temporary (p, 4, "t2"); orc_program_append_2 (p, "addl", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_S3, ORC_VAR_D1); orc_program_append_2 (p, "mulll", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "shrsl", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P3, ORC_VAR_D1); orc_program_append_2 (p, "subl", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_T2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_mas2_sub_s32_op = orc_program_take_code (p); orc_program_free (p); } { /* orc_add2_rshift_sub_s32_22 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_add2_rshift_sub_s32_22"); orc_program_set_backup_function (p, _backup_orc_add2_rshift_sub_s32_22); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_add_constant (p, 4, 0x00000001, "c1"); orc_program_add_constant (p, 4, 0x00000002, "c2"); orc_program_add_temporary (p, 4, "t1"); orc_program_append_2 (p, "loadoffl", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C2, ORC_VAR_D1); orc_program_append_2 (p, "shrsl", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C2, ORC_VAR_D1); orc_program_append_2 (p, "subl", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_add2_rshift_sub_s32_22 = orc_program_take_code (p); orc_program_free (p); } { /* orc_add2_rshift_add_s32_11 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_add2_rshift_add_s32_11"); orc_program_set_backup_function (p, _backup_orc_add2_rshift_add_s32_11); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_add_constant (p, 4, 0x00000001, "c1"); orc_program_add_temporary (p, 4, "t1"); orc_program_append_2 (p, "loadoffl", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "avgsl", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_add2_rshift_add_s32_11 = orc_program_take_code (p); orc_program_free (p); } { /* orc_haar_synth_s32 */ OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_haar_synth_s32"); orc_program_set_backup_function (p, _backup_orc_haar_synth_s32); orc_program_add_destination (p, 4, "d1"); orc_program_add_destination (p, 4, "d2"); orc_program_add_constant (p, 4, 0x00000000, "c1"); orc_program_add_temporary (p, 4, "t1"); orc_program_add_temporary (p, 4, "t2"); orc_program_add_temporary (p, 4, "t3"); orc_program_append_2 (p, "copyl", 0, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "copyl", 0, ORC_VAR_T2, ORC_VAR_D2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "avgsl", 0, ORC_VAR_T3, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "subl", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T3, ORC_VAR_D1); orc_program_append_2 (p, "copyl", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_D2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_haar_synth_s32 = orc_program_take_code (p); orc_program_free (p); } { /* orc_splat_s32_2d */ OrcProgram *p; p = orc_program_new (); orc_program_set_2d (p); orc_program_set_name (p, "orc_splat_s32_2d"); orc_program_set_backup_function (p, _backup_orc_splat_s32_2d); orc_program_add_destination (p, 4, "d1"); orc_program_add_parameter (p, 4, "p1"); orc_program_append_2 (p, "copyl", 0, ORC_VAR_D1, ORC_VAR_P1, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_splat_s32_2d = orc_program_take_code (p); orc_program_free (p); } { /* orc_dequantise_s32_ip_2d */ OrcProgram *p; p = orc_program_new (); orc_program_set_2d (p); orc_program_set_name (p, "orc_dequantise_s32_ip_2d"); orc_program_set_backup_function (p, _backup_orc_dequantise_s32_ip_2d); orc_program_add_destination (p, 4, "d1"); orc_program_add_constant (p, 4, 0x00000002, "c1"); orc_program_add_parameter (p, 4, "p1"); orc_program_add_parameter (p, 4, "p2"); orc_program_add_temporary (p, 4, "t1"); orc_program_add_temporary (p, 4, "t2"); orc_program_append_2 (p, "copyl", 0, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "signl", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "absl", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mulll", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "shrsl", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "mulll", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_compile (p); _orc_code_orc_dequantise_s32_ip_2d = orc_program_take_code (p); orc_program_free (p); } #endif } schroedinger-1.0.11/schroedinger/schrolist.h0000644000175000017500000000167411320232176016033 00000000000000 #ifndef _SCHRO_LIST_H_ #define _SCHRO_LIST_H_ #include SCHRO_BEGIN_DECLS #ifdef SCHRO_ENABLE_UNSTABLE_API typedef struct _SchroList SchroList; typedef void (*SchroListFreeFunc)(void *member, void *priv); struct _SchroList { void **members; int n; int n_alloc; SchroListFreeFunc free; void *priv; }; SchroList *schro_list_new (void); SchroList *schro_list_new_full (SchroListFreeFunc freefunc, void *priv); void schro_list_free (SchroList *list); void *schro_list_get (SchroList *list, int i); int schro_list_get_size (SchroList *list); void schro_list_append (SchroList *list, void *value); void schro_list_insert (SchroList *list, int i, void *value); void *schro_list_remove (SchroList *list, int i); void schro_list_delete (SchroList *list, int i); void *schro_list_replace (SchroList *list, int i, void *value); void schro_list_prepend (SchroList *list, void *value); #endif SCHRO_END_DECLS #endif schroedinger-1.0.11/schroedinger/schrovideoformat.h0000644000175000017500000000521211704371326017376 00000000000000 #ifndef __SCHRO_VIDEO_FORMAT_H__ #define __SCHRO_VIDEO_FORMAT_H__ #include #include SCHRO_BEGIN_DECLS typedef struct _SchroVideoFormat SchroVideoFormat; struct _SchroVideoFormat { SchroVideoFormatEnum index; int width; int height; SchroChromaFormat chroma_format; schro_bool interlaced; schro_bool top_field_first; int frame_rate_numerator; int frame_rate_denominator; int aspect_ratio_numerator; int aspect_ratio_denominator; int clean_width; int clean_height; int left_offset; int top_offset; int luma_offset; int luma_excursion; int chroma_offset; int chroma_excursion; SchroColourPrimaries colour_primaries; SchroColourMatrix colour_matrix; SchroTransferFunction transfer_function; int interlaced_coding; int unused0; int unused1; int unused2; }; int schro_video_format_validate (SchroVideoFormat *format); void schro_video_format_set_std_video_format (SchroVideoFormat *format, SchroVideoFormatEnum index); SchroVideoFormatEnum schro_video_format_get_std_video_format (SchroVideoFormat *format); void schro_video_format_set_std_frame_rate (SchroVideoFormat *format, int index); int schro_video_format_get_std_frame_rate (SchroVideoFormat *format); void schro_video_format_set_std_aspect_ratio (SchroVideoFormat *format, int index); int schro_video_format_get_std_aspect_ratio (SchroVideoFormat *format); void schro_video_format_set_std_signal_range (SchroVideoFormat *format, SchroSignalRange index); SchroSignalRange schro_video_format_get_std_signal_range (SchroVideoFormat *format); void schro_video_format_set_std_colour_spec (SchroVideoFormat *format, SchroColourSpec index); SchroColourSpec schro_video_format_get_std_colour_spec (SchroVideoFormat *format); int schro_video_format_get_bit_depth (SchroVideoFormat *format); #ifdef SCHRO_ENABLE_UNSTABLE_API int schro_video_format_get_picture_height (SchroVideoFormat *format); void schro_video_format_get_picture_luma_size (SchroVideoFormat *format, int *picture_luma_width, int *picture_luma_height); void schro_video_format_get_picture_chroma_size (SchroVideoFormat *format, int *picture_chroma_width, int *picture_chroma_height); void schro_video_format_get_iwt_alloc_size (SchroVideoFormat *format, int *width, int *height, int transform_depth); schro_bool schro_video_format_check_MP_DL (SchroVideoFormat *format); schro_bool schro_video_format_check_VC2_DL (SchroVideoFormat *format); int schro_video_format_compare_new_sequence (SchroVideoFormat *a, SchroVideoFormat *b); int schro_video_format_compare (SchroVideoFormat *a, SchroVideoFormat *b); #endif SCHRO_END_DECLS #endif schroedinger-1.0.11/schroedinger/schrometric.h0000644000175000017500000000537111541755167016360 00000000000000 #ifndef SCHRO_METRIC_H #define SCHRO_METRIC_H #include #include #include SCHRO_BEGIN_DECLS typedef struct _SchroMetricScan SchroMetricScan; typedef struct _SchroMetricInfo SchroMetricInfo; #ifdef SCHRO_ENABLE_UNSTABLE_API #define SCHRO_LIMIT_METRIC_SCAN 42 struct _SchroMetricInfo { SchroFrame *frame; SchroFrame *ref_frame; int block_width[3]; int block_height[3]; int h_shift[3]; int v_shift[3]; int (*metric) (SchroMetricInfo *info, int ref_x, int ref_y, int dx, int dy); int (*metric_right) (SchroMetricInfo *info, int ref_x, int ref_y, int dx, int dy); int (*metric_bottom) (SchroMetricInfo *info, int ref_x, int ref_y, int dx, int dy); int (*metric_corner) (SchroMetricInfo *info, int ref_x, int ref_y, int dx, int dy); }; struct _SchroMetricScan { SchroFrame *frame; SchroFrame *ref_frame; int block_width; int block_height; int x, y; int ref_x, ref_y; int scan_width; int scan_height; int gravity_scale; int gravity_x, gravity_y; int use_chroma; /* output */ uint32_t metrics[SCHRO_LIMIT_METRIC_SCAN*SCHRO_LIMIT_METRIC_SCAN]; uint32_t chroma_metrics[SCHRO_LIMIT_METRIC_SCAN*SCHRO_LIMIT_METRIC_SCAN]; }; #define SCHRO_METRIC_INVALID INT_MAX int schro_metric_absdiff_u8 (uint8_t *a, int a_stride, uint8_t *b, int b_stride, int width, int height); int schro_metric_haar (uint8_t *src1, int stride1, uint8_t *src2, int stride2, int width, int height); int schro_metric_haar_const (uint8_t *data, int stride, int dc_value, int width, int height); int schro_metric_abssum_s16 (int16_t *data, int stride, int width, int height); int schro_metric_sum_u8 (uint8_t *data, int stride, int width, int height); void schro_metric_scan_do_scan (SchroMetricScan *scan); int schro_metric_scan_get_min (SchroMetricScan *scan, int *dx, int *dy , uint32_t* chroma_metric); void schro_metric_scan_setup (SchroMetricScan *scan, int dx, int dy, int dist , int use_chroma); int schro_metric_get (SchroFrameData *src1, SchroFrameData *src2, int width, int height); int schro_metric_get_biref (SchroFrameData *fd, SchroFrameData *src1, int weight1, SchroFrameData *src2, int weight2, int shift, int width, int height); int schro_metric_get_dc (SchroFrameData *src, int value, int width, int height); void schro_metric_info_init (SchroMetricInfo *info, SchroFrame *frame, SchroFrame *ref_frame, int block_width, int block_height); int schro_metric_fast_block (SchroMetricInfo *info, int x, int y, int dx, int dy); int schro_metric_fast_subsuperblock (SchroMetricInfo *info, int x, int y, int dx, int dy); int schro_metric_fast_superblock (SchroMetricInfo *info, int x, int y, int dx, int dy); #endif SCHRO_END_DECLS #endif schroedinger-1.0.11/schroedinger/schroasync.h0000644000175000017500000000430211320237456016172 00000000000000 #ifndef __SCHRO_ASYNC_H__ #define __SCHRO_ASYNC_H__ #include #include SCHRO_BEGIN_DECLS typedef int SchroExecDomain; typedef struct _SchroAsync SchroAsync; typedef struct _SchroThread SchroThread; typedef struct _SchroAsyncTask SchroAsyncTask; typedef struct _SchroAsyncStage SchroAsyncStage; typedef struct _SchroMutex SchroMutex; #ifdef SCHRO_ENABLE_UNSTABLE_API typedef int (*SchroAsyncScheduleFunc)(void *, SchroExecDomain exec_domain); typedef void (*SchroAsyncCompleteFunc)(void *); typedef void (*SchroAsyncTaskFunc) (void *); struct _SchroAsyncTask { SchroAsyncTaskFunc task_func; void *priv; }; struct _SchroAsyncStage { SchroAsyncTaskFunc task_func; void *priv; schro_bool is_ready; schro_bool is_needed; /* FIXME remove eventually */ schro_bool is_done; int priority; int n_tasks_started; int n_tasks_completed; int n_tasks; SchroAsyncTaskFunc tasks[10]; }; void schro_async_init (void); SchroAsync * schro_async_new(int n_threads, SchroAsyncScheduleFunc schedule, SchroAsyncCompleteFunc complete, void *closure); void schro_async_free (SchroAsync *async); /** * schro_async_stop: * * wait for all worker threads belonging to @async to finish their * current task. no further tasks will be executed until * schro_async_start is called */ void schro_async_stop (SchroAsync *async); /** * schro_async_sart: * * Resume execution of scheduler for @async after schro_async_stop * has been called. */ void schro_async_start (SchroAsync *async); void schro_async_run_stage_locked (SchroAsync *async, SchroAsyncStage *stage); int schro_async_wait_locked (SchroAsync *async); void schro_async_signal_scheduler (SchroAsync *async); void schro_async_lock (SchroAsync *async); void schro_async_unlock (SchroAsync *async); SchroExecDomain schro_async_get_exec_domain (void); void schro_async_add_exec_domain (SchroAsync *async, SchroExecDomain exec_domain); SchroMutex *schro_mutex_new (void); #if 0 SchroMutex *schro_mutex_new_recursive (void); #endif void schro_mutex_lock (SchroMutex *mutex); void schro_mutex_unlock (SchroMutex *mutex); void schro_mutex_free (SchroMutex *mutex); #endif SCHRO_END_DECLS #endif schroedinger-1.0.11/schroedinger/schroasync-win32.c0000644000175000017500000002177711556115124017142 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #define COND_LIST_SIZE 10 #define STACK_SIZE 65536 struct _SchroMutex { CRITICAL_SECTION mutex; }; struct _SchroAsync { int n_threads; int n_threads_running; int n_idle; enum { RUNNING = 0, STOP, DIE } stop; volatile int n_completed; CRITICAL_SECTION mutex; HANDLE app_event; SchroThread *threads; SchroAsyncTask task; SchroAsyncScheduleFunc schedule; void *schedule_closure; SchroAsyncCompleteFunc complete; }; struct _SchroThread { HANDLE thread; HANDLE event; SchroExecDomain exec_domain; SchroAsync *async; int busy; int index; }; static DWORD domain_key; static unsigned int __stdcall schro_thread_main (void *ptr); void schro_async_init (void) { domain_key = TlsAlloc (); if (domain_key == TLS_OUT_OF_INDEXES) { /* FIXME */ } } SchroAsync * schro_async_new (int n_threads, SchroAsyncScheduleFunc schedule, SchroAsyncCompleteFunc complete, void *closure) { SchroAsync *async; int i; if (n_threads == 0) { const char *s; s = getenv ("SCHRO_THREADS"); if (s && s[0]) { char *end; int n; n = strtoul (s, &end, 0); if (end[0] == 0) { n_threads = n; } } if (n_threads == 0) { s = getenv ("NUMBER_OF_PROCESSORS"); if (s) { n_threads = atoi (s); } } if (n_threads == 0) { n_threads = 1; } } async = schro_malloc0 (sizeof (SchroAsync)); SCHRO_DEBUG ("%d", n_threads); async->n_threads = n_threads; async->threads = schro_malloc0 (sizeof (SchroThread) * (n_threads + 1)); async->stop = RUNNING; async->schedule = schedule; async->schedule_closure = closure; async->complete = complete; InitializeCriticalSection (&async->mutex); async->app_event = CreateEvent (0, FALSE, FALSE, NULL); EnterCriticalSection (&async->mutex); for (i = 0; i < n_threads; i++) { SchroThread *thread = async->threads + i; unsigned int ignore; thread->event = CreateEvent (0, FALSE, FALSE, NULL); thread->async = async; thread->index = i; thread->exec_domain = SCHRO_EXEC_DOMAIN_CPU; async->threads[i].thread = (HANDLE) _beginthreadex (NULL, STACK_SIZE, schro_thread_main, async->threads + i, 0, &ignore); EnterCriticalSection (&async->mutex); } LeaveCriticalSection (&async->mutex); return async; } void schro_async_free (SchroAsync * async) { int i; HANDLE *handles; EnterCriticalSection (&async->mutex); async->stop = DIE; LeaveCriticalSection (&async->mutex); for (i = 0; i < async->n_threads; i++) { SetEvent (async->threads[i].event); } handles = schro_malloc (sizeof (HANDLE) * async->n_threads); for (i = 0; i < async->n_threads; i++) { handles[i] = async->threads[i].thread; } WaitForMultipleObjects (async->n_threads, handles, TRUE, INFINITE); schro_free (handles); for (i = 0; i < async->n_threads; i++) { CloseHandle (async->threads[i].event); CloseHandle (async->threads[i].thread); } CloseHandle (async->app_event); DeleteCriticalSection (&async->mutex); schro_free (async->threads); schro_free (async); } void schro_async_start (SchroAsync * async) { int i; async->stop = RUNNING; for (i = 0; i < async->n_threads; i++) { SetEvent (async->threads[i].event); } } void schro_async_stop (SchroAsync * async) { int i; HANDLE *handles; for (i = 0; i < async->n_threads; i++) { SetEvent (async->threads[i].event); } handles = schro_malloc (sizeof (HANDLE) * async->n_threads); for (i = 0; i < async->n_threads; i++) { handles[i] = async->threads[i].thread; } WaitForMultipleObjects (async->n_threads, handles, TRUE, INFINITE); schro_free (handles); } void schro_async_run_stage_locked (SchroAsync * async, SchroAsyncStage * stage) { SCHRO_ASSERT (async->task.task_func == NULL); async->task.task_func = stage->task_func; async->task.priv = stage; schro_async_signal_scheduler (async); } static void schro_async_dump (SchroAsync * async) { int i; SCHRO_WARNING ("stop = %d", async->stop); for (i = 0; i < async->n_threads; i++) { SchroThread *thread = async->threads + i; SCHRO_WARNING ("thread %d: busy=%d", i, thread->busy); } } int schro_async_wait_locked (SchroAsync * async) { DWORD ret; LeaveCriticalSection (&async->mutex); ret = WaitForSingleObject (async->app_event, 1000); EnterCriticalSection (&async->mutex); if (ret == WAIT_TIMEOUT) { int i; for (i = 0; i < async->n_threads; i++) { if (async->threads[i].busy != 0) break; } if (i == async->n_threads) { SCHRO_WARNING ("timeout. deadlock?"); schro_async_dump (async); return FALSE; } } return TRUE; } static unsigned int __stdcall schro_thread_main (void *ptr) { void (*func) (void *); void *priv; SchroThread *thread = ptr; SchroAsync *async = thread->async; int ret; /* thread starts with async->mutex locked */ TlsSetValue (domain_key, (void *) (unsigned long) thread->exec_domain); async->n_threads_running++; thread->busy = FALSE; while (1) { /* check for deaths each time */ if (async->stop != RUNNING) { async->n_idle++; thread->busy = FALSE; SetEvent (async->app_event); if (async->stop == DIE) { async->n_threads_running--; LeaveCriticalSection (&async->mutex); SCHRO_DEBUG ("thread %d: dying", thread->index); return 0; } SCHRO_DEBUG ("thread %d: stopping (until restarted)", thread->index); WaitForSingleObject (thread->event, INFINITE); SCHRO_DEBUG ("thread %d: resuming", thread->index); async->n_idle--; continue; } if (thread->busy == 0) { async->n_idle++; LeaveCriticalSection (&async->mutex); SCHRO_DEBUG ("thread %d: idle", thread->index); WaitForSingleObject (thread->event, INFINITE); SCHRO_DEBUG ("thread %d: got signal", thread->index); EnterCriticalSection (&async->mutex); async->n_idle--; thread->busy = TRUE; /* check for stop requests before doing work */ continue; } if (1) { /* avoiding indent change */ ret = async->schedule (async->schedule_closure, thread->exec_domain); /* FIXME ignoring ret */ if (!async->task.task_func) { thread->busy = FALSE; continue; } //thread->busy = TRUE; func = async->task.task_func; priv = async->task.priv; async->task.task_func = NULL; //if (async->n_idle > 0) { // SetEvent (thread->event); //} LeaveCriticalSection (&async->mutex); SCHRO_DEBUG ("thread %d: running", thread->index); func (priv); SCHRO_DEBUG ("thread %d: done", thread->index); EnterCriticalSection (&async->mutex); async->complete (priv); SetEvent (async->app_event); #if defined HAVE_CUDA || defined HAVE_OPENGL /* FIXME */ /* This is required because we don't have a better mechanism * for indicating to threads in other exec domains that it is * their turn to run. It's mostly harmless, although causes * a lot of unnecessary wakeups in some cases. */ { int i; for (i = 0; i < async->n_threads; i++) { SetEvent (async->thread_event); } } #endif //thread->busy = FALSE; } } } void schro_async_lock (SchroAsync * async) { EnterCriticalSection (&async->mutex); } void schro_async_unlock (SchroAsync * async) { LeaveCriticalSection (&async->mutex); } void schro_async_signal_scheduler (SchroAsync * async) { int i; SCHRO_DEBUG ("signal scheduler"); for (i = 0; i < async->n_threads; i++) { SetEvent (async->threads[i].event); } } void schro_async_add_exec_domain (SchroAsync * async, SchroExecDomain exec_domain) { SchroThread *thread; int i; unsigned int ignore; EnterCriticalSection (&async->mutex); /* We allocated a spare thread structure just for this case. */ async->n_threads++; i = async->n_threads - 1; thread = async->threads + i; memset (thread, 0, sizeof (SchroThread)); thread->async = async; thread->index = i; thread->exec_domain = exec_domain; thread->thread = (HANDLE) _beginthreadex (NULL, STACK_SIZE, schro_thread_main, thread, 0, &ignore); EnterCriticalSection (&async->mutex); LeaveCriticalSection (&async->mutex); } SchroExecDomain schro_async_get_exec_domain (void) { void *domain; domain = TlsGetValue (domain_key); return (int) (unsigned long) domain; } SchroMutex * schro_mutex_new (void) { SchroMutex *mutex; mutex = malloc (sizeof (SchroMutex)); InitializeCriticalSection (&mutex->mutex); return mutex; } void schro_mutex_lock (SchroMutex * mutex) { EnterCriticalSection (&mutex->mutex); } void schro_mutex_unlock (SchroMutex * mutex) { LeaveCriticalSection (&mutex->mutex); } void schro_mutex_free (SchroMutex * mutex) { DeleteCriticalSection (&mutex->mutex); schro_free (mutex); } schroedinger-1.0.11/schroedinger/schrotables.c0000644000175000017500000037123711346060402016331 00000000000000 #include "config.h" #include const uint32_t schro_table_offset_3_8[61] = { 1u, 2u, 2u, 3u, 3u, 4u, 4u, 5u, 6u, 7u, 9u, 10u, 12u, 14u, 17u, 20u, 24u, 29u, 34u, 41u, 48u, 57u, 68u, 81u, 96u, 114u, 136u, 162u, 192u, 228u, 272u, 323u, 384u, 457u, 543u, 646u, 768u, 913u, 1086u, 1292u, 1536u, 1827u, 2172u, 2583u, 3072u, 3653u, 4344u, 5166u, 6144u, 7307u, 8689u, 10333u, 12288u, 14613u, 17378u, 20666u, 24576u, 29226u, 34756u, 41332u, 49152u }; const uint32_t schro_table_offset_1_2[61] = { 1u, 2u, 3u, 4u, 4u, 5u, 6u, 7u, 8u, 10u, 12u, 14u, 16u, 19u, 23u, 27u, 32u, 38u, 46u, 54u, 64u, 76u, 91u, 108u, 128u, 152u, 181u, 216u, 256u, 305u, 362u, 431u, 512u, 609u, 724u, 861u, 1024u, 1218u, 1448u, 1722u, 2048u, 2436u, 2897u, 3445u, 4096u, 4871u, 5793u, 6889u, 8192u, 9742u, 11585u, 13777u, 16384u, 19484u, 23171u, 27555u, 32768u, 38968u, 46341u, 55109u, 65536u }; const uint32_t schro_table_quant[61] = { 4u, 5u, 6u, 7u, 8u, 10u, 11u, 13u, 16u, 19u, 23u, 27u, 32u, 38u, 45u, 54u, 64u, 76u, 91u, 108u, 128u, 152u, 181u, 215u, 256u, 304u, 362u, 431u, 512u, 609u, 724u, 861u, 1024u, 1218u, 1448u, 1722u, 2048u, 2435u, 2896u, 3444u, 4096u, 4871u, 5793u, 6889u, 8192u, 9742u, 11585u, 13777u, 16384u, 19484u, 23170u, 27554u, 32768u, 38968u, 46341u, 55109u, 65536u, 77936u, 92682u, 110218u, 131072u }; const uint16_t schro_table_inverse_quant[61] = { 0u, 52429u, 43691u, 37449u, 0u, 52429u, 47663u, 40330u, 0u, 55188u, 45590u, 38836u, 0u, 55188u, 46603u, 38836u, 0u, 55188u, 46091u, 38836u, 0u, 55188u, 46346u, 39017u, 0u, 55188u, 46346u, 38926u, 0u, 55098u, 46346u, 38971u, 0u, 55098u, 46346u, 38971u, 0u, 55120u, 46346u, 38971u, 0u, 55109u, 46338u, 38966u, 0u, 55109u, 46342u, 38969u, 0u, 55109u, 46342u, 38969u, 0u, 55109u, 46341u, 38968u, 0u, 55109u, 46341u, 38968u, 0u }; const uint16_t schro_table_division_factor[257] = { 0, 0, 32768, 21845, 16384, 13107, 10923, 9362, 8192, 7282, 6554, 5958, 5461, 5041, 4681, 4369, 4096, 3855, 3641, 3449, 3277, 3121, 2979, 2849, 2731, 2621, 2521, 2427, 2341, 2260, 2185, 2114, 2048, 1986, 1928, 1872, 1820, 1771, 1725, 1680, 1638, 1598, 1560, 1524, 1489, 1456, 1425, 1394, 1365, 1337, 1311, 1285, 1260, 1237, 1214, 1192, 1170, 1150, 1130, 1111, 1092, 1074, 1057, 1040, 1024, 1008, 993, 978, 964, 950, 936, 923, 910, 898, 886, 874, 862, 851, 840, 830, 819, 809, 799, 790, 780, 771, 762, 753, 745, 736, 728, 720, 712, 705, 697, 690, 683, 676, 669, 662, 655, 649, 643, 636, 630, 624, 618, 612, 607, 601, 596, 590, 585, 580, 575, 570, 565, 560, 555, 551, 546, 542, 537, 533, 529, 524, 520, 516, 512, 508, 504, 500, 496, 493, 489, 485, 482, 478, 475, 471, 468, 465, 462, 458, 455, 452, 449, 446, 443, 440, 437, 434, 431, 428, 426, 423, 420, 417, 415, 412, 410, 407, 405, 402, 400, 397, 395, 392, 390, 388, 386, 383, 381, 379, 377, 374, 372, 370, 368, 366, 364, 362, 360, 358, 356, 354, 352, 350, 349, 347, 345, 343, 341, 340, 338, 336, 334, 333, 331, 329, 328, 326, 324, 323, 321, 320, 318, 317, 315, 314, 312, 311, 309, 308, 306, 305, 303, 302, 301, 299, 298, 297, 295, 294, 293, 291, 290, 289, 287, 286, 285, 284, 282, 281, 280, 279, 278, 277, 275, 274, 273, 272, 271, 270, 269, 267, 266, 265, 264, 263, 262, 261, 260, 259, 258, 257, 256 }; #ifdef ENABLE_ENCODER const double schro_table_error_hist_shift3_1_2[60][104] = { { /* 0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, { /* 1 */ 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0.5, 0, 0.5, 0, 0, 0.5, 0.25, 0, 0.25, 0.25, 0.25, 0.25, 0, 0.25, 0.25, 0.125, 0.25, 0.25, 0.125, 0.25, 0.125, 0.25, 0.1875, 0.1875, 0.25, 0.1875, 0.1875, 0.1875, 0.1875, 0.25, 0.1875, 0.1875, 0.21875, 0.1875, 0.21875, 0.1875, 0.1875, 0.21875, 0.203125, 0.1875, 0.203125, 0.203125, 0.203125, 0.203125, 0.1875, 0.203125, 0.203125, 0.195312, 0.203125, 0.203125, 0.195312, 0.203125, 0.195312, 0.203125, 0.199219, 0.199219, 0.203125, 0.199219, 0.199219, 0.199219, 0.199219, 0.203125, 0.199219, 0.199219, 0.201172, 0.199219, 0.201172, 0.199219, 0.199219, 0.201172, 0.200195, 0.199219, 0.200195, 0.200195, 0.200195, 0.200195, 0.199219, 0.200195, 0.200195, 0.199707, 0.200195, 0.200195, 0.199707, 0.200195, 0.199707, 0.200195, }, { /* 2 */ 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0.5, 0.5, 0, 0.5, 0.5, 0, 0.5, 0.25, 0.5, 0.25, 0.25, 0.5, 0.25, 0.25, 0.5, 0.25, 0.375, 0.375, 0.25, 0.375, 0.375, 0.25, 0.375, 0.3125, 0.375, 0.3125, 0.3125, 0.375, 0.3125, 0.3125, 0.375, 0.3125, 0.34375, 0.34375, 0.3125, 0.34375, 0.34375, 0.3125, 0.34375, 0.328125, 0.34375, 0.328125, 0.328125, 0.34375, 0.328125, 0.328125, 0.34375, 0.328125, 0.335938, 0.335938, 0.328125, 0.335938, 0.335938, 0.328125, 0.335938, 0.332031, 0.335938, 0.332031, 0.332031, 0.335938, 0.332031, 0.332031, 0.335938, 0.332031, 0.333984, 0.333984, 0.332031, 0.333984, 0.333984, 0.332031, 0.333984, 0.333008, 0.333984, 0.333008, 0.333008, 0.333984, 0.333008, 0.333008, 0.333984, 0.333008, 0.333496, 0.333496, 0.333008, 0.333496, 0.333496, 0.333008, 0.333496, }, { /* 3 */ 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0.5, 0.5, 0.5, 0.5, 0.5, 0, 0.5, 0.5, 0.5, 0.5, 0.25, 0.5, 0.5, 0.25, 0.5, 0.5, 0.375, 0.5, 0.375, 0.5, 0.375, 0.375, 0.5, 0.375, 0.4375, 0.4375, 0.4375, 0.4375, 0.4375, 0.375, 0.4375, 0.4375, 0.4375, 0.4375, 0.40625, 0.4375, 0.4375, 0.40625, 0.4375, 0.4375, 0.421875, 0.4375, 0.421875, 0.4375, 0.421875, 0.421875, 0.4375, 0.421875, 0.429688, 0.429688, 0.429688, 0.429688, 0.429688, 0.421875, 0.429688, 0.429688, 0.429688, 0.429688, 0.425781, 0.429688, 0.429688, 0.425781, 0.429688, 0.429688, 0.427734, 0.429688, 0.427734, 0.429688, 0.427734, 0.427734, 0.429688, 0.427734, 0.428711, 0.428711, 0.428711, 0.428711, 0.428711, 0.427734, 0.428711, 0.428711, 0.428711, 0.428711, 0.428223, 0.428711, 0.428711, 0.428223, 0.428711, 0.428711, }, { /* 4 */ 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, }, { /* 5 */ 0, 1, 4, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0.5, 0.5, 0.5, 1, 0.5, 0.5, 0.5, 0.5, 0.75, 0.5, 0.75, 0.5, 0.5, 0.75, 0.5, 0.75, 0.5, 0.625, 0.625, 0.625, 0.625, 0.5, 0.625, 0.625, 0.625, 0.5625, 0.625, 0.5625, 0.625, 0.625, 0.5625, 0.625, 0.59375, 0.59375, 0.59375, 0.625, 0.59375, 0.59375, 0.59375, 0.59375, 0.609375, 0.59375, 0.609375, 0.59375, 0.59375, 0.609375, 0.59375, 0.609375, 0.59375, 0.601562, 0.601562, 0.601562, 0.601562, 0.59375, 0.601562, 0.601562, 0.601562, 0.597656, 0.601562, 0.597656, 0.601562, 0.601562, 0.597656, 0.601562, 0.599609, 0.599609, 0.599609, 0.601562, 0.599609, 0.599609, 0.599609, 0.599609, 0.600586, 0.599609, 0.600586, 0.599609, 0.599609, 0.600586, 0.599609, 0.600586, 0.599609, 0.600098, 0.600098, 0.600098, 0.600098, 0.599609, 0.600098, 0.600098, }, { /* 6 */ 0, 1, 4, 1, 0, 1, 1, 0, 1, 1, 0, 4, 1, 0, 1, 0, 1, 0.5, 0.5, 2.5, 0.5, 0.5, 0.5, 1, 1.25, 0.75, 0.5, 1.5, 0.5, 1.5, 0.5, 0.75, 1, 1, 0.625, 1, 1, 1.125, 0.625, 1, 1, 0.8125, 0.8125, 1, 0.875, 1, 0.8125, 1, 0.9375, 0.90625, 0.8125, 0.9375, 0.90625, 0.90625, 0.9375, 0.90625, 0.921875, 0.921875, 0.859375, 0.921875, 0.921875, 0.90625, 0.921875, 0.921875, 0.890625, 0.921875, 0.890625, 0.921875, 0.914062, 0.898438, 0.914062, 0.921875, 0.902344, 0.90625, 0.90625, 0.917969, 0.90625, 0.90625, 0.917969, 0.90625, 0.90625, 0.910156, 0.90625, 0.912109, 0.912109, 0.90625, 0.912109, 0.904297, 0.90918, 0.90918, 0.908203, 0.912109, 0.90918, 0.908203, 0.90918, 0.908203, 0.90918, 0.908691, 0.908691, 0.910645, 0.908691, 0.908691, 0.908691, 0.90918, }, { /* 7 */ 0, 1, 4, 9, 1, 0, 1, 1, 0, 1, 4, 1, 0, 4, 1, 0, 1, 0.5, 0.5, 2.5, 0.5, 2.5, 0.5, 0.5, 0.75, 2.25, 0.75, 0.5, 1.5, 1.5, 0.75, 1.5, 1, 1.5, 0.625, 1.5, 1, 1.125, 1.375, 1.125, 1.25, 1.0625, 1.0625, 1.0625, 1.25, 1.25, 1.0625, 1.0625, 1.28125, 1.0625, 1.25, 1.0625, 1.15625, 1.15625, 1.1875, 1.15625, 1.15625, 1.15625, 1.17188, 1.15625, 1.10938, 1.17188, 1.15625, 1.10938, 1.16406, 1.15625, 1.16406, 1.16406, 1.13281, 1.16406, 1.13281, 1.16406, 1.16016, 1.15234, 1.14844, 1.16016, 1.14844, 1.14844, 1.16406, 1.16016, 1.14844, 1.15625, 1.1543, 1.15039, 1.1543, 1.15625, 1.14844, 1.16211, 1.15234, 1.15137, 1.15527, 1.15527, 1.15234, 1.15234, 1.15527, 1.15527, 1.15381, 1.15381, 1.15381, 1.15332, 1.15381, 1.15381, 1.15527, 1.15234, }, { /* 8 */ 0, 1, 4, 9, 4, 1, 0, 1, 4, 1, 0, 1, 4, 1, 0, 1, 2.5, 0.5, 2.5, 0.5, 2.5, 0.5, 2.5, 0.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, }, { /* 9 */ 0, 1, 4, 9, 16, 4, 1, 0, 1, 4, 4, 1, 0, 1, 4, 4, 0.5, 5, 2.5, 0.5, 2.5, 0.5, 4, 0.5, 2.5, 3.5, 1.5, 1.5, 1.5, 2.25, 3.75, 1.5, 1.875, 2.5, 2, 2.5, 1.5, 2.375, 2.5, 1.5, 2.4375, 2, 2.25, 2.4375, 1.6875, 2.25, 2.25, 2, 2.34375, 2.0625, 2.125, 2.21875, 2.09375, 2.21875, 2.125, 2.0625, 2.23438, 2.09375, 2.23438, 2.09375, 2.15625, 2.23438, 2.09375, 2.15625, 2.16406, 2.16406, 2.1875, 2.125, 2.16406, 2.16406, 2.16406, 2.125, 2.16406, 2.14453, 2.17578, 2.14453, 2.17969, 2.14453, 2.17578, 2.14453, 2.1543, 2.1543, 2.16016, 2.16211, 2.16016, 2.1543, 2.16016, 2.16211, 2.15723, 2.15234, 2.16113, 2.1543, 2.16113, 2.15723, 2.15723, 2.16113, 2.15918, 2.15527, 2.15723, 2.15771, 2.15918, 2.15918, 2.15674, 2.15771, }, { /* 10 */ 0, 1, 4, 9, 16, 25, 9, 4, 1, 0, 1, 4, 9, 4, 1, 0, 2.5, 2.5, 0.5, 6.5, 2.5, 0.5, 6.5, 2.5, 3.5, 1.5, 2.25, 4.5, 1.5, 3.5, 4.5, 1.5, 3, 2.5, 3.375, 2.5, 3, 3, 2.5, 4, 2.4375, 2.75, 3.5, 2.9375, 2.75, 2.75, 2.9375, 3, 2.84375, 2.84375, 3.125, 2.84375, 2.96875, 2.75, 2.96875, 2.84375, 2.98438, 2.90625, 2.98438, 2.85938, 2.84375, 2.85938, 2.98438, 2.90625, 2.94531, 2.92188, 2.85156, 2.94531, 2.94531, 2.85156, 2.92188, 2.94531, 2.89844, 2.93359, 2.89844, 2.93359, 2.89844, 2.91406, 2.88672, 2.94531, 2.91602, 2.91602, 2.90039, 2.91602, 2.91602, 2.91602, 2.89844, 2.91602, 2.91602, 2.9082, 2.91602, 2.91113, 2.91602, 2.91602, 2.91113, 2.91602, 2.91211, 2.91162, 2.91211, 2.91357, 2.91602, 2.91357, 2.91211, 2.91162, }, { /* 11 */ 0, 1, 4, 9, 16, 25, 36, 9, 4, 1, 0, 1, 4, 9, 9, 4, 0.5, 2.5, 9, 2.5, 0.5, 10, 6.5, 0.5, 4.5, 1.5, 5.75, 3.5, 3.5, 7.5, 1.5, 4.5, 3.5, 3.625, 4.875, 4.625, 4, 4.5, 2.5, 4, 4.75, 3.5625, 4.25, 4.75, 3.0625, 4.75, 3.8125, 3.6875, 4.15625, 4.28125, 4.125, 3.90625, 4, 4.28125, 3.90625, 3.90625, 4.25, 3.90625, 4.32812, 3.82812, 4.21875, 4.0625, 4.09375, 3.95312, 4.07812, 4.07812, 4.14844, 4.02344, 4.07812, 4.07812, 4.14062, 4.02344, 4.07812, 4.07031, 4.07812, 4.05078, 4.07812, 4.05078, 4.09766, 4.05078, 4.08008, 4.08203, 4.08008, 4.07422, 4.06445, 4.06445, 4.07422, 4.08008, 4.08105, 4.06934, 4.07715, 4.08105, 4.06934, 4.0625, 4.08105, 4.07715, 4.0708, 4.0752, 4.0752, 4.07324, 4.0791, 4.06738, 4.0752, 4.0752, }, { /* 12 */ 0, 1, 4, 9, 16, 25, 36, 49, 16, 9, 4, 1, 0, 1, 4, 9, 12.5, 2.5, 0.5, 6.5, 12.5, 2.5, 0.5, 6.5, 7.5, 3.5, 7.5, 3.5, 7.5, 3.5, 7.5, 3.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5, }, { /* 13 */ 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 16, 9, 4, 1, 0, 1, 6.5, 20.5, 12.5, 2.5, 0.5, 6.5, 16, 6.5, 1.5, 16.5, 3.5, 7.5, 7.5, 3.5, 16.5, 1.5, 7.375, 10.5, 7, 7.5, 5.5, 6.375, 10, 7.5, 8.1875, 6.5, 8.75, 8.1875, 5.5, 8.1875, 8.75, 6.5, 8.46875, 6.59375, 8.09375, 8.09375, 6.59375, 8.46875, 7.625, 6.84375, 7.90625, 7.71875, 7.67188, 7.34375, 7.65625, 8.04688, 7.34375, 7.34375, 7.85156, 7.50781, 7.8125, 7.38281, 7.8125, 7.57031, 7.69531, 7.5, 7.69531, 7.59766, 7.69141, 7.59766, 7.67969, 7.59766, 7.66016, 7.59766, 7.61523, 7.61523, 7.62891, 7.63867, 7.64453, 7.64648, 7.64453, 7.63867, 7.62207, 7.60645, 7.63379, 7.64551, 7.6416, 7.62207, 7.62207, 7.6416, 7.63965, 7.61426, 7.64355, 7.62451, 7.63965, 7.63184, 7.62012, 7.64355, }, { /* 14 */ 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 25, 16, 9, 4, 0.5, 2.5, 12.5, 25, 12.5, 2.5, 0.5, 6.5, 25.5, 7.5, 3.5, 23.25, 3.5, 7.5, 18.75, 1.5, 13.5, 11.5, 7.5, 14.5, 12, 5.5, 10.125, 17.5, 8.1875, 12.5625, 10, 11, 10.3125, 10, 13.25, 7.5, 11.625, 11.75, 11.0312, 10.1562, 10.2188, 10.6562, 10.5312, 11.75, 11.1406, 10.1875, 10.8281, 11.5625, 10.0156, 11.1406, 11.1406, 10.2656, 10.9766, 10.6016, 11.1406, 10.7891, 10.5781, 11.1953, 10.3906, 10.9766, 10.7891, 10.9219, 10.8242, 10.7891, 10.7461, 10.8242, 10.9648, 10.7891, 10.7852, 10.8555, 10.8066, 10.834, 10.8066, 10.8555, 10.7383, 10.9238, 10.8203, 10.8115, 10.8311, 10.8311, 10.8203, 10.8047, 10.8311, 10.8311, 10.8101, 10.8311, 10.8086, 10.8311, 10.8081, 10.8311, 10.8086, 10.8311, }, { /* 15 */ 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 36, 25, 12.5, 2.5, 0.5, 6.5, 20.5, 42.5, 30.5, 12.5, 1.5, 13.5, 28.25, 3.5, 7.5, 36.5, 13.5, 1.5, 21.5, 7.5, 22, 15.875, 7.5, 26.5, 5.5, 19, 14.5, 13.1875, 18.25, 18.25, 13.1875, 14.5, 12.25, 17, 16.7188, 13.2188, 17.125, 15.7188, 13.375, 17.2188, 13.8438, 14.625, 15.6719, 15.7188, 15.6719, 14.2344, 15.2969, 16.4219, 14.9688, 14.2344, 15.8594, 14.8594, 15.9141, 14.5469, 15.9141, 14.8594, 15.8594, 14.6016, 15.4062, 15.2305, 15.418, 15.2305, 15.4219, 15.2305, 15.418, 15.2305, 15.3184, 15.3086, 15.2949, 15.2773, 15.2559, 15.2559, 15.2773, 15.2949, 15.3135, 15.3252, 15.3213, 15.3018, 15.2666, 15.2432, 15.2861, 15.3135, 15.3232, 15.2842, 15.2842, 15.3232, 15.2998, 15.2549, 15.3115, 15.3193, }, { /* 16 */ 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 56.5, 30.5, 12.5, 2.5, 0.5, 6.5, 20.5, 42.5, 43.5, 7.5, 3.5, 31.5, 43.5, 7.5, 3.5, 31.5, 25.5, 17.5, 25.5, 17.5, 25.5, 17.5, 25.5, 17.5, 21.5, 21.5, 21.5, 21.5, 21.5, 21.5, 21.5, 21.5, 21.5, 21.5, 21.5, 21.5, 21.5, 21.5, 21.5, 21.5, 21.5, 21.5, 21.5, 21.5, 21.5, 21.5, 21.5, 21.5, 21.5, 21.5, 21.5, 21.5, 21.5, 21.5, 21.5, 21.5, 21.5, 21.5, 21.5, 21.5, 21.5, 21.5, 21.5, 21.5, 21.5, 21.5, 21.5, 21.5, 21.5, 21.5, 21.5, 21.5, 21.5, 21.5, 21.5, 21.5, 21.5, 21.5, 21.5, 21.5, 21.5, 21.5, 21.5, 21.5, 21.5, 21.5, 21.5, 21.5, }, { /* 17 */ 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 272.5, 212, 72.5, 42.5, 20.5, 6.5, 0.5, 2.5, 21.5, 73.5, 43.5, 7.5, 3.5, 31.5, 77.25, 31.5, 5.5, 58.5, 11.5, 37.875, 35.5, 11.5, 58.5, 5.5, 35.9375, 36.5, 33.6875, 27.5, 21.5, 29.9375, 35, 36.6875, 32.4688, 24.5, 35.0938, 33.9688, 24.0938, 33.9688, 35.0938, 24.5, 34.1562, 28.1562, 32.2812, 31.9844, 28.1562, 34.1562, 29.7969, 29.0312, 31.5078, 32.0938, 30.7266, 29.6328, 31.7812, 31.9766, 30.2188, 30.0703, 31.8789, 30.1797, 31.8008, 30.2852, 31.6445, 30.4609, 31.4102, 30.707, 31.0605, 31.0586, 31.0527, 31.043, 31.0293, 31.0117, 30.9902, 30.9648, 30.9189, 30.9004, 30.9775, 31.0205, 31.0479, 31.0596, 31.0557, 31.0361, 30.9756, 30.917, 31.0186, 31.0576, 31.0342, 30.9482, 30.939, 31.0342, }, { /* 18 */ 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 272.5, 342.5, 420.5, 302.5, 90.5, 56.5, 30.5, 12.5, 1.5, 13.5, 57.5, 110.5, 57.5, 13.5, 1.5, 21.5, 89.625, 25.5, 17.5, 94.375, 17.5, 25.5, 79, 7.5, 61.0625, 33.5, 33.5, 62.5, 43.25, 21.5, 54.5, 57.5625, 35.3438, 47.2812, 43.625, 36.75, 53.375, 33.7812, 50.8438, 40.5312, 45.4375, 43.8125, 38.6406, 42.3125, 46.9375, 45.3281, 43.9375, 40.1875, 42.7578, 46.1016, 40.125, 45.0781, 44.3125, 40.7891, 46.3125, 41.8828, 44.0977, 43.0234, 42.4609, 44.0977, 44.0977, 42.5508, 43.0234, 44.0977, 43.2793, 43.5605, 43.2793, 43.5605, 43.3242, 43.5156, 43.0898, 43.7949, 43.3994, 43.4199, 43.4199, 43.4424, 43.3809, 43.4199, 43.4199, 43.4424, 43.3921, 43.4312, 43.3848, 43.4312, 43.3784, 43.4312, 43.373, 43.4312, }, { /* 19 */ 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 272.5, 342.5, 420.5, 506.5, 600.5, 436, 156.5, 110.5, 57.5, 13.5, 1.5, 21.5, 73.5, 157.5, 111.5, 43.5, 5.5, 61.5, 127.375, 17.5, 25.5, 134.5, 47.5, 7.5, 97.1875, 27.5, 80, 72.4375, 33.5, 96.5, 23.5, 86.1875, 52.5, 57.9688, 72.0938, 71.25, 57.9688, 52.5, 54.8438, 65, 69.2812, 53.3594, 67.4219, 62.1094, 54.2969, 71.4062, 56.4844, 58.0469, 62.1406, 64.8203, 62.1406, 57.2656, 62.8516, 64.7656, 61.3203, 57.5781, 64.0273, 59.2969, 64.1367, 59.2461, 64.1367, 59.2969, 64.0273, 59.4492, 61.7559, 61.7695, 61.7793, 61.7852, 61.7871, 61.7852, 61.7793, 61.7695, 61.7471, 61.7041, 61.6455, 61.5713, 61.4814, 61.4551, 61.5713, 61.6455, 61.7256, 61.7803, 61.7725, 61.7021, 61.5693, 61.4795, 61.6436, 61.7451, }, { /* 20 */ 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 272.5, 342.5, 420.5, 506.5, 600.5, 702.5, 812.5, 930.5, 211.5, 111.5, 43.5, 7.5, 3.5, 31.5, 91.5, 183.5, 161.5, 25.5, 17.5, 137.5, 161.5, 25.5, 17.5, 137.5, 93.5, 77.5, 93.5, 77.5, 93.5, 77.5, 93.5, 77.5, 85.5, 85.5, 85.5, 85.5, 85.5, 85.5, 85.5, 85.5, 85.5, 85.5, 85.5, 85.5, 85.5, 85.5, 85.5, 85.5, 85.5, 85.5, 85.5, 85.5, 85.5, 85.5, 85.5, 85.5, 85.5, 85.5, 85.5, 85.5, 85.5, 85.5, 85.5, 85.5, 85.5, 85.5, 85.5, 85.5, 85.5, 85.5, 85.5, 85.5, 85.5, 85.5, 85.5, 85.5, 85.5, 85.5, 85.5, 85.5, 85.5, 85.5, 85.5, 85.5, 85.5, 85.5, 85.5, 85.5, }, { /* 21 */ 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 272.5, 342.5, 420.5, 506.5, 600.5, 702.5, 812.5, 930.5, 1123.5, 837.5, 241.5, 133.5, 57.5, 13.5, 1.5, 21.5, 115.5, 290.5, 137.5, 17.5, 25.5, 161.5, 283, 95.5, 27.5, 230.5, 33.5, 172.75, 111.5, 63.5, 214, 21.5, 136.875, 142.5, 134.625, 113.25, 85.5, 108.375, 132, 142.125, 130.312, 94.5, 132.938, 135.188, 95.3125, 127.312, 138.562, 99.375, 130.312, 109.125, 128.438, 121.156, 110.438, 133.688, 113.719, 115.25, 121.359, 124.875, 120.578, 114.703, 122.688, 124.641, 118.781, 115.797, 123.898, 117.219, 123.82, 117.43, 123.43, 117.922, 122.727, 118.695, 120.73, 120.734, 120.723, 120.695, 120.652, 120.594, 120.52, 120.43, 120.264, 120.102, 120.322, 120.518, 120.65, 120.721, 120.729, 120.674, }, { /* 22 */ 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 272.5, 342.5, 420.5, 506.5, 600.5, 702.5, 812.5, 930.5, 1123.5, 1407.5, 1723.5, 1221.5, 343.5, 211.5, 111.5, 43.5, 5.5, 61.5, 245.5, 416.875, 187.5, 35.5, 11.5, 115.5, 366.5, 77.5, 93.5, 343.062, 41.5, 153.5, 302.188, 23.5, 231.5, 166.875, 105.5, 222.75, 205.5, 87.5, 182.344, 243.875, 128.203, 209.359, 150.25, 164.125, 191.484, 137.875, 214.938, 132.25, 181.906, 179.406, 168.555, 154.719, 167.031, 178.18, 178.023, 178.531, 160.699, 174.156, 177.574, 160.934, 174.469, 178.23, 159.469, 175.289, 168.412, 176.35, 169.342, 167.34, 175.441, 170.162, 167.045, 174.23, 169.708, 172.958, 168.768, 171.739, 172.333, 168.221, 172.984, 170.927, 171.22, 169.984, 170.454, 172.185, 170.863, 169.927, 170.7, 172.24, }, { /* 23 */ 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 272.5, 342.5, 420.5, 506.5, 600.5, 702.5, 812.5, 930.5, 1123.5, 1407.5, 1723.5, 2071.5, 2451.5, 1729.5, 553.5, 381.5, 187.5, 35.5, 11.5, 115.5, 347.5, 626.5, 385.5, 137.5, 21.5, 293.5, 428.25, 41.5, 153.5, 534.5, 131.5, 51.5, 378.375, 141.5, 275.25, 310.344, 97.5, 381.125, 127.5, 291.75, 211.188, 239.5, 299.312, 254.312, 203.922, 208.375, 234.938, 289.438, 243.219, 211.398, 282.125, 213.531, 238.844, 266.055, 205.656, 274.156, 225.387, 242.887, 252.906, 244.324, 224.906, 241.48, 249.918, 247.828, 231.881, 249.605, 231.553, 250.646, 231.021, 249.732, 233.193, 247.262, 240.131, 240.799, 240.087, 240.131, 240.228, 240.971, 240.506, 240.743, 241.324, 241.849, 241.708, 241.234, 240.548, 240.562, 240.097, 240.482, }, { /* 24 */ 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 272.5, 342.5, 420.5, 506.5, 600.5, 702.5, 812.5, 930.5, 1123.5, 1407.5, 1723.5, 2071.5, 2451.5, 2863.5, 3307.5, 3783.5, 817.5, 425.5, 161.5, 25.5, 17.5, 137.5, 385.5, 761.5, 621.5, 93.5, 77.5, 573.5, 621.5, 93.5, 77.5, 573.5, 357.5, 325.5, 357.5, 325.5, 357.5, 325.5, 357.5, 325.5, 341.5, 341.5, 341.5, 341.5, 341.5, 341.5, 341.5, 341.5, 341.5, 341.5, 341.5, 341.5, 341.5, 341.5, 341.5, 341.5, 341.5, 341.5, 341.5, 341.5, 341.5, 341.5, 341.5, 341.5, 341.5, 341.5, 341.5, 341.5, 341.5, 341.5, 341.5, 341.5, 341.5, 341.5, 341.5, 341.5, 341.5, 341.5, 341.5, 341.5, 341.5, 341.5, 341.5, 341.5, 341.5, 341.5, 341.5, 341.5, }, { /* 25 */ 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 272.5, 342.5, 420.5, 506.5, 600.5, 702.5, 812.5, 930.5, 1123.5, 1407.5, 1723.5, 2071.5, 2451.5, 2863.5, 3307.5, 3783.5, 4561.5, 3368.5, 935.5, 511.5, 215.5, 47.5, 7.5, 95.5, 483.5, 1161.5, 527.5, 63.5, 111.5, 671.5, 1116.5, 363.5, 115.5, 921.5, 127.5, 707, 427.5, 267.5, 844.5, 87.5, 544.75, 569.5, 540.25, 457, 343.5, 427.75, 524.5, 567.25, 523.375, 377.5, 528.625, 542.125, 382.375, 505.375, 554.875, 400.25, 518.875, 436, 515.125, 481.938, 442.125, 534.625, 453.062, 462.25, 484.156, 499, 482.594, 458.094, 489.625, 498.219, 475.562, 462.031, 495.016, 468.375, 494.859, 469.078, 493.453, 470.906, 490.797, 473.859, 482.414, 482.438, 482.398, 482.297, 482.133, 481.906, 481.617, 481.266, }, { /* 26 */ 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 272.5, 342.5, 420.5, 506.5, 600.5, 702.5, 812.5, 930.5, 1123.5, 1407.5, 1723.5, 2071.5, 2451.5, 2863.5, 3307.5, 3783.5, 4561.5, 5705.5, 6977.5, 4127.5, 1337.5, 817.5, 425.5, 161.5, 21.5, 261.5, 1013.5, 1658.75, 723.5, 131.5, 51.5, 483.5, 1427.5, 267.5, 427.5, 1336.12, 141.5, 685.5, 1204.41, 91.5, 926.5, 670.312, 397.5, 872.875, 860.578, 353.5, 720.938, 948.75, 511.094, 853.477, 580.156, 674.375, 762.383, 542, 868.383, 527.125, 725.816, 710.469, 679.316, 621.113, 658.906, 709.566, 718.848, 713.441, 643.057, 689.807, 714.207, 641.572, 697.254, 710.393, 637.197, 701.613, 672.968, 704.429, 673.795, 669.413, 702.007, 679.601, 667.226, 696.558, 676.614, 691.771, 673.942, 685.013, 689.515, 671.159, 690.491, 684.036, }, { /* 27 */ 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 272.5, 342.5, 420.5, 506.5, 600.5, 702.5, 812.5, 930.5, 1123.5, 1407.5, 1723.5, 2071.5, 2451.5, 2863.5, 3307.5, 3783.5, 4561.5, 5705.5, 6977.5, 8377.5, 9905.5, 6944.5, 2167.5, 1487.5, 723.5, 131.5, 51.5, 483.5, 1427.5, 2505.5, 1503.5, 527.5, 87.5, 1207.5, 1754, 175.5, 591.5, 2137.5, 547.5, 195.5, 1515.75, 551.5, 1117, 1248.95, 413.5, 1528.12, 473.5, 1211.88, 839.562, 951.156, 1188.5, 1045.19, 850.914, 827.375, 911.75, 1121.12, 1016.44, 839.145, 1116.84, 895.359, 906.75, 1108.3, 837.062, 1027.06, 927.791, 1000.41, 1008.84, 936.229, 923.836, 1004.57, 1004.37, 940.289, 961.567, 974.865, 959.036, 977.704, 956.204, 980.13, 956.61, 979.627, 968.071, 968.37, 968.025, 967.979, 967.935, 968.37, 967.892, 967.849, }, { /* 28 */ 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 272.5, 342.5, 420.5, 506.5, 600.5, 702.5, 812.5, 930.5, 1123.5, 1407.5, 1723.5, 2071.5, 2451.5, 2863.5, 3307.5, 3783.5, 4561.5, 5705.5, 6977.5, 8377.5, 9905.5, 11561.5, 13345.5, 15257.5, 3213.5, 1661.5, 621.5, 93.5, 77.5, 573.5, 1581.5, 3101.5, 2437.5, 357.5, 325.5, 2341.5, 2437.5, 357.5, 325.5, 2341.5, 1397.5, 1333.5, 1397.5, 1333.5, 1397.5, 1333.5, 1397.5, 1333.5, 1365.5, 1365.5, 1365.5, 1365.5, 1365.5, 1365.5, 1365.5, 1365.5, 1365.5, 1365.5, 1365.5, 1365.5, 1365.5, 1365.5, 1365.5, 1365.5, 1365.5, 1365.5, 1365.5, 1365.5, 1365.5, 1365.5, 1365.5, 1365.5, 1365.5, 1365.5, 1365.5, 1365.5, 1365.5, 1365.5, 1365.5, 1365.5, 1365.5, 1365.5, 1365.5, 1365.5, 1365.5, 1365.5, 1365.5, 1365.5, }, { /* 29 */ 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 272.5, 342.5, 420.5, 506.5, 600.5, 702.5, 812.5, 930.5, 1123.5, 1407.5, 1723.5, 2071.5, 2451.5, 2863.5, 3307.5, 3783.5, 4561.5, 5705.5, 6977.5, 8377.5, 9905.5, 11561.5, 13345.5, 15257.5, 18381.5, 14657.9, 3803.5, 2091.5, 891.5, 203.5, 27.5, 363.5, 1891.5, 4638, 2155.5, 267.5, 427.5, 2635.5, 4488, 1491.5, 451.5, 3682.75, 523.5, 2805.44, 1823.5, 991.5, 3435.25, 343.5, 2190.88, 2276.38, 2179.12, 1780.25, 1365.5, 1760.75, 2125.25, 2318.38, 2052.5, 1517.62, 2169.56, 2128.62, 1523.11, 2087.38, 2201.71, 1538.75, 2122, 1761.95, 1979.97, 2021.21, 1755.94, 2100.78, 1900.31, 1788.05, 1975.73, 1994.8, 1867.39, 1892.48, 2001.45, 1965.27, 1832.8, 1948.29, 1961.21, 1916.32, 1923.3, 1954.57, 1894.49, 1977.97, 1883.28, 1985.87, }, { /* 30 */ 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 272.5, 342.5, 420.5, 506.5, 600.5, 702.5, 812.5, 930.5, 1123.5, 1407.5, 1723.5, 2071.5, 2451.5, 2863.5, 3307.5, 3783.5, 4561.5, 5705.5, 6977.5, 8377.5, 9905.5, 11561.5, 13345.5, 15257.5, 18381.5, 22973.5, 28077.5, 14993.5, 5277.5, 3213.5, 1661.5, 621.5, 85.5, 1077.5, 4117.5, 6716.75, 2947.5, 547.5, 195.5, 1891.5, 5638.33, 1043.5, 1747.5, 5417.12, 581.5, 2693.5, 4753.52, 361.5, 3764.5, 2645.29, 1575.5, 3545.88, 3392.26, 1421.5, 2926.44, 3738.41, 2070.84, 3409.44, 2297.89, 2715.38, 3063.29, 2143.21, 3474.04, 2134.12, 2888.54, 2856.63, 2708.36, 2486.13, 2643.51, 2825.57, 2891.27, 2840.59, 2576.9, 2762.39, 2856.24, 2562.38, 2787.22, 2843.53, 2553.66, 2809.01, 2689.27, 2818.4, 2698.59, 2674.8, 2809.32, 2721.42, 2665.89, 2788.13, }, { /* 31 */ 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 272.5, 342.5, 420.5, 506.5, 600.5, 702.5, 812.5, 930.5, 1123.5, 1407.5, 1723.5, 2071.5, 2451.5, 2863.5, 3307.5, 3783.5, 4561.5, 5705.5, 6977.5, 8377.5, 9905.5, 11561.5, 13345.5, 15257.5, 18381.5, 22973.5, 28077.5, 33693.5, 39821.5, 27727.5, 8393.5, 5721.5, 2737.5, 465.5, 241.5, 2065.5, 5937.5, 9915.78, 5635.5, 1891.5, 371.5, 5171.5, 7005.75, 683.5, 2411.5, 8451.42, 2063.5, 847.5, 5959.26, 2357.5, 4203.62, 5251.25, 1605.5, 6026.19, 2015.5, 4603.28, 3342.22, 3931.5, 4747.88, 4042.27, 3437.44, 3277.72, 3690.56, 4617.38, 3930.98, 3407.62, 4460.79, 3506.76, 3717.23, 4339.69, 3345.77, 4251.68, 3630.3, 3967.72, 4037.5, 3839.25, 3609.29, 3929.43, 4053.43, 3876.32, 3749.2, 3982, 3733.05, 3992.3, 3723.82, 4001.85, 3711.1, 4012.3, }, { /* 32 */ 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 272.5, 342.5, 420.5, 506.5, 600.5, 702.5, 812.5, 930.5, 1123.5, 1407.5, 1723.5, 2071.5, 2451.5, 2863.5, 3307.5, 3783.5, 4561.5, 5705.5, 6977.5, 8377.5, 9905.5, 11561.5, 13345.5, 15257.5, 18381.5, 22973.5, 28077.5, 33693.5, 39821.5, 46461.5, 53613.5, 61277.5, 12741.5, 6565.5, 2437.5, 357.5, 325.5, 2341.5, 6405.5, 12517.5, 9653.5, 1397.5, 1333.5, 9461.5, 9653.5, 1397.5, 1333.5, 9461.5, 5525.5, 5397.5, 5525.5, 5397.5, 5525.5, 5397.5, 5525.5, 5397.5, 5461.5, 5461.5, 5461.5, 5461.5, 5461.5, 5461.5, 5461.5, 5461.5, 5461.5, 5461.5, 5461.5, 5461.5, 5461.5, 5461.5, 5461.5, 5461.5, 5461.5, 5461.5, 5461.5, 5461.5, 5461.5, 5461.5, 5461.5, 5461.5, 5461.5, 5461.5, 5461.5, 5461.5, 5461.5, 5461.5, 5461.5, 5461.5, }, { /* 33 */ 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 272.5, 342.5, 420.5, 506.5, 600.5, 702.5, 812.5, 930.5, 1123.5, 1407.5, 1723.5, 2071.5, 2451.5, 2863.5, 3307.5, 3783.5, 4561.5, 5705.5, 6977.5, 8377.5, 9905.5, 11561.5, 13345.5, 15257.5, 18381.5, 22973.5, 28077.5, 33693.5, 39821.5, 46461.5, 53613.5, 61277.5, 73797.5, 56423, 14847.5, 8095.5, 3391.5, 735.5, 127.5, 1567.5, 7823.5, 18574, 8351.5, 991.5, 1823.5, 10847.5, 17979.4, 5891.5, 1827.5, 14733.2, 2067.5, 11264.8, 7065.5, 4121.5, 13625, 1385.5, 8826.94, 9105.75, 8659.84, 7177.88, 5467.5, 7046.86, 8489.62, 9182, 8266.12, 6066.75, 8623.62, 8568.49, 6071.61, 8360.09, 8782.76, 6176.44, 8473.29, 7041.83, 7950.81, 8074.3, 7024.42, 8408.5, 7570.66, 7163.64, 7907.51, 7980.03, 7472.04, 7566.11, 8004.39, 7857.13, 7337.47, 7789.55, }, { /* 34 */ 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 272.5, 342.5, 420.5, 506.5, 600.5, 702.5, 812.5, 930.5, 1123.5, 1407.5, 1723.5, 2071.5, 2451.5, 2863.5, 3307.5, 3783.5, 4561.5, 5705.5, 6977.5, 8377.5, 9905.5, 11561.5, 13345.5, 15257.5, 18381.5, 22973.5, 28077.5, 33693.5, 39821.5, 46461.5, 53613.5, 61277.5, 73797.5, 92197.5, 112646, 59732.4, 20677.5, 12517.5, 6405.5, 2341.5, 341.5, 4501.5, 16853.5, 26695.9, 11471.5, 2063.5, 847.5, 7823.5, 22538.8, 4017.5, 7217.5, 21533.4, 2235.5, 11067.5, 18758.3, 1421.5, 15049.5, 10704.4, 6217.5, 14120.4, 13637.6, 5733.5, 11588, 14967.5, 8286.91, 13662.8, 9140.62, 10942.4, 12168.9, 8599.21, 13888.9, 8508.39, 11547.8, 11431.4, 10849.5, 9950.68, 10546.9, 11286.4, 11560.5, 11369, 10315.3, 11029.9, 11427.8, 10253.7, 11131, 11378.8, 10215.3, 11220, }, { /* 35 */ 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 272.5, 342.5, 420.5, 506.5, 600.5, 702.5, 812.5, 930.5, 1123.5, 1407.5, 1723.5, 2071.5, 2451.5, 2863.5, 3307.5, 3783.5, 4561.5, 5705.5, 6977.5, 8377.5, 9905.5, 11561.5, 13345.5, 15257.5, 18381.5, 22973.5, 28077.5, 33693.5, 39821.5, 46461.5, 53613.5, 61277.5, 73797.5, 92197.5, 112646, 135142, 159686, 106658, 33391.5, 22735.5, 10847.5, 1823.5, 991.5, 8351.5, 23903.5, 39652.2, 22393.5, 7481.5, 1497.5, 20825.5, 27612.6, 2625.5, 9921.5, 33759.7, 8007.5, 3527.5, 23955.9, 9493.5, 16744.3, 20967.9, 6331.5, 24076.8, 8217.5, 18405.1, 13376.8, 15709.5, 19028.6, 16147.1, 13649.7, 13118.9, 14861.7, 18479.8, 15707.5, 13605.9, 17875.7, 13970.1, 14930.1, 17344.4, 13342.3, 17060.1, 14516, 15843.3, 16151.8, 15382.6, 14433.9, 15712.2, 16192.4, 15521.1, }, { /* 36 */ 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 272.5, 342.5, 420.5, 506.5, 600.5, 702.5, 812.5, 930.5, 1123.5, 1407.5, 1723.5, 2071.5, 2451.5, 2863.5, 3307.5, 3783.5, 4561.5, 5705.5, 6977.5, 8377.5, 9905.5, 11561.5, 13345.5, 15257.5, 18381.5, 22973.5, 28077.5, 33693.5, 39821.5, 46461.5, 53613.5, 61277.5, 73797.5, 92197.5, 112646, 135142, 159686, 186278, 214918, 245606, 50741.5, 26101.5, 9653.5, 1397.5, 1333.5, 9461.5, 25781.5, 50293.5, 38421.5, 5525.5, 5397.5, 38037.5, 38421.5, 5525.5, 5397.5, 38037.5, 21973.5, 21717.5, 21973.5, 21717.5, 21973.5, 21717.5, 21973.5, 21717.5, 21845.5, 21845.5, 21845.5, 21845.5, 21845.5, 21845.5, 21845.5, 21845.5, 21845.5, 21845.5, 21845.5, 21845.5, 21845.5, 21845.5, 21845.5, 21845.5, 21845.5, 21845.5, 21845.5, 21845.5, 21845.5, 21845.5, 21845.5, 21845.5, }, { /* 37 */ 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 272.5, 342.5, 420.5, 506.5, 600.5, 702.5, 812.5, 930.5, 1123.5, 1407.5, 1723.5, 2071.5, 2451.5, 2863.5, 3307.5, 3783.5, 4561.5, 5705.5, 6977.5, 8377.5, 9905.5, 11561.5, 13345.5, 15257.5, 18381.5, 22973.5, 28077.5, 33693.5, 39821.5, 46461.5, 53613.5, 61277.5, 73797.5, 92197.5, 112646, 135142, 159686, 186278, 214918, 245606, 295734, 221249, 58663.5, 31847.5, 13223.5, 2791.5, 551.5, 6503.5, 31815.5, 74582.5, 33227.5, 3915.5, 7371.5, 43595.5, 71437.2, 23121.5, 7441.5, 59185.8, 8217.5, 45078, 27513.5, 17017.5, 54405.5, 5571.5, 35078.9, 36605.4, 34429, 29035.4, 21901.5, 27856, 33976.7, 36350.9, 33278.3, 24266.6, 34276.6, 34440.6, 24247, 33136.2, 35241.3, 24982.1, 33723.1, 28036.9, 32195.3, 31906.6, 28079.1, 33867.3, 29903.8, 28820.9, }, { /* 38 */ 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 272.5, 342.5, 420.5, 506.5, 600.5, 702.5, 812.5, 930.5, 1123.5, 1407.5, 1723.5, 2071.5, 2451.5, 2863.5, 3307.5, 3783.5, 4561.5, 5705.5, 6977.5, 8377.5, 9905.5, 11561.5, 13345.5, 15257.5, 18381.5, 22973.5, 28077.5, 33693.5, 39821.5, 46461.5, 53613.5, 61277.5, 73797.5, 92197.5, 112646, 135142, 159686, 186278, 214918, 245606, 295734, 369398, 451254, 238918, 82423.5, 49847.5, 25463.5, 9271.5, 1367.5, 18135.5, 67671.5, 106671, 45675.5, 8171.5, 3435.5, 31467.5, 90147.6, 15967.5, 29023.5, 86045.2, 8883.5, 44467.5, 74864.4, 5671.5, 60194.3, 42901.4, 24815.5, 56441.2, 54597.8, 22967.5, 46275.2, 59881.3, 33151.8, 54669.9, 36530.3, 43825.2, 48621.3, 34416.3, 55552.7, 34016.7, 46188.6, 45730.6, 43410.7, 39808.6, 42171.5, 45137, 46240.7, 45482.4, }, { /* 39 */ 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 272.5, 342.5, 420.5, 506.5, 600.5, 702.5, 812.5, 930.5, 1123.5, 1407.5, 1723.5, 2071.5, 2451.5, 2863.5, 3307.5, 3783.5, 4561.5, 5705.5, 6977.5, 8377.5, 9905.5, 11561.5, 13345.5, 15257.5, 18381.5, 22973.5, 28077.5, 33693.5, 39821.5, 46461.5, 53613.5, 61277.5, 73797.5, 92197.5, 112646, 135142, 159686, 186278, 214918, 245606, 295734, 369398, 451254, 541302, 639542, 418128, 133202, 90641.5, 43185.5, 7217.5, 4017.5, 33585.5, 95921.5, 159007, 89871.5, 30095.5, 5967.5, 83023.5, 110130, 10431.5, 39871.5, 135405, 32193.5, 14017.5, 95526.8, 38101.5, 67194.4, 83609, 25267.5, 96608.6, 32765.5, 73387.1, 53673.1, 62728.3, 76122.9, 64687, 54438.3, 52648, 59316.2, 73959.4, 62791.8, 54437.1, 71558.6, 55900.9, 59689, 69327.4, 53368, 68290.1, }, { /* 40 */ 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 272.5, 342.5, 420.5, 506.5, 600.5, 702.5, 812.5, 930.5, 1123.5, 1407.5, 1723.5, 2071.5, 2451.5, 2863.5, 3307.5, 3783.5, 4561.5, 5705.5, 6977.5, 8377.5, 9905.5, 11561.5, 13345.5, 15257.5, 18381.5, 22973.5, 28077.5, 33693.5, 39821.5, 46461.5, 53613.5, 61277.5, 73797.5, 92197.5, 112646, 135142, 159686, 186278, 214918, 245606, 295734, 369398, 451254, 541302, 639542, 745974, 860598, 983414, 202518, 104086, 38421.5, 5525.5, 5397.5, 38037.5, 103446, 201622, 153302, 21973.5, 21717.5, 152534, 153302, 21973.5, 21717.5, 152534, 87637.5, 87125.5, 87637.5, 87125.5, 87637.5, 87125.5, 87637.5, 87125.5, 87381.5, 87381.5, 87381.5, 87381.5, 87381.5, 87381.5, 87381.5, 87381.5, 87381.5, 87381.5, 87381.5, 87381.5, 87381.5, 87381.5, 87381.5, 87381.5, }, { /* 41 */ 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 272.5, 342.5, 420.5, 506.5, 600.5, 702.5, 812.5, 930.5, 1123.5, 1407.5, 1723.5, 2071.5, 2451.5, 2863.5, 3307.5, 3783.5, 4561.5, 5705.5, 6977.5, 8377.5, 9905.5, 11561.5, 13345.5, 15257.5, 18381.5, 22973.5, 28077.5, 33693.5, 39821.5, 46461.5, 53613.5, 61277.5, 73797.5, 92197.5, 112646, 135142, 159686, 186278, 214918, 245606, 295734, 369398, 451254, 541302, 639542, 745974, 860598, 983414, 1.18402e+06, 885887, 235138, 127746, 53121.5, 11265.5, 2177.5, 25857.5, 126914, 298315, 133268, 15763.5, 29331.5, 173972, 285217, 92191.5, 29855.5, 236745, 32765.5, 180836, 110948, 67427.5, 218108, 22225.5, 140063, 146415, 138219, 115762, 87537.5, 111576, 136036, 146144, 132699, 97119.6, 137652, 137324, 97075, 132887, 140985, 99482.3, }, { /* 42 */ 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 272.5, 342.5, 420.5, 506.5, 600.5, 702.5, 812.5, 930.5, 1123.5, 1407.5, 1723.5, 2071.5, 2451.5, 2863.5, 3307.5, 3783.5, 4561.5, 5705.5, 6977.5, 8377.5, 9905.5, 11561.5, 13345.5, 15257.5, 18381.5, 22973.5, 28077.5, 33693.5, 39821.5, 46461.5, 53613.5, 61277.5, 73797.5, 92197.5, 112646, 135142, 159686, 186278, 214918, 245606, 295734, 369398, 451254, 541302, 639542, 745974, 860598, 983414, 1.18402e+06, 1.47881e+06, 1.80636e+06, 968862, 330268, 199836, 102172, 37275.5, 5467.5, 72283.5, 270172, 426899, 183124, 32851.5, 13651.5, 125524, 360601, 64075.5, 115788, 344352, 35651.5, 177476, 300654, 22775.5, 240794, 171096, 99591.5, 226001, 218417, 91541.5, 185857, 239404, 132563, 218608, 146570, 174519, 195472, 137315, 222413, 136439, }, { /* 43 */ 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 272.5, 342.5, 420.5, 506.5, 600.5, 702.5, 812.5, 930.5, 1123.5, 1407.5, 1723.5, 2071.5, 2451.5, 2863.5, 3307.5, 3783.5, 4561.5, 5705.5, 6977.5, 8377.5, 9905.5, 11561.5, 13345.5, 15257.5, 18381.5, 22973.5, 28077.5, 33693.5, 39821.5, 46461.5, 53613.5, 61277.5, 73797.5, 92197.5, 112646, 135142, 159686, 186278, 214918, 245606, 295734, 369398, 451254, 541302, 639542, 745974, 860598, 983414, 1.18402e+06, 1.47881e+06, 1.80636e+06, 2.16668e+06, 2.55977e+06, 1.69019e+06, 532078, 361966, 172334, 28717.5, 16173.5, 134702, 384302, 635945, 358892, 120044, 23915.5, 332652, 440014, 41585.5, 159858, 541555, 128448, 56255.5, 382698, 152152, 269056, 334239, 101188, 386460, 130854, 294519, 214601, 250666, 304544, 259190, 217936, 210515, 237126, 295274, }, { /* 44 */ 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 272.5, 342.5, 420.5, 506.5, 600.5, 702.5, 812.5, 930.5, 1123.5, 1407.5, 1723.5, 2071.5, 2451.5, 2863.5, 3307.5, 3783.5, 4561.5, 5705.5, 6977.5, 8377.5, 9905.5, 11561.5, 13345.5, 15257.5, 18381.5, 22973.5, 28077.5, 33693.5, 39821.5, 46461.5, 53613.5, 61277.5, 73797.5, 92197.5, 112646, 135142, 159686, 186278, 214918, 245606, 295734, 369398, 451254, 541302, 639542, 745974, 860598, 983414, 1.18402e+06, 1.47881e+06, 1.80636e+06, 2.16668e+06, 2.55977e+06, 2.98562e+06, 3.44425e+06, 3.93564e+06, 809174, 415702, 153302, 21973.5, 21717.5, 152534, 414422, 807382, 612438, 87637.5, 87125.5, 610902, 612438, 87637.5, 87125.5, 610902, 350038, 349014, 350038, 349014, 350038, 349014, 350038, 349014, 349526, 349526, 349526, 349526, 349526, 349526, 349526, 349526, }, { /* 45 */ 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 272.5, 342.5, 420.5, 506.5, 600.5, 702.5, 812.5, 930.5, 1123.5, 1407.5, 1723.5, 2071.5, 2451.5, 2863.5, 3307.5, 3783.5, 4561.5, 5705.5, 6977.5, 8377.5, 9905.5, 11561.5, 13345.5, 15257.5, 18381.5, 22973.5, 28077.5, 33693.5, 39821.5, 46461.5, 53613.5, 61277.5, 73797.5, 92197.5, 112646, 135142, 159686, 186278, 214918, 245606, 295734, 369398, 451254, 541302, 639542, 745974, 860598, 983414, 1.18402e+06, 1.47881e+06, 1.80636e+06, 2.16668e+06, 2.55977e+06, 2.98562e+06, 3.44425e+06, 3.93564e+06, 4.73826e+06, 3.54309e+06, 937652, 508852, 211124, 44467.5, 8883.5, 104372, 509748, 1.19335e+06, 530928, 62447.5, 118256, 698352, 1.14106e+06, 368178, 119602, 947000, 130854, 723649, 442002, 270994, 871463, 89021.5, 560758, 585664, 552410, 463504, 350228, 446326, 544056, 583841, }, { /* 46 */ 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 272.5, 342.5, 420.5, 506.5, 600.5, 702.5, 812.5, 930.5, 1123.5, 1407.5, 1723.5, 2071.5, 2451.5, 2863.5, 3307.5, 3783.5, 4561.5, 5705.5, 6977.5, 8377.5, 9905.5, 11561.5, 13345.5, 15257.5, 18381.5, 22973.5, 28077.5, 33693.5, 39821.5, 46461.5, 53613.5, 61277.5, 73797.5, 92197.5, 112646, 135142, 159686, 186278, 214918, 245606, 295734, 369398, 451254, 541302, 639542, 745974, 860598, 983414, 1.18402e+06, 1.47881e+06, 1.80636e+06, 2.16668e+06, 2.55977e+06, 2.98562e+06, 3.44425e+06, 3.93564e+06, 4.73826e+06, 5.91765e+06, 7.22812e+06, 3.84899e+06, 1.31763e+06, 796672, 406784, 147968, 21887.5, 290688, 1.08378e+06, 1.70628e+06, 729968, 130416, 55151.5, 504176, 1.44233e+06, 255072, 464992, 1.37637e+06, 141904, 712272, 1.19888e+06, 90803.5, 963117, 686080, 397268, 903214, 874005, 367082, 741310, 957954, }, { /* 47 */ 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 272.5, 342.5, 420.5, 506.5, 600.5, 702.5, 812.5, 930.5, 1123.5, 1407.5, 1723.5, 2071.5, 2451.5, 2863.5, 3307.5, 3783.5, 4561.5, 5705.5, 6977.5, 8377.5, 9905.5, 11561.5, 13345.5, 15257.5, 18381.5, 22973.5, 28077.5, 33693.5, 39821.5, 46461.5, 53613.5, 61277.5, 73797.5, 92197.5, 112646, 135142, 159686, 186278, 214918, 245606, 295734, 369398, 451254, 541302, 639542, 745974, 860598, 983414, 1.18402e+06, 1.47881e+06, 1.80636e+06, 2.16668e+06, 2.55977e+06, 2.98562e+06, 3.44425e+06, 3.93564e+06, 4.73826e+06, 5.91765e+06, 7.22812e+06, 8.66965e+06, 1.02423e+07, 6.72487e+06, 2.12394e+06, 1.44426e+06, 686886, 113958, 65317.5, 540966, 1.5409e+06, 2.5434e+06, 1.432e+06, 478146, 95937.5, 1.33395e+06, 1.75709e+06, 165502, 641662, 2.16589e+06, 511834, 226138, 1.52909e+06, 611158, 1.07337e+06, 1.33886e+06, 403582, 1.54552e+06, 525506, 1.17409e+06, }, { /* 48 */ 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 272.5, 342.5, 420.5, 506.5, 600.5, 702.5, 812.5, 930.5, 1123.5, 1407.5, 1723.5, 2071.5, 2451.5, 2863.5, 3307.5, 3783.5, 4561.5, 5705.5, 6977.5, 8377.5, 9905.5, 11561.5, 13345.5, 15257.5, 18381.5, 22973.5, 28077.5, 33693.5, 39821.5, 46461.5, 53613.5, 61277.5, 73797.5, 92197.5, 112646, 135142, 159686, 186278, 214918, 245606, 295734, 369398, 451254, 541302, 639542, 745974, 860598, 983414, 1.18402e+06, 1.47881e+06, 1.80636e+06, 2.16668e+06, 2.55977e+06, 2.98562e+06, 3.44425e+06, 3.93564e+06, 4.73826e+06, 5.91765e+06, 7.22812e+06, 8.66965e+06, 1.02423e+07, 1.19459e+07, 1.37807e+07, 1.57465e+07, 3.2349e+06, 1.66153e+06, 612438, 87637.5, 87125.5, 610902, 1.65897e+06, 3.23132e+06, 2.44821e+06, 350038, 349014, 2.44514e+06, 2.44821e+06, 350038, 349014, 2.44514e+06, 1.39913e+06, 1.39708e+06, 1.39913e+06, 1.39708e+06, 1.39913e+06, 1.39708e+06, 1.39913e+06, 1.39708e+06, }, { /* 49 */ 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 272.5, 342.5, 420.5, 506.5, 600.5, 702.5, 812.5, 930.5, 1123.5, 1407.5, 1723.5, 2071.5, 2451.5, 2863.5, 3307.5, 3783.5, 4561.5, 5705.5, 6977.5, 8377.5, 9905.5, 11561.5, 13345.5, 15257.5, 18381.5, 22973.5, 28077.5, 33693.5, 39821.5, 46461.5, 53613.5, 61277.5, 73797.5, 92197.5, 112646, 135142, 159686, 186278, 214918, 245606, 295734, 369398, 451254, 541302, 639542, 745974, 860598, 983414, 1.18402e+06, 1.47881e+06, 1.80636e+06, 2.16668e+06, 2.55977e+06, 2.98562e+06, 3.44425e+06, 3.93564e+06, 4.73826e+06, 5.91765e+06, 7.22812e+06, 8.66965e+06, 1.02423e+07, 1.19459e+07, 1.37807e+07, 1.57465e+07, 1.89574e+07, 1.41412e+07, 3.75254e+06, 2.03683e+06, 845402, 178266, 35417.5, 416858, 2.03759e+06, 4.77122e+06, 2.12228e+06, 249388, 473644, 2.79505e+06, 4.56636e+06, 1.47389e+06, 478048, 3.78608e+06, 522998, 2.8962e+06, 1.7692e+06, 1.08312e+06, 3.48404e+06, 356168, }, { /* 50 */ 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 272.5, 342.5, 420.5, 506.5, 600.5, 702.5, 812.5, 930.5, 1123.5, 1407.5, 1723.5, 2071.5, 2451.5, 2863.5, 3307.5, 3783.5, 4561.5, 5705.5, 6977.5, 8377.5, 9905.5, 11561.5, 13345.5, 15257.5, 18381.5, 22973.5, 28077.5, 33693.5, 39821.5, 46461.5, 53613.5, 61277.5, 73797.5, 92197.5, 112646, 135142, 159686, 186278, 214918, 245606, 295734, 369398, 451254, 541302, 639542, 745974, 860598, 983414, 1.18402e+06, 1.47881e+06, 1.80636e+06, 2.16668e+06, 2.55977e+06, 2.98562e+06, 3.44425e+06, 3.93564e+06, 4.73826e+06, 5.91765e+06, 7.22812e+06, 8.66965e+06, 1.02423e+07, 1.19459e+07, 1.37807e+07, 1.57465e+07, 1.89574e+07, 2.36755e+07, 2.89178e+07, 1.5343e+07, 5.26366e+06, 3.18135e+06, 1.62334e+06, 589608, 87591.5, 1.16586e+06, 4.34129e+06, 6.82247e+06, 2.91482e+06, 519688, 221704, 2.02087e+06, 5.77158e+06, 1.01947e+06, 1.8612e+06, 5.50477e+06, 567148, 2.85067e+06, 4.79073e+06, 362866, }, { /* 51 */ 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 272.5, 342.5, 420.5, 506.5, 600.5, 702.5, 812.5, 930.5, 1123.5, 1407.5, 1723.5, 2071.5, 2451.5, 2863.5, 3307.5, 3783.5, 4561.5, 5705.5, 6977.5, 8377.5, 9905.5, 11561.5, 13345.5, 15257.5, 18381.5, 22973.5, 28077.5, 33693.5, 39821.5, 46461.5, 53613.5, 61277.5, 73797.5, 92197.5, 112646, 135142, 159686, 186278, 214918, 245606, 295734, 369398, 451254, 541302, 639542, 745974, 860598, 983414, 1.18402e+06, 1.47881e+06, 1.80636e+06, 2.16668e+06, 2.55977e+06, 2.98562e+06, 3.44425e+06, 3.93564e+06, 4.73826e+06, 5.91765e+06, 7.22812e+06, 8.66965e+06, 1.02423e+07, 1.19459e+07, 1.37807e+07, 1.57465e+07, 1.89574e+07, 2.36755e+07, 2.89178e+07, 3.46845e+07, 4.09754e+07, 2.68277e+07, 8.48704e+06, 5.76985e+06, 2.74265e+06, 454012, 262524, 2.16819e+06, 6.171e+06, 1.01728e+07, 5.72088e+06, 1.90853e+06, 384308, 5.34252e+06, 7.02699e+06, 661448, 2.56814e+06, 8.66335e+06, 2.04603e+06, 905296, }, { /* 52 */ 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 272.5, 342.5, 420.5, 506.5, 600.5, 702.5, 812.5, 930.5, 1123.5, 1407.5, 1723.5, 2071.5, 2451.5, 2863.5, 3307.5, 3783.5, 4561.5, 5705.5, 6977.5, 8377.5, 9905.5, 11561.5, 13345.5, 15257.5, 18381.5, 22973.5, 28077.5, 33693.5, 39821.5, 46461.5, 53613.5, 61277.5, 73797.5, 92197.5, 112646, 135142, 159686, 186278, 214918, 245606, 295734, 369398, 451254, 541302, 639542, 745974, 860598, 983414, 1.18402e+06, 1.47881e+06, 1.80636e+06, 2.16668e+06, 2.55977e+06, 2.98562e+06, 3.44425e+06, 3.93564e+06, 4.73826e+06, 5.91765e+06, 7.22812e+06, 8.66965e+06, 1.02423e+07, 1.19459e+07, 1.37807e+07, 1.57465e+07, 1.89574e+07, 2.36755e+07, 2.89178e+07, 3.46845e+07, 4.09754e+07, 4.77907e+07, 5.51302e+07, 6.2994e+07, 1.2936e+07, 6.64354e+06, 2.44821e+06, 350038, 349014, 2.44514e+06, 6.63842e+06, 1.29289e+07, 9.78978e+06, 1.39913e+06, 1.39708e+06, 9.78364e+06, 9.78978e+06, 1.39913e+06, 1.39708e+06, 9.78364e+06, }, { /* 53 */ 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 272.5, 342.5, 420.5, 506.5, 600.5, 702.5, 812.5, 930.5, 1123.5, 1407.5, 1723.5, 2071.5, 2451.5, 2863.5, 3307.5, 3783.5, 4561.5, 5705.5, 6977.5, 8377.5, 9905.5, 11561.5, 13345.5, 15257.5, 18381.5, 22973.5, 28077.5, 33693.5, 39821.5, 46461.5, 53613.5, 61277.5, 73797.5, 92197.5, 112646, 135142, 159686, 186278, 214918, 245606, 295734, 369398, 451254, 541302, 639542, 745974, 860598, 983414, 1.18402e+06, 1.47881e+06, 1.80636e+06, 2.16668e+06, 2.55977e+06, 2.98562e+06, 3.44425e+06, 3.93564e+06, 4.73826e+06, 5.91765e+06, 7.22812e+06, 8.66965e+06, 1.02423e+07, 1.19459e+07, 1.37807e+07, 1.57465e+07, 1.89574e+07, 2.36755e+07, 2.89178e+07, 3.46845e+07, 4.09754e+07, 4.77907e+07, 5.51302e+07, 6.2994e+07, 7.58383e+07, 5.65628e+07, 1.49986e+07, 8.13879e+06, 3.37616e+06, 710692, 142372, 1.6712e+06, 8.15876e+06, 1.90852e+07, 8.48058e+06, 995138, 1.89831e+06, 1.11901e+07, 1.82601e+07, 5.88849e+06, }, { /* 54 */ 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 272.5, 342.5, 420.5, 506.5, 600.5, 702.5, 812.5, 930.5, 1123.5, 1407.5, 1723.5, 2071.5, 2451.5, 2863.5, 3307.5, 3783.5, 4561.5, 5705.5, 6977.5, 8377.5, 9905.5, 11561.5, 13345.5, 15257.5, 18381.5, 22973.5, 28077.5, 33693.5, 39821.5, 46461.5, 53613.5, 61277.5, 73797.5, 92197.5, 112646, 135142, 159686, 186278, 214918, 245606, 295734, 369398, 451254, 541302, 639542, 745974, 860598, 983414, 1.18402e+06, 1.47881e+06, 1.80636e+06, 2.16668e+06, 2.55977e+06, 2.98562e+06, 3.44425e+06, 3.93564e+06, 4.73826e+06, 5.91765e+06, 7.22812e+06, 8.66965e+06, 1.02423e+07, 1.19459e+07, 1.37807e+07, 1.57465e+07, 1.89574e+07, 2.36755e+07, 2.89178e+07, 3.46845e+07, 4.09754e+07, 4.77907e+07, 5.51302e+07, 6.2994e+07, 7.58383e+07, 9.47116e+07, 1.15682e+08, 6.1372e+07, 2.105e+07, 1.27219e+07, 6.49081e+06, 2.35692e+06, 350396, 4.66553e+06, 1.73693e+07, 2.72951e+07, 1.16627e+07, 2.08007e+06, 886082, 8.08071e+06, }, { /* 55 */ 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 272.5, 342.5, 420.5, 506.5, 600.5, 702.5, 812.5, 930.5, 1123.5, 1407.5, 1723.5, 2071.5, 2451.5, 2863.5, 3307.5, 3783.5, 4561.5, 5705.5, 6977.5, 8377.5, 9905.5, 11561.5, 13345.5, 15257.5, 18381.5, 22973.5, 28077.5, 33693.5, 39821.5, 46461.5, 53613.5, 61277.5, 73797.5, 92197.5, 112646, 135142, 159686, 186278, 214918, 245606, 295734, 369398, 451254, 541302, 639542, 745974, 860598, 983414, 1.18402e+06, 1.47881e+06, 1.80636e+06, 2.16668e+06, 2.55977e+06, 2.98562e+06, 3.44425e+06, 3.93564e+06, 4.73826e+06, 5.91765e+06, 7.22812e+06, 8.66965e+06, 1.02423e+07, 1.19459e+07, 1.37807e+07, 1.57465e+07, 1.89574e+07, 2.36755e+07, 2.89178e+07, 3.46845e+07, 4.09754e+07, 4.77907e+07, 5.51302e+07, 6.2994e+07, 7.58383e+07, 9.47116e+07, 1.15682e+08, 1.3875e+08, 1.63915e+08, 1.07313e+08, 3.39423e+07, 2.30746e+07, 1.09673e+07, 1.81484e+06, 1.05093e+06, 8.67564e+06, 2.46889e+07, 4.06976e+07, 2.28883e+07, 7.63683e+06, }, { /* 56 */ 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 272.5, 342.5, 420.5, 506.5, 600.5, 702.5, 812.5, 930.5, 1123.5, 1407.5, 1723.5, 2071.5, 2451.5, 2863.5, 3307.5, 3783.5, 4561.5, 5705.5, 6977.5, 8377.5, 9905.5, 11561.5, 13345.5, 15257.5, 18381.5, 22973.5, 28077.5, 33693.5, 39821.5, 46461.5, 53613.5, 61277.5, 73797.5, 92197.5, 112646, 135142, 159686, 186278, 214918, 245606, 295734, 369398, 451254, 541302, 639542, 745974, 860598, 983414, 1.18402e+06, 1.47881e+06, 1.80636e+06, 2.16668e+06, 2.55977e+06, 2.98562e+06, 3.44425e+06, 3.93564e+06, 4.73826e+06, 5.91765e+06, 7.22812e+06, 8.66965e+06, 1.02423e+07, 1.19459e+07, 1.37807e+07, 1.57465e+07, 1.89574e+07, 2.36755e+07, 2.89178e+07, 3.46845e+07, 4.09754e+07, 4.77907e+07, 5.51302e+07, 6.2994e+07, 7.58383e+07, 9.47116e+07, 1.15682e+08, 1.3875e+08, 1.63915e+08, 1.91177e+08, 2.20536e+08, 2.51992e+08, 5.17369e+07, 2.6569e+07, 9.78978e+06, 1.39913e+06, 1.39708e+06, 9.78364e+06, 2.65588e+07, 5.17226e+07, }, { /* 57 */ 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 272.5, 342.5, 420.5, 506.5, 600.5, 702.5, 812.5, 930.5, 1123.5, 1407.5, 1723.5, 2071.5, 2451.5, 2863.5, 3307.5, 3783.5, 4561.5, 5705.5, 6977.5, 8377.5, 9905.5, 11561.5, 13345.5, 15257.5, 18381.5, 22973.5, 28077.5, 33693.5, 39821.5, 46461.5, 53613.5, 61277.5, 73797.5, 92197.5, 112646, 135142, 159686, 186278, 214918, 245606, 295734, 369398, 451254, 541302, 639542, 745974, 860598, 983414, 1.18402e+06, 1.47881e+06, 1.80636e+06, 2.16668e+06, 2.55977e+06, 2.98562e+06, 3.44425e+06, 3.93564e+06, 4.73826e+06, 5.91765e+06, 7.22812e+06, 8.66965e+06, 1.02423e+07, 1.19459e+07, 1.37807e+07, 1.57465e+07, 1.89574e+07, 2.36755e+07, 2.89178e+07, 3.46845e+07, 4.09754e+07, 4.77907e+07, 5.51302e+07, 6.2994e+07, 7.58383e+07, 9.47116e+07, 1.15682e+08, 1.3875e+08, 1.63915e+08, 1.91177e+08, 2.20536e+08, 2.51992e+08, 3.03371e+08, 2.26256e+08, 5.99865e+07, 3.25495e+07, 1.3501e+07, 2.84119e+06, 569956, 6.68733e+06, }, { /* 58 */ 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 272.5, 342.5, 420.5, 506.5, 600.5, 702.5, 812.5, 930.5, 1123.5, 1407.5, 1723.5, 2071.5, 2451.5, 2863.5, 3307.5, 3783.5, 4561.5, 5705.5, 6977.5, 8377.5, 9905.5, 11561.5, 13345.5, 15257.5, 18381.5, 22973.5, 28077.5, 33693.5, 39821.5, 46461.5, 53613.5, 61277.5, 73797.5, 92197.5, 112646, 135142, 159686, 186278, 214918, 245606, 295734, 369398, 451254, 541302, 639542, 745974, 860598, 983414, 1.18402e+06, 1.47881e+06, 1.80636e+06, 2.16668e+06, 2.55977e+06, 2.98562e+06, 3.44425e+06, 3.93564e+06, 4.73826e+06, 5.91765e+06, 7.22812e+06, 8.66965e+06, 1.02423e+07, 1.19459e+07, 1.37807e+07, 1.57465e+07, 1.89574e+07, 2.36755e+07, 2.89178e+07, 3.46845e+07, 4.09754e+07, 4.77907e+07, 5.51302e+07, 6.2994e+07, 7.58383e+07, 9.47116e+07, 1.15682e+08, 1.3875e+08, 1.63915e+08, 1.91177e+08, 2.20536e+08, 2.51992e+08, 3.03371e+08, 3.78866e+08, 4.6275e+08, 2.45291e+08, 8.4191e+07, 5.08803e+07, 2.59582e+07, 9.42468e+06, }, { /* 59 */ 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 272.5, 342.5, 420.5, 506.5, 600.5, 702.5, 812.5, 930.5, 1123.5, 1407.5, 1723.5, 2071.5, 2451.5, 2863.5, 3307.5, 3783.5, 4561.5, 5705.5, 6977.5, 8377.5, 9905.5, 11561.5, 13345.5, 15257.5, 18381.5, 22973.5, 28077.5, 33693.5, 39821.5, 46461.5, 53613.5, 61277.5, 73797.5, 92197.5, 112646, 135142, 159686, 186278, 214918, 245606, 295734, 369398, 451254, 541302, 639542, 745974, 860598, 983414, 1.18402e+06, 1.47881e+06, 1.80636e+06, 2.16668e+06, 2.55977e+06, 2.98562e+06, 3.44425e+06, 3.93564e+06, 4.73826e+06, 5.91765e+06, 7.22812e+06, 8.66965e+06, 1.02423e+07, 1.19459e+07, 1.37807e+07, 1.57465e+07, 1.89574e+07, 2.36755e+07, 2.89178e+07, 3.46845e+07, 4.09754e+07, 4.77907e+07, 5.51302e+07, 6.2994e+07, 7.58383e+07, 9.47116e+07, 1.15682e+08, 1.3875e+08, 1.63915e+08, 1.91177e+08, 2.20536e+08, 2.51992e+08, 3.03371e+08, 3.78866e+08, 4.6275e+08, 5.55023e+08, 6.55684e+08, 4.2898e+08, 1.35758e+08, 9.22889e+07, }, }; const double schro_table_onebits_hist_shift3_1_2[60][104] = { { /* 0 */ 0, 0, 1, 0, 1, 1, 2, 0, 1, 1, 2, 1, 2, 2, 3, 0, 1, 1.5, 2, 2, 2, 2.5, 3, 2, 1.25, 2, 2.25, 2.75, 2.25, 3, 3.25, 3.25, 1.625, 2.5, 2.625, 3.375, 2.625, 3.5, 3.625, 4.125, 2.0625, 3, 3.0625, 3.9375, 3.0625, 4, 4.0625, 4.8125, 2.53125, 3.5, 3.53125, 4.46875, 3.53125, 4.5, 4.53125, 5.40625, 3.01562, 4, 4.01562, 4.98438, 4.01562, 5, 5.01562, 5.95312, 3.50781, 4.5, 4.50781, 5.49219, 4.50781, 5.5, 5.50781, 6.47656, 4.00391, 5, 5.00391, 5.99609, 5.00391, 6, 6.00391, 6.98828, 4.50195, 5.5, 5.50195, 6.49805, 5.50195, 6.5, 6.50195, 7.49414, 5.00098, 6, 6.00098, 6.99902, 6.00098, 7, 7.00098, 7.99707, 5.50049, 6.5, 6.50049, 7.49951, 6.50049, 7.5, 7.50049, 8.49854, }, { /* 1 */ 0, 0, 0, 1, 0, 1, 1, 1, 2, 0, 1, 1, 1, 2, 1, 2, 2, 1.5, 1, 1.5, 1.5, 2, 2, 2, 2.5, 2.5, 1.25, 1.75, 2, 2.5, 2.75, 2.25, 2.875, 3.375, 1.5, 2.25, 2.5, 2.875, 3.5, 2.5, 3.375, 4.0625, 1.875, 2.6875, 3, 3.375, 4.125, 2.875, 3.84375, 4.6875, 2.28125, 3.1875, 3.5, 3.84375, 4.71875, 3.28125, 4.34375, 5.25, 2.73438, 3.67188, 4, 4.34375, 5.26562, 3.73438, 4.83594, 5.78906, 3.20312, 4.17188, 4.5, 4.83594, 5.79688, 4.20312, 5.33594, 6.30859, 3.6875, 4.66797, 5, 5.33594, 6.3125, 4.6875, 5.83398, 6.82031, 4.17773, 5.16797, 5.5, 5.83398, 6.82227, 5.17773, 6.33398, 7.32617, 4.67285, 5.66699, 6, 6.33398, 7.32715, 5.67285, 6.8335, 7.82959, 5.16992, 6.16699, 6.5, 6.8335, 7.83008, 6.16992, }, { /* 2 */ 0, 0, 0, 1, 1, 0, 1, 1, 1, 2, 2, 0, 1, 1, 1, 2, 1.5, 2, 2.5, 1.5, 1, 1.5, 1.5, 2, 2.25, 2.25, 2.75, 2.75, 1.25, 1.75, 2.25, 2.25, 2.875, 2.5, 3.25, 3.625, 1.5, 2.25, 2.875, 2.5, 3.5, 2.875, 3.6875, 4.375, 1.875, 2.6875, 3.5, 2.875, 4.0625, 3.28125, 4.1875, 5, 2.28125, 3.1875, 4.0625, 3.28125, 4.60938, 3.73438, 4.67188, 5.57812, 2.73438, 3.67188, 4.60938, 3.73438, 5.13281, 4.20312, 5.17188, 6.11719, 3.20312, 4.17188, 5.13281, 4.20312, 5.64844, 4.6875, 5.66797, 6.64062, 3.6875, 4.66797, 5.64844, 4.6875, 6.15625, 5.17773, 6.16797, 7.15234, 4.17773, 5.16797, 6.15625, 5.17773, 6.66113, 5.67285, 6.66699, 7.65918, 4.67285, 5.66699, 6.66113, 5.67285, 7.16357, 6.16992, 7.16699, 8.1626, 5.16992, 6.16699, 7.16357, 6.16992, }, { /* 3 */ 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 2, 2, 0, 1, 1, 1, 2, 1.5, 2, 2.5, 1.5, 1, 1, 1.75, 2.25, 2, 2.5, 2.75, 2.75, 1, 1.75, 2.125, 2.625, 2.5, 3, 3.25, 3.625, 1.375, 2.125, 2.5625, 3.125, 3.0625, 3.375, 3.75, 4.375, 1.75, 2.5625, 3.09375, 3.5625, 3.59375, 3.84375, 4.21875, 5.03125, 2.15625, 3.09375, 3.57812, 4.03125, 4.10938, 4.32812, 4.71875, 5.60938, 2.625, 3.57812, 4.07031, 4.52344, 4.625, 4.80469, 5.21875, 6.15625, 3.10156, 4.07031, 4.57422, 5.01172, 5.13281, 5.29688, 5.71484, 6.68359, 3.58594, 4.57422, 5.07227, 5.50586, 5.63672, 5.79297, 6.21484, 7.19727, 4.08008, 5.07227, 5.57129, 6.00391, 6.13965, 6.28906, 6.71484, 7.70508, 4.57617, 5.57129, 6.07178, 6.50195, 6.64111, 6.7876, 7.21436, 8.20947, 5.07373, 6.07178, }, { /* 4 */ 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 2, 2, 0, 0, 1, 1, 2, 1, 2, 2, 3, 0, 1, 1.5, 2, 2, 2, 2.5, 3, 2, 1.25, 2, 2.25, 2.75, 2.25, 3, 3.25, 3.25, 1.625, 2.5, 2.625, 3.375, 2.625, 3.5, 3.625, 4.125, 2.0625, 3, 3.0625, 3.9375, 3.0625, 4, 4.0625, 4.8125, 2.53125, 3.5, 3.53125, 4.46875, 3.53125, 4.5, 4.53125, 5.40625, 3.01562, 4, 4.01562, 4.98438, 4.01562, 5, 5.01562, 5.95312, 3.50781, 4.5, 4.50781, 5.49219, 4.50781, 5.5, 5.50781, 6.47656, 4.00391, 5, 5.00391, 5.99609, 5.00391, 6, 6.00391, 6.98828, 4.50195, 5.5, 5.50195, 6.49805, 5.50195, 6.5, 6.50195, 7.49414, 5.00098, 6, 6.00098, 6.99902, 6.00098, 7, 7.00098, 7.99707, }, { /* 5 */ 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 2, 2, 0, 1, 1, 1.5, 2, 1, 2, 2.25, 1.5, 1, 1.75, 1.5, 2.25, 2, 2, 2.625, 2.625, 1.375, 1.875, 2, 2.625, 2.875, 2.375, 2.9375, 3.5, 1.625, 2.3125, 2.625, 2.9375, 3.625, 2.625, 3.46875, 4.15625, 1.96875, 2.78125, 3.125, 3.46875, 4.21875, 2.96875, 3.95312, 4.78125, 2.375, 3.29688, 3.59375, 3.95312, 4.8125, 3.375, 4.44531, 5.35156, 2.83594, 3.77344, 4.09375, 4.44531, 5.36719, 3.83594, 4.93359, 5.89062, 3.30469, 4.26953, 4.60156, 4.93359, 5.89844, 4.30469, 5.43555, 6.4082, 3.78711, 4.76758, 5.10156, 5.43555, 6.41211, 4.78711, 5.93457, 6.91992, 4.27734, 5.26855, 5.59961, 5.93457, 6.92188, 5.27734, 6.43408, 7.42627, 4.77295, 5.76709, 6.09961, 6.43408, 7.42725, 5.77295, }, { /* 6 */ 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1.5, 2, 0, 1, 1, 1, 2, 1.5, 1.75, 2.25, 1.5, 1, 1.5, 1.5, 2, 2.75, 1.75, 2.75, 2.625, 1.25, 1.75, 2.125, 2.375, 3, 2.375, 3.0625, 3.5625, 1.5, 2.25, 2.625, 2.9375, 3.25, 2.9375, 3.53125, 4.25, 1.875, 2.78125, 3.09375, 3.3125, 3.71875, 3.48438, 4.01562, 4.85938, 2.32812, 3.20312, 3.625, 3.76562, 4.23438, 4, 4.5, 5.42188, 2.76562, 3.69531, 4.14844, 4.22656, 4.75, 4.50391, 5, 5.95312, 3.23047, 4.1875, 4.67188, 4.70703, 5.25, 5.00781, 5.49609, 6.47266, 3.70898, 4.68945, 5.17188, 5.20508, 5.75195, 5.51074, 5.99316, 6.98242, 4.19922, 5.18848, 5.67188, 5.7041, 6.25195, 6.01074, 6.49463, 7.48682, 4.69385, 5.68799, 6.17139, 6.20459, 6.75195, }, { /* 7 */ 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 2, 1, 0, 1, 1, 1, 1.75, 1.25, 2, 2.5, 0.75, 1, 1.25, 1.5, 1.875, 2, 2.375, 2.625, 2.25, 1.125, 1.625, 2.25, 2.125, 2.5625, 2.625, 3.1875, 3.25, 1.375, 2, 2.875, 2.53125, 3.09375, 3.03125, 3.59375, 4.125, 1.6875, 2.5, 3.21875, 3.07812, 3.60938, 3.48438, 4.0625, 4.8125, 2.09375, 3.01562, 3.625, 3.59375, 4.10938, 3.96875, 4.54688, 5.41406, 2.55469, 3.5, 4.0625, 4.11328, 4.61328, 4.45703, 5.03906, 5.96875, 3.02734, 3.97266, 4.55859, 4.61914, 5.12109, 4.94727, 5.53516, 6.49805, 3.5, 4.47266, 5.05469, 5.12305, 5.62305, 5.44238, 6.03418, 7.01367, 3.98633, 4.96875, 5.55566, 5.62598, 6.12012, 5.94336, 6.53271, 7.52246, 4.47754, 5.46875, 6.05566, }, { /* 8 */ 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 0, 0, 1, 1, 2, 1, 2, 2, 3, 0, 1, 1.5, 2, 2, 2, 2.5, 3, 2, 1.25, 2, 2.25, 2.75, 2.25, 3, 3.25, 3.25, 1.625, 2.5, 2.625, 3.375, 2.625, 3.5, 3.625, 4.125, 2.0625, 3, 3.0625, 3.9375, 3.0625, 4, 4.0625, 4.8125, 2.53125, 3.5, 3.53125, 4.46875, 3.53125, 4.5, 4.53125, 5.40625, 3.01562, 4, 4.01562, 4.98438, 4.01562, 5, 5.01562, 5.95312, 3.50781, 4.5, 4.50781, 5.49219, 4.50781, 5.5, 5.50781, 6.47656, 4.00391, 5, 5.00391, 5.99609, 5.00391, 6, 6.00391, 6.98828, 4.50195, 5.5, 5.50195, 6.49805, 5.50195, 6.5, 6.50195, 7.49414, }, { /* 9 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0.5, 1, 1, 1, 1, 1.5, 2, 1, 0.5, 1, 1, 2, 1.25, 1.75, 2, 2.625, 0.5, 1.25, 1.5, 2, 2.375, 1.75, 2.5, 2.8125, 1.5, 1.625, 2.0625, 2.3125, 3.25, 1.875, 2.75, 3.28125, 2.3125, 1.9375, 2.65625, 2.78125, 3.46875, 2.5625, 3.1875, 3.73438, 2.96875, 2.39062, 3.15625, 3.3125, 3.79688, 3.125, 3.71875, 4.19531, 3.50781, 2.90625, 3.67188, 3.71094, 4.30469, 3.67969, 4.23438, 4.66406, 4.03516, 3.41016, 4.17578, 4.16406, 4.80859, 4.20703, 4.69141, 5.16992, 4.54492, 3.91797, 4.66992, 4.64844, 5.31055, 4.72266, 5.16992, 5.6748, 5.04883, 4.42285, 5.16602, 5.13965, 5.80957, 5.23145, 5.65918, 6.17773, 5.55176, 4.92383, 5.6626, 5.63672, 6.31055, 5.73584, 6.15283, }, { /* 10 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0.5, 1, 1, 1, 1, 1.25, 2, 0.5, 0.5, 1, 1, 1.5, 2, 1.375, 2, 2.5, 0.5, 1, 1.75, 1.625, 2.125, 2, 2.375, 3.125, 1.25, 1.4375, 2.3125, 1.75, 2.5625, 2.5, 2.9375, 3.34375, 2.1875, 1.875, 2.53125, 2.4375, 2.9375, 3.04688, 3.46875, 3.65625, 2.85938, 2.40625, 2.90625, 3.03125, 3.32812, 3.58594, 3.91406, 4.125, 3.46875, 2.89844, 3.36719, 3.48438, 3.86719, 4.09766, 4.35156, 4.63672, 4.00781, 3.42188, 3.85156, 3.95703, 4.38281, 4.60156, 4.82031, 5.14844, 4.52344, 3.92578, 4.33398, 4.46484, 4.88672, 5.10449, 5.30273, 5.65625, 5.0293, 4.43066, 4.81445, 4.97949, 5.38574, 5.60449, 5.79492, 6.15625, 5.53613, 4.93115, 5.30713, 5.48291, 5.89014, }, { /* 11 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0.5, 0, 0, 0.5, 1, 1, 1, 1, 1.75, 2, 0, 0.5, 1, 1, 1.5, 1.375, 1.875, 2.125, 2.25, 0.5, 1, 1.75, 1.625, 2.1875, 1.875, 2.625, 3.3125, 1, 1.4375, 1.8125, 2.15625, 2.90625, 2.125, 3.03125, 3.5625, 2.03125, 2.03125, 2.03125, 2.59375, 3.5, 2.57812, 3.45312, 4, 2.75, 2.375, 2.64062, 3.04688, 3.90625, 3.19531, 3.92969, 4.42188, 3.375, 2.8125, 3.21094, 3.5, 4.38281, 3.74219, 4.43359, 4.85156, 3.96484, 3.26953, 3.73047, 3.98633, 4.86328, 4.27148, 4.91016, 5.33789, 4.50195, 3.75781, 4.20898, 4.49316, 5.35254, 4.79004, 5.39941, 5.83301, 5.01953, 4.25293, 4.69824, 4.99561, 5.8457, 5.2998, 5.89453, 6.33105, 5.5293, 4.75098, 5.18945, }, { /* 12 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 0, 0, 1, 1, 2, 1, 2, 2, 3, 0, 1, 1.5, 2, 2, 2, 2.5, 3, 2, 1.25, 2, 2.25, 2.75, 2.25, 3, 3.25, 3.25, 1.625, 2.5, 2.625, 3.375, 2.625, 3.5, 3.625, 4.125, 2.0625, 3, 3.0625, 3.9375, 3.0625, 4, 4.0625, 4.8125, 2.53125, 3.5, 3.53125, 4.46875, 3.53125, 4.5, 4.53125, 5.40625, 3.01562, 4, 4.01562, 4.98438, 4.01562, 5, 5.01562, 5.95312, 3.50781, 4.5, 4.50781, 5.49219, 4.50781, 5.5, 5.50781, 6.47656, 4.00391, 5, 5.00391, 5.99609, 5.00391, 6, 6.00391, 6.98828, }, { /* 13 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.5, 1, 1, 1, 1, 0.5, 0, 0, 0.5, 1, 1, 1, 1, 1.75, 2, 0.75, 0.5, 1, 1.125, 2, 1.125, 1.75, 2, 2.5, 0.5, 1.3125, 1.4375, 2, 2.3125, 1.75, 2.5625, 2.8125, 1.375, 1.625, 2.03125, 2.3125, 3.1875, 1.90625, 2.71875, 3.26562, 2.25, 1.9375, 2.60938, 2.76562, 3.48438, 2.5, 3.17188, 3.71094, 2.9375, 2.35938, 3.125, 3.28906, 3.78906, 3.09375, 3.6875, 4.17578, 3.47266, 2.87891, 3.64453, 3.69922, 4.27344, 3.64844, 4.20703, 4.64062, 4.00781, 3.38086, 4.15234, 4.14062, 4.7832, 4.17578, 4.67188, 5.14258, 4.5166, 3.89062, 4.64453, 4.62402, 5.28418, 4.69434, 5.14648, 5.64795, 5.02197, 4.396, 5.14062, 5.11426, 5.7832, 5.20361, 5.63428, }, { /* 14 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.5, 1, 1, 1, 1, 0.5, 0, 0, 0.75, 1, 1, 1, 1, 1.5, 1.75, 0, 0.75, 1, 1, 1.875, 1.5, 1.5625, 2.125, 1.6875, 0.75, 1.3125, 1.375, 1.9375, 2.5, 1.75, 2.5, 3.0625, 0.78125, 1.65625, 2.0625, 2.15625, 2.65625, 2.4375, 2.85938, 3.71875, 1.35938, 2, 2.76562, 2.34375, 3.17188, 2.94531, 3.32031, 4.07812, 2.14062, 2.4375, 3.38281, 2.66406, 3.5625, 3.47266, 3.84375, 4.48828, 2.78516, 2.92188, 3.85547, 3.11719, 4.04688, 3.97656, 4.37109, 4.92969, 3.35547, 3.42578, 4.27539, 3.65625, 4.53906, 4.48145, 4.86133, 5.41797, 3.89355, 3.93066, 4.72949, 4.16992, 5.04395, 4.97998, 5.35742, 5.91455, 4.4126, 4.42383, 5.21484, 4.67822, 5.5459, }, { /* 15 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.5, 1, 1, 1, 1, 0.25, 0, 0, 0.5, 1, 1, 1, 1, 1.875, 1.75, 0, 0.5, 1, 1, 1.5625, 1.3125, 1.875, 2.1875, 2.0625, 0.5, 1, 1.8125, 1.59375, 2.15625, 1.90625, 2.59375, 3.34375, 0.875, 1.4375, 1.8125, 2.15625, 2.85938, 2.125, 3.01562, 3.5625, 1.98438, 2, 2.03125, 2.57812, 3.5, 2.53906, 3.4375, 3.99219, 2.71094, 2.375, 2.60938, 3.03516, 3.89062, 3.16797, 3.91406, 4.41406, 3.33984, 2.80078, 3.1875, 3.48438, 4.36719, 3.71875, 4.41602, 4.83789, 3.94141, 3.25195, 3.7168, 3.9668, 4.84668, 4.25, 4.89355, 5.32031, 4.47949, 3.74023, 4.19238, 4.47412, 5.33496, 4.77002, 5.38184, 5.81494, 4.99951, 4.23486, 4.68066, }, { /* 16 */ 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, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 0, 0, 1, 1, 2, 1, 2, 2, 3, 0, 1, 1.5, 2, 2, 2, 2.5, 3, 2, 1.25, 2, 2.25, 2.75, 2.25, 3, 3.25, 3.25, 1.625, 2.5, 2.625, 3.375, 2.625, 3.5, 3.625, 4.125, 2.0625, 3, 3.0625, 3.9375, 3.0625, 4, 4.0625, 4.8125, 2.53125, 3.5, 3.53125, 4.46875, 3.53125, 4.5, 4.53125, 5.40625, 3.01562, 4, 4.01562, 4.98438, 4.01562, 5, 5.01562, 5.95312, 3.50781, 4.5, 4.50781, 5.49219, 4.50781, 5.5, 5.50781, 6.47656, }, { /* 17 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.5, 1, 1, 1, 1, 0.25, 0, 0, 0.5, 1, 1, 1, 1, 1.75, 2, 0.625, 0.5, 1, 1.125, 2, 1.0625, 1.75, 2, 2.40625, 0.5, 1.3125, 1.40625, 2, 2.25, 1.75, 2.5625, 2.79688, 1.3125, 1.60938, 2, 2.29688, 3.14062, 1.90625, 2.70312, 3.24219, 2.20312, 1.92188, 2.57812, 2.74219, 3.47656, 2.46094, 3.14844, 3.6875, 2.90625, 2.33203, 3.09766, 3.26172, 3.77344, 3.0625, 3.66016, 4.15234, 3.44336, 2.85156, 3.61719, 3.67969, 4.24609, 3.61914, 4.17969, 4.61621, 3.98047, 3.35352, 4.12695, 4.11621, 4.75684, 4.14746, 4.64844, 5.11572, 4.48975, 3.86377, 4.61865, 4.59863, 5.25781, 4.66699, 5.12158, }, { /* 18 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.5, 1, 1, 1, 1, 0.625, 0, 0, 0.625, 1, 1, 1, 1, 1.4375, 2, 0, 0.625, 1, 1, 1.75, 1.6875, 1.46875, 2.03125, 2.0625, 0.625, 1.1875, 1.53125, 1.78125, 2.34375, 1.84375, 2.40625, 3.32812, 0.75, 1.5625, 2.23438, 1.84375, 2.65625, 2.47656, 2.83594, 3.51562, 1.79688, 1.92188, 2.80469, 2.17188, 3.00781, 3.01172, 3.36719, 3.875, 2.58984, 2.30078, 3.14453, 2.78906, 3.45703, 3.52148, 3.87695, 4.32227, 3.12305, 2.83203, 3.58984, 3.32031, 3.94727, 4.01074, 4.38867, 4.81055, 3.63379, 3.3418, 4.04102, 3.86914, 4.43652, 4.50146, 4.89795, 5.27539, 4.16846, 3.84424, 4.51709, 4.38574, 4.94092, }, { /* 19 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.5, 1, 1, 1, 1, 0.125, 0, 0, 0.5, 1, 1, 1, 1, 1.875, 1.625, 0, 0.5, 1, 1, 1.5625, 1.28125, 1.875, 2.1875, 1.96875, 0.5, 1, 1.8125, 1.57812, 2.125, 1.90625, 2.57812, 3.34375, 0.8125, 1.42188, 1.8125, 2.14062, 2.82812, 2.11719, 3, 3.55469, 1.94531, 1.97656, 2.02344, 2.5625, 3.48828, 2.51172, 3.42188, 3.97656, 2.68359, 2.36328, 2.58594, 3.01953, 3.875, 3.14453, 3.89648, 4.40039, 3.31445, 2.78516, 3.16602, 3.46777, 4.34961, 3.69824, 4.39746, 4.82227, 3.91992, 3.23438, 3.7002, 3.94775, 4.8291, 4.22998, 4.87598, 5.30225, 4.45947, 3.72217, 4.1748, }, { /* 20 */ 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 0, 0, 1, 1, 2, 1, 2, 2, 3, 0, 1, 1.5, 2, 2, 2, 2.5, 3, 2, 1.25, 2, 2.25, 2.75, 2.25, 3, 3.25, 3.25, 1.625, 2.5, 2.625, 3.375, 2.625, 3.5, 3.625, 4.125, 2.0625, 3, 3.0625, 3.9375, 3.0625, 4, 4.0625, 4.8125, 2.53125, 3.5, 3.53125, 4.46875, 3.53125, 4.5, 4.53125, 5.40625, 3.01562, 4, 4.01562, 4.98438, 4.01562, 5, 5.01562, 5.95312, }, { /* 21 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.5, 1, 1, 1, 1, 0.25, 0, 0, 0.5, 1, 1, 1, 1, 1.75, 2, 0.625, 0.5, 1, 1.125, 2, 1.0625, 1.75, 2, 2.40625, 0.5, 1.3125, 1.40625, 2, 2.25, 1.75, 2.5625, 2.79688, 1.3125, 1.60938, 2, 2.29688, 3.14062, 1.90625, 2.70312, 3.24219, 2.20312, 1.92188, 2.57812, 2.74219, 3.47656, 2.46094, 3.14844, 3.6875, 2.90625, 2.33203, 3.09766, 3.26172, 3.77344, 3.0625, 3.66016, 4.15234, 3.44336, 2.85156, 3.61719, 3.67969, 4.24609, 3.61914, 4.17969, 4.61621, 3.98047, 3.35352, 4.12695, 4.11621, 4.75684, 4.14746, 4.64844, }, { /* 22 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.625, 1, 1, 1, 1, 0.5, 0, 0, 0.6875, 1, 1, 1, 1, 1.5, 1.8125, 0, 0.6875, 1, 1, 1.84375, 1.5625, 1.51562, 2.09375, 1.82812, 0.6875, 1.26562, 1.4375, 1.85938, 2.4375, 1.78125, 2.45312, 3.23438, 0.6875, 1.625, 2.14062, 2.00781, 2.64844, 2.46875, 2.82422, 3.60938, 1.54688, 1.98047, 2.84766, 2.1875, 3.08984, 2.95508, 3.35352, 3.96484, 2.33984, 2.42188, 3.25586, 2.66406, 3.5332, 3.48438, 3.85254, 4.39453, 3.00195, 2.83594, 3.68262, 3.2373, 3.97852, 4.01318, 4.33887, 4.8584, 3.59814, 3.27832, 4.14648, 3.78467, 4.44775, }, { /* 23 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.5, 1, 1, 1, 1, 0.125, 0, 0, 0.5625, 1, 1, 1, 1, 1.90625, 1.5625, 0, 0.5625, 1, 1, 1.59375, 1.25, 1.92188, 2.23438, 1.82812, 0.5625, 1, 1.84375, 1.60156, 2.08594, 2, 2.58594, 3.39844, 0.65625, 1.42188, 1.92188, 2.16406, 2.74609, 2.21484, 3.00391, 3.61328, 1.83594, 1.91406, 2.13672, 2.58398, 3.47852, 2.53125, 3.45508, 4.00391, 2.56836, 2.50195, 2.49414, 3.05664, 3.97559, 3.03125, 3.92871, 4.47656, 3.18066, 2.88672, 3.07031, 3.55078, 4.40137, 3.60742, 4.40137, 4.97559, 3.70508, 3.35938, 3.59473, }, { /* 24 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 0, 0, 1, 1, 2, 1, 2, 2, 3, 0, 1, 1.5, 2, 2, 2, 2.5, 3, 2, 1.25, 2, 2.25, 2.75, 2.25, 3, 3.25, 3.25, 1.625, 2.5, 2.625, 3.375, 2.625, 3.5, 3.625, 4.125, 2.0625, 3, 3.0625, 3.9375, 3.0625, 4, 4.0625, 4.8125, 2.53125, 3.5, 3.53125, 4.46875, 3.53125, 4.5, 4.53125, 5.40625, }, { /* 25 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.5, 1, 1, 1, 1, 0.25, 0, 0, 0.5, 1, 1, 1, 1, 1.75, 2, 0.625, 0.5, 1, 1.125, 2, 1.0625, 1.75, 2, 2.40625, 0.5, 1.3125, 1.40625, 2, 2.25, 1.75, 2.5625, 2.79688, 1.3125, 1.60938, 2, 2.29688, 3.14062, 1.90625, 2.70312, 3.24219, 2.20312, 1.92188, 2.57812, 2.74219, 3.47656, 2.46094, 3.14844, 3.6875, 2.90625, 2.33203, 3.09766, 3.26172, 3.77344, 3.0625, 3.66016, 4.15234, 3.44336, 2.85156, 3.61719, 3.67969, 4.24609, 3.61914, 4.17969, }, { /* 26 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.6875, 1, 1, 1, 1, 0.5, 0, 0, 0.6875, 1, 1, 1, 1, 1.51562, 1.8125, 0, 0.6875, 1, 1, 1.85938, 1.5625, 1.51562, 2.10156, 1.82812, 0.6875, 1.27344, 1.4375, 1.85938, 2.44531, 1.78125, 2.45703, 3.23828, 0.6875, 1.62891, 2.14453, 2.01172, 2.64844, 2.47266, 2.82617, 3.61328, 1.54883, 1.98242, 2.85156, 2.18945, 3.09375, 2.95703, 3.35645, 3.96777, 2.34277, 2.4248, 3.25879, 2.66602, 3.53613, 3.4873, 3.85547, 4.39697, 3.00488, 2.83887, 3.68506, 3.24023, 3.98145, }, { /* 27 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.5, 1, 1, 1, 1, 0.125, 0, 0, 0.53125, 1, 1, 1, 1, 1.89062, 1.59375, 0, 0.53125, 1, 1, 1.57812, 1.26562, 1.89844, 2.21094, 1.89844, 0.53125, 1, 1.84375, 1.58203, 2.10547, 1.95312, 2.58203, 3.37109, 0.734375, 1.42188, 1.85156, 2.16016, 2.78711, 2.16602, 3.00195, 3.58398, 1.89062, 1.94531, 2.06445, 2.58105, 3.52246, 2.48242, 3.42676, 4.00195, 2.62598, 2.43262, 2.52441, 3.05469, 3.90674, 3.09766, 3.90088, 4.47559, 3.2085, 2.84961, 3.10254, }, { /* 28 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 0, 0, 1, 1, 2, 1, 2, 2, 3, 0, 1, 1.5, 2, 2, 2, 2.5, 3, 2, 1.25, 2, 2.25, 2.75, 2.25, 3, 3.25, 3.25, 1.625, 2.5, 2.625, 3.375, 2.625, 3.5, 3.625, 4.125, 2.0625, 3, 3.0625, 3.9375, 3.0625, 4, 4.0625, 4.8125, }, { /* 29 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.46875, 1, 1, 1, 1, 0.28125, 0, 0, 0.484375, 1, 1, 1, 1, 1.71875, 2, 0.65625, 0.484375, 1, 1.10156, 2, 1.08594, 1.72656, 2, 2.4375, 0.484375, 1.29297, 1.40625, 2, 2.27344, 1.72656, 2.53516, 2.78125, 1.35938, 1.5918, 2, 2.29688, 3.16602, 1.85742, 2.70312, 3.22754, 2.25, 1.88965, 2.59473, 2.74316, 3.40918, 2.50684, 3.14844, 3.67383, 2.9209, 2.3335, 3.11523, 3.23438, 3.73633, 3.10107, 3.66895, }, { /* 30 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.6875, 1, 1, 1, 1, 0.484375, 0, 0, 0.6875, 1, 1, 1, 1, 1.51562, 1.79688, 0, 0.6875, 1, 1, 1.85938, 1.55469, 1.51562, 2.10156, 1.81641, 0.6875, 1.27344, 1.43359, 1.85938, 2.44531, 1.77734, 2.45508, 3.23047, 0.6875, 1.62695, 2.14062, 2.01172, 2.64648, 2.46973, 2.82324, 3.6123, 1.54297, 1.98047, 2.84766, 2.18848, 3.0918, 2.9541, 3.35352, 3.96582, 2.33838, 2.42236, 3.25732, 2.6626, 3.53369, }, { /* 31 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.53125, 1, 1, 1, 1, 0.09375, 0, 0, 0.546875, 1, 1, 1, 1, 1.90625, 1.54688, 0, 0.546875, 1, 1, 1.58984, 1.25, 1.91016, 2.22656, 1.83984, 0.546875, 1, 1.83984, 1.5918, 2.08984, 1.97852, 2.58008, 3.38672, 0.679688, 1.41992, 1.88867, 2.15918, 2.75977, 2.18945, 3, 3.59766, 1.85547, 1.9248, 2.09961, 2.57959, 3.49512, 2.50488, 3.43848, 4, 2.59131, 2.46582, 2.50439, }, { /* 32 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 0, 0, 1, 1, 2, 1, 2, 2, 3, 0, 1, 1.5, 2, 2, 2, 2.5, 3, 2, 1.25, 2, 2.25, 2.75, 2.25, 3, 3.25, 3.25, 1.625, 2.5, 2.625, 3.375, 2.625, 3.5, 3.625, 4.125, }, { /* 33 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.484375, 1, 1, 1, 1, 0.28125, 0, 0, 0.484375, 1, 1, 1, 1, 1.72656, 2, 0.65625, 0.484375, 1, 1.10547, 2, 1.08594, 1.72656, 2, 2.43945, 0.484375, 1.29492, 1.40625, 2, 2.27539, 1.72656, 2.53711, 2.78223, 1.35938, 1.59277, 2.00098, 2.29785, 3.16699, 1.8584, 2.70312, 3.22852, 2.25098, 1.89014, 2.5957, 2.74414, 3.41016, 2.50732, 3.14941, }, { /* 34 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.6875, 1, 1, 1, 1, 0.484375, 0, 0, 0.6875, 1, 1, 1, 1, 1.51562, 1.79688, 0, 0.6875, 1, 1, 1.85938, 1.55469, 1.51562, 2.10156, 1.81641, 0.6875, 1.27344, 1.43359, 1.85938, 2.44531, 1.77734, 2.45508, 3.23047, 0.6875, 1.62695, 2.14062, 2.01172, 2.64648, 2.46973, 2.82324, 3.6123, 1.54297, 1.98047, 2.84766, 2.18848, 3.0918, }, { /* 35 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.546875, 1, 1, 1, 1, 0.09375, 0, 0, 0.546875, 1, 1, 1, 1, 1.91016, 1.54688, 0, 0.546875, 1, 1, 1.5918, 1.25, 1.91016, 2.22852, 1.83984, 0.546875, 1, 1.8418, 1.5918, 2.09082, 1.97949, 2.58008, 3.3877, 0.679688, 1.4209, 1.88965, 2.15967, 2.76025, 2.18994, 3.00049, 3.59814, 1.85645, 1.92529, 2.1001, }, { /* 36 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 0, 0, 1, 1, 2, 1, 2, 2, 3, 0, 1, 1.5, 2, 2, 2, 2.5, 3, 2, 1.25, 2, 2.25, 2.75, 2.25, 3, 3.25, 3.25, }, { /* 37 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.484375, 1, 1, 1, 1, 0.273438, 0, 0, 0.488281, 1, 1, 1, 1, 1.73047, 2, 0.648438, 0.488281, 1, 1.10938, 2, 1.08008, 1.73242, 2, 2.43066, 0.488281, 1.29883, 1.40625, 2, 2.26855, 1.73242, 2.54297, 2.78564, 1.34766, 1.59668, 2.00049, 2.29736, 3.16016, 1.87012, 2.70312, }, { /* 38 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.6875, 1, 1, 1, 1, 0.484375, 0, 0, 0.6875, 1, 1, 1, 1, 1.51562, 1.79688, 0, 0.6875, 1, 1, 1.85938, 1.55469, 1.51562, 2.10156, 1.81641, 0.6875, 1.27344, 1.43359, 1.85938, 2.44531, 1.77734, 2.45508, 3.23047, 0.6875, 1.62695, 2.14062, 2.01172, 2.64648, }, { /* 39 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.546875, 1, 1, 1, 1, 0.0898438, 0, 0, 0.546875, 1, 1, 1, 1, 1.91016, 1.54297, 0, 0.546875, 1, 1, 1.5918, 1.24902, 1.91016, 2.22852, 1.83691, 0.546875, 1, 1.84082, 1.5918, 2.08984, 1.97949, 2.57959, 3.3877, 0.677734, 1.42041, 1.88965, }, { /* 40 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 0, 0, 1, 1, 2, 1, 2, 2, 3, 0, 1, 1.5, 2, 2, 2, 2.5, 3, 2, }, { /* 41 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.484375, 1, 1, 1, 1, 0.273438, 0, 0, 0.486328, 1, 1, 1, 1, 1.72852, 2, 0.650391, 0.486328, 1, 1.10742, 2, 1.08203, 1.72949, 2, 2.43359, 0.486328, 1.29688, 1.40576, 2, 2.271, 1.72949, 2.54004, }, { /* 42 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.683594, 1, 1, 1, 1, 0.486328, 0, 0, 0.685547, 1, 1, 1, 1, 1.51367, 1.80078, 0, 0.685547, 1, 1, 1.85645, 1.55762, 1.51416, 2.09961, 1.82227, 0.685547, 1.271, 1.43604, 1.85693, 2.44238, }, { /* 43 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.542969, 1, 1, 1, 1, 0.0917969, 0, 0, 0.544922, 1, 1, 1, 1, 1.9082, 1.54688, 0, 0.544922, 1, 1, 1.59033, 1.25049, 1.90869, 2.22656, 1.84277, 0.544922, 1, 1.84082, }, { /* 44 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 0, 0, 1, 1, 2, 1, 2, 2, 3, 0, }, { /* 45 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.486328, 1, 1, 1, 1, 0.271484, 0, 0, 0.486328, 1, 1, 1, 1, 1.72949, 2, 0.649414, 0.486328, 1, 1.10791, 2, 1.08154, 1.72949, 2, }, { /* 46 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.685547, 1, 1, 1, 1, 0.485352, 0, 0, 0.686523, 1, 1, 1, 1, 1.51465, 1.79883, 0, 0.686523, 1, 1, 1.85791, 1.55615, }, { /* 47 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.544922, 1, 1, 1, 1, 0.0908203, 0, 0, 0.545898, 1, 1, 1, 1, 1.90918, 1.54492, 0, 0.545898, 1, 1, }, { /* 48 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 0, 0, }, { /* 49 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.486328, 1, 1, 1, 1, 0.270508, 0, 0, 0.486328, 1, 1, 1, 1, 1.72949, 2, }, { /* 50 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.686523, 1, 1, 1, 1, 0.485352, 0, 0, 0.686523, 1, 1, 1, 1, }, { /* 51 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.545898, 1, 1, 1, 1, 0.0908203, 0, 0, 0.545898, 1, 1, }, { /* 52 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, }, { /* 53 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.486328, 1, 1, 1, 1, 0.270508, 0, }, { /* 54 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.686035, 1, 1, 1, 1, }, { /* 55 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.54541, 1, 1, }, { /* 56 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, { /* 57 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, { /* 58 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, { /* 59 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, }; const double schro_table_zerobits_hist_shift3_1_2[60][104] = { { /* 0 */ 0, 1, 0, 2, 1, 1, 0, 3, 2, 2, 1, 2, 1, 1, 0, 4, 3, 2.5, 2, 2, 2, 1.5, 1, 2.5, 3.75, 3, 2.75, 2.25, 2.75, 2, 1.75, 2, 4.375, 3.5, 3.375, 2.625, 3.375, 2.5, 2.375, 2, 4.9375, 4, 3.9375, 3.0625, 3.9375, 3, 2.9375, 2.25, 5.46875, 4.5, 4.46875, 3.53125, 4.46875, 3.5, 3.46875, 2.625, 5.98438, 5, 4.98438, 4.01562, 4.98438, 4, 3.98438, 3.0625, 6.49219, 5.5, 5.49219, 4.50781, 5.49219, 4.5, 4.49219, 3.53125, 6.99609, 6, 5.99609, 5.00391, 5.99609, 5, 4.99609, 4.01562, 7.49805, 6.5, 6.49805, 5.50195, 6.49805, 5.5, 5.49805, 4.50781, 7.99902, 7, 6.99902, 6.00098, 6.99902, 6, 5.99902, 5.00391, 8.49951, 7.5, 7.49951, 6.50049, 7.49951, 6.5, 6.49951, 5.50195, }, { /* 1 */ 0, 0, 1, 0, 2, 1, 1, 1, 0, 3, 2, 2, 2, 1, 2, 1, 1, 2, 3, 2.5, 2.5, 2, 2, 2, 1.5, 1.75, 3.75, 3.25, 3, 2.5, 2.25, 2.75, 2.125, 1.75, 4.5, 3.75, 3.5, 3.125, 2.5, 3.5, 2.625, 2, 5.125, 4.3125, 4, 3.625, 2.875, 4.125, 3.15625, 2.34375, 5.71875, 4.8125, 4.5, 4.15625, 3.28125, 4.71875, 3.65625, 2.76562, 6.26562, 5.32812, 5, 4.65625, 3.73438, 5.26562, 4.16406, 3.21875, 6.79688, 5.82812, 5.5, 5.16406, 4.20312, 5.79688, 4.66406, 3.69531, 7.3125, 6.33203, 6, 5.66406, 4.6875, 6.3125, 5.16602, 4.18164, 7.82227, 6.83203, 6.5, 6.16602, 5.17773, 6.82227, 5.66602, 4.6748, 8.32715, 7.33301, 7, 6.66602, 5.67285, 7.32715, 6.1665, 5.1709, 8.83008, 7.83301, 7.5, 7.1665, 6.16992, 7.83008, }, { /* 2 */ 0, 0, 1, 0, 0, 2, 1, 1, 1, 0, 0, 3, 2, 2, 2, 1, 1.5, 1, 0.5, 2, 3, 2.5, 2.5, 2, 1.75, 1.75, 1.25, 1.5, 3.75, 3.25, 2.75, 2.75, 2.125, 2.5, 1.75, 1.5, 4.5, 3.75, 3.125, 3.5, 2.5, 3.125, 2.3125, 1.6875, 5.125, 4.3125, 3.5, 4.125, 2.9375, 3.71875, 2.8125, 2.03125, 5.71875, 4.8125, 3.9375, 4.71875, 3.39062, 4.26562, 3.32812, 2.4375, 6.26562, 5.32812, 4.39062, 5.26562, 3.86719, 4.79688, 3.82812, 2.89062, 6.79688, 5.82812, 4.86719, 5.79688, 4.35156, 5.3125, 4.33203, 3.36328, 7.3125, 6.33203, 5.35156, 6.3125, 4.84375, 5.82227, 4.83203, 3.84961, 7.82227, 6.83203, 5.84375, 6.82227, 5.33887, 6.32715, 5.33301, 4.3418, 8.32715, 7.33301, 6.33887, 7.32715, 5.83643, 6.83008, 5.83301, 4.83789, 8.83008, 7.83301, 6.83643, 7.83008, }, { /* 3 */ 0, 0, 1, 1, 0, 0, 2, 1, 1, 1, 1, 0, 0, 3, 2, 2, 2, 1, 1.5, 1, 0.5, 2, 3, 3, 2.25, 1.75, 2, 1.5, 1.25, 1.5, 4, 3.25, 2.875, 2.375, 2.5, 2, 1.75, 1.5, 4.625, 3.875, 3.4375, 2.875, 2.9375, 2.625, 2.25, 1.6875, 5.25, 4.4375, 3.90625, 3.4375, 3.40625, 3.15625, 2.78125, 2, 5.84375, 4.90625, 4.42188, 3.96875, 3.89062, 3.67188, 3.28125, 2.40625, 6.375, 5.42188, 4.92969, 4.47656, 4.375, 4.19531, 3.78125, 2.85156, 6.89844, 5.92969, 5.42578, 4.98828, 4.86719, 4.70312, 4.28516, 3.32031, 7.41406, 6.42578, 5.92773, 5.49414, 5.36328, 5.20703, 4.78516, 3.80469, 7.91992, 6.92773, 6.42871, 5.99609, 5.86035, 5.71094, 5.28516, 4.2959, 8.42383, 7.42871, 6.92822, 6.49805, 6.35889, 6.2124, 5.78564, 4.79102, 8.92627, 7.92822, }, { /* 4 */ 0, 0, 1, 1, 0, 0, 2, 2, 1, 1, 1, 1, 0, 0, 3, 3, 2, 2, 1, 2, 1, 1, 0, 4, 3, 2.5, 2, 2, 2, 1.5, 1, 2.5, 3.75, 3, 2.75, 2.25, 2.75, 2, 1.75, 2, 4.375, 3.5, 3.375, 2.625, 3.375, 2.5, 2.375, 2, 4.9375, 4, 3.9375, 3.0625, 3.9375, 3, 2.9375, 2.25, 5.46875, 4.5, 4.46875, 3.53125, 4.46875, 3.5, 3.46875, 2.625, 5.98438, 5, 4.98438, 4.01562, 4.98438, 4, 3.98438, 3.0625, 6.49219, 5.5, 5.49219, 4.50781, 5.49219, 4.5, 4.49219, 3.53125, 6.99609, 6, 5.99609, 5.00391, 5.99609, 5, 4.99609, 4.01562, 7.49805, 6.5, 6.49805, 5.50195, 6.49805, 5.5, 5.49805, 4.50781, 7.99902, 7, 6.99902, 6.00098, 6.99902, 6, 5.99902, 5.00391, }, { /* 5 */ 0, 0, 0, 1, 1, 0, 0, 0, 2, 2, 1, 1, 1, 1, 1, 0, 0, 3, 2, 2, 1.5, 1, 2, 1, 0.75, 2, 3, 2.25, 2.5, 1.75, 2, 2, 1.375, 1.625, 3.625, 3.125, 3, 2.375, 2.125, 2.625, 2.0625, 1.625, 4.375, 3.6875, 3.375, 3.0625, 2.375, 3.375, 2.53125, 1.90625, 5.03125, 4.21875, 3.875, 3.53125, 2.78125, 4.03125, 3.04688, 2.25, 5.625, 4.70312, 4.40625, 4.04688, 3.1875, 4.625, 3.55469, 2.66406, 6.16406, 5.22656, 4.90625, 4.55469, 3.63281, 5.16406, 4.06641, 3.11719, 6.69531, 5.73047, 5.39844, 5.06641, 4.10156, 5.69531, 4.56445, 3.5957, 7.21289, 6.23242, 5.89844, 5.56445, 4.58789, 6.21289, 5.06543, 4.08203, 7.72266, 6.73145, 6.40039, 6.06543, 5.07812, 6.72266, 5.56592, 4.57471, 8.22705, 7.23291, 6.90039, 6.56592, 5.57275, 7.22705, }, { /* 6 */ 0, 0, 0, 1, 1, 1, 0, 0, 0, 2, 2, 1, 1, 1, 1, 1, 0.5, 0, 3, 2, 2, 2, 1, 1.5, 1.25, 0.75, 2, 3, 2.5, 2.5, 2, 1.25, 2.25, 1.25, 1.625, 3.75, 3.25, 2.875, 2.625, 2, 2.625, 1.9375, 1.5625, 4.5, 3.75, 3.375, 3.0625, 2.75, 3.0625, 2.46875, 1.8125, 5.125, 4.21875, 3.90625, 3.6875, 3.28125, 3.51562, 2.98438, 2.17188, 5.67188, 4.79688, 4.375, 4.23438, 3.76562, 4, 3.5, 2.59375, 6.23438, 5.30469, 4.85156, 4.77344, 4.25, 4.49609, 4, 3.05469, 6.76953, 5.8125, 5.32812, 5.29297, 4.75, 4.99219, 4.50391, 3.53125, 7.29102, 6.31055, 5.82812, 5.79492, 5.24805, 5.48926, 5.00684, 4.01953, 7.80078, 6.81152, 6.32812, 6.2959, 5.74805, 5.98926, 5.50537, 4.51416, 8.30615, 7.31201, 6.82861, 6.79541, 6.24805, }, { /* 7 */ 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 2, 2, 2, 1, 1, 1, 1, 1, 0, 1.5, 3, 2, 2, 2, 1.25, 1.75, 1, 0.5, 3, 3, 2.75, 2.5, 2.125, 2, 1.625, 1.375, 2.125, 3.875, 3.375, 2.75, 2.875, 2.4375, 2.375, 1.8125, 1.9375, 4.625, 4, 3.125, 3.46875, 2.90625, 2.96875, 2.40625, 1.96875, 5.3125, 4.5, 3.78125, 3.92188, 3.39062, 3.51562, 2.9375, 2.23438, 5.90625, 4.98438, 4.375, 4.40625, 3.89062, 4.03125, 3.45312, 2.60938, 6.44531, 5.5, 4.9375, 4.88672, 4.38672, 4.54297, 3.96094, 3.04297, 6.97266, 6.02734, 5.44141, 5.38086, 4.87891, 5.05273, 4.46484, 3.50781, 7.5, 6.52734, 5.94531, 5.87695, 5.37695, 5.55762, 4.96582, 3.98926, 8.01367, 7.03125, 6.44434, 6.37402, 5.87988, 6.05664, 5.46729, 4.479, 8.52246, 7.53125, 6.94434, }, { /* 8 */ 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 3, 3, 2, 2, 1, 2, 1, 1, 0, 4, 3, 2.5, 2, 2, 2, 1.5, 1, 2.5, 3.75, 3, 2.75, 2.25, 2.75, 2, 1.75, 2, 4.375, 3.5, 3.375, 2.625, 3.375, 2.5, 2.375, 2, 4.9375, 4, 3.9375, 3.0625, 3.9375, 3, 2.9375, 2.25, 5.46875, 4.5, 4.46875, 3.53125, 4.46875, 3.5, 3.46875, 2.625, 5.98438, 5, 4.98438, 4.01562, 4.98438, 4, 3.98438, 3.0625, 6.49219, 5.5, 5.49219, 4.50781, 5.49219, 4.5, 4.49219, 3.53125, 6.99609, 6, 5.99609, 5.00391, 5.99609, 5, 4.99609, 4.01562, 7.49805, 6.5, 6.49805, 5.50195, 6.49805, 5.5, 5.49805, 4.50781, }, { /* 9 */ 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 2, 2, 1.5, 1, 1, 1, 1, 0.5, 0, 1.5, 2.5, 2, 2, 1, 1.75, 1.25, 1, 0.375, 3.5, 2.75, 2.5, 2, 1.625, 2.25, 1.5, 1.1875, 3.25, 3.375, 2.9375, 2.6875, 1.75, 3.125, 2.25, 1.71875, 3.3125, 4.0625, 3.34375, 3.21875, 2.53125, 3.4375, 2.8125, 2.26562, 3.59375, 4.60938, 3.84375, 3.6875, 3.20312, 3.875, 3.28125, 2.80469, 4.02344, 5.09375, 4.32812, 4.28906, 3.69531, 4.32031, 3.76562, 3.33594, 4.48047, 5.58984, 4.82422, 4.83594, 4.19141, 4.79297, 4.30859, 3.83008, 4.96289, 6.08203, 5.33008, 5.35156, 4.68945, 5.27734, 4.83008, 4.3252, 5.45508, 6.57715, 5.83398, 5.86035, 5.19043, 5.76855, 5.34082, 4.82227, 5.9502, 7.07617, 6.3374, 6.36328, 5.68945, 6.26416, 5.84717, }, { /* 10 */ 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 2, 2, 1.5, 1, 1, 1, 1, 0.75, 0, 2.25, 2.5, 2, 2, 1.5, 1, 1.625, 1, 0.625, 3.5, 3, 2.25, 2.375, 1.875, 2, 1.625, 0.875, 3.5625, 3.5625, 2.6875, 3.25, 2.4375, 2.5, 2.0625, 1.65625, 3.46875, 4.125, 3.46875, 3.5625, 3.0625, 2.95312, 2.53125, 2.34375, 3.71875, 4.59375, 4.09375, 3.96875, 3.67188, 3.41406, 3.08594, 2.875, 4.07031, 5.10156, 4.63281, 4.51562, 4.13281, 3.90234, 3.64844, 3.36328, 4.51172, 5.57812, 5.14844, 5.04297, 4.61719, 4.39844, 4.17969, 3.85156, 4.98633, 6.07422, 5.66602, 5.53516, 5.11328, 4.89551, 4.69727, 4.34375, 5.47559, 6.56934, 6.18555, 6.02051, 5.61426, 5.39551, 5.20508, 4.84375, 5.96631, 7.06885, 6.69287, 6.51709, 6.10986, }, { /* 11 */ 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 2, 2, 1.5, 1, 1, 1, 1, 0.25, 0, 3, 2.5, 2, 2, 1.5, 1.625, 1.125, 0.875, 1, 3.5, 3, 2.25, 2.375, 1.8125, 2.125, 1.375, 0.6875, 3.875, 3.5625, 3.1875, 2.84375, 2.09375, 2.875, 1.96875, 1.4375, 3.65625, 3.96875, 3.96875, 3.40625, 2.5, 3.42188, 2.54688, 2, 3.84375, 4.625, 4.35938, 3.95312, 3.09375, 3.80469, 3.07031, 2.57812, 4.17188, 5.1875, 4.78906, 4.5, 3.61719, 4.25781, 3.56641, 3.14844, 4.55859, 5.73047, 5.26953, 5.01367, 4.13672, 4.72852, 4.08984, 3.66211, 5.00977, 6.24219, 5.79102, 5.50684, 4.64746, 5.20996, 4.60059, 4.16699, 5.48633, 6.74707, 6.30176, 6.00439, 5.1543, 5.7002, 5.10547, 4.66895, 5.97363, 7.24902, 6.81055, }, { /* 12 */ 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 3, 3, 2, 2, 1, 2, 1, 1, 0, 4, 3, 2.5, 2, 2, 2, 1.5, 1, 2.5, 3.75, 3, 2.75, 2.25, 2.75, 2, 1.75, 2, 4.375, 3.5, 3.375, 2.625, 3.375, 2.5, 2.375, 2, 4.9375, 4, 3.9375, 3.0625, 3.9375, 3, 2.9375, 2.25, 5.46875, 4.5, 4.46875, 3.53125, 4.46875, 3.5, 3.46875, 2.625, 5.98438, 5, 4.98438, 4.01562, 4.98438, 4, 3.98438, 3.0625, 6.49219, 5.5, 5.49219, 4.50781, 5.49219, 4.5, 4.49219, 3.53125, 6.99609, 6, 5.99609, 5.00391, 5.99609, 5, 4.99609, 4.01562, }, { /* 13 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0.5, 0, 0, 0, 0, 1, 2, 2, 1.5, 1, 1, 1, 1, 0.25, 0, 1.875, 2.5, 2, 1.875, 1, 1.875, 1.25, 1, 0.5625, 3.5, 2.6875, 2.5625, 2, 1.6875, 2.25, 1.4375, 1.1875, 3.40625, 3.375, 2.96875, 2.6875, 1.8125, 3.09375, 2.28125, 1.73438, 3.39062, 4.0625, 3.39062, 3.23438, 2.51562, 3.5, 2.82812, 2.28906, 3.63281, 4.64062, 3.875, 3.71094, 3.21094, 3.90625, 3.3125, 2.82422, 4.0625, 5.12109, 4.35547, 4.30078, 3.72656, 4.35156, 3.79297, 3.35938, 4.50977, 5.61914, 4.84766, 4.85938, 4.2168, 4.82422, 4.32812, 3.85742, 4.99219, 6.10938, 5.35547, 5.37598, 4.71582, 5.30566, 4.85352, 4.35205, 5.48242, 6.604, 5.85938, 5.88574, 5.2168, 5.79639, 5.36572, }, { /* 14 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0.5, 0, 0, 0, 0, 1, 2, 2, 1.25, 1, 1, 1, 1, 0.5, 0.375, 3, 2.25, 2, 2, 1.125, 1.5, 1.4375, 0.875, 1.75, 3.25, 2.6875, 2.625, 2.0625, 1.5, 2.25, 1.5, 1.03125, 4.21875, 3.34375, 2.9375, 2.84375, 2.34375, 2.5625, 2.14062, 1.28125, 4.5625, 4, 3.23438, 3.65625, 2.82812, 3.05469, 2.67969, 1.92188, 4.69531, 4.5625, 3.61719, 4.33594, 3.4375, 3.52734, 3.15625, 2.51172, 5.00781, 5.07812, 4.14453, 4.88281, 3.95312, 4.02344, 3.62891, 3.07031, 5.41602, 5.57422, 4.72461, 5.34375, 4.46094, 4.51855, 4.13867, 3.58203, 5.86719, 6.06934, 5.27051, 5.83008, 4.95605, 5.02002, 4.64258, 4.08545, 6.34277, 6.57617, 5.78516, 6.32178, 5.4541, }, { /* 15 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0.5, 0, 0, 0, 0, 1.5, 2, 2, 1.5, 1, 1, 1, 1, 0.125, 0.375, 3, 2.5, 2, 2, 1.4375, 1.6875, 1.125, 0.8125, 1.25, 3.5, 3, 2.1875, 2.40625, 1.84375, 2.09375, 1.40625, 0.65625, 4.03125, 3.5625, 3.1875, 2.84375, 2.14062, 2.875, 1.98438, 1.4375, 3.71875, 4, 3.96875, 3.42188, 2.5, 3.46094, 2.5625, 2.00781, 3.89062, 4.625, 4.39062, 3.96484, 3.10938, 3.83203, 3.08594, 2.58594, 4.21094, 5.19922, 4.8125, 4.51562, 3.63281, 4.28125, 3.58398, 3.16211, 4.58398, 5.74805, 5.2832, 5.0332, 4.15332, 4.75, 4.10645, 3.67969, 5.0332, 6.25977, 5.80762, 5.52588, 4.66504, 5.22998, 4.61816, 4.18506, 5.50684, 6.76514, 6.31934, }, { /* 16 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 3, 3, 2, 2, 1, 2, 1, 1, 0, 4, 3, 2.5, 2, 2, 2, 1.5, 1, 2.5, 3.75, 3, 2.75, 2.25, 2.75, 2, 1.75, 2, 4.375, 3.5, 3.375, 2.625, 3.375, 2.5, 2.375, 2, 4.9375, 4, 3.9375, 3.0625, 3.9375, 3, 2.9375, 2.25, 5.46875, 4.5, 4.46875, 3.53125, 4.46875, 3.5, 3.46875, 2.625, 5.98438, 5, 4.98438, 4.01562, 4.98438, 4, 3.98438, 3.0625, 6.49219, 5.5, 5.49219, 4.50781, 5.49219, 4.5, 4.49219, 3.53125, }, { /* 17 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.5, 1, 1, 1, 1, 1, 1, 1, 0.5, 0, 0, 0, 0, 1.5, 2, 2, 1.5, 1, 1, 1, 1, 0.25, 0, 2.0625, 2.5, 2, 1.875, 1, 1.9375, 1.25, 1, 0.6875, 3.5, 2.6875, 2.59375, 2, 1.75, 2.25, 1.4375, 1.20312, 3.48438, 3.39062, 3, 2.70312, 1.85938, 3.09375, 2.29688, 1.75781, 3.44531, 4.07812, 3.42188, 3.25781, 2.52344, 3.53906, 2.85156, 2.3125, 3.66797, 4.66797, 3.90234, 3.73828, 3.22656, 3.9375, 3.33984, 2.84766, 4.09375, 5.14844, 4.38281, 4.32031, 3.75391, 4.38086, 3.82031, 3.38379, 4.53809, 5.64648, 4.87305, 4.88379, 4.24316, 4.85254, 4.35156, 3.88428, 5.01953, 6.13623, 5.38135, 5.40137, 4.74219, 5.33301, 4.87842, }, { /* 18 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.5, 1, 1, 1, 1, 1, 1, 1, 0.5, 0, 0, 0, 0, 0.75, 2, 2, 1.375, 1, 1, 1, 1, 0.5625, 0, 3, 2.375, 2, 2, 1.25, 1.3125, 1.53125, 0.96875, 1.25, 3.375, 2.8125, 2.46875, 2.21875, 1.65625, 2.15625, 1.59375, 0.671875, 4.21875, 3.4375, 2.76562, 3.15625, 2.34375, 2.52344, 2.16406, 1.48438, 4, 4.07812, 3.19531, 3.82812, 2.99219, 2.98828, 2.63281, 2.125, 4.12109, 4.69922, 3.85547, 4.21094, 3.54297, 3.47852, 3.12305, 2.67773, 4.54492, 5.16797, 4.41016, 4.67969, 4.05273, 3.98926, 3.61133, 3.18945, 5.0127, 5.6582, 4.95898, 5.13086, 4.56348, 4.49854, 4.10205, 3.72461, 5.46729, 6.15576, 5.48291, 5.61426, 5.05908, }, { /* 19 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.5, 1, 1, 1, 1, 1, 1, 1, 0.5, 0, 0, 0, 0, 1.75, 2, 2, 1.5, 1, 1, 1, 1, 0.125, 0.5625, 3, 2.5, 2, 2, 1.4375, 1.71875, 1.125, 0.8125, 1.375, 3.5, 3, 2.1875, 2.42188, 1.875, 2.09375, 1.42188, 0.65625, 4.10938, 3.57812, 3.1875, 2.85938, 2.17188, 2.88281, 2, 1.44531, 3.76562, 4.02344, 3.97656, 3.4375, 2.51172, 3.48828, 2.57812, 2.02344, 3.92188, 4.63672, 4.41406, 3.98047, 3.125, 3.85547, 3.10352, 2.59961, 4.23828, 5.21484, 4.83398, 4.53223, 3.65039, 4.30176, 3.60254, 3.17773, 4.60645, 5.76562, 5.2998, 5.05225, 4.1709, 4.77002, 4.12402, 3.69775, 5.05371, 6.27783, 5.8252, }, { /* 20 */ 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, 0, 0, 0, 0, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 3, 3, 2, 2, 1, 2, 1, 1, 0, 4, 3, 2.5, 2, 2, 2, 1.5, 1, 2.5, 3.75, 3, 2.75, 2.25, 2.75, 2, 1.75, 2, 4.375, 3.5, 3.375, 2.625, 3.375, 2.5, 2.375, 2, 4.9375, 4, 3.9375, 3.0625, 3.9375, 3, 2.9375, 2.25, 5.46875, 4.5, 4.46875, 3.53125, 4.46875, 3.5, 3.46875, 2.625, 5.98438, 5, 4.98438, 4.01562, 4.98438, 4, 3.98438, 3.0625, }, { /* 21 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.5, 1, 1, 1, 1, 1, 1, 1, 0.5, 0, 0, 0, 0, 1.5, 2, 2, 1.5, 1, 1, 1, 1, 0.25, 0, 2.0625, 2.5, 2, 1.875, 1, 1.9375, 1.25, 1, 0.6875, 3.5, 2.6875, 2.59375, 2, 1.75, 2.25, 1.4375, 1.20312, 3.48438, 3.39062, 3, 2.70312, 1.85938, 3.09375, 2.29688, 1.75781, 3.44531, 4.07812, 3.42188, 3.25781, 2.52344, 3.53906, 2.85156, 2.3125, 3.66797, 4.66797, 3.90234, 3.73828, 3.22656, 3.9375, 3.33984, 2.84766, 4.09375, 5.14844, 4.38281, 4.32031, 3.75391, 4.38086, 3.82031, 3.38379, 4.53809, 5.64648, 4.87305, 4.88379, 4.24316, 4.85254, 4.35156, }, { /* 22 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.5, 1, 1, 1, 1, 1, 1, 1, 0.375, 0, 0, 0, 0, 1, 2, 2, 1.3125, 1, 1, 1, 1, 0.5, 0.28125, 3, 2.3125, 2, 2, 1.15625, 1.4375, 1.48438, 0.90625, 1.5625, 3.3125, 2.73438, 2.5625, 2.14062, 1.5625, 2.21875, 1.54688, 0.804688, 4.3125, 3.375, 2.85938, 2.99219, 2.35156, 2.53125, 2.17578, 1.39062, 4.31641, 4.01953, 3.15234, 3.8125, 2.91016, 3.04492, 2.64648, 2.03516, 4.43555, 4.57812, 3.74414, 4.33594, 3.4668, 3.51562, 3.14746, 2.60547, 4.72949, 5.16406, 4.31738, 4.7627, 4.02148, 3.98682, 3.66113, 3.1416, 5.11133, 5.72168, 4.85352, 5.21533, 4.55225, }, { /* 23 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.5, 1, 1, 1, 1, 1, 1, 1, 0.5, 0, 0, 0, 0, 1.75, 2, 2, 1.4375, 1, 1, 1, 1, 0.09375, 0.65625, 3, 2.4375, 2, 2, 1.40625, 1.75, 1.07812, 0.765625, 1.5625, 3.4375, 3, 2.15625, 2.39844, 1.91406, 2, 1.41406, 0.601562, 4.32031, 3.57812, 3.07812, 2.83594, 2.25391, 2.78516, 1.99609, 1.38672, 3.93359, 4.08594, 3.86328, 3.41602, 2.52148, 3.46875, 2.54492, 1.99609, 4.09766, 4.49805, 4.50586, 3.94336, 3.02441, 3.96875, 3.07129, 2.52344, 4.43359, 5.11328, 4.92969, 4.44922, 3.59863, 4.39258, 3.59863, 3.02441, 4.8833, 5.64062, 5.40527, }, { /* 24 */ 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 3, 3, 2, 2, 1, 2, 1, 1, 0, 4, 3, 2.5, 2, 2, 2, 1.5, 1, 2.5, 3.75, 3, 2.75, 2.25, 2.75, 2, 1.75, 2, 4.375, 3.5, 3.375, 2.625, 3.375, 2.5, 2.375, 2, 4.9375, 4, 3.9375, 3.0625, 3.9375, 3, 2.9375, 2.25, 5.46875, 4.5, 4.46875, 3.53125, 4.46875, 3.5, 3.46875, 2.625, }, { /* 25 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.5, 1, 1, 1, 1, 1, 1, 1, 0.5, 0, 0, 0, 0, 1.5, 2, 2, 1.5, 1, 1, 1, 1, 0.25, 0, 2.0625, 2.5, 2, 1.875, 1, 1.9375, 1.25, 1, 0.6875, 3.5, 2.6875, 2.59375, 2, 1.75, 2.25, 1.4375, 1.20312, 3.48438, 3.39062, 3, 2.70312, 1.85938, 3.09375, 2.29688, 1.75781, 3.44531, 4.07812, 3.42188, 3.25781, 2.52344, 3.53906, 2.85156, 2.3125, 3.66797, 4.66797, 3.90234, 3.73828, 3.22656, 3.9375, 3.33984, 2.84766, 4.09375, 5.14844, 4.38281, 4.32031, 3.75391, 4.38086, 3.82031, }, { /* 26 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.625, 1, 1, 1, 1, 1, 1, 1, 0.3125, 0, 0, 0, 0, 1, 2, 2, 1.3125, 1, 1, 1, 1, 0.484375, 0.28125, 3, 2.3125, 2, 2, 1.14062, 1.4375, 1.48438, 0.898438, 1.5625, 3.3125, 2.72656, 2.5625, 2.14062, 1.55469, 2.21875, 1.54297, 0.800781, 4.3125, 3.37109, 2.85547, 2.98828, 2.35156, 2.52734, 2.17383, 1.38672, 4.31445, 4.01758, 3.14844, 3.81055, 2.90625, 3.04297, 2.64355, 2.03223, 4.43262, 4.5752, 3.74121, 4.33398, 3.46387, 3.5127, 3.14453, 2.60303, 4.72656, 5.16113, 4.31494, 4.75977, 4.01855, }, { /* 27 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.5, 1, 1, 1, 1, 1, 1, 1, 0.5, 0, 0, 0, 0, 1.75, 2, 2, 1.46875, 1, 1, 1, 1, 0.109375, 0.609375, 3, 2.46875, 2, 2, 1.42188, 1.73438, 1.10156, 0.789062, 1.46875, 3.46875, 3, 2.15625, 2.41797, 1.89453, 2.04688, 1.41797, 0.628906, 4.21484, 3.57812, 3.14844, 2.83984, 2.21289, 2.83398, 1.99805, 1.41602, 3.84961, 4.05469, 3.93555, 3.41895, 2.47754, 3.51758, 2.57324, 1.99805, 4.00977, 4.56738, 4.47559, 3.94531, 3.09326, 3.90234, 3.09912, 2.52441, 4.375, 5.15039, 4.89746, }, { /* 28 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 3, 3, 2, 2, 1, 2, 1, 1, 0, 4, 3, 2.5, 2, 2, 2, 1.5, 1, 2.5, 3.75, 3, 2.75, 2.25, 2.75, 2, 1.75, 2, 4.375, 3.5, 3.375, 2.625, 3.375, 2.5, 2.375, 2, 4.9375, 4, 3.9375, 3.0625, 3.9375, 3, 2.9375, 2.25, }, { /* 29 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.4375, 1, 1, 1, 1, 1, 1, 1, 0.53125, 0, 0, 0, 0, 1.4375, 2, 2, 1.51562, 1, 1, 1, 1, 0.28125, 0, 2.01562, 2.51562, 2, 1.89844, 1, 1.91406, 1.27344, 1, 0.640625, 3.51562, 2.70703, 2.59375, 2, 1.72656, 2.27344, 1.46484, 1.21875, 3.42188, 3.4082, 3, 2.70312, 1.83398, 3.14258, 2.29688, 1.77246, 3.38281, 4.11035, 3.40527, 3.25684, 2.59082, 3.49316, 2.85156, 2.32617, 3.6377, 4.6665, 3.88477, 3.76562, 3.26367, 3.89893, 3.33105, }, { /* 30 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.6875, 1, 1, 1, 1, 1, 1, 1, 0.3125, 0, 0, 0, 0, 1.03125, 2, 2, 1.3125, 1, 1, 1, 1, 0.484375, 0.304688, 3, 2.3125, 2, 2, 1.14062, 1.44531, 1.48438, 0.898438, 1.57812, 3.3125, 2.72656, 2.56641, 2.14062, 1.55469, 2.22266, 1.54492, 0.810547, 4.3125, 3.37305, 2.85938, 2.98828, 2.35352, 2.53027, 2.17676, 1.3877, 4.32129, 4.01953, 3.15234, 3.81152, 2.9082, 3.0459, 2.64648, 2.03418, 4.4375, 4.57764, 3.74268, 4.3374, 3.46631, }, { /* 31 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.5, 1, 1, 1, 1, 1, 1, 1, 0.46875, 0, 0, 0, 0, 1.8125, 2, 2, 1.45312, 1, 1, 1, 1, 0.09375, 0.679688, 3, 2.45312, 2, 2, 1.41016, 1.75, 1.08984, 0.773438, 1.54688, 3.45312, 3, 2.16016, 2.4082, 1.91016, 2.02148, 1.41992, 0.613281, 4.28711, 3.58008, 3.11133, 2.84082, 2.24023, 2.81055, 2, 1.40234, 3.90137, 4.0752, 3.90039, 3.42041, 2.50488, 3.49512, 2.56152, 2, 4.06055, 4.53418, 4.49561, }, { /* 32 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 3, 3, 2, 2, 1, 2, 1, 1, 0, 4, 3, 2.5, 2, 2, 2, 1.5, 1, 2.5, 3.75, 3, 2.75, 2.25, 2.75, 2, 1.75, 2, 4.375, 3.5, 3.375, 2.625, 3.375, 2.5, 2.375, 2, }, { /* 33 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.46875, 1, 1, 1, 1, 1, 1, 1, 0.515625, 0, 0, 0, 0, 1.4375, 2, 2, 1.51562, 1, 1, 1, 1, 0.273438, 0, 2.01562, 2.51562, 2, 1.89453, 1, 1.91406, 1.27344, 1, 0.638672, 3.51562, 2.70508, 2.59375, 2, 1.72461, 2.27344, 1.46289, 1.21777, 3.42188, 3.40723, 2.99902, 2.70215, 1.83301, 3.1416, 2.29688, 1.77148, 3.38184, 4.10986, 3.4043, 3.25586, 2.58984, 3.49268, 2.85059, }, { /* 34 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.6875, 1, 1, 1, 1, 1, 1, 1, 0.3125, 0, 0, 0, 0, 1.03125, 2, 2, 1.3125, 1, 1, 1, 1, 0.484375, 0.304688, 3, 2.3125, 2, 2, 1.14062, 1.44531, 1.48438, 0.898438, 1.57812, 3.3125, 2.72656, 2.56641, 2.14062, 1.55469, 2.22266, 1.54492, 0.810547, 4.3125, 3.37305, 2.85938, 2.98828, 2.35352, 2.53027, 2.17676, 1.3877, 4.32129, 4.01953, 3.15234, 3.81152, 2.9082, }, { /* 35 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.53125, 1, 1, 1, 1, 1, 1, 1, 0.453125, 0, 0, 0, 0, 1.8125, 2, 2, 1.45312, 1, 1, 1, 1, 0.0898438, 0.679688, 3, 2.45312, 2, 2, 1.4082, 1.75, 1.08984, 0.771484, 1.54688, 3.45312, 3, 2.1582, 2.4082, 1.90918, 2.02051, 1.41992, 0.612305, 4.28711, 3.5791, 3.11035, 2.84033, 2.23975, 2.81006, 1.99951, 1.40186, 3.90039, 4.07471, 3.8999, }, { /* 36 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 3, 3, 2, 2, 1, 2, 1, 1, 0, 4, 3, 2.5, 2, 2, 2, 1.5, 1, 2.5, 3.75, 3, 2.75, 2.25, 2.75, 2, 1.75, 2, }, { /* 37 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.484375, 1, 1, 1, 1, 1, 1, 1, 0.515625, 0, 0, 0, 0, 1.45312, 2, 2, 1.51172, 1, 1, 1, 1, 0.269531, 0, 2.02734, 2.51172, 2, 1.89062, 1, 1.91992, 1.26758, 1, 0.651367, 3.51172, 2.70117, 2.59375, 2, 1.73145, 2.26758, 1.45703, 1.21436, 3.4375, 3.40332, 2.99951, 2.70264, 1.83984, 3.12988, 2.29688, }, { /* 38 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.6875, 1, 1, 1, 1, 1, 1, 1, 0.3125, 0, 0, 0, 0, 1.03125, 2, 2, 1.3125, 1, 1, 1, 1, 0.484375, 0.304688, 3, 2.3125, 2, 2, 1.14062, 1.44531, 1.48438, 0.898438, 1.57812, 3.3125, 2.72656, 2.56641, 2.14062, 1.55469, 2.22266, 1.54492, 0.810547, 4.3125, 3.37305, 2.85938, 2.98828, 2.35352, }, { /* 39 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.546875, 1, 1, 1, 1, 1, 1, 1, 0.453125, 0, 0, 0, 0, 1.82031, 2, 2, 1.45312, 1, 1, 1, 1, 0.0898438, 0.685547, 3, 2.45312, 2, 2, 1.4082, 1.75098, 1.08984, 0.771484, 1.55078, 3.45312, 3, 2.15918, 2.4082, 1.91016, 2.02051, 1.42041, 0.612305, 4.28955, 3.57959, 3.11035, }, { /* 40 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 3, 3, 2, 2, 1, 2, 1, 1, 0, 4, 3, 2.5, 2, 2, 2, 1.5, 1, 2.5, }, { /* 41 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.484375, 1, 1, 1, 1, 1, 1, 1, 0.515625, 0, 0, 0, 0, 1.45312, 2, 2, 1.51367, 1, 1, 1, 1, 0.271484, 0, 2.02441, 2.51367, 2, 1.89258, 1, 1.91797, 1.27051, 1, 0.646973, 3.51367, 2.70312, 2.59424, 2, 1.729, 2.27051, 1.45996, }, { /* 42 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.679688, 1, 1, 1, 1, 1, 1, 1, 0.316406, 0, 0, 0, 0, 1.02734, 2, 2, 1.31445, 1, 1, 1, 1, 0.486328, 0.298828, 3, 2.31445, 2, 2, 1.14355, 1.44238, 1.48584, 0.900391, 1.57031, 3.31445, 2.729, 2.56396, 2.14307, 1.55762, }, { /* 43 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.539062, 1, 1, 1, 1, 1, 1, 1, 0.457031, 0, 0, 0, 0, 1.81641, 2, 2, 1.45508, 1, 1, 1, 1, 0.0917969, 0.679688, 3, 2.45508, 2, 2, 1.40967, 1.74951, 1.09131, 0.773438, 1.54297, 3.45508, 3, 2.15918, }, { /* 44 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 3, 3, 2, 2, 1, 2, 1, 1, 0, 4, }, { /* 45 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.484375, 1, 1, 1, 1, 1, 1, 1, 0.513672, 0, 0, 0, 0, 1.45703, 2, 2, 1.51367, 1, 1, 1, 1, 0.270508, 0, 2.02588, 2.51367, 2, 1.89209, 1, 1.91846, 1.27051, 1, }, { /* 46 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.683594, 1, 1, 1, 1, 1, 1, 1, 0.314453, 0, 0, 0, 0, 1.0293, 2, 2, 1.31348, 1, 1, 1, 1, 0.485352, 0.301758, 3, 2.31348, 2, 2, 1.14209, 1.44385, }, { /* 47 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.542969, 1, 1, 1, 1, 1, 1, 1, 0.455078, 0, 0, 0, 0, 1.81836, 2, 2, 1.4541, 1, 1, 1, 1, 0.0908203, 0.682617, 3, 2.4541, 2, 2, }, { /* 48 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 3, 3, }, { /* 49 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.486328, 1, 1, 1, 1, 1, 1, 1, 0.513672, 0, 0, 0, 0, 1.45898, 2, 2, 1.51367, 1, 1, 1, 1, 0.270508, 0, }, { /* 50 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.685547, 1, 1, 1, 1, 1, 1, 1, 0.313477, 0, 0, 0, 0, 1.0293, 2, 2, 1.31348, 1, 1, 1, 1, }, { /* 51 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.544922, 1, 1, 1, 1, 1, 1, 1, 0.454102, 0, 0, 0, 0, 1.81836, 2, 2, 1.4541, 1, 1, }, { /* 52 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 2, 2, 2, 2, }, { /* 53 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.486328, 1, 1, 1, 1, 1, 1, 1, 0.513672, 0, 0, 0, 0, 1.45898, 2, }, { /* 54 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.685547, 1, 1, 1, 1, 1, 1, 1, 0.313965, 0, 0, 0, 0, }, { /* 55 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.544922, 1, 1, 1, 1, 1, 1, 1, 0.45459, 0, 0, }, { /* 56 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, }, { /* 57 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.486328, 1, 1, 1, 1, 1, 1, }, { /* 58 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.686035, 1, 1, 1, 1, }, { /* 59 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.54541, 1, 1, }, }; #endif schroedinger-1.0.11/schroedinger/schrotables.h0000644000175000017500000000222111541755167016336 00000000000000 #ifndef __SCHRO_SCHRO_TABLES_H__ #define __SCHRO_SCHRO_TABLES_H__ #include #include SCHRO_BEGIN_DECLS #ifdef SCHRO_ENABLE_UNSTABLE_API extern const uint32_t schro_table_offset_3_8[61]; extern const uint32_t schro_table_offset_1_2[61]; extern const uint32_t schro_table_quant[61]; extern const uint16_t schro_table_inverse_quant[61]; extern const uint16_t schro_table_division_factor[257]; extern const double schro_table_error_hist_shift3_1_2[60][104]; extern const double schro_table_onebits_hist_shift3_1_2[60][104]; extern const double schro_table_zerobits_hist_shift3_1_2[60][104]; extern const float schro_tables_wavelet_noise_curve[SCHRO_N_WAVELETS][8][128]; extern const double schro_tables_wavelet_gain[SCHRO_N_WAVELETS][2]; #define SCHRO_UNPACK_TABLE_SHIFT 10 extern const int16_t schro_table_unpack_sint[(1< #endif #include #include #include #include #include SchroQueue * schro_queue_new (int size, SchroQueueFreeFunc free_func) { SchroQueue *queue; queue = schro_malloc0 (sizeof (*queue)); queue->size = size; queue->free = free_func; queue->elements = schro_malloc0 (size * sizeof (SchroQueueElement)); return queue; } void schro_queue_free (SchroQueue * queue) { int i; if (queue->free) { for (i = 0; i < queue->n; i++) { queue->free (queue->elements[i].data, queue->elements[i].picture_number); } } schro_free (queue->elements); schro_free (queue); } void schro_queue_add (SchroQueue * queue, void *data, SchroPictureNumber picture_number) { SCHRO_ASSERT (queue->n < queue->size); queue->elements[queue->n].data = data; queue->elements[queue->n].picture_number = picture_number; queue->n++; } void * schro_queue_find (SchroQueue * queue, SchroPictureNumber picture_number) { int i; for (i = 0; i < queue->n; i++) { if (queue->elements[i].picture_number == picture_number) { return queue->elements[i].data; } } return NULL; } void schro_queue_delete (SchroQueue * queue, SchroPictureNumber picture_number) { int i; for (i = 0; i < queue->n; i++) { if (queue->elements[i].picture_number == picture_number) { if (queue->free) { queue->free (queue->elements[i].data, queue->elements[i].picture_number); } memmove (queue->elements + i, queue->elements + i + 1, sizeof (SchroQueueElement) * (queue->n - i - 1)); queue->n--; return; } } } #ifdef unused void * schro_queue_remove (SchroQueue * queue, SchroPictureNumber picture_number) { int i; void *ret; for (i = 0; i < queue->n; i++) { if (queue->elements[i].picture_number == picture_number) { ret = queue->elements[i].data; memmove (queue->elements + i, queue->elements + i + 1, sizeof (SchroQueueElement) * (queue->n - i - 1)); queue->n--; return ret; } } return NULL; } #endif #ifdef unused void schro_queue_clear (SchroQueue * queue) { int i; for (i = 0; i < queue->n; i++) { if (queue->free) { queue->free (queue->elements[i].data, queue->elements[i].picture_number); } } queue->n = 0; } #endif void schro_queue_pop (SchroQueue * queue) { if (queue->n == 0) return; if (queue->free) { queue->free (queue->elements[0].data, queue->elements[0].picture_number); } memmove (queue->elements, queue->elements + 1, sizeof (SchroQueueElement) * (queue->n - 1)); queue->n--; } void * schro_queue_peek (SchroQueue * queue) { if (queue->n == 0) return NULL; return queue->elements[0].data; } void * schro_queue_pull (SchroQueue * queue) { void *ret; if (queue->n == 0) return NULL; ret = queue->elements[0].data; memmove (queue->elements, queue->elements + 1, sizeof (SchroQueueElement) * (queue->n - 1)); queue->n--; return ret; } int schro_queue_is_full (SchroQueue * queue) { return (queue->n == queue->size); } int schro_queue_slots_available (SchroQueue * queue) { return queue->size - queue->n; } int schro_queue_is_empty (SchroQueue * queue) { return (queue->n == 0); } schroedinger-1.0.11/schroedinger/schropack.h0000644000175000017500000000251311702516761016000 00000000000000 #ifndef _SCHRO_PACK_H_ #define _SCHRO_PACK_H_ #include #include SCHRO_BEGIN_DECLS typedef struct _SchroPack SchroPack; struct _SchroPack { SchroBuffer *buffer; int n; int shift; int n_pack; uint32_t value; int error; }; #ifdef SCHRO_ENABLE_UNSTABLE_API SchroPack * schro_pack_new (void); void schro_pack_free (SchroPack *pack); void schro_pack_encode_init (SchroPack *pack, SchroBuffer *buffer); void schro_pack_copy (SchroPack *dest, SchroPack *src); void schro_pack_sync (SchroPack *pack); void schro_pack_flush (SchroPack *pack); int schro_pack_get_offset (SchroPack *pack); int schro_pack_get_bit_offset (SchroPack *pack); void schro_pack_append (SchroPack *pack, const uint8_t *data, int len); void schro_pack_append_zero (SchroPack *pack, int len); void schro_pack_encode_bit (SchroPack *pack, int value); void schro_pack_encode_bits (SchroPack *pack, int n, unsigned int value); void schro_pack_encode_uint (SchroPack *pack, int value); void schro_pack_encode_sint (SchroPack *pack, int value); void schro_pack_encode_sint_s16 (SchroPack *pack, int16_t *values, int n); void schro_pack_encode_sint_s32 (SchroPack *pack, int32_t *values, int n); int schro_pack_estimate_uint (int value); int schro_pack_estimate_sint (int value); #endif SCHRO_END_DECLS #endif schroedinger-1.0.11/schroedinger/schrossim.c0000644000175000017500000000760711541755167016047 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include static SchroFrame * schro_frame_dup16 (SchroFrame * frame) { SchroFrame *newframe; SchroFrameFormat format; /* FIXME hack */ format = SCHRO_FRAME_FORMAT_S16_444 | frame->format; newframe = schro_frame_new_and_alloc (NULL, format, frame->width, frame->height); schro_frame_convert (newframe, frame); return newframe; } static void schro_frame_multiply_s16 (SchroFrame * dest, SchroFrame * src) { SchroFrameData *dcomp; SchroFrameData *scomp; int i; int16_t *ddata; int16_t *sdata; int width, height; int x, y; for (i = 0; i < 3; i++) { dcomp = &dest->components[i]; scomp = &src->components[i]; ddata = dcomp->data; sdata = scomp->data; width = (dcomp->width < scomp->width) ? dcomp->width : scomp->width; height = (dcomp->height < scomp->height) ? dcomp->height : scomp->height; for (y = 0; y < height; y++) { ddata = SCHRO_FRAME_DATA_GET_LINE (dcomp, y); sdata = SCHRO_FRAME_DATA_GET_LINE (scomp, y); for (x = 0; x < width; x++) { int z; z = ddata[x] * sdata[x]; ddata[x] = CLAMP (z, -32768, 32767); } } } } static void schro_frame_multiply (SchroFrame * a, SchroFrame * b) { schro_frame_multiply_s16 (a, b); } #define SSIM_SIGMA 1.5 double schro_frame_ssim (SchroFrame * a, SchroFrame * b) { SchroFrame *a_lowpass; SchroFrame *b_lowpass; SchroFrame *a_hipass; SchroFrame *b_hipass; SchroFrame *ab; double ssim_sum; double mssim; double sum, diff; double ave; int i, j; a_lowpass = schro_frame_dup (a); schro_frame_filter_lowpass2 (a_lowpass, (a->width / 256.0) * SSIM_SIGMA); b_lowpass = schro_frame_dup (b); schro_frame_filter_lowpass2 (b_lowpass, (b->width / 256.0) * SSIM_SIGMA); a_hipass = schro_frame_dup16 (a); schro_frame_subtract (a_hipass, a_lowpass); b_hipass = schro_frame_dup16 (b); schro_frame_subtract (b_hipass, b_lowpass); ab = schro_frame_dup (a_hipass); schro_frame_multiply (ab, b_hipass); schro_frame_multiply (a_hipass, a_hipass); schro_frame_multiply (b_hipass, b_hipass); schro_frame_filter_lowpass2 (a_hipass, (a->width / 256.0) * SSIM_SIGMA); schro_frame_filter_lowpass2 (b_hipass, (a->width / 256.0) * SSIM_SIGMA); schro_frame_filter_lowpass2 (ab, (a->width / 256.0) * SSIM_SIGMA); ssim_sum = 0; for (j = 0; j < a->height; j++) { for (i = 0; i < a->width; i++) { double ssim; double c1 = (0.01 * 255) * (0.01 * 255); double c2 = (0.03 * 255) * (0.03 * 255); int mu_x, mu_y, sigma_x2, sigma_y2, sigma_xy; #define GET(f, x, y) SCHRO_GET(f->components[0].data, f->components[0].stride * j + i * sizeof(uint8_t), uint8_t) #define GET16(f, x, y) SCHRO_GET(f->components[0].data, f->components[0].stride * j + i * sizeof(int16_t), int16_t) mu_x = GET (a_lowpass, i, j); mu_y = GET (b_lowpass, i, j); sigma_x2 = GET16 (a_hipass, i, j); sigma_y2 = GET16 (b_hipass, i, j); sigma_xy = GET16 (ab, i, j); ssim = (2 * mu_x * mu_y + c1) * (2 * sigma_xy + c2) / ((mu_x * mu_x + mu_y * mu_y + c1) * (sigma_x2 + sigma_y2 + c2)); //SCHRO_ERROR("%d %d, mu %d %d sigma %d %d %d ssim %g", // i,j, mu_x, mu_y, sigma_x2, sigma_y2, sigma_xy, ssim); //SCHRO_ASSERT(ssim <= 1.0); ssim_sum += ssim; } } mssim = ssim_sum / (a->width * a->height); sum = 0; for (j = 0; j < a->height; j++) { for (i = 0; i < a->width; i++) { int x_a, x_b; x_a = GET (a, i, j); x_b = GET (b, i, j); sum += abs (x_a - x_b); } } diff = sum / (a->width * a->height * 255.0); ave = schro_frame_calculate_average_luma (a) / 255.0; SCHRO_DEBUG ("mssim,diff,ave %g %g %g", mssim, diff, ave); schro_frame_unref (a_lowpass); schro_frame_unref (b_lowpass); schro_frame_unref (a_hipass); schro_frame_unref (b_hipass); schro_frame_unref (ab); return mssim; } schroedinger-1.0.11/schroedinger/cuda/0000775000175000017500000000000011707140272014642 500000000000000schroedinger-1.0.11/schroedinger/cuda/iwt5_3.cu0000644000175000017500000003671210737003215016231 00000000000000 // Autogenerated by WaveGen.py, do not edit! // #include #include #include "common.h" #include "wavelet_common.h" /// This much is reserved at the sides of the signal #define BLEFT 2 #define BRIGHT 2 /// Initial shift (to keep precision in integer wavelets) #define INITIAL_OFFSET 1 #define INITIAL_SHIFT 1 /// Shifts for lifting steps #define STAGE1_OFFSET 0 #define STAGE1_SHIFT 1 #define STAGE2_OFFSET 2 #define STAGE2_SHIFT 2 /// Vertical pass row management #define RLEFT 1 #define RRIGHT 1 #define COPYROWS 0 static __global__ void a_transform_h( DATATYPE* data, int width, int stride ) { extern __shared__ DATATYPE shared[]; const int bid = blockIdx.x; // row const int tid = threadIdx.x; // thread id within row const int tidu16 = ((tid&16)>>4)|((tid&15)<<1)|(tid&~31); data += __mul24(bid, stride); // Load entire line into shared memory // Deinterleave right here int half = BLEFT+(width>>1)+BRIGHT; unsigned int ofs; // Shared memory output offset for this thread i16_2 *row = (i16_2*)data; for(ofs = tid; ofs < (width>>1); ofs += BSH) { i16_2 val = row[ofs]; shared[BLEFT + ofs] = val.a << INITIAL_SHIFT; // even shared[BLEFT + ofs + half] = val.b << INITIAL_SHIFT; // odd } __syncthreads(); // Duplicate right boundary if(tidu16==0) shared[BLEFT+(width>>1)] = shared[BLEFT+(width>>1)-1]; __syncthreads(); // Now apply wavelet lifting to entire line at once // Process odd const int end = BLEFT+(width>>1); for(ofs = BLEFT+tidu16; ofs < end; ofs += BSH) { /// Accumulate value int acc = STAGE1_OFFSET; acc += -1*shared[ofs]; acc += -1*shared[ofs+1]; shared[ofs + half] += acc >> STAGE1_SHIFT; } // Duplicate left boundary // Do this in thread that wrote shared[half+BLEFT] (tid 0) if(tidu16 == 0) shared[half+BLEFT-1] = shared[half+BLEFT]; __syncthreads(); // Process even for(ofs = BLEFT+tidu16; ofs < end; ofs += BSH) { /// Accumulate value int acc = STAGE2_OFFSET; acc += 1*shared[half+ofs-1]; acc += 1*shared[half+ofs]; shared[ofs] += acc >> STAGE2_SHIFT; } __syncthreads(); /// Write line back to global memory, don't interleave again /// Mind the gap between BLEFT+width/2 and half if(width&3) // If width is not a multiple of 4, we need to use the slower method { /// Left part (even coefficients) for(ofs = tid; ofs < (width>>1); ofs += BSH) data[ofs] = shared[BLEFT+ofs]; /// Right part (odd coefficients) for(ofs = tid; ofs < (width>>1); ofs += BSH) data[(width>>1)+ofs] = shared[half+BLEFT+ofs]; } else { /// Left part (even coefficients) for(ofs = tid; ofs < (width>>2); ofs += BSH) row[ofs] = *((i16_2*)&shared[BLEFT+(ofs<<1)]); row += (width>>2); /// Right part (odd coefficients) for(ofs = tid; ofs < (width>>2); ofs += BSH) row[ofs] = *((i16_2*)&shared[half+BLEFT+(ofs<<1)]); } } #define BROWS (2*BSVY+COPYROWS) /* Rows to process at once */ #define SKIPTOP COPYROWS #define PAD_ROWS (WRITEBACK-SKIPTOP+RRIGHT+COPYROWS) /* Rows below which to use s_transform_v_pad */ /// tid is BCOLSxBROWS matrix /// RLEFT+BROWS+RRIGHT rows #define TOTALROWS (RLEFT+BROWS+RRIGHT) #define OVERLAP (RLEFT+RRIGHT+COPYROWS) #define OVERLAP_OFFSET (TOTALROWS-OVERLAP) #define WRITEBACK (2*BSVY) __device__ void doTransform(int xofs) { const int tidx = (threadIdx.x<<1)+xofs; // column const int tidy = threadIdx.y; // row extern __shared__ DATATYPE shared[]; unsigned int ofs; /// Do the transform /// Do procesing on shared mem /// Treat all columns the same /// Process odd rows /// shared[ofs-1*BCOLS] /// shared[ofs+1*BCOLS] ofs = ((RLEFT+(tidy<<1)+1)<>1); //for(ofs = RLEFT+tid; ofs < end; ofs += BSVY) { /// Accumulate value int acc = STAGE1_OFFSET; acc += -1*shared[ofs-BCOLS]; acc += -1*shared[ofs+BCOLS]; shared[ofs] += acc >> STAGE1_SHIFT; } __syncthreads(); /// Process even rows - we can process one less now at the bottom /// shared[ofs-1*BCOLS] /// shared[ofs+1*BCOLS] ofs -= BCOLS; { /// Accumulate value int acc = STAGE2_OFFSET; acc += 1*shared[ofs-BCOLS]; acc += 1*shared[ofs+BCOLS]; shared[ofs] += acc >> STAGE2_SHIFT; } } __device__ void doTransformTB(int xofs, unsigned int leftover) { const int tidx = (threadIdx.x<<1)+xofs; // column const int tidy = threadIdx.y; // row const unsigned int minn = (RLEFT<> STAGE1_SHIFT; } __syncthreads(); /// Process even rows - we can process one less now at the bottom ofs -= BCOLS; { /// Accumulate value int acc = STAGE2_OFFSET; acc += 1*shared[max(ofs-BCOLS, minn+BCOLS)]; acc += 1*shared[ofs+BCOLS]; shared[ofs] += acc >> STAGE2_SHIFT; } } __device__ void doTransformT(int xofs) { const int tidx = (threadIdx.x<<1)+xofs; // column const int tidy = threadIdx.y; // row const unsigned int minn = (RLEFT<> STAGE1_SHIFT; } __syncthreads(); /// Process even rows - we can process one less now at the bottom ofs -= BCOLS; { /// Accumulate value int acc = STAGE2_OFFSET; acc += 1*shared[max(ofs-BCOLS, minn+BCOLS)]; acc += 1*shared[ofs+BCOLS]; shared[ofs] += acc >> STAGE2_SHIFT; } } __device__ void doTransformB(int xofs, unsigned int leftover) { const int tidx = (threadIdx.x<<1)+xofs; // column const int tidy = threadIdx.y; // row //const unsigned int minn = RLEFT*BCOLS + threadIdx.x; const unsigned int maxx = leftover-(2<> STAGE1_SHIFT; } __syncthreads(); /// Process even rows - we can process one less now at the bottom ofs -= BCOLS; { /// Accumulate value int acc = STAGE2_OFFSET; acc += 1*shared[ofs-BCOLS]; acc += 1*shared[ofs+BCOLS]; shared[ofs] += acc >> STAGE2_SHIFT; } } static __global__ void a_transform_v( DATATYPE* data, int width, int height, int stride ) { extern __shared__ DATATYPE shared[]; const unsigned int bid = blockIdx.x; // slab (BCOLS columns) const unsigned int tidx = threadIdx.x<<1; // column const unsigned int tidy = threadIdx.y; // row const unsigned int swidth = min(width-(bid<>>(d_data, lwidth, stride); #endif #ifdef VERTICAL block_size.x = BSVX; block_size.y = BSVY; block_size.z = 1; grid_size.x = (lwidth+BCOLS-1)/BCOLS; grid_size.y = 1; grid_size.z = 1; shared_size = BCOLS*(BROWS+RLEFT+RRIGHT)*2; if(lheight < PAD_ROWS) a_transform_v_pad<<>>(d_data, lwidth, lheight, stride); else a_transform_v<<>>(d_data, lwidth, lheight, stride); #endif } schroedinger-1.0.11/schroedinger/cuda/cudawavelet.cu0000644000175000017500000000634110737003215017416 00000000000000#include "wavelets.h" extern void cuda_iwt_13_5(int16_t *d_data, int lwidth, int lheight, int stride, cudaStream_t stream); extern void cuda_iiwt_13_5(int16_t *d_data, int lwidth, int lheight, int stride, cudaStream_t stream); extern void cuda_iwt_5_3(int16_t *d_data, int lwidth, int lheight, int stride, cudaStream_t stream); extern void cuda_iiwt_5_3(int16_t *d_data, int lwidth, int lheight, int stride, cudaStream_t stream); extern void cuda_iwt_9_3(int16_t *d_data, int lwidth, int lheight, int stride, cudaStream_t stream); extern void cuda_iiwt_9_3(int16_t *d_data, int lwidth, int lheight, int stride, cudaStream_t stream); extern void cuda_iwt_9_7(int16_t *d_data, int lwidth, int lheight, int stride, cudaStream_t stream); extern void cuda_iiwt_9_7(int16_t *d_data, int lwidth, int lheight, int stride, cudaStream_t stream); extern void cuda_iwt_fidelity(int16_t *d_data, int lwidth, int lheight, int stride, cudaStream_t stream); extern void cuda_iiwt_fidelity(int16_t *d_data, int lwidth, int lheight, int stride, cudaStream_t stream); extern void cuda_iwt_haar(int shift, int16_t *d_data, int lwidth, int lheight, int stride, cudaStream_t stream); extern void cuda_iiwt_haar(int shift, int16_t *d_data, int lwidth, int lheight, int stride, cudaStream_t stream); extern "C" { void cuda_wavelet_inverse_transform_2d (int filter, int16_t *data, int stride, int width, int height, cudaStream_t stream) { stride /= 2; switch (filter) { case SCHRO_WAVELET_DESL_9_3: cuda_iiwt_9_3 (data, width, height, stride, stream); break; case SCHRO_WAVELET_5_3: cuda_iiwt_5_3 (data, width, height, stride, stream); break; case SCHRO_WAVELET_13_5: cuda_iiwt_13_5 (data, width, height, stride, stream); break; case SCHRO_WAVELET_HAAR_0: cuda_iiwt_haar (0, data, width, height, stride, stream); break; case SCHRO_WAVELET_HAAR_1: cuda_iiwt_haar (1, data, width, height, stride, stream); break; case SCHRO_WAVELET_HAAR_2: cuda_iiwt_haar (2, data, width, height, stride, stream); break; case SCHRO_WAVELET_FIDELITY: cuda_iiwt_fidelity (data, width, height, stride, stream); break; case SCHRO_WAVELET_DAUB_9_7: cuda_iiwt_9_7(data, width, height, stride, stream); break; } } void cuda_wavelet_transform_2d (int filter, int16_t *data, int stride, int width, int height, cudaStream_t stream) { stride /= 2; switch (filter) { case SCHRO_WAVELET_DESL_9_3: cuda_iwt_9_3 (data, width, height, stride, stream); break; case SCHRO_WAVELET_5_3: cuda_iwt_5_3 (data, width, height, stride, stream); break; case SCHRO_WAVELET_13_5: cuda_iwt_13_5 (data, width, height, stride, stream); break; case SCHRO_WAVELET_HAAR_0: cuda_iwt_haar (0, data, width, height, stride, stream); break; case SCHRO_WAVELET_HAAR_1: cuda_iwt_haar (1, data, width, height, stride, stream); break; case SCHRO_WAVELET_HAAR_2: cuda_iwt_haar (2, data, width, height, stride, stream); break; case SCHRO_WAVELET_FIDELITY: cuda_iwt_fidelity (data, width, height, stride, stream); break; case SCHRO_WAVELET_DAUB_9_7: cuda_iwt_9_7(data, width, height, stride, stream); break; } } } schroedinger-1.0.11/schroedinger/cuda/upsample.cu0000644000175000017500000000256610737003215016745 00000000000000#include #include #include #include // includes, project //#include #include #include #include #define THREADS 256 #include "common.h" #include "upsample_kernel.h" extern "C" { void cuda_upsample_horizontal(uint8_t *output, int ostride, uint8_t *input, int istride, int width, int height, cudaStream_t stream) { dim3 block_size, grid_size; int shared_size; block_size.x = THREADS; block_size.y = block_size.z = 1; grid_size.x = height; grid_size.y = grid_size.z = 1; shared_size = ROUNDUP4(BLEFT+width+BRIGHT) + ROUNDUP4(width); upsample_horizontal<<>>(output, ostride, input, istride, width); } void cuda_upsample_vertical(uint8_t *output, int ostride, uint8_t *input, int istride, int width, int height, cudaStream_t stream) { dim3 block_size, grid_size; int shared_size; block_size.x = COLUMN_THREAD_W; block_size.y = COLUMN_THREAD_H; block_size.z = 1; grid_size.x = (width+COLUMN_TILE_W-1)/COLUMN_TILE_W; grid_size.y = (height+COLUMN_TILE_H-1)/COLUMN_TILE_H; grid_size.z = 1; shared_size = COLUMN_TILE_W*(BLEFT+COLUMN_TILE_H+BRIGHT) + COLUMN_TILE_W*COLUMN_TILE_H; upsample_vertical<<>>(output, ostride, input, istride, width, height); } } schroedinger-1.0.11/schroedinger/cuda/haar_iwt.cu0000644000175000017500000001130210737003215016701 00000000000000#include #include #include "common.h" #include "wavelet_common.h" #define BROWS (2*BSVY) static __global__ void a_transform_h( DATATYPE* data, int width, int stride, int shift ) { extern __shared__ DATATYPE shared[]; const int bid = blockIdx.x; // row const int tid = threadIdx.x; // thread id within row const int tidu16 = ((tid&16)>>4)|((tid&15)<<1)|(tid&~31); //const int BSH = blockDim.x; // Row offset const unsigned int idata = __mul24(bid, stride); // Load entire line into shared memory // Deinterleave right here int half = (width>>1); // Make sure half is odd, to prevent bank conflicts unsigned int ofs; // Shared memory output offset for this thread uint32_t *row = (uint32_t*)&data[idata]; for(ofs = tid; ofs < (width>>1); ofs += BSH) { uint32_t val = row[ofs]; shared[ofs] = (val&0xFFFF) << shift; // even shared[ofs + half] = (val>>16) << shift; // odd } __syncthreads(); // Now apply wavelet lifting to entire line at once const int end = (width>>1); for(ofs = tidu16; ofs < end; ofs += BSH) { int val1 = shared[ofs]; int val2 = shared[half+ofs]; val2 -= val1; val1 += (val2+1)>>1; shared[ofs] = val1; shared[half+ofs] = val2; } __syncthreads(); /// Write line back to global memory, don't interleave again for(ofs = tid; ofs < (width>>1); ofs += BSH) row[ofs] = *((uint32_t*)&shared[ofs<<1]); } // Process BROWS lines __device__ void doTransform() { const int tidx = threadIdx.x<<1; // column const int tidy = threadIdx.y; // row extern __shared__ DATATYPE shared[]; int ofs; ofs = (((tidy<<1))<>1; shared[ofs] = val1; shared[ofs+BCOLS] = val2; } { int val1 = shared[ofs+1]; int val2 = shared[ofs+BCOLS+1]; val2 -= val1; val1 += (val2+1)>>1; shared[ofs+1] = val1; shared[ofs+BCOLS+1] = val2; } } static __global__ void a_transform_v( DATATYPE* data, int width, int height, int stride ) { extern __shared__ DATATYPE shared[]; const unsigned int bid = blockIdx.x; // slab (BCOLS columns) const unsigned int tidx = threadIdx.x<<1; // column const unsigned int tidy = threadIdx.y; // row const unsigned int swidth = min(width-(bid<>>(d_data, lwidth, stride, shift); #endif #ifdef VERTICAL block_size.x = BSVX; block_size.y = BSVY; block_size.z = 1; grid_size.x = (lwidth+BCOLS-1)/BCOLS; grid_size.y = 1; grid_size.z = 1; shared_size = BCOLS*BROWS*2; a_transform_v<<>>(d_data, lwidth, lheight, stride); #endif } schroedinger-1.0.11/schroedinger/cuda/iiwt5_3.cu0000644000175000017500000004534210737003215016401 00000000000000 // Autogenerated by WaveGen.py, do not edit! // #include #include #include "common.h" #include "wavelet_common.h" /// This much is reserved at the sides of the signal #define BLEFT 2 #define BRIGHT 2 /// Initial shift (to keep precision in integer wavelets) #define INITIAL_OFFSET 1 #define INITIAL_SHIFT 1 /// Shifts for lifting steps #define STAGE1_OFFSET 0 #define STAGE1_SHIFT 1 #define STAGE2_OFFSET 2 #define STAGE2_SHIFT 2 /// Vertical pass row management #define RLEFT 1 #define RRIGHT 0 #define COPYROWS 1 static __global__ void s_transform_h( DATATYPE* data, int width, int stride ) { extern __shared__ DATATYPE shared[]; const int bid = blockIdx.x; // row const int tid = threadIdx.x; // thread id within row const int tidu16 = ((tid&16)>>4)|((tid&15)<<1)|(tid&~31); data += __mul24(bid, stride); int half = BLEFT+(width>>1)+BRIGHT; int ofs; if(width&3) // If width is not a multiple of 4, we need to use the slower method { /// Left part (even coefficients) /// Right part (odd coefficients) int w2 = (width>>1); uint16_t *row = (uint16_t*)data; uint16_t *row2 = (uint16_t*)&data[w2]; uint16_t *dest1 = (uint16_t*)&shared[BLEFT]; uint16_t *dest2 = (uint16_t*)&shared[half+BLEFT]; ofs = tid; while(true) { if(ofs>2); uint32_t *row = (uint32_t*)data; uint32_t *row2 = (uint32_t*)&data[width>>1]; uint32_t *dest1 = (uint32_t*)&shared[BLEFT]; uint32_t *dest2 = (uint32_t*)&shared[half+BLEFT]; /// Left part (even coefficients) ofs = tid; while(true) { if(ofs>1); // Process even for(ofs = BLEFT+tidu16; ofs < end; ofs += BSH) { /// Accumulate value int acc = STAGE2_OFFSET; acc += 1*shared[half+ofs-1]; acc += 1*shared[half+ofs]; shared[ofs] -= acc >> STAGE2_SHIFT; } __syncthreads(); if(tid==0) shared[BLEFT+(width>>1)] = shared[BLEFT+(width>>1)-1]; __syncthreads(); // Process odd for(ofs = BLEFT+tidu16; ofs < end; ofs += BSH) { /// Accumulate value int acc = STAGE1_OFFSET; acc += -1*shared[ofs]; acc += -1*shared[ofs+1]; shared[ofs + half] -= acc >> STAGE1_SHIFT; } __syncthreads(); if(width&3) { uint32_t *row = (uint32_t*)data; int16_t *src1 = (int16_t*)&shared[BLEFT]; int16_t *src2 = (int16_t*)&shared[half+BLEFT]; int w2 = (width>>1); ofs = tid; while(true) { if(ofs>INITIAL_SHIFT; int b = (src2[ofs] + INITIAL_OFFSET)>>INITIAL_SHIFT; row[ofs] = (a&0xFFFF)|((b&0xFFFF)<<16); ofs += BSH; } else break; if(ofs>INITIAL_SHIFT; int b = (src2[ofs] + INITIAL_OFFSET)>>INITIAL_SHIFT; row[ofs] = (a&0xFFFF)|((b&0xFFFF)<<16); ofs += BSH; } else break; if(ofs>INITIAL_SHIFT; int b = (src2[ofs] + INITIAL_OFFSET)>>INITIAL_SHIFT; row[ofs] = (a&0xFFFF)|((b&0xFFFF)<<16); ofs += BSH; } else break; } } else { i16_4 *row = (i16_4*)data; i16_2 *src1 = (i16_2*)&shared[BLEFT]; i16_2 *src2 = (i16_2*)&shared[half+BLEFT]; int w2 = (width>>2); ofs = tid; while(true) { if(ofs < w2) { i16_4 x; i16_2 a = src1[ofs]; x.a = (a.a + INITIAL_OFFSET)>>INITIAL_SHIFT; x.c = (a.b + INITIAL_OFFSET)>>INITIAL_SHIFT; i16_2 b = src2[ofs]; x.b = (b.a + INITIAL_OFFSET)>>INITIAL_SHIFT; x.d = (b.b + INITIAL_OFFSET)>>INITIAL_SHIFT; row[ofs] = x; ofs += BSH; } else break; if(ofs < w2) { i16_4 x; i16_2 a = src1[ofs]; x.a = (a.a + INITIAL_OFFSET)>>INITIAL_SHIFT; x.c = (a.b + INITIAL_OFFSET)>>INITIAL_SHIFT; i16_2 b = src2[ofs]; x.b = (b.a + INITIAL_OFFSET)>>INITIAL_SHIFT; x.d = (b.b + INITIAL_OFFSET)>>INITIAL_SHIFT; row[ofs] = x; ofs += BSH; } else break; if(ofs < w2) { i16_4 x; i16_2 a = src1[ofs]; x.a = (a.a + INITIAL_OFFSET)>>INITIAL_SHIFT; x.c = (a.b + INITIAL_OFFSET)>>INITIAL_SHIFT; i16_2 b = src2[ofs]; x.b = (b.a + INITIAL_OFFSET)>>INITIAL_SHIFT; x.d = (b.b + INITIAL_OFFSET)>>INITIAL_SHIFT; row[ofs] = x; ofs += BSH; } else break; } } } #define BROWS (2*BSVY+COPYROWS) /* Rows to process at once */ #define SKIPTOP COPYROWS #define PAD_ROWS (WRITEBACK-SKIPTOP+RRIGHT+COPYROWS) /* Rows below which to use s_transform_v_pad */ /// tid is BCOLSxBROWS matrix /// RLEFT+BROWS+RRIGHT rows #define TOTALROWS (RLEFT+BROWS+RRIGHT) #define OVERLAP (RLEFT+RRIGHT+COPYROWS) #define OVERLAP_OFFSET (TOTALROWS-OVERLAP) #define WRITEBACK (2*BSVY) __device__ void doTransform(int xofs) { const int tidx = (threadIdx.x<<1)+xofs; // column const int tidy = threadIdx.y; // row extern __shared__ DATATYPE shared[]; int ofs; ofs = ((RLEFT+(tidy<<1)+1)<> STAGE2_SHIFT; } __syncthreads(); ofs -= BCOLS; { int acc = STAGE1_OFFSET; acc += -1*shared[ofs-BCOLS]; acc += -1*shared[ofs+BCOLS]; shared[ofs] -= acc >> STAGE1_SHIFT; } } // Process BROWS-2 lines __device__ void doTransformTB(int xofs, unsigned int leftover) { const int tidx = (threadIdx.x<<1)+xofs; // column const int tidy = threadIdx.y; // row const int minn = (RLEFT<> STAGE2_SHIFT; } __syncthreads(); /// Process odd rows ofs += BCOLS; { int acc = STAGE1_OFFSET; acc += -1*shared[ofs-BCOLS]; acc += -1*shared[min(ofs+BCOLS,maxx)]; shared[ofs] -= acc >> STAGE1_SHIFT; } } // Process BROWS-2 lines __device__ void doTransformT(int xofs) { const int tidx = (threadIdx.x<<1)+xofs; // column const int tidy = threadIdx.y; // row const int minn = ((RLEFT+SKIPTOP)<> STAGE2_SHIFT; } __syncthreads(); /// Process odd rows, except for last ofs += BCOLS; if(tidy != (BSVY-1)) { int acc = STAGE1_OFFSET; acc += -1*shared[ofs-BCOLS]; acc += -1*shared[ofs+BCOLS]; shared[ofs] -= acc >> STAGE1_SHIFT; } } // Process leftover __device__ void doTransformB(int xofs, unsigned int leftover) { const int tidx = (threadIdx.x<<1)+xofs; // column const int tidy = threadIdx.y; // row const int maxx = leftover-(2<> STAGE2_SHIFT; } __syncthreads(); for(ofs_t=ofs+0*BCOLS; ofs_t> STAGE1_SHIFT; } } #if 0 // Rolled #define READ_LOOP(rows) for(; sofs < (rows); sofs += (BCOLS*BSVY), gofs += istride) *((uint32_t*)&shared[sofs]) = *((uint32_t*)&data[gofs]); #define WRITE_LOOP(rows) for(; sofs < (rows); sofs += (BCOLS*BSVY), gofs += istride) *((uint32_t*)&data[gofs]) = *((uint32_t*)&shared[sofs]); #endif #if 1 // Unrolled #define READ_LOOP_ENTRY(rows) if(sofs < (rows)) { *((uint32_t*)&shared[sofs]) = *((uint32_t*)&data[gofs]); sofs += (BCOLS*BSVY); gofs += istride; } else break; #define READ_LOOP(rows) while(1) { READ_LOOP_ENTRY(rows); READ_LOOP_ENTRY(rows); } #define WRITE_LOOP_ENTRY(rows) if(sofs < (rows)) { *((uint32_t*)&data[gofs]) = *((uint32_t*)&shared[sofs]); sofs += (BCOLS*BSVY); gofs += istride; } else break; #define WRITE_LOOP(rows) while(1) { WRITE_LOOP_ENTRY(rows); WRITE_LOOP_ENTRY(rows); } #endif #if 0 // Unrolled #define READ_LOOP_ENTRY(rows) if(sofs < (rows)) { *((uint32_t*)&shared[sofs]) = *((uint32_t*)&data[gofs]); sofs += (BCOLS*BSVY); gofs += istride; } #define READ_LOOP(rows) READ_LOOP_ENTRY(rows); READ_LOOP_ENTRY(rows); READ_LOOP_ENTRY(rows); #define WRITE_LOOP_ENTRY(rows) if(sofs < (rows)) { *((uint32_t*)&data[gofs]) = *((uint32_t*)&shared[sofs]); sofs += (BCOLS*BSVY); gofs += istride; } #define WRITE_LOOP(rows) WRITE_LOOP_ENTRY(rows); WRITE_LOOP_ENTRY(rows); WRITE_LOOP_ENTRY(rows); #endif static __global__ void s_transform_v( DATATYPE* data, int width, int height, int stride ) { extern __shared__ DATATYPE shared[]; const unsigned int bid = blockIdx.x; // slab (BCOLS columns) const unsigned int tidx = threadIdx.x<<1; // column const unsigned int tidy = threadIdx.y; // row const unsigned int swidth = min(width-(bid<>>(d_data, lwidth, lheight, stride); else s_transform_v<<>>(d_data, lwidth, lheight, stride); #endif #ifdef HORIZONTAL block_size.x = BSH; block_size.y = 1; block_size.z = 1; grid_size.x = lheight; grid_size.y = 1; grid_size.z = 1; shared_size = (lwidth+BLEFT*2+BRIGHT*2) * sizeof(DATATYPE); s_transform_h<<>>(d_data, lwidth, stride); #endif } schroedinger-1.0.11/schroedinger/cuda/init.cu0000644000175000017500000000173310735554556016076 00000000000000#include "cudainit.h" /* extern void cuda_iwt_5_3_prerun(); extern void cuda_iwt_desl_9_3_prerun(); extern void cuda_iwt_haar_prerun(); extern void cuda_iwt_13_5_prerun(); extern void cuda_iwt_daub_9_7_prerun(); extern void cuda_iwt_fidelity_prerun(); extern void cuda_iiwt_5_3_prerun(); extern void cuda_iiwt_desl_9_3_prerun(); extern void cuda_iiwt_haar_prerun(); extern void cuda_iiwt_13_5_prerun(); extern void cuda_iiwt_daub_9_7_prerun(); extern void cuda_iiwt_fidelity_prerun(); */ extern "C" { void cudawl_init() { /* /// Prerun all kernels cuda_iwt_5_3_prerun(); cuda_iwt_desl_9_3_prerun(); cuda_iwt_haar_prerun(); cuda_iwt_13_5_prerun(); cuda_iwt_daub_9_7_prerun(); cuda_iwt_fidelity_prerun(); cuda_iiwt_5_3_prerun(); cuda_iiwt_desl_9_3_prerun(); cuda_iiwt_haar_prerun(); cuda_iiwt_13_5_prerun(); cuda_iiwt_daub_9_7_prerun(); cuda_iiwt_fidelity_prerun(); */ } void cudawl_exit() { /// Free temporary storage etc } }; schroedinger-1.0.11/schroedinger/cuda/iwt9_7.cu0000644000175000017500000004444310737003215016241 00000000000000 // Autogenerated by WaveGen.py, do not edit! // #include #include #include "common.h" #include "wavelet_common.h" /// Boundaries (depends on wavelet) /// This much is reserved at the sides of the signal /// Must be even! #define BLEFT 2 #define BRIGHT 2 /// Initial shift (to keep precision in integer wavelets) #define INITIAL_SHIFT 1 #define INITIAL_OFFSET 1 #define STAGE1_OFFSET 2047 #define STAGE1_SHIFT 12 #define STAGE1_COEFF (-6497) #define STAGE2_OFFSET 2047 #define STAGE2_SHIFT 12 #define STAGE2_COEFF (-217) #define STAGE3_OFFSET 2048 #define STAGE3_SHIFT 12 #define STAGE3_COEFF (3616) #define STAGE4_OFFSET 2048 #define STAGE4_SHIFT 12 #define STAGE4_COEFF (1817) /// Vertical pass row management #define RLEFT 1 #define RRIGHT 1 #define COPYROWS 2 static __global__ void a_transform_h( DATATYPE* data, int width, int stride ) { extern __shared__ DATATYPE shared[]; const int bid = blockIdx.x; // row const int tid = threadIdx.x; // thread id within row const int tidu16 = ((tid&16)>>4)|((tid&15)<<1)|(tid&~31); data += __mul24(bid, stride); // Load entire line into shared memory // Deinterleave right here int half = BLEFT+(width>>1)+BRIGHT; unsigned int ofs; // Shared memory output offset for this thread i16_2 *row = (i16_2*)data; for(ofs = tid; ofs < (width>>1); ofs += BSH) { i16_2 val = row[ofs]; shared[BLEFT + ofs] = val.a << INITIAL_SHIFT; // even shared[BLEFT + ofs + half] = val.b << INITIAL_SHIFT; // odd } __syncthreads(); // hi[n] = hi[n-1] shared[BLEFT+(width>>1)] = shared[BLEFT+(width>>1)-1]; __syncthreads(); // Now apply wavelet lifting to entire line at once // Process odd const int end = BLEFT+(width>>1); for(ofs = BLEFT+tidu16; ofs < end; ofs += BSH) { int acc = STAGE1_OFFSET; acc += __mul24(STAGE1_COEFF, shared[ofs+0]); acc += __mul24(STAGE1_COEFF, shared[ofs+1]); shared[ofs + half] += acc >> STAGE1_SHIFT; } // lo[-1] = hi[0] if(tidu16 == 0) { shared[half+BLEFT-1] = shared[half+BLEFT]; } __syncthreads(); // Process even for(ofs = BLEFT+tidu16; ofs < end; ofs += BSH) { int acc = STAGE2_OFFSET; acc += __mul24(STAGE2_COEFF,shared[half+ofs-1]); acc += __mul24(STAGE2_COEFF,shared[half+ofs+0]); shared[ofs] += acc >> STAGE2_SHIFT; } // hi[n] = hi[n-1] if(ofs == (end-1+BSH)) { shared[BLEFT+(width>>1)] = shared[BLEFT+(width>>1)-1]; } __syncthreads(); for(ofs = BLEFT+tidu16; ofs < end; ofs += BSH) { int acc = STAGE3_OFFSET; acc += __mul24(STAGE3_COEFF, shared[ofs+0]); acc += __mul24(STAGE3_COEFF, shared[ofs+1]); shared[ofs + half] += acc >> STAGE3_SHIFT; } // lo[-1] = hi[0] if(tidu16 == 0) { shared[half+BLEFT-1] = shared[half+BLEFT]; } __syncthreads(); // Process even for(ofs = BLEFT+tidu16; ofs < end; ofs += BSH) { int acc = STAGE4_OFFSET; acc += __mul24(STAGE4_COEFF,shared[half+ofs-1]); acc += __mul24(STAGE4_COEFF,shared[half+ofs+0]); shared[ofs] += acc >> STAGE4_SHIFT; } __syncthreads(); /// Write line back to global memory, don't interleave again /// Mind the gap between BLEFT+width/2 and half if(width&3) // If width is not a multiple of 4, we need to use the slower method { /// Left part (even coefficients) for(ofs = tid; ofs < (width>>1); ofs += BSH) data[ofs] = shared[BLEFT+ofs]; /// Right part (odd coefficients) for(ofs = tid; ofs < (width>>1); ofs += BSH) data[(width>>1)+ofs] = shared[half+BLEFT+ofs]; } else { /// Left part (even coefficients) for(ofs = tid; ofs < (width>>2); ofs += BSH) row[ofs] = *((i16_2*)&shared[BLEFT+(ofs<<1)]); row += (width>>2); /// Right part (odd coefficients) for(ofs = tid; ofs < (width>>2); ofs += BSH) row[ofs] = *((i16_2*)&shared[half+BLEFT+(ofs<<1)]); } } #define BROWS (2*BSVY+COPYROWS) /* Rows to process at once */ #define SKIPTOP COPYROWS #define PAD_ROWS (WRITEBACK-SKIPTOP+RRIGHT+COPYROWS) /* Rows below which to use s_transform_v_pad */ /// tid is BCOLSxBROWS matrix /// RLEFT+BROWS+RRIGHT rows #define TOTALROWS (RLEFT+BROWS+RRIGHT) #define OVERLAP (RLEFT+RRIGHT+COPYROWS) #define OVERLAP_OFFSET (TOTALROWS-OVERLAP) #define WRITEBACK (2*BSVY) __device__ void doTransform(int xofs) { const int tidx = (threadIdx.x<<1)+xofs; // column const int tidy = threadIdx.y; // row extern __shared__ DATATYPE shared[]; int ofs; ofs = ((RLEFT+(tidy<<1)+3)<> STAGE1_SHIFT; } __syncthreads(); /* Phase 2 at +2*BCOLS */ ofs -= BCOLS; { int acc = STAGE2_OFFSET; acc += __mul24(STAGE2_COEFF,shared[ofs-BCOLS]); acc += __mul24(STAGE2_COEFF,shared[ofs+BCOLS]); shared[ofs] += acc >> STAGE2_SHIFT; } __syncthreads(); /* Phase 3 at +1*BCOLS */ ofs -= BCOLS; { int acc = STAGE3_OFFSET; acc += __mul24(STAGE3_COEFF,shared[ofs-BCOLS]); acc += __mul24(STAGE3_COEFF,shared[ofs+BCOLS]); shared[ofs] += acc >> STAGE3_SHIFT; } __syncthreads(); /* Phase 4 at +0*BCOLS */ ofs -= BCOLS; { int acc = STAGE4_OFFSET; acc += __mul24(STAGE4_COEFF,shared[ofs-BCOLS]); acc += __mul24(STAGE4_COEFF,shared[ofs+BCOLS]); shared[ofs] += acc >> STAGE4_SHIFT; } } // Process BROWS-2 lines __device__ void doTransformTB(int xofs, unsigned int leftover) { const int tidx = (threadIdx.x<<1)+xofs; // column const int tidy = threadIdx.y; // row const int minn = (RLEFT<> STAGE1_SHIFT; } __syncthreads(); /* Phase 2 (even) */ ofs -= BCOLS; { int acc = STAGE2_OFFSET; acc += __mul24(STAGE2_COEFF,shared[max(ofs-BCOLS, minn+BCOLS)]); acc += __mul24(STAGE2_COEFF,shared[ofs+BCOLS]); shared[ofs] += acc >> STAGE2_SHIFT; } __syncthreads(); /* Phase 3 (odd) */ ofs += BCOLS; { int acc = STAGE3_OFFSET; acc += __mul24(STAGE3_COEFF, shared[ofs-BCOLS]); acc += __mul24(STAGE3_COEFF, shared[min(ofs+BCOLS,maxx)]); shared[ofs] += acc >> STAGE3_SHIFT; } __syncthreads(); /* Phase 4 (even) */ ofs -= BCOLS; { int acc = STAGE4_OFFSET; acc += __mul24(STAGE4_COEFF,shared[max(ofs-BCOLS, minn+BCOLS)]); acc += __mul24(STAGE4_COEFF,shared[ofs+BCOLS]); shared[ofs] += acc >> STAGE4_SHIFT; } } // Process BROWS-2 lines __device__ void doTransformT(int xofs) { const int tidx = (threadIdx.x<<1)+xofs; // column const int tidy = threadIdx.y; // row const int minn = ((RLEFT+SKIPTOP)<> STAGE1_SHIFT; } __syncthreads(); /* Phase 2 (even), offset +0, stop at -1 */ ofs -= BCOLS; { int acc = STAGE2_OFFSET; acc += __mul24(STAGE2_COEFF,shared[max(ofs-BCOLS, minn+BCOLS)]); acc += __mul24(STAGE2_COEFF,shared[ofs+BCOLS]); shared[ofs] += acc >> STAGE2_SHIFT; } __syncthreads(); /* Phase 3 (odd), offset +1, stop at -2 */ ofs += BCOLS; if(tidy != (BSVY-1)) { int acc = STAGE3_OFFSET; acc += __mul24(STAGE3_COEFF, shared[ofs-BCOLS]); acc += __mul24(STAGE3_COEFF, shared[ofs+BCOLS]); shared[ofs] += acc >> STAGE3_SHIFT; } __syncthreads(); /* Phase 4 (even), offset +0, stop at -3 */ ofs -= BCOLS; if(tidy != (BSVY-1)) { int acc = STAGE4_OFFSET; acc += __mul24(STAGE4_COEFF,shared[max(ofs-BCOLS, minn+BCOLS)]); acc += __mul24(STAGE4_COEFF,shared[ofs+BCOLS]); shared[ofs] += acc >> STAGE4_SHIFT; } } // Finish off leftover __device__ void doTransformB(int xofs, unsigned int leftover) { const int tidx = (threadIdx.x<<1)+xofs; // column const int tidy = threadIdx.y; // row //const unsigned int minn = RLEFT*BCOLS + threadIdx.x; const int maxx = leftover-(2<> STAGE1_SHIFT; } __syncthreads(); for(ofs_t=ofs+2*BCOLS; ofs_t> STAGE2_SHIFT; } __syncthreads(); for(ofs_t=ofs+1*BCOLS; ofs_t> STAGE3_SHIFT; } __syncthreads(); for(ofs_t=ofs+0*BCOLS; ofs_t> STAGE4_SHIFT; } } static __global__ void a_transform_v( DATATYPE* data, int width, int height, int stride ) { extern __shared__ DATATYPE shared[]; const unsigned int bid = blockIdx.x; // slab (BCOLS columns) const unsigned int tidx = threadIdx.x<<1; // column const unsigned int tidy = threadIdx.y; // row const unsigned int swidth = min(width-(bid<>>(d_data, lwidth, stride); #endif #ifdef VERTICAL block_size.x = BSVX; block_size.y = BSVY; block_size.z = 1; grid_size.x = (lwidth+BCOLS-1)/BCOLS; grid_size.y = 1; grid_size.z = 1; shared_size = BCOLS*(BROWS+RLEFT+RRIGHT)*2; if(lheight < PAD_ROWS) a_transform_v_pad<<>>(d_data, lwidth, lheight, stride); else a_transform_v<<>>(d_data, lwidth, lheight, stride); #endif } schroedinger-1.0.11/schroedinger/cuda/iwt9_3.cu0000644000175000017500000003664410737003215016241 00000000000000 // Autogenerated by WaveGen.py, do not edit! // #include #include #include "common.h" #include "wavelet_common.h" /// This much is reserved at the sides of the signal #define BLEFT 2 #define BRIGHT 2 /// Initial shift (to keep precision in integer wavelets) #define INITIAL_OFFSET 1 #define INITIAL_SHIFT 1 #define STAGE1_OFFSET 7 #define STAGE1_SHIFT 4 #define STAGE2_OFFSET 2 #define STAGE2_SHIFT 2 /// Vertical pass row management #define RLEFT 3 #define RRIGHT 3 #define COPYROWS 2 static __global__ void a_transform_h( DATATYPE* data, int width, int stride ) { extern __shared__ DATATYPE shared[]; const int bid = blockIdx.x; // row const int tid = threadIdx.x; // thread id within row const int tidu16 = ((tid&16)>>4)|((tid&15)<<1)|(tid&~31); data += __mul24(bid, stride); // Load entire line into shared memory // Deinterleave right here int half = BLEFT+(width>>1)+BRIGHT; unsigned int ofs; // Shared memory output offset for this thread i16_2 *row = (i16_2*)data; for(ofs = tid; ofs < (width>>1); ofs += BSH) { i16_2 val = row[ofs]; shared[BLEFT + ofs] = val.a << INITIAL_SHIFT; // even shared[BLEFT + ofs + half] = val.b << INITIAL_SHIFT; // odd } __syncthreads(); if(tidu16==0) { shared[BLEFT-1] = shared[BLEFT]; shared[BLEFT+(width>>1)] = shared[BLEFT+(width>>1)-1]; shared[BLEFT+(width>>1)+1] = shared[BLEFT+(width>>1)-1]; } __syncthreads(); // Now apply wavelet lifting to entire line at once // Process odd const int end = BLEFT+(width>>1); for(ofs = BLEFT+tidu16; ofs < end; ofs += BSH) { /// Accumulate value int acc = STAGE1_OFFSET; acc += 1*shared[ofs-1]; acc += __mul24(-9, shared[ofs+0]); acc += __mul24(-9, shared[ofs+1]); acc += 1*shared[ofs+2]; shared[ofs + half] += acc >> STAGE1_SHIFT; } //__syncthreads(); // Duplicate boundary // lo[-1] = lo[0] // Do this in the thread that wrote shared[half+BLEFT] if(tidu16 == 0) { shared[half+BLEFT-1] = shared[half+BLEFT]; } __syncthreads(); // Process even for(ofs = BLEFT+tidu16; ofs < end; ofs += BSH) { /// Accumulate value int acc = STAGE2_OFFSET; acc += 1*shared[half+ofs-1]; acc += 1*shared[half+ofs+0]; shared[ofs] += acc >> STAGE2_SHIFT; } __syncthreads(); /// Write line back to global memory, don't interleave again /// Mind the gap between BLEFT+width/2 and half if(width&3) // If width is not a multiple of 4, we need to use the slower method { /// Left part (even coefficients) for(ofs = tid; ofs < (width>>1); ofs += BSH) data[ofs] = shared[BLEFT+ofs]; /// Right part (odd coefficients) for(ofs = tid; ofs < (width>>1); ofs += BSH) data[(width>>1)+ofs] = shared[half+BLEFT+ofs]; } else { /// Left part (even coefficients) for(ofs = tid; ofs < (width>>2); ofs += BSH) row[ofs] = *((i16_2*)&shared[BLEFT+(ofs<<1)]); row += (width>>2); /// Right part (odd coefficients) for(ofs = tid; ofs < (width>>2); ofs += BSH) row[ofs] = *((i16_2*)&shared[half+BLEFT+(ofs<<1)]); } } #define BROWS (2*BSVY+COPYROWS) /* Rows to process at once */ #define SKIPTOP COPYROWS #define PAD_ROWS (WRITEBACK-SKIPTOP+RRIGHT+COPYROWS) /* Rows below which to use s_transform_v_pad */ /// tid is BCOLSxBROWS matrix /// RLEFT+BROWS+RRIGHT rows #define TOTALROWS (RLEFT+BROWS+RRIGHT) #define OVERLAP (RLEFT+RRIGHT+COPYROWS) #define OVERLAP_OFFSET (TOTALROWS-OVERLAP) #define WRITEBACK (2*BSVY) __device__ void doTransform(int xofs) { const int tidx = (threadIdx.x<<1)+xofs; // column const int tidy = threadIdx.y; // row extern __shared__ DATATYPE shared[]; int ofs; //ofs = ((RLEFT+(tidy<<1)+1)<> STAGE1_SHIFT; } __syncthreads(); ofs -= BCOLS*3; { int acc = STAGE2_OFFSET; acc += shared[ofs-BCOLS]; acc += shared[ofs+BCOLS]; shared[ofs] += acc >> STAGE2_SHIFT; } } // Process BROWS-2 lines __device__ void doTransformTB(int xofs, unsigned int leftover) { const int tidx = (threadIdx.x<<1)+xofs; // column const int tidy = threadIdx.y; // row const int minn = (RLEFT<> STAGE1_SHIFT; } __syncthreads(); /// Process even rows ofs -= BCOLS; { /// Accumulate value int acc = STAGE2_OFFSET; acc += shared[max(ofs-BCOLS, minn+BCOLS)]; acc += shared[ofs+BCOLS]; shared[ofs] += acc >> STAGE2_SHIFT; } } // Process BROWS-2 lines __device__ void doTransformT(int xofs) { const int tidx = (threadIdx.x<<1)+xofs; // column const int tidy = threadIdx.y; // row const int minn = ((RLEFT+SKIPTOP)<> STAGE1_SHIFT; } __syncthreads(); /// Process even rows, except for last ofs -= BCOLS; if(tidy != (BSVY-1)) { /// Accumulate value int acc = STAGE2_OFFSET; acc += shared[max(ofs-BCOLS, minn+BCOLS)]; acc += shared[ofs+BCOLS]; shared[ofs] += acc >> STAGE2_SHIFT; } } // Process leftover __device__ void doTransformB(int xofs, unsigned int leftover) { const int tidx = (threadIdx.x<<1)+xofs; // column const int tidy = threadIdx.y; // row const int maxx = leftover-(2<> STAGE1_SHIFT; } __syncthreads(); for(ofs_t=ofs; ofs_t> STAGE2_SHIFT; } } static __global__ void a_transform_v( DATATYPE* data, int width, int height, int stride ) { extern __shared__ DATATYPE shared[]; const unsigned int bid = blockIdx.x; // slab (BCOLS columns) const unsigned int tidx = threadIdx.x<<1; // column const unsigned int tidy = threadIdx.y; // row const unsigned int swidth = min(width-(bid<>>(d_data, lwidth, stride); #endif #ifdef VERTICAL block_size.x = BSVX; block_size.y = BSVY; block_size.z = 1; grid_size.x = (lwidth+BCOLS-1)/BCOLS; grid_size.y = 1; grid_size.z = 1; shared_size = BCOLS*(BROWS+RLEFT+RRIGHT)*2; if(lheight < PAD_ROWS) a_transform_v_pad<<>>(d_data, lwidth, lheight, stride); else a_transform_v<<>>(d_data, lwidth, lheight, stride); #endif } schroedinger-1.0.11/schroedinger/cuda/iwt13_5.cu0000644000175000017500000004016610737003215016310 00000000000000 // Autogenerated by WaveGen.py, do not edit! // #include #include #include "common.h" #include "wavelet_common.h" /// Boundaries (depends on wavelet) /// This much is reserved at the sides of the signal /// Must be even! #define BLEFT 2 #define BRIGHT 2 /// Initial shift (to keep precision in integer wavelets) #define INITIAL_SHIFT 1 #define INITIAL_OFFSET 1 #define STAGE1_OFFSET 7 #define STAGE1_SHIFT 4 #define STAGE2_OFFSET 16 #define STAGE2_SHIFT 5 /// Vertical pass row management #define RLEFT 3 #define RRIGHT 3 #define COPYROWS 2 static __global__ void a_transform_h( DATATYPE* data, int width, int stride ) { extern __shared__ DATATYPE shared[]; const int bid = blockIdx.x; // row const int tid = threadIdx.x; // thread id within row const int tidu16 = ((tid&16)>>4)|((tid&15)<<1)|(tid&~31); data += __mul24(bid, stride); // Load entire line into shared memory // Deinterleave right here int half = BLEFT+(width>>1)+BRIGHT; unsigned int ofs; // Shared memory output offset for this thread i16_2 *row = (i16_2*)data; for(ofs = tid; ofs < (width>>1); ofs += BSH) { i16_2 val = row[ofs]; shared[BLEFT + ofs] = val.a << INITIAL_SHIFT; // even shared[BLEFT + ofs + half] = val.b << INITIAL_SHIFT; // odd } __syncthreads(); if(tidu16==0) { shared[BLEFT-1] = shared[BLEFT]; shared[BLEFT+(width>>1)] = shared[BLEFT+(width>>1)-1]; shared[BLEFT+(width>>1)+1] = shared[BLEFT+(width>>1)-1]; } __syncthreads(); // Now apply wavelet lifting to entire line at once // Process odd const int end = BLEFT+(width>>1); for(ofs = BLEFT+tidu16; ofs < end; ofs += BSH) { /// Accumulate value int acc = STAGE1_OFFSET; acc += 1*shared[ofs-1]; acc += __mul24(-9, shared[ofs+0]); acc += __mul24(-9, shared[ofs+1]); acc += 1*shared[ofs+2]; shared[ofs + half] += acc >> STAGE1_SHIFT; } __syncthreads(); // Duplicate boundary // Do this in the thread that wrote shared[half+BLEFT] if(tidu16 == 0) { shared[half+BLEFT-2] = shared[half+BLEFT]; shared[half+BLEFT-1] = shared[half+BLEFT]; shared[half+BLEFT+(width>>1)] = shared[half+BLEFT+(width>>1)-1]; } __syncthreads(); // Process even for(ofs = BLEFT+tidu16; ofs < end; ofs += BSH) { /// Accumulate value int acc = STAGE2_OFFSET; acc += -1*shared[half+ofs-2]; acc += __mul24(9,shared[half+ofs-1]); acc += __mul24(9,shared[half+ofs+0]); acc += -1*shared[half+ofs+1]; shared[ofs] += acc >> STAGE2_SHIFT; } __syncthreads(); /// Write line back to global memory, don't interleave again /// Mind the gap between BLEFT+width/2 and half if(width&3) // If width is not a multiple of 4, we need to use the slower method { /// Left part (even coefficients) for(ofs = tid; ofs < (width>>1); ofs += BSH) data[ofs] = shared[BLEFT+ofs]; /// Right part (odd coefficients) for(ofs = tid; ofs < (width>>1); ofs += BSH) data[(width>>1)+ofs] = shared[half+BLEFT+ofs]; } else { /// Left part (even coefficients) for(ofs = tid; ofs < (width>>2); ofs += BSH) row[ofs] = *((i16_2*)&shared[BLEFT+(ofs<<1)]); row += (width>>2); /// Right part (odd coefficients) for(ofs = tid; ofs < (width>>2); ofs += BSH) row[ofs] = *((i16_2*)&shared[half+BLEFT+(ofs<<1)]); } } #define BROWS (2*BSVY+COPYROWS) /* Rows to process at once */ #define SKIPTOP COPYROWS #define PAD_ROWS (WRITEBACK-SKIPTOP+RRIGHT+COPYROWS) /* Rows below which to use s_transform_v_pad */ /// tid is BCOLSxBROWS matrix /// RLEFT+BROWS+RRIGHT rows #define TOTALROWS (RLEFT+BROWS+RRIGHT) #define OVERLAP (RLEFT+RRIGHT+COPYROWS) #define OVERLAP_OFFSET (TOTALROWS-OVERLAP) #define WRITEBACK (2*BSVY) __device__ void doTransform(int xofs) { const int tidx = (threadIdx.x<<1)+xofs; // column const int tidy = threadIdx.y; // row extern __shared__ DATATYPE shared[]; int ofs; //ofs = ((RLEFT+(tidy<<1)+1)<> STAGE1_SHIFT; } __syncthreads(); ofs -= BCOLS*3; { int acc = STAGE2_OFFSET; acc += -1*shared[ofs-3*BCOLS]; acc += __mul24(9,shared[ofs-BCOLS]); acc += __mul24(9,shared[ofs+BCOLS]); acc += -1*shared[ofs+3*BCOLS]; shared[ofs] += acc >> STAGE2_SHIFT; } } // Process BROWS-2 lines __device__ void doTransformTB(int xofs, unsigned int leftover) { const int tidx = (threadIdx.x<<1)+xofs; // column const int tidy = threadIdx.y; // row const int minn = (RLEFT<> STAGE1_SHIFT; } __syncthreads(); /// Process even rows ofs -= BCOLS; { /// Accumulate value int acc = STAGE2_OFFSET; acc += -1*shared[max(ofs-3*BCOLS, minn+BCOLS)]; acc += __mul24(9,shared[max(ofs-BCOLS, minn+BCOLS)]); acc += __mul24(9,shared[ofs+BCOLS]); acc += -1*shared[min(ofs+3*BCOLS, maxx+BCOLS)]; shared[ofs] += acc >> STAGE2_SHIFT; } } // Process BROWS-2 lines __device__ void doTransformT(int xofs) { const int tidx = (threadIdx.x<<1)+xofs; // column const int tidy = threadIdx.y; // row const int minn = ((RLEFT+SKIPTOP)<> STAGE1_SHIFT; } __syncthreads(); /// Process even rows, except for last ofs -= BCOLS; if(tidy != (BSVY-1)) { /// Accumulate value int acc = STAGE2_OFFSET; acc += -1*shared[max(ofs-3*BCOLS, minn+BCOLS)]; acc += __mul24(9,shared[max(ofs-BCOLS, minn+BCOLS)]); acc += __mul24(9,shared[ofs+BCOLS]); acc += -1*shared[ofs+3*BCOLS]; shared[ofs] += acc >> STAGE2_SHIFT; } } // Process leftover __device__ void doTransformB(int xofs, unsigned int leftover) { const int tidx = (threadIdx.x<<1)+xofs; // column const int tidy = threadIdx.y; // row const int maxx = leftover-(2<> STAGE1_SHIFT; } __syncthreads(); for(ofs_t=ofs; ofs_t> STAGE2_SHIFT; } } static __global__ void a_transform_v( DATATYPE* data, int width, int height, int stride ) { extern __shared__ DATATYPE shared[]; const unsigned int bid = blockIdx.x; // slab (BCOLS columns) const unsigned int tidx = threadIdx.x<<1; // column const unsigned int tidy = threadIdx.y; // row const unsigned int swidth = min(width-(bid<>>(d_data, lwidth, stride); #endif #ifdef VERTICAL block_size.x = BSVX; block_size.y = BSVY; block_size.z = 1; grid_size.x = (lwidth+BCOLS-1)/BCOLS; grid_size.y = 1; grid_size.z = 1; shared_size = BCOLS*(BROWS+RLEFT+RRIGHT)*2; if(lheight < PAD_ROWS) a_transform_v_pad<<>>(d_data, lwidth, lheight, stride); else a_transform_v<<>>(d_data, lwidth, lheight, stride); #endif } schroedinger-1.0.11/schroedinger/cuda/iiwt9_3.cu0000644000175000017500000004661010737003215016404 00000000000000 // Autogenerated by WaveGen.py, do not edit! // #include #include #include "common.h" #include "wavelet_common.h" /// This much is reserved at the sides of the signal #define BLEFT 2 #define BRIGHT 2 /// Initial shift (to keep precision in integer wavelets) #define INITIAL_OFFSET 1 #define INITIAL_SHIFT 1 #define STAGE1_OFFSET 7 #define STAGE1_SHIFT 4 #define STAGE2_OFFSET 2 #define STAGE2_SHIFT 2 /// Vertical pass row management #define RLEFT 3 #define RRIGHT 0 #define COPYROWS 3 static __global__ void s_transform_h( DATATYPE* data, int width, int stride ) { extern __shared__ DATATYPE shared[]; const int bid = blockIdx.x; // row const int tid = threadIdx.x; // thread id within row const int tidu16 = ((tid&16)>>4)|((tid&15)<<1)|(tid&~31); data += __mul24(bid, stride); int half = BLEFT+(width>>1)+BRIGHT; int ofs; if(width&3) // If width is not a multiple of 4, we need to use the slower method { /// Left part (even coefficients) /// Right part (odd coefficients) int w2 = (width>>1); uint16_t *row = (uint16_t*)data; uint16_t *row2 = (uint16_t*)&data[w2]; uint16_t *dest1 = (uint16_t*)&shared[BLEFT]; uint16_t *dest2 = (uint16_t*)&shared[half+BLEFT]; ofs = tid; while(true) { if(ofs>2); uint32_t *row = (uint32_t*)data; uint32_t *row2 = (uint32_t*)&data[width>>1]; uint32_t *dest1 = (uint32_t*)&shared[BLEFT]; uint32_t *dest2 = (uint32_t*)&shared[half+BLEFT]; /// Left part (even coefficients) ofs = tid; while(true) { if(ofs>1); // Now apply wavelet lifting to entire line at once // Process even for(ofs = BLEFT+tidu16; ofs < end; ofs += BSH) { /// Accumulate value int acc = STAGE2_OFFSET; acc += 1*shared[half+ofs-1]; acc += 1*shared[half+ofs+0]; shared[ofs] -= acc >> STAGE2_SHIFT; } __syncthreads(); if(tidu16==0) { // hi[-1] = hi[0] shared[BLEFT-1] = shared[BLEFT]; // hi[n] = hi[n-1] // hi[n+1] = hi[n-1] shared[BLEFT+(width>>1)] = shared[BLEFT+(width>>1)-1]; shared[BLEFT+(width>>1)+1] = shared[BLEFT+(width>>1)-1]; } __syncthreads(); // Process odd for(ofs = BLEFT+tidu16; ofs < end; ofs += BSH) { /// Accumulate value int acc = STAGE1_OFFSET; acc += 1*shared[ofs-1]; acc += __mul24(-9, shared[ofs+0]); acc += __mul24(-9, shared[ofs+1]); acc += 1*shared[ofs+2]; shared[ofs + half] -= acc >> STAGE1_SHIFT; } __syncthreads(); if(width&3) { uint32_t *row = (uint32_t*)data; int16_t *src1 = (int16_t*)&shared[BLEFT]; int16_t *src2 = (int16_t*)&shared[half+BLEFT]; int w2 = (width>>1); ofs = tid; while(true) { if(ofs>INITIAL_SHIFT; int b = (src2[ofs] + INITIAL_OFFSET)>>INITIAL_SHIFT; row[ofs] = (a&0xFFFF)|((b&0xFFFF)<<16); ofs += BSH; } else break; if(ofs>INITIAL_SHIFT; int b = (src2[ofs] + INITIAL_OFFSET)>>INITIAL_SHIFT; row[ofs] = (a&0xFFFF)|((b&0xFFFF)<<16); ofs += BSH; } else break; if(ofs>INITIAL_SHIFT; int b = (src2[ofs] + INITIAL_OFFSET)>>INITIAL_SHIFT; row[ofs] = (a&0xFFFF)|((b&0xFFFF)<<16); ofs += BSH; } else break; } } else { i16_4 *row = (i16_4*)data; i16_2 *src1 = (i16_2*)&shared[BLEFT]; i16_2 *src2 = (i16_2*)&shared[half+BLEFT]; int w2 = (width>>2); ofs = tid; while(true) { if(ofs < w2) { i16_4 x; i16_2 a = src1[ofs]; x.a = (a.a + INITIAL_OFFSET)>>INITIAL_SHIFT; x.c = (a.b + INITIAL_OFFSET)>>INITIAL_SHIFT; i16_2 b = src2[ofs]; x.b = (b.a + INITIAL_OFFSET)>>INITIAL_SHIFT; x.d = (b.b + INITIAL_OFFSET)>>INITIAL_SHIFT; row[ofs] = x; ofs += BSH; } else break; if(ofs < w2) { i16_4 x; i16_2 a = src1[ofs]; x.a = (a.a + INITIAL_OFFSET)>>INITIAL_SHIFT; x.c = (a.b + INITIAL_OFFSET)>>INITIAL_SHIFT; i16_2 b = src2[ofs]; x.b = (b.a + INITIAL_OFFSET)>>INITIAL_SHIFT; x.d = (b.b + INITIAL_OFFSET)>>INITIAL_SHIFT; row[ofs] = x; ofs += BSH; } else break; if(ofs < w2) { i16_4 x; i16_2 a = src1[ofs]; x.a = (a.a + INITIAL_OFFSET)>>INITIAL_SHIFT; x.c = (a.b + INITIAL_OFFSET)>>INITIAL_SHIFT; i16_2 b = src2[ofs]; x.b = (b.a + INITIAL_OFFSET)>>INITIAL_SHIFT; x.d = (b.b + INITIAL_OFFSET)>>INITIAL_SHIFT; row[ofs] = x; ofs += BSH; } else break; } } } #define BROWS (2*BSVY+COPYROWS) /* Rows to process at once */ #define SKIPTOP COPYROWS #define PAD_ROWS (WRITEBACK-SKIPTOP+RRIGHT+COPYROWS) /* Rows below which to use s_transform_v_pad */ /// tid is BCOLSxBROWS matrix /// RLEFT+BROWS+RRIGHT rows #define TOTALROWS (RLEFT+BROWS+RRIGHT) #define OVERLAP (RLEFT+RRIGHT+COPYROWS) #define OVERLAP_OFFSET (TOTALROWS-OVERLAP) #define WRITEBACK (2*BSVY) __device__ void doTransform(int xofs) { const int tidx = (threadIdx.x<<1)+xofs; // column const int tidy = threadIdx.y; // row extern __shared__ DATATYPE shared[]; int ofs; ofs = ((RLEFT+(tidy<<1)+3)<> STAGE2_SHIFT; } __syncthreads(); ofs -= BCOLS*3; { int acc = STAGE1_OFFSET; acc += 1*shared[ofs-3*BCOLS]; acc += __mul24(-9, shared[ofs-BCOLS]); acc += __mul24(-9, shared[ofs+BCOLS]); acc += 1*shared[ofs+3*BCOLS]; shared[ofs] -= acc >> STAGE1_SHIFT; } } // Process BROWS-2 lines __device__ void doTransformTB(int xofs, unsigned int leftover) { const int tidx = (threadIdx.x<<1)+xofs; // column const int tidy = threadIdx.y; // row const int minn = (RLEFT<> STAGE2_SHIFT; } __syncthreads(); /// Process odd rows ofs += BCOLS; { int acc = STAGE1_OFFSET; acc += 1*shared[max(ofs-3*BCOLS,minn)]; acc += __mul24(-9, shared[ofs-BCOLS]); acc += __mul24(-9, shared[min(ofs+BCOLS,maxx)]); acc += 1*shared[min(ofs+3*BCOLS,maxx)]; shared[ofs] -= acc >> STAGE1_SHIFT; } } __device__ void doTransformT(int xofs) { const int tidx = (threadIdx.x<<1)+xofs; // column const int tidy = threadIdx.y; // row const int minn = ((RLEFT+SKIPTOP)<> STAGE2_SHIFT; } __syncthreads(); /// Process odd rows, except for last two ofs += BCOLS; if(tidy < (BSVY-2)) { int acc = STAGE1_OFFSET; acc += 1*shared[max(ofs-3*BCOLS,minn)]; acc += __mul24(-9, shared[ofs-BCOLS]); acc += __mul24(-9, shared[ofs+BCOLS]); acc += 1*shared[ofs+3*BCOLS]; shared[ofs] -= acc >> STAGE1_SHIFT; } } // Process leftover __device__ void doTransformB(int xofs, unsigned int leftover) { const int tidx = (threadIdx.x<<1)+xofs; // column const int tidy = threadIdx.y; // row const int maxx = leftover-(2<> STAGE2_SHIFT; } __syncthreads(); for(ofs_t=ofs; ofs_t> STAGE1_SHIFT; } } #if 0 // Rolled #define READ_LOOP(rows) for(; sofs < (rows); sofs += (BCOLS*BSVY), gofs += istride) *((uint32_t*)&shared[sofs]) = *((uint32_t*)&data[gofs]); #define WRITE_LOOP(rows) for(; sofs < (rows); sofs += (BCOLS*BSVY), gofs += istride) *((uint32_t*)&data[gofs]) = *((uint32_t*)&shared[sofs]); #endif #if 1 // Unrolled #define READ_LOOP_ENTRY(rows) if(sofs < (rows)) { *((uint32_t*)&shared[sofs]) = *((uint32_t*)&data[gofs]); sofs += (BCOLS*BSVY); gofs += istride; } else break; #define READ_LOOP(rows) while(1) { READ_LOOP_ENTRY(rows); READ_LOOP_ENTRY(rows); } #define WRITE_LOOP_ENTRY(rows) if(sofs < (rows)) { *((uint32_t*)&data[gofs]) = *((uint32_t*)&shared[sofs]); sofs += (BCOLS*BSVY); gofs += istride; } else break; #define WRITE_LOOP(rows) while(1) { WRITE_LOOP_ENTRY(rows); WRITE_LOOP_ENTRY(rows); } #endif #if 0 // Unrolled #define READ_LOOP_ENTRY(rows) if(sofs < (rows)) { *((uint32_t*)&shared[sofs]) = *((uint32_t*)&data[gofs]); sofs += (BCOLS*BSVY); gofs += istride; } #define READ_LOOP(rows) READ_LOOP_ENTRY(rows); READ_LOOP_ENTRY(rows); READ_LOOP_ENTRY(rows); #define WRITE_LOOP_ENTRY(rows) if(sofs < (rows)) { *((uint32_t*)&data[gofs]) = *((uint32_t*)&shared[sofs]); sofs += (BCOLS*BSVY); gofs += istride; } #define WRITE_LOOP(rows) WRITE_LOOP_ENTRY(rows); WRITE_LOOP_ENTRY(rows); WRITE_LOOP_ENTRY(rows); #endif static __global__ void s_transform_v( DATATYPE* data, int width, int height, int stride ) { extern __shared__ DATATYPE shared[]; const unsigned int bid = blockIdx.x; // slab (BCOLS columns) const unsigned int tidx = threadIdx.x<<1; // column const unsigned int tidy = threadIdx.y; // row const unsigned int swidth = min(width-(bid<>>(d_data, lwidth, lheight, stride); else s_transform_v<<>>(d_data, lwidth, lheight, stride); #endif #ifdef HORIZONTAL block_size.x = BSH; block_size.y = 1; block_size.z = 1; grid_size.x = lheight; grid_size.y = 1; grid_size.z = 1; shared_size = (lwidth+BLEFT*2+BRIGHT*2) * sizeof(DATATYPE); s_transform_h<<>>(d_data, lwidth, stride); #endif } schroedinger-1.0.11/schroedinger/cuda/motion_tex.cu0000644000175000017500000001501010740326751017277 00000000000000/** Overlapped block motion compensation for CUDA Efficient implementation that divides up the image into regions based on the amount of blocks that overlap it, which is 1 (in the middle), 2 (horizontal or vertical overlap) or 4 (diagonal overlap). By processing these regions in different cuda blocks, any divergence between threads is prevented. */ #include #include #include #include // includes, project //#include #include #include #include #define SPECIAL //#define USING_GLOBAL #define THREADSX_LOG2 4 #define THREADSY_LOG2 4 #ifdef SPECIAL #define WIDTHX_LOG2 (THREADSX_LOG2+1) #define WIDTHY_LOG2 THREADSY_LOG2 #else #define WIDTHX_LOG2 THREADSX_LOG2 #define WIDTHY_LOG2 THREADSY_LOG2 #endif #define THREADSX (1<vectors = 0; rv->bdata = 0; rv->stream = stream; return rv; } void cuda_motion_free(CudaMotion *rv) { cudaFreeArray(rv->bdata); cudaFreeHost((void*)rv->vectors); delete rv; } struct _MotionVector *cuda_motion_reserve(CudaMotion *self, int width, int height) { /// XXX check for dimension changes! cudaChannelFormatDesc bdesc = cudaCreateChannelDesc(); if(!self->vectors) cudaMallocHost((void**)&self->vectors, width*height*sizeof(struct _MotionVector)); if(!self->bdata) cudaMallocArray(&self->bdata, &bdesc, width, height); return self->vectors; } void cuda_motion_begin(CudaMotion *self, CudaMotionData *d) { /// Upload motion vectors cudaChannelFormatDesc bdesc = cudaCreateChannelDesc(); cudaMemcpy2DToArrayAsync(self->bdata, 0, 0, self->vectors, d->obmc.blocksx*8, d->obmc.blocksx*8, d->obmc.blocksy, cudaMemcpyHostToDevice, self->stream); bt1.addressMode[0] = cudaAddressModeClamp; bt1.addressMode[1] = cudaAddressModeClamp; bt1.filterMode = cudaFilterModePoint; bt1.normalized = false; ref1.addressMode[0] = cudaAddressModeClamp; ref1.addressMode[1] = cudaAddressModeClamp; ref1.filterMode = cudaFilterModeLinear; ref1.normalized = false; ref2.addressMode[0] = cudaAddressModeClamp; ref2.addressMode[1] = cudaAddressModeClamp; ref2.filterMode = cudaFilterModeLinear; ref2.normalized = false; /// Bind motion vector texture cudaBindTextureToArray(bt1, self->bdata, bdesc); } void cuda_motion_copy(CudaMotion *self, CudaMotionData *d, int16_t *output, int ostride, int width, int height, int component, int xshift, int yshift, struct cudaArray *aref1, struct cudaArray *aref2) { /// Bind reference texture cudaChannelFormatDesc channelDesc = cudaCreateChannelDesc(8, 0, 0, 0, cudaChannelFormatKindUnsigned); cudaBindTextureToArray(ref1, aref1, channelDesc); if(aref2) cudaBindTextureToArray(ref2, aref2, channelDesc); /// Execute the kernel dim3 block_size, grid_size; int shared_size; /// Determine execution parameters block_size.x = THREADSX; block_size.y = THREADSY; block_size.z = 1; int blocksX = div_roundup(width, d->obmc.x_sep>>xshift); int blocksY = div_roundup(height, d->obmc.y_sep>>yshift); int xB = div_roundup(blocksX * (d->obmc.x_mid>>xshift), WIDTHX); int yB = div_roundup(blocksY * (d->obmc.y_mid>>yshift), WIDTHY); int xC = div_roundup((blocksX+1) * (d->obmc.x_ramp>>xshift), WIDTHX); int yC = div_roundup((blocksY+1) * (d->obmc.y_ramp>>yshift), WIDTHY); /* printf("%i %i : %i %i %i %i %i %i : %i %i %i %i %i %i : %i %i\n", width, height, d->obmc.x_sep>>xshift, d->obmc.y_sep>>yshift, d->obmc.x_mid>>xshift, d->obmc.y_mid>>yshift, d->obmc.x_ramp>>xshift, d->obmc.y_ramp>>yshift, blocksX, blocksY, xB, yB, xC, yC, xB + xC, yB + yB); */ grid_size.x = xB + xC; grid_size.y = yB + yC; grid_size.z = 1; shared_size = 0; /* printf("%ix%i comp %i grid %ix%i scale %fx%f ramp %i %i sep %i %i mid %i %i\n", width, height, component, grid_size.x, grid_size.y, sxscale, syscale, d->obmc.x_ramp_log2 - xshift, d->obmc.y_ramp_log2 - yshift, d->obmc.x_sep_log2 - xshift, d->obmc.y_sep_log2 - yshift, d->obmc.x_mid_log2 - xshift, d->obmc.y_mid_log2 - yshift ); */ #if 1 if((d->obmc.x_ramp_log2 - xshift - 1) == 0) { /** Slower variant, use 2 byte writes */ motion_copy_2ref_2b<<stream>>>( output, ostride, width, height, xB, yB, component*8, d->obmc.x_ramp_log2 - xshift, d->obmc.y_ramp_log2 - yshift, d->obmc.x_sep_log2 - xshift, d->obmc.y_sep_log2 - yshift, d->obmc.x_mid_log2 - xshift, d->obmc.y_mid_log2 - yshift, d->obmc.weight1, d->obmc.weight2, d->obmc.weight_shift, xshift, yshift ); } else { /** Fast variant, use 4 byte writes */ motion_copy_2ref_4b<<stream>>>( output, ostride, width, height, xB, yB, component*8, d->obmc.x_ramp_log2 - xshift, d->obmc.y_ramp_log2 - yshift, d->obmc.x_sep_log2 - xshift, d->obmc.y_sep_log2 - yshift, d->obmc.x_mid_log2 - xshift, d->obmc.y_mid_log2 - yshift, d->obmc.weight1, d->obmc.weight2, d->obmc.weight_shift, xshift, yshift ); } #else tex_copy<<>>( output, ostride, width, height); #endif /// XXX unbind textures? } } schroedinger-1.0.11/schroedinger/cuda/iiwt13_5.cu0000644000175000017500000004777010737003215016471 00000000000000 // Autogenerated by WaveGen.py, do not edit! // #include #include #include "common.h" #include "wavelet_common.h" /// Boundaries (depends on wavelet) /// This much is reserved at the sides of the signal /// Must be even! #define BLEFT 2 #define BRIGHT 2 /// Initial shift (to keep precision in integer wavelets) #define INITIAL_SHIFT 1 #define INITIAL_OFFSET 1 #define STAGE1_OFFSET 7 #define STAGE1_SHIFT 4 #define STAGE2_OFFSET 16 #define STAGE2_SHIFT 5 /// Vertical pass row management #define RLEFT 3 #define RRIGHT 2 #define COPYROWS 3 static __global__ void s_transform_h( DATATYPE* data, int width, int stride ) { extern __shared__ DATATYPE shared[]; const int bid = blockIdx.x; // row const int tid = threadIdx.x; // thread id within row const int tidu16 = ((tid&16)>>4)|((tid&15)<<1)|(tid&~31); data += __mul24(bid, stride); int half = BLEFT+(width>>1)+BRIGHT; int ofs; if(width&3) // If width is not a multiple of 4, we need to use the slower method { /// Left part (even coefficients) /// Right part (odd coefficients) int w2 = (width>>1); uint16_t *row = (uint16_t*)data; uint16_t *row2 = (uint16_t*)&data[w2]; uint16_t *dest1 = (uint16_t*)&shared[BLEFT]; uint16_t *dest2 = (uint16_t*)&shared[half+BLEFT]; ofs = tid; while(true) { if(ofs>2); uint32_t *row = (uint32_t*)data; uint32_t *row2 = (uint32_t*)&data[width>>1]; uint32_t *dest1 = (uint32_t*)&shared[BLEFT]; uint32_t *dest2 = (uint32_t*)&shared[half+BLEFT]; /// Left part (even coefficients) ofs = tid; while(true) { if(ofs>1)] = shared[half+BLEFT+(width>>1)-1]; } __syncthreads(); // Now apply wavelet lifting to entire line at once // Process odd const int end = BLEFT+(width>>1); for(ofs = BLEFT+tidu16; ofs < end; ofs += BSH) { int acc = STAGE2_OFFSET; acc += -1*shared[half+ofs-2]; acc += __mul24(9,shared[half+ofs-1]); acc += __mul24(9,shared[half+ofs+0]); acc += -1*shared[half+ofs+1]; shared[ofs] -= acc >> STAGE2_SHIFT; } __syncthreads(); if(tidu16==0) { shared[BLEFT-1] = shared[BLEFT]; shared[BLEFT+(width>>1)] = shared[BLEFT+(width>>1)-1]; shared[BLEFT+(width>>1)+1] = shared[BLEFT+(width>>1)-1]; } __syncthreads(); // Process even for(ofs = BLEFT+tidu16; ofs < end; ofs += BSH) { int acc = STAGE1_OFFSET; acc += 1*shared[ofs-1]; acc += __mul24(-9, shared[ofs+0]); acc += __mul24(-9, shared[ofs+1]); acc += 1*shared[ofs+2]; shared[ofs + half] -= acc >> STAGE1_SHIFT; } __syncthreads(); if(width&3) { uint32_t *row = (uint32_t*)data; int16_t *src1 = (int16_t*)&shared[BLEFT]; int16_t *src2 = (int16_t*)&shared[half+BLEFT]; int w2 = (width>>1); ofs = tid; while(true) { if(ofs>INITIAL_SHIFT; int b = (src2[ofs] + INITIAL_OFFSET)>>INITIAL_SHIFT; row[ofs] = (a&0xFFFF)|((b&0xFFFF)<<16); ofs += BSH; } else break; if(ofs>INITIAL_SHIFT; int b = (src2[ofs] + INITIAL_OFFSET)>>INITIAL_SHIFT; row[ofs] = (a&0xFFFF)|((b&0xFFFF)<<16); ofs += BSH; } else break; if(ofs>INITIAL_SHIFT; int b = (src2[ofs] + INITIAL_OFFSET)>>INITIAL_SHIFT; row[ofs] = (a&0xFFFF)|((b&0xFFFF)<<16); ofs += BSH; } else break; } } else { i16_4 *row = (i16_4*)data; i16_2 *src1 = (i16_2*)&shared[BLEFT]; i16_2 *src2 = (i16_2*)&shared[half+BLEFT]; int w2 = (width>>2); ofs = tid; while(true) { if(ofs < w2) { i16_4 x; i16_2 a = src1[ofs]; x.a = (a.a + INITIAL_OFFSET)>>INITIAL_SHIFT; x.c = (a.b + INITIAL_OFFSET)>>INITIAL_SHIFT; i16_2 b = src2[ofs]; x.b = (b.a + INITIAL_OFFSET)>>INITIAL_SHIFT; x.d = (b.b + INITIAL_OFFSET)>>INITIAL_SHIFT; row[ofs] = x; ofs += BSH; } else break; if(ofs < w2) { i16_4 x; i16_2 a = src1[ofs]; x.a = (a.a + INITIAL_OFFSET)>>INITIAL_SHIFT; x.c = (a.b + INITIAL_OFFSET)>>INITIAL_SHIFT; i16_2 b = src2[ofs]; x.b = (b.a + INITIAL_OFFSET)>>INITIAL_SHIFT; x.d = (b.b + INITIAL_OFFSET)>>INITIAL_SHIFT; row[ofs] = x; ofs += BSH; } else break; if(ofs < w2) { i16_4 x; i16_2 a = src1[ofs]; x.a = (a.a + INITIAL_OFFSET)>>INITIAL_SHIFT; x.c = (a.b + INITIAL_OFFSET)>>INITIAL_SHIFT; i16_2 b = src2[ofs]; x.b = (b.a + INITIAL_OFFSET)>>INITIAL_SHIFT; x.d = (b.b + INITIAL_OFFSET)>>INITIAL_SHIFT; row[ofs] = x; ofs += BSH; } else break; } } } #define BROWS (2*BSVY+COPYROWS) /* Rows to process at once */ #define SKIPTOP COPYROWS #define PAD_ROWS (WRITEBACK-SKIPTOP+RRIGHT+COPYROWS) /* Rows below which to use s_transform_v_pad */ /// tid is BCOLSxBROWS matrix /// RLEFT+BROWS+RRIGHT rows #define TOTALROWS (RLEFT+BROWS+RRIGHT) #define OVERLAP (RLEFT+RRIGHT+COPYROWS) #define OVERLAP_OFFSET (TOTALROWS-OVERLAP) #define WRITEBACK (2*BSVY) __device__ void doTransform(int xofs) { const int tidx = (threadIdx.x<<1)+xofs; // column const int tidy = threadIdx.y; // row extern __shared__ DATATYPE shared[]; int ofs; ofs = ((RLEFT+(tidy<<1)+3)<> STAGE2_SHIFT; } __syncthreads(); ofs -= BCOLS*3; { int acc = STAGE1_OFFSET; acc += 1*shared[ofs-3*BCOLS]; acc += __mul24(-9, shared[ofs-BCOLS]); acc += __mul24(-9, shared[ofs+BCOLS]); acc += 1*shared[ofs+3*BCOLS]; shared[ofs] -= acc >> STAGE1_SHIFT; } } __device__ void doTransformTB(int xofs, unsigned int leftover) { const int tidx = (threadIdx.x<<1)+xofs; // column const int tidy = threadIdx.y; // row const int minn = (RLEFT<> STAGE2_SHIFT; } __syncthreads(); /// Process odd rows ofs += BCOLS; { int acc = STAGE1_OFFSET; acc += 1*shared[max(ofs-3*BCOLS,minn)]; acc += __mul24(-9, shared[ofs-BCOLS]); acc += __mul24(-9, shared[min(ofs+BCOLS,maxx)]); acc += 1*shared[min(ofs+3*BCOLS,maxx)]; shared[ofs] -= acc >> STAGE1_SHIFT; } } __device__ void doTransformT(int xofs) { const int tidx = (threadIdx.x<<1)+xofs; // column const int tidy = threadIdx.y; // row const int minn = ((RLEFT+SKIPTOP)<> STAGE2_SHIFT; } __syncthreads(); /// Process odd rows, except for last ofs += BCOLS; if(tidy < (BSVY-2)) { int acc = STAGE1_OFFSET; acc += 1*shared[max(ofs-3*BCOLS,minn)]; acc += __mul24(-9, shared[ofs-BCOLS]); acc += __mul24(-9, shared[ofs+BCOLS]); acc += 1*shared[ofs+3*BCOLS]; shared[ofs] -= acc >> STAGE1_SHIFT; } } // Process leftover __device__ void doTransformB(int xofs, unsigned int leftover) { const int tidx = (threadIdx.x<<1)+xofs; // column const int tidy = threadIdx.y; // row const int maxx = leftover-(2<> STAGE2_SHIFT; } __syncthreads(); for(ofs_t=ofs; ofs_t> STAGE1_SHIFT; } } #if 0 // Rolled #define READ_LOOP(rows) for(; sofs < (rows); sofs += (BCOLS*BSVY), gofs += istride) *((uint32_t*)&shared[sofs]) = *((uint32_t*)&data[gofs]); #define WRITE_LOOP(rows) for(; sofs < (rows); sofs += (BCOLS*BSVY), gofs += istride) *((uint32_t*)&data[gofs]) = *((uint32_t*)&shared[sofs]); #endif #if 1 // Unrolled #define READ_LOOP_ENTRY(rows) if(sofs < (rows)) { *((uint32_t*)&shared[sofs]) = *((uint32_t*)&data[gofs]); sofs += (BCOLS*BSVY); gofs += istride; } else break; #define READ_LOOP(rows) while(1) { READ_LOOP_ENTRY(rows); READ_LOOP_ENTRY(rows); } #define WRITE_LOOP_ENTRY(rows) if(sofs < (rows)) { *((uint32_t*)&data[gofs]) = *((uint32_t*)&shared[sofs]); sofs += (BCOLS*BSVY); gofs += istride; } else break; #define WRITE_LOOP(rows) while(1) { WRITE_LOOP_ENTRY(rows); WRITE_LOOP_ENTRY(rows); } #endif #if 0 // Unrolled #define READ_LOOP_ENTRY(rows) if(sofs < (rows)) { *((uint32_t*)&shared[sofs]) = *((uint32_t*)&data[gofs]); sofs += (BCOLS*BSVY); gofs += istride; } #define READ_LOOP(rows) READ_LOOP_ENTRY(rows); READ_LOOP_ENTRY(rows); READ_LOOP_ENTRY(rows); #define WRITE_LOOP_ENTRY(rows) if(sofs < (rows)) { *((uint32_t*)&data[gofs]) = *((uint32_t*)&shared[sofs]); sofs += (BCOLS*BSVY); gofs += istride; } #define WRITE_LOOP(rows) WRITE_LOOP_ENTRY(rows); WRITE_LOOP_ENTRY(rows); WRITE_LOOP_ENTRY(rows); #endif static __global__ void s_transform_v( DATATYPE* data, int width, int height, int stride ) { extern __shared__ DATATYPE shared[]; const unsigned int bid = blockIdx.x; // slab (BCOLS columns) const unsigned int tidx = threadIdx.x<<1; // column const unsigned int tidy = threadIdx.y; // row const unsigned int swidth = min(width-(bid<>>(d_data, lwidth, lheight, stride); else s_transform_v<<>>(d_data, lwidth, lheight, stride); #endif #ifdef HORIZONTAL block_size.x = BSH; block_size.y = 1; block_size.z = 1; grid_size.x = lheight; grid_size.y = 1; grid_size.z = 1; shared_size = (lwidth+BLEFT*2+BRIGHT*2) * sizeof(DATATYPE); s_transform_h<<>>(d_data, lwidth, stride); #endif } schroedinger-1.0.11/schroedinger/cuda/haar_iiwt.cu0000644000175000017500000001132610737003215017060 00000000000000#include #include #include "common.h" #include "wavelet_common.h" #define BROWS (2*BSVY) static __global__ void s_transform_h( DATATYPE* data, int width, int stride, int shift ) { extern __shared__ DATATYPE shared[]; const int bid = blockIdx.x; // row const int tid = threadIdx.x; // thread id within row const int tidu16 = ((tid&16)>>4)|((tid&15)<<1)|(tid&~31); //const int BSH = blockDim.x; // Row offset const unsigned int idata = __mul24(bid, stride); // Load entire line into shared memory // Deinterleave right here int half = (width>>1); // Make sure half is odd, to prevent bank conflicts unsigned int ofs; /// Write line back to global memory, don't interleave again uint32_t *row = (uint32_t*)&data[idata]; for(ofs = tid; ofs < (width>>1); ofs += BSH) *((uint32_t*)&shared[ofs<<1]) = row[ofs]; __syncthreads(); // Now apply wavelet lifting to entire line at once const int end = (width>>1); for(ofs = tidu16; ofs < end; ofs += BSH) { int val1 = shared[ofs]; int val2 = shared[half+ofs]; val1 -= (val2+1)>>1; val2 += val1; shared[ofs] = val1; shared[half+ofs] = val2; } __syncthreads(); // Shared memory output offset for this thread int od = (1<>1; for(ofs = tid; ofs < (width>>1); ofs += BSH) { uint16_t a = (uint16_t)((shared[ofs]+od)>>shift); uint16_t b = (uint16_t)((shared[ofs + half]+od)>>shift); row[ofs] = a|(b<<16); } } __device__ void doRevTransform() { const int tidx = threadIdx.x<<1; // column const int tidy = threadIdx.y; // row extern __shared__ DATATYPE shared[]; int ofs; ofs = (((tidy<<1))<>1; val2 += val1; shared[ofs] = val1; shared[ofs+BCOLS] = val2; } { int val1 = shared[ofs+1]; int val2 = shared[ofs+BCOLS+1]; val1 -= (val2+1)>>1; val2 += val1; shared[ofs+1] = val1; shared[ofs+BCOLS+1] = val2; } } static __global__ void s_transform_v( DATATYPE* data, int width, int height, int stride ) { extern __shared__ DATATYPE shared[]; const unsigned int bid = blockIdx.x; // slab (BCOLS columns) const unsigned int tidx = threadIdx.x<<1; // column const unsigned int tidy = threadIdx.y; // row const unsigned int swidth = min(width-(bid<>>(d_data, lwidth, lheight, stride); #endif #ifdef HORIZONTAL block_size.x = BSH; block_size.y = 1; block_size.z = 1; grid_size.x = lheight; grid_size.y = 1; grid_size.z = 1; shared_size = lwidth * sizeof(int16_t); s_transform_h<<>>(d_data, lwidth, stride, shift); #endif } schroedinger-1.0.11/schroedinger/cuda/iiwtfidelity.cu0000644000175000017500000006024310737003215017621 00000000000000 // Autogenerated by WaveGen.py, do not edit! // #include #include #include "common.h" #include "wavelet_common.h" /// Boundaries (depends on wavelet) /// This much is reserved at the sides of the signal /// Must be even! #define BLEFT 4 #define BRIGHT 4 /// Initial shift (to keep precision in integer wavelets) #define INITIAL_SHIFT 0 #define INITIAL_OFFSET 0 // static const int16_t stage1_weights[] = { -8, 21, -46, 161, 161, -46, 21, -8 }; // static const int16_t stage2_weights[] = { 2, -10, 25, -81, -81, 25, -10, 2 }; #define STAGE1_OFFSET 128 #define STAGE1_SHIFT 8 #define STAGE1_COEFF0 (-8) #define STAGE1_COEFF1 (21) #define STAGE1_COEFF2 (-46) #define STAGE1_COEFF3 (161) #define STAGE1_COEFF4 (161) #define STAGE1_COEFF5 (-46) #define STAGE1_COEFF6 (21) #define STAGE1_COEFF7 (-8) #define STAGE2_OFFSET 127 #define STAGE2_SHIFT 8 #define STAGE2_COEFF0 (2) #define STAGE2_COEFF1 (-10) #define STAGE2_COEFF2 (25) #define STAGE2_COEFF3 (-81) #define STAGE2_COEFF4 (-81) #define STAGE2_COEFF5 (25) #define STAGE2_COEFF6 (-10) #define STAGE2_COEFF7 (2) /// Vertical pass row management #define RLEFT 8 #define RRIGHT 7 #define COPYROWS 7 static __global__ void s_transform_h( DATATYPE* data, int width, int stride ) { extern __shared__ DATATYPE shared[]; const int bid = blockIdx.x; // row const int tid = threadIdx.x; // thread id within row const int tidu16 = ((tid&16)>>4)|((tid&15)<<1)|(tid&~31); data += __mul24(bid, stride); int half = BLEFT+(width>>1)+BRIGHT; int ofs; if(width&3) // If width is not a multiple of 4, we need to use the slower method { /// Left part (even coefficients) /// Right part (odd coefficients) int w2 = (width>>1); uint16_t *row = (uint16_t*)data; uint16_t *row2 = (uint16_t*)&data[w2]; uint16_t *dest1 = (uint16_t*)&shared[BLEFT]; uint16_t *dest2 = (uint16_t*)&shared[half+BLEFT]; ofs = tid; while(true) { if(ofs>2); uint32_t *row = (uint32_t*)data; uint32_t *row2 = (uint32_t*)&data[width>>1]; uint32_t *dest1 = (uint32_t*)&shared[BLEFT]; uint32_t *dest2 = (uint32_t*)&shared[half+BLEFT]; /// Left part (even coefficients) ofs = tid; while(true) { if(ofs>1); if(tidu16<4) { /* hi[-3] = hi[0]; hi[-2] = hi[0]; hi[-1] = hi[0]; hi[n] = hi[n-1]; hi[n+1] = hi[n-1]; hi[n+2] = hi[n-1]; hi[n+3] = hi[n-1]; */ shared[BLEFT-4+tidu16] = shared[BLEFT]; shared[BLEFT+(width>>1)+tidu16] = shared[BLEFT+(width>>1)-1]; } __syncthreads(); // Process odd for(ofs = BLEFT+tidu16; ofs < end; ofs += BSH) { int acc = STAGE2_OFFSET; acc += __mul24(STAGE2_COEFF0, shared[ofs-3]); acc += __mul24(STAGE2_COEFF1, shared[ofs-2]); acc += __mul24(STAGE2_COEFF2, shared[ofs-1]); acc += __mul24(STAGE2_COEFF3, shared[ofs-0]); acc += __mul24(STAGE2_COEFF4, shared[ofs+1]); acc += __mul24(STAGE2_COEFF5, shared[ofs+2]); acc += __mul24(STAGE2_COEFF6, shared[ofs+3]); acc += __mul24(STAGE2_COEFF7, shared[ofs+4]); shared[ofs + half] -= acc >> STAGE2_SHIFT; } __syncthreads(); if(tidu16<4) { /* lo[-4] = lo[0]; lo[-3] = lo[0]; lo[-2] = lo[0]; lo[-1] = lo[0]; lo[n] = lo[n-1]; lo[n+1] = lo[n-1]; lo[n+2] = lo[n-1]; */ shared[half+BLEFT-4+tidu16] = shared[half+BLEFT]; shared[half+BLEFT+(width>>1)+tidu16] = shared[half+BLEFT+(width>>1)-1]; } __syncthreads(); // Process even for(ofs = BLEFT+tidu16; ofs < end; ofs += BSH) { int acc = STAGE1_OFFSET; acc += __mul24(STAGE1_COEFF0,shared[half+ofs-4]); acc += __mul24(STAGE1_COEFF1,shared[half+ofs-3]); acc += __mul24(STAGE1_COEFF2,shared[half+ofs-2]); acc += __mul24(STAGE1_COEFF3,shared[half+ofs-1]); acc += __mul24(STAGE1_COEFF4,shared[half+ofs+0]); acc += __mul24(STAGE1_COEFF5,shared[half+ofs+1]); acc += __mul24(STAGE1_COEFF6,shared[half+ofs+2]); acc += __mul24(STAGE1_COEFF7,shared[half+ofs+3]); shared[ofs] -= acc >> STAGE1_SHIFT; } __syncthreads(); if(width&3) { uint32_t *row = (uint32_t*)data; int16_t *src1 = (int16_t*)&shared[BLEFT]; int16_t *src2 = (int16_t*)&shared[half+BLEFT]; int w2 = (width>>1); ofs = tid; while(true) { if(ofs>INITIAL_SHIFT; int b = (src2[ofs] + INITIAL_OFFSET)>>INITIAL_SHIFT; row[ofs] = (a&0xFFFF)|((b&0xFFFF)<<16); ofs += BSH; } else break; if(ofs>INITIAL_SHIFT; int b = (src2[ofs] + INITIAL_OFFSET)>>INITIAL_SHIFT; row[ofs] = (a&0xFFFF)|((b&0xFFFF)<<16); ofs += BSH; } else break; if(ofs>INITIAL_SHIFT; int b = (src2[ofs] + INITIAL_OFFSET)>>INITIAL_SHIFT; row[ofs] = (a&0xFFFF)|((b&0xFFFF)<<16); ofs += BSH; } else break; } } else { i16_4 *row = (i16_4*)data; i16_2 *src1 = (i16_2*)&shared[BLEFT]; i16_2 *src2 = (i16_2*)&shared[half+BLEFT]; int w2 = (width>>2); ofs = tid; while(true) { if(ofs < w2) { i16_4 x; i16_2 a = src1[ofs]; x.a = (a.a + INITIAL_OFFSET)>>INITIAL_SHIFT; x.c = (a.b + INITIAL_OFFSET)>>INITIAL_SHIFT; i16_2 b = src2[ofs]; x.b = (b.a + INITIAL_OFFSET)>>INITIAL_SHIFT; x.d = (b.b + INITIAL_OFFSET)>>INITIAL_SHIFT; row[ofs] = x; ofs += BSH; } else break; if(ofs < w2) { i16_4 x; i16_2 a = src1[ofs]; x.a = (a.a + INITIAL_OFFSET)>>INITIAL_SHIFT; x.c = (a.b + INITIAL_OFFSET)>>INITIAL_SHIFT; i16_2 b = src2[ofs]; x.b = (b.a + INITIAL_OFFSET)>>INITIAL_SHIFT; x.d = (b.b + INITIAL_OFFSET)>>INITIAL_SHIFT; row[ofs] = x; ofs += BSH; } else break; if(ofs < w2) { i16_4 x; i16_2 a = src1[ofs]; x.a = (a.a + INITIAL_OFFSET)>>INITIAL_SHIFT; x.c = (a.b + INITIAL_OFFSET)>>INITIAL_SHIFT; i16_2 b = src2[ofs]; x.b = (b.a + INITIAL_OFFSET)>>INITIAL_SHIFT; x.d = (b.b + INITIAL_OFFSET)>>INITIAL_SHIFT; row[ofs] = x; ofs += BSH; } else break; } } } #define BROWS (2*BSVY+COPYROWS) /* Rows to process at once */ #define SKIPTOP COPYROWS #define PAD_ROWS (WRITEBACK-SKIPTOP+RRIGHT+COPYROWS) /* Rows below which to use s_transform_v_pad */ /// tid is BCOLSxBROWS matrix /// RLEFT+BROWS+RRIGHT rows #define TOTALROWS (RLEFT+BROWS+RRIGHT) #define OVERLAP (RLEFT+RRIGHT+COPYROWS) #define OVERLAP_OFFSET (TOTALROWS-OVERLAP) #define WRITEBACK (2*BSVY) __device__ void doTransform(int xofs) { const int tidx = (threadIdx.x<<1)+xofs; // column const int tidy = threadIdx.y; // row extern __shared__ DATATYPE shared[]; int ofs; ofs = ((RLEFT+(tidy<<1)+8)<> STAGE2_SHIFT; } __syncthreads(); /* Phase 1 (even) at +8*BCOLS */ ofs -= 7*BCOLS; { int acc = STAGE1_OFFSET; acc += __mul24(STAGE1_COEFF0, shared[ofs-7*BCOLS]); acc += __mul24(STAGE1_COEFF1, shared[ofs-5*BCOLS]); acc += __mul24(STAGE1_COEFF2, shared[ofs-3*BCOLS]); acc += __mul24(STAGE1_COEFF3, shared[ofs-1*BCOLS]); acc += __mul24(STAGE1_COEFF4, shared[ofs+1*BCOLS]); acc += __mul24(STAGE1_COEFF5, shared[ofs+3*BCOLS]); acc += __mul24(STAGE1_COEFF6, shared[ofs+5*BCOLS]); acc += __mul24(STAGE1_COEFF7, shared[ofs+7*BCOLS]); shared[ofs] -= acc >> STAGE1_SHIFT; } } __device__ void doTransformTB(int xofs, unsigned int leftover) { const int tidx = (threadIdx.x<<1)+xofs; // column const int tidy = threadIdx.y; // row const int minn = (RLEFT<> STAGE2_SHIFT; } __syncthreads(); /* Phase 1 (even) */ for(ofs_t=ofs+0*BCOLS; ofs_t> STAGE1_SHIFT; } } __device__ void doTransformT(int xofs) { const int tidx = (threadIdx.x<<1)+xofs; // column const int tidy = threadIdx.y; // row const int minn = ((RLEFT+SKIPTOP)<> STAGE2_SHIFT; } __syncthreads(); /* Phase 1 (even), offset +0 */ ofs -= BCOLS; if(tidy<(BSVY-3)) { int acc = STAGE1_OFFSET; acc += __mul24(STAGE1_COEFF0, shared[max(ofs-7*BCOLS, minn+BCOLS)]); acc += __mul24(STAGE1_COEFF1, shared[max(ofs-5*BCOLS, minn+BCOLS)]); acc += __mul24(STAGE1_COEFF2, shared[max(ofs-3*BCOLS, minn+BCOLS)]); acc += __mul24(STAGE1_COEFF3, shared[max(ofs-1*BCOLS, minn+BCOLS)]); acc += __mul24(STAGE1_COEFF4, shared[ofs+1*BCOLS]); acc += __mul24(STAGE1_COEFF5, shared[ofs+3*BCOLS]); acc += __mul24(STAGE1_COEFF6, shared[ofs+5*BCOLS]); acc += __mul24(STAGE1_COEFF7, shared[ofs+7*BCOLS]); shared[ofs] -= acc >> STAGE1_SHIFT; } } // Finish off leftover __device__ void doTransformB(int xofs, unsigned int leftover) { const int tidx = (threadIdx.x<<1)+xofs; // column const int tidy = threadIdx.y; // row const int maxx = leftover-(2<> STAGE2_SHIFT; } __syncthreads(); for(ofs_t=ofs+1*BCOLS; ofs_t> STAGE1_SHIFT; } } #if 0 // Rolled #define READ_LOOP(rows) for(; sofs < (rows); sofs += (BCOLS*BSVY), gofs += istride) *((uint32_t*)&shared[sofs]) = *((uint32_t*)&data[gofs]); #define WRITE_LOOP(rows) for(; sofs < (rows); sofs += (BCOLS*BSVY), gofs += istride) *((uint32_t*)&data[gofs]) = *((uint32_t*)&shared[sofs]); #endif #if 1 // Unrolled #define READ_LOOP_ENTRY(rows) if(sofs < (rows)) { *((uint32_t*)&shared[sofs]) = *((uint32_t*)&data[gofs]); sofs += (BCOLS*BSVY); gofs += istride; } else break; #define READ_LOOP(rows) while(1) { READ_LOOP_ENTRY(rows); READ_LOOP_ENTRY(rows); } #define WRITE_LOOP_ENTRY(rows) if(sofs < (rows)) { *((uint32_t*)&data[gofs]) = *((uint32_t*)&shared[sofs]); sofs += (BCOLS*BSVY); gofs += istride; } else break; #define WRITE_LOOP(rows) while(1) { WRITE_LOOP_ENTRY(rows); WRITE_LOOP_ENTRY(rows); } #endif #if 0 // Unrolled #define READ_LOOP_ENTRY(rows) if(sofs < (rows)) { *((uint32_t*)&shared[sofs]) = *((uint32_t*)&data[gofs]); sofs += (BCOLS*BSVY); gofs += istride; } #define READ_LOOP(rows) READ_LOOP_ENTRY(rows); READ_LOOP_ENTRY(rows); READ_LOOP_ENTRY(rows); #define WRITE_LOOP_ENTRY(rows) if(sofs < (rows)) { *((uint32_t*)&data[gofs]) = *((uint32_t*)&shared[sofs]); sofs += (BCOLS*BSVY); gofs += istride; } #define WRITE_LOOP(rows) WRITE_LOOP_ENTRY(rows); WRITE_LOOP_ENTRY(rows); WRITE_LOOP_ENTRY(rows); #endif static __global__ void s_transform_v( DATATYPE* data, int width, int height, int stride ) { extern __shared__ DATATYPE shared[]; const unsigned int bid = blockIdx.x; // slab (BCOLS columns) const unsigned int tidx = threadIdx.x<<1; // column const unsigned int tidy = threadIdx.y; // row const unsigned int swidth = min(width-(bid<>>(d_data, lwidth, lheight, stride); else s_transform_v<<>>(d_data, lwidth, lheight, stride); #endif #ifdef HORIZONTAL block_size.x = BSH; block_size.y = 1; block_size.z = 1; grid_size.x = lheight; grid_size.y = 1; grid_size.z = 1; shared_size = (lwidth+BLEFT*2+BRIGHT*2) * sizeof(DATATYPE); s_transform_h<<>>(d_data, lwidth, stride); #endif } schroedinger-1.0.11/schroedinger/cuda/Makefile.am0000644000175000017500000000100311320237456016610 00000000000000.cu.lo: $(top_builddir)/cudalt.py $@ $(NVCC) -c $(NVCCFLAGS) $< noinst_LTLIBRARIES = libdcuda.la CCLD = g++ libdcuda_la_SOURCES = \ dummy.c \ init.cu cudawavelet.cu \ haar_iwt.cu haar_iiwt.cu \ frame.cu upsample.cu motion_tex.cu \ iiwt5_3.cu iwt5_3.cu iiwt9_3.cu iwt9_3.cu iiwt13_5.cu iwt13_5.cu \ iiwtfidelity.cu iwtfidelity.cu iiwt9_7.cu iwt9_7.cu libdcuda_la_CFLAGS = $(SCHRO_CFLAGS) $(CUDA_CFLAGS) $(ERROR_CFLAGS) libdcuda_la_LIBADD = $(CUDA_LIBS) libdcuda_la_LDFLAGS = schroedinger-1.0.11/schroedinger/cuda/Makefile.in0000664000175000017500000004172711707140261016640 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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@ subdir = schroedinger/cuda DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-auto-alt.m4 \ $(top_srcdir)/m4/as-compiler-flag.m4 \ $(top_srcdir)/m4/as-host-defines.m4 \ $(top_srcdir)/m4/as-version.m4 $(top_srcdir)/m4/gst-args.m4 \ $(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)/m4/pkg.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) am__DEPENDENCIES_1 = libdcuda_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_libdcuda_la_OBJECTS = libdcuda_la-dummy.lo init.lo cudawavelet.lo \ haar_iwt.lo haar_iiwt.lo frame.lo upsample.lo motion_tex.lo \ iiwt5_3.lo iwt5_3.lo iiwt9_3.lo iwt9_3.lo iiwt13_5.lo \ iwt13_5.lo iiwtfidelity.lo iwtfidelity.lo iiwt9_7.lo iwt9_7.lo libdcuda_la_OBJECTS = $(am_libdcuda_la_OBJECTS) libdcuda_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libdcuda_la_CFLAGS) \ $(CFLAGS) $(libdcuda_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libdcuda_la_SOURCES) DIST_SOURCES = $(libdcuda_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUDA_CFLAGS = @CUDA_CFLAGS@ CUDA_LIBS = @CUDA_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ GCOV = @GCOV@ GCOV_CFLAGS = @GCOV_CFLAGS@ GCOV_LIBS = @GCOV_LIBS@ GREP = @GREP@ GTHREAD_CFLAGS = @GTHREAD_CFLAGS@ GTHREAD_LIBS = @GTHREAD_LIBS@ GTKDOC_CHECK = @GTKDOC_CHECK@ 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@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ NVCC = @NVCC@ NVCCFLAGS = @NVCCFLAGS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENGL_CFLAGS = @OPENGL_CFLAGS@ OPENGL_LIBS = @OPENGL_LIBS@ ORCC = @ORCC@ ORC_CFLAGS = @ORC_CFLAGS@ ORC_LIBS = @ORC_LIBS@ 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@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SCHRO_CFLAGS = @SCHRO_CFLAGS@ SCHRO_LIBS = @SCHRO_LIBS@ SCHRO_LIBVERSION = @SCHRO_LIBVERSION@ SCHRO_MAJORMINOR = @SCHRO_MAJORMINOR@ SCHRO_PKG_DEPS = @SCHRO_PKG_DEPS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ THREAD_IMPL = @THREAD_IMPL@ VERSION = @VERSION@ 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_CXX = @ac_ct_CXX@ 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@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libdcuda.la CCLD = g++ libdcuda_la_SOURCES = \ dummy.c \ init.cu cudawavelet.cu \ haar_iwt.cu haar_iiwt.cu \ frame.cu upsample.cu motion_tex.cu \ iiwt5_3.cu iwt5_3.cu iiwt9_3.cu iwt9_3.cu iiwt13_5.cu iwt13_5.cu \ iiwtfidelity.cu iwtfidelity.cu iiwt9_7.cu iwt9_7.cu libdcuda_la_CFLAGS = $(SCHRO_CFLAGS) $(CUDA_CFLAGS) $(ERROR_CFLAGS) libdcuda_la_LIBADD = $(CUDA_LIBS) libdcuda_la_LDFLAGS = all: all-am .SUFFIXES: .SUFFIXES: .c .cu .lo .o .obj $(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) --foreign schroedinger/cuda/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign schroedinger/cuda/Makefile .PRECIOUS: 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)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libdcuda.la: $(libdcuda_la_OBJECTS) $(libdcuda_la_DEPENDENCIES) $(libdcuda_la_LINK) $(libdcuda_la_OBJECTS) $(libdcuda_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdcuda_la-dummy.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< libdcuda_la-dummy.lo: dummy.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdcuda_la_CFLAGS) $(CFLAGS) -MT libdcuda_la-dummy.lo -MD -MP -MF $(DEPDIR)/libdcuda_la-dummy.Tpo -c -o libdcuda_la-dummy.lo `test -f 'dummy.c' || echo '$(srcdir)/'`dummy.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libdcuda_la-dummy.Tpo $(DEPDIR)/libdcuda_la-dummy.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dummy.c' object='libdcuda_la-dummy.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdcuda_la_CFLAGS) $(CFLAGS) -c -o libdcuda_la-dummy.lo `test -f 'dummy.c' || echo '$(srcdir)/'`dummy.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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) 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 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 all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags 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 uninstall uninstall-am .cu.lo: $(top_builddir)/cudalt.py $@ $(NVCC) -c $(NVCCFLAGS) $< # 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: schroedinger-1.0.11/schroedinger/cuda/dummy.c0000644000175000017500000000004010735570150016053 00000000000000 /* Just look the other way */ schroedinger-1.0.11/schroedinger/cuda/iiwt9_7.cu0000644000175000017500000005442010737003215016406 00000000000000 // Autogenerated by WaveGen.py, do not edit! // #include #include #include "common.h" #include "wavelet_common.h" /// Boundaries (depends on wavelet) /// This much is reserved at the sides of the signal /// Must be even! #define BLEFT 2 #define BRIGHT 2 /// Initial shift (to keep precision in integer wavelets) #define INITIAL_SHIFT 1 #define INITIAL_OFFSET 1 #define STAGE1_OFFSET 2047 #define STAGE1_SHIFT 12 #define STAGE1_COEFF (-6497) #define STAGE2_OFFSET 2047 #define STAGE2_SHIFT 12 #define STAGE2_COEFF (-217) #define STAGE3_OFFSET 2048 #define STAGE3_SHIFT 12 #define STAGE3_COEFF (3616) #define STAGE4_OFFSET 2048 #define STAGE4_SHIFT 12 #define STAGE4_COEFF (1817) /// Vertical pass row management #define RLEFT 1 #define RRIGHT 0 #define COPYROWS 3 static __global__ void s_transform_h( DATATYPE* data, int width, int stride ) { extern __shared__ DATATYPE shared[]; const int bid = blockIdx.x; // row const int tid = threadIdx.x; // thread id within row const int tidu16 = ((tid&16)>>4)|((tid&15)<<1)|(tid&~31); data += __mul24(bid, stride); int half = BLEFT+(width>>1)+BRIGHT; int ofs; if(width&3) // If width is not a multiple of 4, we need to use the slower method { /// Left part (even coefficients) /// Right part (odd coefficients) int w2 = (width>>1); uint16_t *row = (uint16_t*)data; uint16_t *row2 = (uint16_t*)&data[w2]; uint16_t *dest1 = (uint16_t*)&shared[BLEFT]; uint16_t *dest2 = (uint16_t*)&shared[half+BLEFT]; ofs = tid; while(true) { if(ofs>2); uint32_t *row = (uint32_t*)data; uint32_t *row2 = (uint32_t*)&data[width>>1]; uint32_t *dest1 = (uint32_t*)&shared[BLEFT]; uint32_t *dest2 = (uint32_t*)&shared[half+BLEFT]; /// Left part (even coefficients) ofs = tid; while(true) { if(ofs>1); shared[half+BLEFT-1] = shared[half+BLEFT]; __syncthreads(); // Process even for(ofs = BLEFT+tidu16; ofs < end; ofs += BSH) { int acc = STAGE4_OFFSET; acc += __mul24(STAGE4_COEFF,shared[half+ofs-1]); acc += __mul24(STAGE4_COEFF,shared[half+ofs+0]); shared[ofs] -= acc >> STAGE4_SHIFT; } // hi[n] = hi[n-1] if(ofs == (end-1+BSH)) { shared[BLEFT+(width>>1)] = shared[BLEFT+(width>>1)-1]; } __syncthreads(); for(ofs = BLEFT+tidu16; ofs < end; ofs += BSH) { int acc = STAGE3_OFFSET; acc += __mul24(STAGE3_COEFF, shared[ofs+0]); acc += __mul24(STAGE3_COEFF, shared[ofs+1]); shared[ofs + half] -= acc >> STAGE3_SHIFT; } // lo[-1] = hi[0] if(tidu16 == 0) { shared[half+BLEFT-1] = shared[half+BLEFT]; } __syncthreads(); // Process even for(ofs = BLEFT+tidu16; ofs < end; ofs += BSH) { int acc = STAGE2_OFFSET; acc += __mul24(STAGE2_COEFF,shared[half+ofs-1]); acc += __mul24(STAGE2_COEFF,shared[half+ofs+0]); shared[ofs] -= acc >> STAGE2_SHIFT; } // hi[n] = hi[n-1] if(ofs == (end-1+BSH)) { shared[BLEFT+(width>>1)] = shared[BLEFT+(width>>1)-1]; } __syncthreads(); // Process odd for(ofs = BLEFT+tidu16; ofs < end; ofs += BSH) { int acc = STAGE1_OFFSET; acc += __mul24(STAGE1_COEFF, shared[ofs+0]); acc += __mul24(STAGE1_COEFF, shared[ofs+1]); shared[ofs + half] -= acc >> STAGE1_SHIFT; } __syncthreads(); if(width&3) { uint32_t *row = (uint32_t*)data; int16_t *src1 = (int16_t*)&shared[BLEFT]; int16_t *src2 = (int16_t*)&shared[half+BLEFT]; int w2 = (width>>1); ofs = tid; while(true) { if(ofs>INITIAL_SHIFT; int b = (src2[ofs] + INITIAL_OFFSET)>>INITIAL_SHIFT; row[ofs] = (a&0xFFFF)|((b&0xFFFF)<<16); ofs += BSH; } else break; if(ofs>INITIAL_SHIFT; int b = (src2[ofs] + INITIAL_OFFSET)>>INITIAL_SHIFT; row[ofs] = (a&0xFFFF)|((b&0xFFFF)<<16); ofs += BSH; } else break; if(ofs>INITIAL_SHIFT; int b = (src2[ofs] + INITIAL_OFFSET)>>INITIAL_SHIFT; row[ofs] = (a&0xFFFF)|((b&0xFFFF)<<16); ofs += BSH; } else break; } } else { i16_4 *row = (i16_4*)data; i16_2 *src1 = (i16_2*)&shared[BLEFT]; i16_2 *src2 = (i16_2*)&shared[half+BLEFT]; int w2 = (width>>2); ofs = tid; while(true) { if(ofs < w2) { i16_4 x; i16_2 a = src1[ofs]; x.a = (a.a + INITIAL_OFFSET)>>INITIAL_SHIFT; x.c = (a.b + INITIAL_OFFSET)>>INITIAL_SHIFT; i16_2 b = src2[ofs]; x.b = (b.a + INITIAL_OFFSET)>>INITIAL_SHIFT; x.d = (b.b + INITIAL_OFFSET)>>INITIAL_SHIFT; row[ofs] = x; ofs += BSH; } else break; if(ofs < w2) { i16_4 x; i16_2 a = src1[ofs]; x.a = (a.a + INITIAL_OFFSET)>>INITIAL_SHIFT; x.c = (a.b + INITIAL_OFFSET)>>INITIAL_SHIFT; i16_2 b = src2[ofs]; x.b = (b.a + INITIAL_OFFSET)>>INITIAL_SHIFT; x.d = (b.b + INITIAL_OFFSET)>>INITIAL_SHIFT; row[ofs] = x; ofs += BSH; } else break; if(ofs < w2) { i16_4 x; i16_2 a = src1[ofs]; x.a = (a.a + INITIAL_OFFSET)>>INITIAL_SHIFT; x.c = (a.b + INITIAL_OFFSET)>>INITIAL_SHIFT; i16_2 b = src2[ofs]; x.b = (b.a + INITIAL_OFFSET)>>INITIAL_SHIFT; x.d = (b.b + INITIAL_OFFSET)>>INITIAL_SHIFT; row[ofs] = x; ofs += BSH; } else break; } } } #define BROWS (2*BSVY+COPYROWS) /* Rows to process at once */ #define SKIPTOP COPYROWS #define PAD_ROWS (WRITEBACK-SKIPTOP+RRIGHT+COPYROWS) /* Rows below which to use s_transform_v_pad */ /// tid is BCOLSxBROWS matrix /// RLEFT+BROWS+RRIGHT rows #define TOTALROWS (RLEFT+BROWS+RRIGHT) #define OVERLAP (RLEFT+RRIGHT+COPYROWS) #define OVERLAP_OFFSET (TOTALROWS-OVERLAP) #define WRITEBACK (2*BSVY) __device__ void doTransform(int xofs) { const int tidx = (threadIdx.x<<1)+xofs; // column const int tidy = threadIdx.y; // row extern __shared__ DATATYPE shared[]; int ofs; ofs = ((RLEFT+(tidy<<1)+3)<> STAGE4_SHIFT; } __syncthreads(); /* Phase 3 at +2*BCOLS */ ofs -= BCOLS; { int acc = STAGE3_OFFSET; acc += __mul24(STAGE3_COEFF,shared[ofs-BCOLS]); acc += __mul24(STAGE3_COEFF,shared[ofs+BCOLS]); shared[ofs] -= acc >> STAGE3_SHIFT; } __syncthreads(); /* Phase 2 at +1*BCOLS */ ofs -= BCOLS; { int acc = STAGE2_OFFSET; acc += __mul24(STAGE2_COEFF,shared[ofs-BCOLS]); acc += __mul24(STAGE2_COEFF,shared[ofs+BCOLS]); shared[ofs] -= acc >> STAGE2_SHIFT; } __syncthreads(); /* Phase 1 at +0*BCOLS */ ofs -= BCOLS; { int acc = STAGE1_OFFSET; acc += __mul24(STAGE1_COEFF, shared[ofs-BCOLS]); acc += __mul24(STAGE1_COEFF, shared[ofs+BCOLS]); shared[ofs] -= acc >> STAGE1_SHIFT; } } __device__ void doTransformTB(int xofs, unsigned int leftover) { const int tidx = (threadIdx.x<<1)+xofs; // column const int tidy = threadIdx.y; // row const int minn = (RLEFT<> STAGE4_SHIFT; } __syncthreads(); /* Phase 3 (odd) */ ofs += BCOLS; { int acc = STAGE3_OFFSET; acc += __mul24(STAGE3_COEFF, shared[ofs-BCOLS]); acc += __mul24(STAGE3_COEFF, shared[min(ofs+BCOLS,maxx)]); shared[ofs] -= acc >> STAGE3_SHIFT; } __syncthreads(); /* Phase 2 (even) */ ofs -= BCOLS; { int acc = STAGE2_OFFSET; acc += __mul24(STAGE2_COEFF,shared[max(ofs-BCOLS, minn+BCOLS)]); acc += __mul24(STAGE2_COEFF,shared[ofs+BCOLS]); shared[ofs] -= acc >> STAGE2_SHIFT; } __syncthreads(); /* Phase 1 (odd) */ ofs += BCOLS; { int acc = STAGE1_OFFSET; acc += __mul24(STAGE1_COEFF, shared[ofs-BCOLS]); acc += __mul24(STAGE1_COEFF, shared[min(ofs+BCOLS,maxx)]); shared[ofs] -= acc >> STAGE1_SHIFT; } } __device__ void doTransformT(int xofs) { const int tidx = (threadIdx.x<<1)+xofs; // column const int tidy = threadIdx.y; // row const int minn = ((RLEFT+SKIPTOP)<> STAGE4_SHIFT; } __syncthreads(); /* Phase 3 (odd), offset +1 */ ofs += BCOLS; if(tidy != (BSVY-1)) { int acc = STAGE3_OFFSET; acc += __mul24(STAGE3_COEFF, shared[ofs-BCOLS]); acc += __mul24(STAGE3_COEFF, shared[ofs+BCOLS]); shared[ofs] -= acc >> STAGE3_SHIFT; } __syncthreads(); /* Phase 2 (even), offset +0 */ ofs -= BCOLS; if(tidy != (BSVY-1)) { int acc = STAGE2_OFFSET; acc += __mul24(STAGE2_COEFF,shared[max(ofs-BCOLS, minn+BCOLS)]); acc += __mul24(STAGE2_COEFF,shared[ofs+BCOLS]); shared[ofs] -= acc >> STAGE2_SHIFT; } __syncthreads(); /* Phase 1 (odd), offset +1 */ ofs += BCOLS; if(tidy < (BSVY-2)) { int acc = STAGE1_OFFSET; acc += __mul24(STAGE1_COEFF, shared[ofs-BCOLS]); acc += __mul24(STAGE1_COEFF, shared[ofs+BCOLS]); shared[ofs] -= acc >> STAGE1_SHIFT; } } __device__ void doTransformB(int xofs, unsigned int leftover) { const int tidx = (threadIdx.x<<1)+xofs; // column const int tidy = threadIdx.y; // row const int maxx = leftover-(2<> STAGE4_SHIFT; } __syncthreads(); for(ofs_t=ofs+2*BCOLS; ofs_t> STAGE3_SHIFT; } __syncthreads(); for(ofs_t=ofs+1*BCOLS; ofs_t> STAGE2_SHIFT; } __syncthreads(); for(ofs_t=ofs+0*BCOLS; ofs_t> STAGE1_SHIFT; } } #if 0 // Rolled #define READ_LOOP(rows) for(; sofs < (rows); sofs += (BCOLS*BSVY), gofs += istride) *((uint32_t*)&shared[sofs]) = *((uint32_t*)&data[gofs]); #define WRITE_LOOP(rows) for(; sofs < (rows); sofs += (BCOLS*BSVY), gofs += istride) *((uint32_t*)&data[gofs]) = *((uint32_t*)&shared[sofs]); #endif #if 1 // Unrolled #define READ_LOOP_ENTRY(rows) if(sofs < (rows)) { *((uint32_t*)&shared[sofs]) = *((uint32_t*)&data[gofs]); sofs += (BCOLS*BSVY); gofs += istride; } else break; #define READ_LOOP(rows) while(1) { READ_LOOP_ENTRY(rows); READ_LOOP_ENTRY(rows); } #define WRITE_LOOP_ENTRY(rows) if(sofs < (rows)) { *((uint32_t*)&data[gofs]) = *((uint32_t*)&shared[sofs]); sofs += (BCOLS*BSVY); gofs += istride; } else break; #define WRITE_LOOP(rows) while(1) { WRITE_LOOP_ENTRY(rows); WRITE_LOOP_ENTRY(rows); } #endif #if 0 // Unrolled #define READ_LOOP_ENTRY(rows) if(sofs < (rows)) { *((uint32_t*)&shared[sofs]) = *((uint32_t*)&data[gofs]); sofs += (BCOLS*BSVY); gofs += istride; } #define READ_LOOP(rows) READ_LOOP_ENTRY(rows); READ_LOOP_ENTRY(rows); READ_LOOP_ENTRY(rows); #define WRITE_LOOP_ENTRY(rows) if(sofs < (rows)) { *((uint32_t*)&data[gofs]) = *((uint32_t*)&shared[sofs]); sofs += (BCOLS*BSVY); gofs += istride; } #define WRITE_LOOP(rows) WRITE_LOOP_ENTRY(rows); WRITE_LOOP_ENTRY(rows); WRITE_LOOP_ENTRY(rows); #endif static __global__ void s_transform_v( DATATYPE* data, int width, int height, int stride ) { extern __shared__ DATATYPE shared[]; const unsigned int bid = blockIdx.x; // slab (BCOLS columns) const unsigned int tidx = threadIdx.x<<1; // column const unsigned int tidy = threadIdx.y; // row const unsigned int swidth = min(width-(bid<>>(d_data, lwidth, lheight, stride); else s_transform_v<<>>(d_data, lwidth, lheight, stride); #endif #ifdef HORIZONTAL block_size.x = BSH; block_size.y = 1; block_size.z = 1; grid_size.x = lheight; grid_size.y = 1; grid_size.z = 1; shared_size = (lwidth+BLEFT*2+BRIGHT*2) * sizeof(DATATYPE); s_transform_h<<>>(d_data, lwidth, stride); #endif } schroedinger-1.0.11/schroedinger/cuda/iwtfidelity.cu0000644000175000017500000005003510737003215017446 00000000000000 // Autogenerated by WaveGen.py, do not edit! // #include #include #include "common.h" #include "wavelet_common.h" /// Boundaries (depends on wavelet) /// This much is reserved at the sides of the signal /// Must be even! #define BLEFT 4 #define BRIGHT 4 /// Initial shift (to keep precision in integer wavelets) #define INITIAL_SHIFT 0 #define INITIAL_OFFSET 0 // static const int16_t stage1_weights[] = { -8, 21, -46, 161, 161, -46, 21, -8 }; // static const int16_t stage2_weights[] = { 2, -10, 25, -81, -81, 25, -10, 2 }; #define STAGE1_OFFSET 128 #define STAGE1_SHIFT 8 #define STAGE1_COEFF0 (-8) #define STAGE1_COEFF1 (21) #define STAGE1_COEFF2 (-46) #define STAGE1_COEFF3 (161) #define STAGE1_COEFF4 (161) #define STAGE1_COEFF5 (-46) #define STAGE1_COEFF6 (21) #define STAGE1_COEFF7 (-8) #define STAGE2_OFFSET 127 #define STAGE2_SHIFT 8 #define STAGE2_COEFF0 (2) #define STAGE2_COEFF1 (-10) #define STAGE2_COEFF2 (25) #define STAGE2_COEFF3 (-81) #define STAGE2_COEFF4 (-81) #define STAGE2_COEFF5 (25) #define STAGE2_COEFF6 (-10) #define STAGE2_COEFF7 (2) /// Vertical pass row management #define RLEFT 6 #define RRIGHT 6 #define COPYROWS 8 static __global__ void a_transform_h( DATATYPE* data, int width, int stride ) { extern __shared__ DATATYPE shared[]; const int bid = blockIdx.x; // row const int tid = threadIdx.x; // thread id within row const int tidu16 = ((tid&16)>>4)|((tid&15)<<1)|(tid&~31); data += __mul24(bid, stride); // Load entire line into shared memory // Deinterleave right here int half = BLEFT+(width>>1)+BRIGHT; unsigned int ofs; // Shared memory output offset for this thread i16_2 *row = (i16_2*)data; for(ofs = tid; ofs < (width>>1); ofs += BSH) { i16_2 val = row[ofs]; shared[BLEFT + ofs] = val.a << INITIAL_SHIFT; // even shared[BLEFT + ofs + half] = val.b << INITIAL_SHIFT; // odd } __syncthreads(); if(tidu16<4) { /* lo[-4] = lo[0]; lo[-3] = lo[0]; lo[-2] = lo[0]; lo[-1] = lo[0]; lo[n] = lo[n-1]; lo[n+1] = lo[n-1]; lo[n+2] = lo[n-1]; */ shared[half+BLEFT-4+tidu16] = shared[half+BLEFT]; shared[half+BLEFT+(width>>1)+tidu16] = shared[half+BLEFT+(width>>1)-1]; } __syncthreads(); // Now apply wavelet lifting to entire line at once // Process even const int end = BLEFT+(width>>1); for(ofs = BLEFT+tidu16; ofs < end; ofs += BSH) { int acc = STAGE1_OFFSET; acc += __mul24(STAGE1_COEFF0,shared[half+ofs-4]); acc += __mul24(STAGE1_COEFF1,shared[half+ofs-3]); acc += __mul24(STAGE1_COEFF2,shared[half+ofs-2]); acc += __mul24(STAGE1_COEFF3,shared[half+ofs-1]); acc += __mul24(STAGE1_COEFF4,shared[half+ofs+0]); acc += __mul24(STAGE1_COEFF5,shared[half+ofs+1]); acc += __mul24(STAGE1_COEFF6,shared[half+ofs+2]); acc += __mul24(STAGE1_COEFF7,shared[half+ofs+3]); shared[ofs] += acc >> STAGE1_SHIFT; } __syncthreads(); if(tidu16<4) { /* hi[-3] = hi[0]; hi[-2] = hi[0]; hi[-1] = hi[0]; hi[n] = hi[n-1]; hi[n+1] = hi[n-1]; hi[n+2] = hi[n-1]; hi[n+3] = hi[n-1]; */ shared[BLEFT-4+tidu16] = shared[BLEFT]; shared[BLEFT+(width>>1)+tidu16] = shared[BLEFT+(width>>1)-1]; } __syncthreads(); // Process odd for(ofs = BLEFT+tidu16; ofs < end; ofs += BSH) { int acc = STAGE2_OFFSET; acc += __mul24(STAGE2_COEFF0, shared[ofs-3]); acc += __mul24(STAGE2_COEFF1, shared[ofs-2]); acc += __mul24(STAGE2_COEFF2, shared[ofs-1]); acc += __mul24(STAGE2_COEFF3, shared[ofs-0]); acc += __mul24(STAGE2_COEFF4, shared[ofs+1]); acc += __mul24(STAGE2_COEFF5, shared[ofs+2]); acc += __mul24(STAGE2_COEFF6, shared[ofs+3]); acc += __mul24(STAGE2_COEFF7, shared[ofs+4]); shared[ofs + half] += acc >> STAGE2_SHIFT; } __syncthreads(); /// Write line back to global memory, don't interleave again /// Mind the gap between BLEFT+width/2 and half if(width&3) // If width is not a multiple of 4, we need to use the slower method { /// Left part (even coefficients) for(ofs = tid; ofs < (width>>1); ofs += BSH) data[ofs] = shared[BLEFT+ofs]; /// Right part (odd coefficients) for(ofs = tid; ofs < (width>>1); ofs += BSH) data[(width>>1)+ofs] = shared[half+BLEFT+ofs]; } else { /// Left part (even coefficients) for(ofs = tid; ofs < (width>>2); ofs += BSH) row[ofs] = *((i16_2*)&shared[BLEFT+(ofs<<1)]); row += (width>>2); /// Right part (odd coefficients) for(ofs = tid; ofs < (width>>2); ofs += BSH) row[ofs] = *((i16_2*)&shared[half+BLEFT+(ofs<<1)]); } } #define BROWS (2*BSVY+COPYROWS) /* Rows to process at once */ #define SKIPTOP COPYROWS #define PAD_ROWS (WRITEBACK-SKIPTOP+RRIGHT+COPYROWS) /* Rows below which to use s_transform_v_pad */ /// tid is BCOLSxBROWS matrix /// RLEFT+BROWS+RRIGHT rows #define TOTALROWS (RLEFT+BROWS+RRIGHT) #define OVERLAP (RLEFT+RRIGHT+COPYROWS) #define OVERLAP_OFFSET (TOTALROWS-OVERLAP) #define WRITEBACK (2*BSVY) __device__ void doTransform(int xofs) { const int tidx = (threadIdx.x<<1)+xofs; // column const int tidy = threadIdx.y; // row extern __shared__ DATATYPE shared[]; int ofs; ofs = ((RLEFT+(tidy<<1)+8)<> STAGE1_SHIFT; } __syncthreads(); /* Phase 2 (odd) at +1*BCOLS */ ofs -= 7*BCOLS; { int acc = STAGE2_OFFSET; acc += __mul24(STAGE2_COEFF0, shared[ofs-7*BCOLS]); acc += __mul24(STAGE2_COEFF1, shared[ofs-5*BCOLS]); acc += __mul24(STAGE2_COEFF2, shared[ofs-3*BCOLS]); acc += __mul24(STAGE2_COEFF3, shared[ofs-1*BCOLS]); acc += __mul24(STAGE2_COEFF4, shared[ofs+1*BCOLS]); acc += __mul24(STAGE2_COEFF5, shared[ofs+3*BCOLS]); acc += __mul24(STAGE2_COEFF6, shared[ofs+5*BCOLS]); acc += __mul24(STAGE2_COEFF7, shared[ofs+7*BCOLS]); shared[ofs] += acc >> STAGE2_SHIFT; } } // Process 16 lines __device__ void doTransformTB(int xofs, unsigned int leftover) { const int tidx = (threadIdx.x<<1)+xofs; // column const int tidy = threadIdx.y; // row const int minn = (RLEFT<> STAGE1_SHIFT; } __syncthreads(); /* Phase 2 (odd) */ for(ofs_t=ofs+1*BCOLS; ofs_t> STAGE2_SHIFT; } } // Process BROWS-2 lines __device__ void doTransformT(int xofs) { const int tidx = (threadIdx.x<<1)+xofs; // column const int tidy = threadIdx.y; // row const int minn = ((RLEFT+SKIPTOP)<> STAGE1_SHIFT; } __syncthreads(); /* Phase 2 (odd), offset +1, stop at -8 */ ofs += BCOLS; if(tidy<(BSVY-4)) { int acc = STAGE2_OFFSET; acc += __mul24(STAGE2_COEFF0, shared[max(ofs-7*BCOLS, minn)]); acc += __mul24(STAGE2_COEFF1, shared[max(ofs-5*BCOLS, minn)]); acc += __mul24(STAGE2_COEFF2, shared[max(ofs-3*BCOLS, minn)]); acc += __mul24(STAGE2_COEFF3, shared[ofs-1*BCOLS]); acc += __mul24(STAGE2_COEFF4, shared[ofs+1*BCOLS]); acc += __mul24(STAGE2_COEFF5, shared[ofs+3*BCOLS]); acc += __mul24(STAGE2_COEFF6, shared[ofs+5*BCOLS]); acc += __mul24(STAGE2_COEFF7, shared[ofs+7*BCOLS]); shared[ofs] += acc >> STAGE2_SHIFT; } } // Finish off leftover __device__ void doTransformB(int xofs, unsigned int leftover) { const int tidx = (threadIdx.x<<1)+xofs; // column const int tidy = threadIdx.y; // row const int maxx = leftover-(2<> STAGE1_SHIFT; } __syncthreads(); for(ofs_t=ofs+1*BCOLS; ofs_t> STAGE2_SHIFT; } } static __global__ void a_transform_v( DATATYPE* data, int width, int height, int stride ) { extern __shared__ DATATYPE shared[]; const unsigned int bid = blockIdx.x; // slab (BCOLS columns) const unsigned int tidx = threadIdx.x<<1; // column const unsigned int tidy = threadIdx.y; // row const unsigned int swidth = min(width-(bid<>>(d_data, lwidth, stride); #endif #ifdef VERTICAL block_size.x = BSVX; block_size.y = BSVY; block_size.z = 1; grid_size.x = (lwidth+BCOLS-1)/BCOLS; grid_size.y = 1; grid_size.z = 1; shared_size = BCOLS*(BROWS+RLEFT+RRIGHT)*2; if(lheight < PAD_ROWS) a_transform_v_pad<<>>(d_data, lwidth, lheight, stride); else a_transform_v<<>>(d_data, lwidth, lheight, stride); #endif } schroedinger-1.0.11/schroedinger/cuda/frame.cu0000644000175000017500000001750310737003215016206 00000000000000/// XXX speed up by using shared memory / coalescing? #ifdef _WIN32 # define NOMINMAX #endif // includes, system #include #include #include #include // includes, project //#include #include #include #include #define THREADS 256 #include "common.h" #include "convert_base_coalesce.h" //#include "convert_base.h" #include "convert_packed.h" #include "arith_coalesce.h" //#include "arith.h" extern "C" { void cuda_convert_u8_s16(uint8_t* dst, int dstride, int dwidth, int dheight, int16_t* src, int sstride, int swidth, int sheight, cudaStream_t stream) { dim3 block_size, grid_size; int shared_size; block_size.x = THREADS; block_size.y = block_size.z = 1; grid_size.x = dheight; grid_size.y = grid_size.z = 1; shared_size = 0; convert_u8_s16<<>>(dst, dstride, dwidth, src, sstride, swidth, sheight); } void cuda_convert_s16_u8(int16_t* dst, int dstride, int dwidth, int dheight, uint8_t* src, int sstride, int swidth, int sheight, cudaStream_t stream) { dim3 block_size, grid_size; int shared_size; block_size.x = THREADS; block_size.y = block_size.z = 1; grid_size.x = dheight; grid_size.y = grid_size.z = 1; shared_size = 0; convert_s16_u8<<>>(dst, dstride, dwidth, src, sstride, swidth, sheight); } void cuda_convert_u8_u8(uint8_t* dst, int dstride, int dwidth, int dheight, uint8_t* src, int sstride, int swidth, int sheight, cudaStream_t stream) { dim3 block_size, grid_size; int shared_size; block_size.x = THREADS; block_size.y = block_size.z = 1; grid_size.x = dheight; grid_size.y = grid_size.z = 1; shared_size = 0; convert_u8_u8<<>>(dst, dstride, dwidth, src, sstride, swidth, sheight); } void cuda_convert_s16_s16(int16_t* dst, int dstride, int dwidth, int dheight, int16_t* src, int sstride, int swidth, int sheight, cudaStream_t stream) { dim3 block_size, grid_size; int shared_size; block_size.x = THREADS; block_size.y = block_size.z = 1; grid_size.x = dheight; grid_size.y = grid_size.z = 1; shared_size = 0; convert_s16_s16<<>>(dst, dstride, dwidth, src, sstride, swidth, sheight); } void cuda_convert_u8_422_yuyv(uint8_t* dsty, int ystride, uint8_t* dstu, int ustride, uint8_t* dstv, int vstride, int dwidth, int dheight, uint8_t* _src, int sstride, int swidth, int sheight, cudaStream_t stream) { dim3 block_size, grid_size; int shared_size; dwidth >>= 1; swidth >>= 1; block_size.x = THREADS; block_size.y = block_size.z = 1; grid_size.x = dheight; grid_size.y = grid_size.z = 1; shared_size = 0; convert_u8_422_yuyv<<>>(dsty, ystride, dstu, ustride, dstv, vstride, dwidth, _src, sstride, swidth, sheight); } void cuda_convert_u8_422_uyvy(uint8_t* dsty, int ystride, uint8_t* dstu, int ustride, uint8_t* dstv, int vstride, int dwidth, int dheight, uint8_t* _src, int sstride, int swidth, int sheight, cudaStream_t stream) { dim3 block_size, grid_size; int shared_size; dwidth >>= 1; swidth >>= 1; block_size.x = THREADS; block_size.y = block_size.z = 1; grid_size.x = dheight; grid_size.y = grid_size.z = 1; shared_size = 0; convert_u8_422_uyvy<<>>(dsty, ystride, dstu, ustride, dstv, vstride, dwidth, _src, sstride, swidth, sheight); } void cuda_convert_u8_444_ayuv(uint8_t* dsty, int ystride, uint8_t* dstu, int ustride, uint8_t* dstv, int vstride, int dwidth, int dheight, uint8_t* _src, int sstride, int swidth, int sheight, cudaStream_t stream) { dim3 block_size, grid_size; int shared_size; block_size.x = THREADS; block_size.y = block_size.z = 1; grid_size.x = dheight; grid_size.y = grid_size.z = 1; shared_size = 0; convert_u8_444_ayuv<<>>(dsty, ystride, dstu, ustride, dstv, vstride, dwidth, _src, sstride, swidth, sheight); } void cuda_convert_yuyv_u8_422 (uint8_t* _dst, int dstride, int dwidth, int dheight, uint8_t* srcy, int ystride, uint8_t* srcu, int ustride, uint8_t* srcv, int vstride, int swidth, int sheight, cudaStream_t stream) { dim3 block_size, grid_size; int shared_size; dwidth >>= 1; swidth >>= 1; block_size.x = THREADS; block_size.y = block_size.z = 1; grid_size.x = dheight; grid_size.y = grid_size.z = 1; shared_size = 0; convert_yuyv_u8_422<<>>(_dst, dstride, dwidth, srcy, ystride, srcu, ustride, srcv, vstride, swidth, sheight); } void cuda_convert_uyvy_u8_422 (uint8_t* _dst, int dstride, int dwidth, int dheight, uint8_t* srcy, int ystride, uint8_t* srcu, int ustride, uint8_t* srcv, int vstride, int swidth, int sheight, cudaStream_t stream) { dim3 block_size, grid_size; int shared_size; dwidth >>= 1; swidth >>= 1; block_size.x = THREADS; block_size.y = block_size.z = 1; grid_size.x = dheight; grid_size.y = grid_size.z = 1; shared_size = 0; convert_uyvy_u8_422<<>>(_dst, dstride, dwidth, srcy, ystride, srcu, ustride, srcv, vstride, swidth, sheight); } void cuda_convert_ayuv_u8_444 (uint8_t* _dst, int dstride, int dwidth, int dheight, uint8_t* srcy, int ystride, uint8_t* srcu, int ustride, uint8_t* srcv, int vstride, int swidth, int sheight, cudaStream_t stream) { dim3 block_size, grid_size; int shared_size; block_size.x = THREADS; block_size.y = block_size.z = 1; grid_size.x = dheight; grid_size.y = grid_size.z = 1; shared_size = 0; convert_ayuv_u8_444<<>>(_dst, dstride, dwidth, srcy, ystride, srcu, ustride, srcv, vstride, swidth, sheight); } void cuda_subtract_s16_u8(int16_t* dst, int dstride, int dwidth, int dheight, uint8_t* src, int sstride, int swidth, int sheight, cudaStream_t stream) { dim3 block_size, grid_size; int shared_size; block_size.x = THREADS; block_size.y = block_size.z = 1; grid_size.x = std::min(dheight, sheight); grid_size.y = grid_size.z = 1; shared_size = 0; subtract_s16_u8<<>>(dst, dstride, src, sstride, std::min(swidth, dwidth)); } void cuda_subtract_s16_s16(int16_t* dst, int dstride, int dwidth, int dheight, int16_t* src, int sstride, int swidth, int sheight, cudaStream_t stream) { dim3 block_size, grid_size; int shared_size; block_size.x = THREADS; block_size.y = block_size.z = 1; grid_size.x = std::min(dheight, sheight); grid_size.y = grid_size.z = 1; shared_size = 0; subtract_s16_s16<<>>(dst, dstride, src, sstride, std::min(swidth, dwidth)); } void cuda_add_s16_u8(int16_t* dst, int dstride, int dwidth, int dheight, uint8_t* src, int sstride, int swidth, int sheight, cudaStream_t stream) { dim3 block_size, grid_size; int shared_size; block_size.x = THREADS; block_size.y = block_size.z = 1; grid_size.x = std::min(dheight, sheight); grid_size.y = grid_size.z = 1; shared_size = 0; add_s16_u8<<>>(dst, dstride, src, sstride, std::min(swidth, dwidth)); } void cuda_add_s16_s16(int16_t* dst, int dstride, int dwidth, int dheight, int16_t* src, int sstride, int swidth, int sheight, cudaStream_t stream) { dim3 block_size, grid_size; int shared_size; block_size.x = THREADS; block_size.y = block_size.z = 1; grid_size.x = std::min(dheight, sheight); grid_size.y = grid_size.z = 1; shared_size = 0; add_s16_s16<<>>(dst, dstride, src, sstride, std::min(swidth, dwidth)); } } schroedinger-1.0.11/schroedinger/schrovirtframe.h0000644000175000017500000000424611704365701017064 00000000000000 #ifndef __SCHRO_VIRT_FRAME_H__ #define __SCHRO_VIRT_FRAME_H__ #include #include SCHRO_BEGIN_DECLS #ifdef SCHRO_ENABLE_UNSTABLE_API SchroFrame *schro_frame_new_virtual (SchroMemoryDomain *domain, SchroFrameFormat format, int width, int height); void *schro_virt_frame_get_line (SchroFrame *frame, int component, int i); void *schro_virt_frame_get_line_unrendered (SchroFrame *frame, int component, int i); void schro_virt_frame_set_line_rendered (SchroFrame *frame, int component, int i); void schro_virt_frame_render_line (SchroFrame *frame, void *dest, int component, int i); void schro_virt_frame_render (SchroFrame *frame, SchroFrame *dest); SchroFrame *schro_virt_frame_new_horiz_downsample (SchroFrame *vf, int cosite); SchroFrame *schro_virt_frame_new_vert_downsample (SchroFrame *vf, int cosite); SchroFrame *schro_virt_frame_new_vert_resample (SchroFrame *vf, int height); SchroFrame *schro_virt_frame_new_horiz_resample (SchroFrame *vf, int width); SchroFrame *schro_virt_frame_new_unpack (SchroFrame *vf); SchroFrame *schro_virt_frame_new_pack_YUY2 (SchroFrame *vf); SchroFrame *schro_virt_frame_new_pack_UYVY (SchroFrame *vf); SchroFrame *schro_virt_frame_new_pack_AYUV (SchroFrame *vf); SchroFrame *schro_virt_frame_new_pack_v216 (SchroFrame *vf); SchroFrame *schro_virt_frame_new_pack_v210 (SchroFrame *vf); SchroFrame *schro_virt_frame_new_pack_RGB (SchroFrame *vf); SchroFrame *schro_virt_frame_new_pack_AY64 (SchroFrame * vf); SchroFrame *schro_virt_frame_new_color_matrix (SchroFrame *vf); SchroFrame *schro_virt_frame_new_subsample (SchroFrame *vf, SchroFrameFormat format); SchroFrame * schro_virt_frame_new_convert_u8 (SchroFrame *vf); SchroFrame * schro_virt_frame_new_convert_u8_s32 (SchroFrame *vf); SchroFrame * schro_virt_frame_new_convert_s16 (SchroFrame *vf); SchroFrame * schro_virt_frame_new_convert_s32 (SchroFrame * vf); SchroFrame * schro_virt_frame_new_crop (SchroFrame *vf, int width, int height); SchroFrame * schro_virt_frame_new_edgeextend (SchroFrame *vf, int width, int height); SchroFrame * schro_virt_frame_new_interlace (SchroFrame *vf_top, SchroFrame *vf_bottom); #endif SCHRO_END_DECLS #endif schroedinger-1.0.11/schroedinger/schroframe.h0000644000175000017500000001702611704400006016143 00000000000000 #ifndef __SCHRO_FRAME_H__ #define __SCHRO_FRAME_H__ #include #include SCHRO_BEGIN_DECLS typedef struct _SchroFrame SchroFrame; typedef struct _SchroFrameData SchroFrameData; typedef struct _SchroUpsampledFrame SchroUpsampledFrame; typedef void (*SchroFrameFreeFunc)(SchroFrame *frame, void *priv); typedef void (*SchroFrameRenderFunc)(SchroFrame *frame, void *dest, int component, int i); /* bit pattern: * 0x100 - 0: normal, 1: indirect (packed) * 0x001 - horizontal chroma subsampling: 0: 1, 1: 2 * 0x002 - vertical chroma subsampling: 0: 1, 1: 2 * 0x00c - depth: 0: u8, 1: s16, 2: s32 * */ typedef enum _SchroFrameFormat { SCHRO_FRAME_FORMAT_U8_444 = 0x00, SCHRO_FRAME_FORMAT_U8_422 = 0x01, SCHRO_FRAME_FORMAT_U8_420 = 0x03, SCHRO_FRAME_FORMAT_S16_444 = 0x04, SCHRO_FRAME_FORMAT_S16_422 = 0x05, SCHRO_FRAME_FORMAT_S16_420 = 0x07, SCHRO_FRAME_FORMAT_S32_444 = 0x08, SCHRO_FRAME_FORMAT_S32_422 = 0x09, SCHRO_FRAME_FORMAT_S32_420 = 0x0b, /* indirectly supported */ SCHRO_FRAME_FORMAT_YUYV = 0x100, /* YUYV order */ SCHRO_FRAME_FORMAT_UYVY = 0x101, /* UYVY order */ SCHRO_FRAME_FORMAT_AYUV = 0x102, SCHRO_FRAME_FORMAT_ARGB = 0x103, SCHRO_FRAME_FORMAT_RGB = 0x104, SCHRO_FRAME_FORMAT_v216 = 0x105, SCHRO_FRAME_FORMAT_v210 = 0x106, SCHRO_FRAME_FORMAT_AY64 = 0x107 } SchroFrameFormat; #define SCHRO_FRAME_FORMAT_DEPTH(format) ((format) & 0xc) #define SCHRO_FRAME_FORMAT_DEPTH_U8 0x00 #define SCHRO_FRAME_FORMAT_DEPTH_S16 0x04 #define SCHRO_FRAME_FORMAT_DEPTH_S32 0x08 #define SCHRO_FRAME_FORMAT_H_SHIFT(format) ((format) & 0x1) #define SCHRO_FRAME_FORMAT_V_SHIFT(format) (((format)>>1) & 0x1) #define SCHRO_FRAME_IS_PACKED(format) (((format)>>8) & 0x1) #define SCHRO_FRAME_CACHE_SIZE 32 struct _SchroFrameData { SchroFrameFormat format; void *data; int stride; int width; int height; int length; int h_shift; int v_shift; }; struct _SchroFrame { int refcount; SchroFrameFreeFunc free; SchroMemoryDomain *domain; void *regions[3]; void *priv; SchroFrameFormat format; int width; int height; SchroFrameData components[3]; int is_virtual; int cached_lines[3][SCHRO_FRAME_CACHE_SIZE]; SchroFrame *virt_frame1; SchroFrame *virt_frame2; void (*render_line) (SchroFrame *frame, void *dest, int component, int i); void *virt_priv; void *virt_priv2; int extension; int cache_offset[3]; int is_upsampled; }; struct _SchroUpsampledFrame { SchroFrame *frames[4]; }; #define SCHRO_FRAME_DATA_GET_LINE(fd,i) (SCHRO_OFFSET((fd)->data,(fd)->stride*(i))) #define SCHRO_FRAME_DATA_GET_PIXEL_U8(fd,i,j) ((uint8_t *)SCHRO_OFFSET((fd)->data,(fd)->stride*(j)+(i))) #define SCHRO_FRAME_DATA_GET_PIXEL_S16(fd,i,j) ((int16_t *)SCHRO_OFFSET((fd)->data,(fd)->stride*(j)+(i)*sizeof(int16_t))) #define SCHRO_FRAME_DATA_GET_PIXEL_S32(fd,i,j) ((int32_t *)SCHRO_OFFSET((fd)->data,(fd)->stride*(j)+(i)*sizeof(int32_t))) SchroFrame * schro_frame_new (void); SchroFrame * schro_frame_new_and_alloc (SchroMemoryDomain *domain, SchroFrameFormat format, int width, int height); SchroFrame * schro_frame_new_from_data_I420 (void *data, int width, int height); SchroFrame * schro_frame_new_from_data_Y42B (void *data, int width, int height); SchroFrame * schro_frame_new_from_data_Y444 (void *data, int width, int height); SchroFrame * schro_frame_new_from_data_YV12 (void *data, int width, int height); SchroFrame * schro_frame_new_from_data_YUY2 (void *data, int width, int height); SchroFrame * schro_frame_new_from_data_UYVY (void *data, int width, int height); SchroFrame * schro_frame_new_from_data_UYVY_full (void *data, int width, int height, int stride); SchroFrame * schro_frame_new_from_data_AYUV (void *data, int width, int height); SchroFrame * schro_frame_new_from_data_v216 (void *data, int width, int height); SchroFrame * schro_frame_new_from_data_v210 (void *data, int width, int height); SchroFrame * schro_frame_new_from_data_AY64 (void *data, int width, int height); void schro_frame_set_free_callback (SchroFrame *frame, SchroFrameFreeFunc free_func, void *priv); void schro_frame_unref (SchroFrame *frame); SchroFrame *schro_frame_ref (SchroFrame *frame); SchroFrame *schro_frame_dup (SchroFrame *frame); SchroFrame *schro_frame_clone (SchroMemoryDomain *domain, SchroFrame *frame); void schro_frame_convert (SchroFrame *dest, SchroFrame *src); void schro_frame_add (SchroFrame *dest, SchroFrame *src); void schro_frame_subtract (SchroFrame *dest, SchroFrame *src); void schro_frame_shift_left (SchroFrame *frame, int shift); void schro_frame_shift_right (SchroFrame *frame, int shift); void schro_frame_clear (SchroFrame *frame); void schro_frame_downsample (SchroFrame *dest, SchroFrame *src); void schro_frame_upsample_horiz (SchroFrame *dest, SchroFrame *src); void schro_frame_upsample_vert (SchroFrame *dest, SchroFrame *src); double schro_frame_calculate_average_luma (SchroFrame *frame); SchroFrame * schro_frame_convert_to_444 (SchroFrame *frame); void schro_frame_md5 (SchroFrame *frame, uint32_t *state); #ifdef SCHRO_ENABLE_UNSTABLE_API SchroFrame * schro_frame_new_and_alloc_extended (SchroMemoryDomain *domain, SchroFrameFormat format, int width, int height, int extension); SchroFrame * schro_frame_new_and_alloc_full (SchroMemoryDomain * domain, SchroFrameFormat format, int width, int height, int extension, int upsampled); SchroFrame *schro_frame_dup_extended (SchroFrame *frame, int extension); SchroFrame *schro_frame_dup_full (SchroFrame *frame, int extension, int is_upsampled); void schro_frame_edge_extend (SchroFrame *frame, int width, int height); void schro_frame_zero_extend (SchroFrame *frame, int width, int height); void schro_frame_mark (SchroFrame *frame, int value); void schro_frame_mc_edgeextend (SchroFrame *frame); void schro_frame_data_get_codeblock (SchroFrameData *dest, SchroFrameData *src, int x, int y, int horiz_codeblocks, int vert_codeblocks); SchroUpsampledFrame * schro_upsampled_frame_new (SchroFrame *frame); void schro_upsampled_frame_free (SchroUpsampledFrame *df); void schro_upsampled_frame_upsample (SchroUpsampledFrame *df); #ifdef ENABLE_MOTION_REF int schro_upsampled_frame_get_pixel_prec0 (SchroUpsampledFrame *upframe, int k, int x, int y); int schro_upsampled_frame_get_pixel_prec1 (SchroUpsampledFrame *upframe, int k, int x, int y); int schro_upsampled_frame_get_pixel_prec3 (SchroUpsampledFrame *upframe, int k, int x, int y); int schro_upsampled_frame_get_pixel_precN (SchroUpsampledFrame *upframe, int k, int x, int y, int mv_precision); #endif void schro_upsampled_frame_get_block_precN (SchroUpsampledFrame *upframe, int k, int x, int y, int prec, SchroFrameData *dest); void schro_upsampled_frame_get_block_fast_precN (SchroUpsampledFrame *upframe, int k, int x, int y, int prec, SchroFrameData *dest, SchroFrameData *fd); void schro_upsampled_frame_get_subdata_prec0 (SchroUpsampledFrame *upframe, int k, int x, int y, SchroFrameData *fd); void schro_upsampled_frame_get_subdata_prec1 (SchroUpsampledFrame *upframe, int k, int x, int y, SchroFrameData *fd); /* it extracts a block of data from a frame, if possible */ int schro_frame_get_data (SchroFrame* frame, SchroFrameData* fd, int comp , int x, int y); void schro_frame_get_subdata (SchroFrame *frame, SchroFrameData *fd, int comp, int x, int y); void schro_frame_get_reference_subdata (SchroFrame* frame, SchroFrameData* fd , int comp, int x, int y); void schro_frame_split_fields (SchroFrame *dest1, SchroFrame *dest2, SchroFrame *src); int schro_frame_get_bit_depth (SchroFrame *frame); #endif SCHRO_END_DECLS #endif schroedinger-1.0.11/schroedinger/schrophasecorrelation.c0000644000175000017500000003431711541755167020434 00000000000000 #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #define COMPLEX_MULT_R(a,b,c,d) ((a)*(c) - (b)*(d)) #define COMPLEX_MULT_I(a,b,c,d) ((a)*(d) + (b)*(c)) static void complex_mult_f32 (float *d1, float *d2, float *s1, float *s2, float *s3, float *s4, int n) { int i; for (i = 0; i < n; i++) { d1[i] = COMPLEX_MULT_R (s1[i], s2[i], s3[i], s4[i]); d2[i] = COMPLEX_MULT_I (s1[i], s2[i], s3[i], s4[i]); } } static void complex_normalize_f32 (float *i1, float *i2, int n) { int i; float x; for (i = 0; i < n; i++) { x = sqrt (i1[i] * i1[i] + i2[i] * i2[i]); if (x > 0) x = 1 / x; i1[i] *= x; i2[i] *= x; } } static void negate_f32 (float *i1, int n) { int j; for (j = 0; j < n; j++) { i1[j] = -i1[j]; } } static int get_max_f32 (float *src, int n) { int i; float max; int max_i; max = src[0]; max_i = 0; for (i = 1; i < n; i++) { if (src[i] > max) { max_i = i; max = src[i]; } } return max_i; } static void generate_weights (float *weight, int width, int height) { int i; int j; double d2; double mid_x, mid_y; double scale_x, scale_y; double sum; double weight2; mid_x = 0.5 * (width - 1); mid_y = 0.5 * (height - 1); scale_x = 1.0 / mid_x; scale_y = 1.0 / mid_y; sum = 0; for (j = 0; j < height; j++) { for (i = 0; i < width; i++) { d2 = (i - mid_x) * (i - mid_x) * scale_x * scale_x + (j - mid_y) * (j - mid_y) * scale_y * scale_y; weight[j * width + i] = exp (-2 * d2); sum += weight[j * width + i]; } } weight2 = 1.0 / sum; for (j = 0; j < height; j++) { for (i = 0; i < width; i++) { weight[j * width + i] *= weight2; } } } static void get_image (float *image, SchroFrame * frame, int x, int y, int width, int height, float *weight) { double sum; int i, j; uint8_t *line; double weight2; sum = 0; for (j = 0; j < height; j++) { line = SCHRO_FRAME_DATA_GET_LINE (&frame->components[0], j + y); for (i = 0; i < width; i++) { sum += line[i + x] * weight[j * width + i]; } } weight2 = 1.0 / sum; for (j = 0; j < height; j++) { line = SCHRO_FRAME_DATA_GET_LINE (&frame->components[0], j + y); for (i = 0; i < width; i++) { image[j * width + i] = line[i + x] * weight[j * width + i] * weight2; } } } static void find_peak (float *ccorr, int hshift, int vshift, double *dx, double *dy) { int idx, idy; int width = 1 << hshift; int height = 1 << vshift; int i; float peak; float a, b; i = get_max_f32 (ccorr, width * height); peak = ccorr[i]; if (peak == 0) { *dx = 0; *dy = 0; } idx = i & (width - 1); if (idx >= width / 2) idx -= width; idy = i >> hshift; if (idy >= height / 2) idy -= height; #define get_ccorr_value(x,y) ccorr[((x)&(width-1)) + (((y)&(height-1))< b) { *dx = idx + 0.5 * a / peak; } else { *dx = idx - 0.5 * b / peak; } a = get_ccorr_value (idx, idy + 1); b = get_ccorr_value (idx, idy - 1); if (a > b) { *dy = idy + 0.5 * a / peak; } else { *dy = idy - 0.5 * b / peak; } get_ccorr_value (idx - 1, idy - 1) = 0; get_ccorr_value (idx, idy - 1) = 0; get_ccorr_value (idx + 1, idy - 1) = 0; get_ccorr_value (idx - 1, idy) = 0; get_ccorr_value (idx, idy) = 0; get_ccorr_value (idx + 1, idy) = 0; get_ccorr_value (idx - 1, idy + 1) = 0; get_ccorr_value (idx, idy + 1) = 0; get_ccorr_value (idx + 1, idy + 1) = 0; } #define motion_field_get(mf,x,y) \ ((mf)->motion_vectors + (y)*(mf)->x_num_blocks + (x)) static SchroFrame * get_downsampled (SchroEncoderFrame * frame, int i) { SCHRO_ASSERT (frame); SCHRO_ASSERT (frame->have_downsampling); if (i == 0) { return frame->filtered_frame; } return frame->downsampled_frames[i - 1]; } #if 0 typedef struct _SchroMVComp SchroMVComp; struct _SchroMVComp { int metric; SchroFrame *frame; SchroFrame *ref; int dx, dy; }; static void schro_mvcomp_init (SchroMVComp * mvcomp, SchroFrame * frame, SchroFrame * ref) { memset (mvcomp, 0, sizeof (*mvcomp)); mvcomp->metric = 32000; mvcomp->frame = frame; mvcomp->ref = ref; } static void schro_mvcomp_add (SchroMVComp * mvcomp, int i, int j, int dx, int dy) { int metric; #if 0 metric = schro_frame_get_metric (mvcomp->frame, i * 8, j * 8, mvcomp->ref, i * 8 + dx, j * 8 + dy); #endif metric = 0x7fffffff; if (metric < mvcomp->metric) { mvcomp->metric = metric; mvcomp->dx = dx; mvcomp->dy = dy; } } #endif SchroPhaseCorr * schro_phasecorr_new (SchroEncoderFrame * frame, SchroEncoderFrame * ref) { SchroPhaseCorr *pc; pc = schro_malloc0 (sizeof (SchroPhaseCorr)); pc->frame = frame; pc->ref = ref; return pc; } void schro_phasecorr_free (SchroPhaseCorr * pc) { int i; for (i = 0; i < pc->n_levels; i++) { schro_free (pc->levels[i].vecs_dx); schro_free (pc->levels[i].vecs_dy); schro_free (pc->levels[i].vecs2_dx); schro_free (pc->levels[i].vecs2_dy); } schro_free (pc); } static void schro_phasecorr_cleanup (SchroPhaseCorr * pc) { schro_free (pc->s); schro_free (pc->c); schro_free (pc->weight); schro_free (pc->zero); schro_free (pc->image1); schro_free (pc->image2); schro_free (pc->ft1r); schro_free (pc->ft1i); schro_free (pc->ft2r); schro_free (pc->ft2i); schro_free (pc->conv_r); schro_free (pc->conv_i); schro_free (pc->resr); schro_free (pc->resi); } static void schro_phasecorr_setup (SchroPhaseCorr * pc, int level, int picture_shift, int hshift, int vshift) { pc->picture_shift = picture_shift; pc->levels[level].hshift = hshift; pc->levels[level].vshift = vshift; pc->levels[level].width = 1 << hshift; pc->levels[level].height = 1 << vshift; pc->shift = hshift + vshift; pc->n = 1 << pc->shift; pc->s = schro_malloc (pc->n * sizeof (float)); pc->c = schro_malloc (pc->n * sizeof (float)); pc->weight = schro_malloc (pc->n * sizeof (float)); pc->zero = schro_malloc (pc->n * sizeof (float)); memset (pc->zero, 0, pc->n * sizeof (float)); pc->image1 = schro_malloc (pc->n * sizeof (float)); pc->image2 = schro_malloc (pc->n * sizeof (float)); pc->ft1r = schro_malloc (pc->n * sizeof (float)); pc->ft1i = schro_malloc (pc->n * sizeof (float)); pc->ft2r = schro_malloc (pc->n * sizeof (float)); pc->ft2i = schro_malloc (pc->n * sizeof (float)); pc->conv_r = schro_malloc (pc->n * sizeof (float)); pc->conv_i = schro_malloc (pc->n * sizeof (float)); pc->resr = schro_malloc (pc->n * sizeof (float)); pc->resi = schro_malloc (pc->n * sizeof (float)); generate_weights (pc->weight, pc->levels[level].width, pc->levels[level].height); schro_fft_generate_tables_f32 (pc->c, pc->s, pc->shift); pc->levels[level].num_x = ((pc->frame->filtered_frame->width >> picture_shift) - pc->levels[level].width) / (pc->levels[level].width / 2) + 2; pc->levels[level].num_y = ((pc->frame->filtered_frame->height >> picture_shift) - pc->levels[level].height) / (pc->levels[level].height / 2) + 2; pc->levels[level].vecs_dx = schro_malloc (sizeof (int) * pc->levels[level].num_x * pc->levels[level].num_y); pc->levels[level].vecs_dy = schro_malloc (sizeof (int) * pc->levels[level].num_x * pc->levels[level].num_y); pc->levels[level].vecs2_dx = schro_malloc (sizeof (int) * pc->levels[level].num_x * pc->levels[level].num_y); pc->levels[level].vecs2_dy = schro_malloc (sizeof (int) * pc->levels[level].num_x * pc->levels[level].num_y); } static void do_phase_corr (SchroPhaseCorr * pc, int level) { int ix, iy; int x, y; SchroFrame *src_frame; SchroFrame *ref_frame; src_frame = get_downsampled (pc->frame, pc->picture_shift); ref_frame = get_downsampled (pc->ref, pc->picture_shift); for (iy = 0; iy < pc->levels[level].num_y; iy++) { for (ix = 0; ix < pc->levels[level].num_x; ix++) { double dx, dy; x = ((src_frame->width - pc->levels[level].width) * ix) / (pc->levels[level].num_x - 1); y = ((src_frame->height - pc->levels[level].height) * iy) / (pc->levels[level].num_y - 1); get_image (pc->image1, src_frame, x, y, pc->levels[level].width, pc->levels[level].height, pc->weight); get_image (pc->image2, ref_frame, x, y, pc->levels[level].width, pc->levels[level].height, pc->weight); schro_fft_fwd_f32 (pc->ft1r, pc->ft1i, pc->image1, pc->zero, pc->c, pc->s, pc->shift); schro_fft_fwd_f32 (pc->ft2r, pc->ft2i, pc->image2, pc->zero, pc->c, pc->s, pc->shift); negate_f32 (pc->ft2i, pc->n); complex_mult_f32 (pc->conv_r, pc->conv_i, pc->ft1r, pc->ft1i, pc->ft2r, pc->ft2i, pc->n); complex_normalize_f32 (pc->conv_r, pc->conv_i, pc->n); schro_fft_rev_f32 (pc->resr, pc->resi, pc->conv_r, pc->conv_i, pc->c, pc->s, pc->shift); find_peak (pc->resr, pc->levels[level].hshift, pc->levels[level].vshift, &dx, &dy); #if 0 schro_dump (SCHRO_DUMP_PHASE_CORR, "%d %d %d %g %g\n", frame->frame_number, x, y, dx, dy); #endif pc->levels[level].vecs_dx[iy * pc->levels[level].num_x + ix] = rint (-dx * (1 << pc->picture_shift)); pc->levels[level].vecs_dy[iy * pc->levels[level].num_x + ix] = rint (-dy * (1 << pc->picture_shift)); find_peak (pc->resr, pc->levels[level].hshift, pc->levels[level].vshift, &dx, &dy); pc->levels[level].vecs2_dx[iy * pc->levels[level].num_x + ix] = rint (-dx * (1 << pc->picture_shift)); pc->levels[level].vecs2_dy[iy * pc->levels[level].num_x + ix] = rint (-dy * (1 << pc->picture_shift)); } } } #if 0 static void do_motion_field (SchroPhaseCorr * pc, int level) { SchroParams *params = &pc->frame->params; SchroMotionField *mf; SchroFrame *ref; SchroFrame *src; int x, y; int ix, iy; int k, l; mf = schro_motion_field_new (params->x_num_blocks, params->y_num_blocks); src = get_downsampled (pc->frame, 0); ref = get_downsampled (pc->ref, 0); for (l = 0; l < params->y_num_blocks; l++) { for (k = 0; k < params->x_num_blocks; k++) { SchroMotionVector *mv; int ymin, ymax; int xmin, xmax; SchroMVComp mvcomp; /* FIXME real block params */ xmin = k * 8 - 2; xmax = k * 8 + 10; ymin = l * 8 - 2; ymax = l * 8 + 10; schro_mvcomp_init (&mvcomp, src, ref); for (iy = 0; iy < pc->levels[level].num_y; iy++) { for (ix = 0; ix < pc->levels[level].num_x; ix++) { x = ((src->width - (pc->levels[level].width << pc->picture_shift)) * ix) / (pc->levels[level].num_x - 1); y = ((src->height - (pc->levels[level].height << pc->picture_shift)) * iy) / (pc->levels[level].num_y - 1); if (xmax < x || ymax < y || xmin >= x + (pc->levels[level].width << pc->picture_shift) || ymin >= y + (pc->levels[level].height << pc->picture_shift)) { continue; } schro_mvcomp_add (&mvcomp, k, l, pc->levels[level].vecs_dx[iy * pc->levels[level].num_x + ix], pc->levels[level].vecs_dy[iy * pc->levels[level].num_x + ix]); schro_mvcomp_add (&mvcomp, k, l, pc->levels[level].vecs2_dx[iy * pc->levels[level].num_x + ix], pc->levels[level].vecs2_dy[iy * pc->levels[level].num_x + ix]); } } mv = motion_field_get (mf, k, l); mv->split = 2; mv->pred_mode = 1; mv->dx[0] = mvcomp.dx; mv->dy[0] = mvcomp.dy; mv->metric = mvcomp.metric; } } //schro_motion_field_scan (mf, params, src, ref, 2); //schro_motion_field_lshift (mf, params->mv_precision); schro_list_append (pc->frame->motion_field_list, mf); } #endif void schro_encoder_phasecorr_estimation (SchroPhaseCorr * pc) { SchroParams *params = &pc->frame->params; int ref; int i; for (i = 0; i < 4; i++) { SCHRO_DEBUG ("block size %dx%d", 1 << (2 + 5 + i), 1 << (2 + 4 + i)); if (pc->frame->filtered_frame->width < 1 << (2 + 5 + i) || pc->frame->filtered_frame->height < 1 << (2 + 4 + i)) { continue; } pc->n_levels = i + 1; schro_phasecorr_setup (pc, i, 2, 5 + i, 4 + i); for (ref = 0; ref < params->num_refs; ref++) { do_phase_corr (pc, i); //do_motion_field (pc, i); } schro_phasecorr_cleanup (pc); } } #define SCHRO_METRIC_INVALID_2 0x7fffffff void schro_motionest_superblock_phasecorr1 (SchroMotionEst * me, int ref, SchroBlock * block, int i, int j) { SchroMotionVector *mv; SchroParams *params = &me->encoder_frame->params; int dx, dy; SchroPhaseCorr *pc = me->encoder_frame->phasecorr[ref]; int xmin, xmax, ymin, ymax; int ix, iy; int level; int x, y; int width, height; xmin = i * params->xbsep_luma; xmax = (i + 4) * params->xbsep_luma; ymin = j * params->ybsep_luma; ymax = (j + 4) * params->ybsep_luma; level = 0; width = params->video_format->width; height = params->video_format->height; for (iy = 0; iy < pc->levels[level].num_y; iy++) { for (ix = 0; ix < pc->levels[level].num_x; ix++) { x = ((width - (pc->levels[level].width << pc->picture_shift)) * ix) / (pc->levels[level].num_x - 1); y = ((height - (pc->levels[level].height << pc->picture_shift)) * iy) / (pc->levels[level].num_y - 1); if (xmax < x || ymax < y || xmin >= x + (pc->levels[level].width << pc->picture_shift) || ymin >= y + (pc->levels[level].height << pc->picture_shift)) { continue; } dx = pc->levels[level].vecs_dx[iy * pc->levels[level].num_x + ix]; dy = pc->levels[level].vecs_dy[iy * pc->levels[level].num_x + ix]; goto out; } } block->valid = FALSE; return; out: mv = &block->mv[0][0]; mv->split = 0; mv->pred_mode = 1 << ref; mv->using_global = 0; mv->u.vec.dx[ref] = dx; mv->u.vec.dy[ref] = dy; block->error = schro_motionest_superblock_get_metric (me, block, i, j); block->entropy = 0; schro_block_fixup (block); block->valid = (block->error != SCHRO_METRIC_INVALID_2); } schroedinger-1.0.11/schroedinger/schroanalysis.c0000644000175000017500000000440611541755167016711 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include void schro_encoder_frame_downsample (SchroEncoderFrame * frame) { int i; SchroFrame *last; SCHRO_DEBUG ("downsampling frame %d", frame->frame_number); last = frame->filtered_frame; for (i = 0; i < frame->encoder->downsample_levels; i++) { frame->downsampled_frames[i] = schro_frame_new_and_alloc_extended (NULL, frame->filtered_frame->format, ROUND_UP_SHIFT (frame->filtered_frame->width, i + 1), ROUND_UP_SHIFT (frame->filtered_frame->height, i + 1), MAX (frame->params.xbsep_luma, frame->params.ybsep_luma)); schro_frame_downsample (frame->downsampled_frames[i], last); schro_frame_mc_edgeextend (frame->downsampled_frames[i]); last = frame->downsampled_frames[i]; } } void schro_encoder_frame_upsample (SchroEncoderFrame * frame) { SCHRO_ASSERT (frame); SCHRO_DEBUG ("upsampling frame %d", frame->frame_number); if (frame->upsampled_original_frame) { return; } schro_frame_ref (frame->filtered_frame); frame->upsampled_original_frame = schro_upsampled_frame_new (frame->filtered_frame); schro_upsampled_frame_upsample (frame->upsampled_original_frame); } static double schro_frame_component_squared_error (SchroFrameData * a, SchroFrameData * b) { int j; double sum; SCHRO_ASSERT (a->width == b->width); SCHRO_ASSERT (a->height == b->height); sum = 0; for (j = 0; j < a->height; j++) { int32_t linesum; orc_sum_square_diff_u8 (&linesum, SCHRO_FRAME_DATA_GET_LINE (a, j), SCHRO_FRAME_DATA_GET_LINE (b, j), a->width); sum += linesum; } return sum; } void schro_frame_mean_squared_error (SchroFrame * a, SchroFrame * b, double *mse) { double sum, n; sum = schro_frame_component_squared_error (&a->components[0], &b->components[0]); n = a->components[0].width * a->components[0].height; mse[0] = sum / n; sum = schro_frame_component_squared_error (&a->components[1], &b->components[1]); n = a->components[1].width * a->components[1].height; mse[1] = sum / n; sum = schro_frame_component_squared_error (&a->components[2], &b->components[2]); n = a->components[2].width * a->components[2].height; mse[2] = sum / n; } schroedinger-1.0.11/schroedinger/schro-stdint.h0000644000175000017500000000004511320234754016435 00000000000000#include schroedinger-1.0.11/schroedinger/schrodomain.c0000644000175000017500000000601211541755167016330 00000000000000 #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include //#define MEM_DOMAIN_ALWAYS_FREE 1 /* SchroMemoryDomain */ SchroMemoryDomain * schro_memory_domain_new (void) { SchroMemoryDomain *domain; domain = schro_malloc0 (sizeof (SchroMemoryDomain)); domain->mutex = schro_mutex_new (); return domain; } SchroMemoryDomain * schro_memory_domain_new_local (void) { SchroMemoryDomain *domain; domain = schro_memory_domain_new (); domain->alloc = (void *) malloc; domain->free = (void *) free; domain->flags = SCHRO_MEMORY_DOMAIN_CPU; return domain; } void schro_memory_domain_free (SchroMemoryDomain * domain) { int i; SCHRO_ASSERT (domain != NULL); for (i = 0; i < SCHRO_MEMORY_DOMAIN_SLOTS; i++) { if (domain->slots[i].flags & SCHRO_MEMORY_DOMAIN_SLOT_ALLOCATED) { domain->free (domain->slots[i].ptr, domain->slots[i].size); } } schro_mutex_free (domain->mutex); schro_free (domain); } void * schro_memory_domain_alloc (SchroMemoryDomain * domain, int size) { int i; void *ptr; SCHRO_ASSERT (domain != NULL); SCHRO_DEBUG ("alloc %d", size); schro_mutex_lock (domain->mutex); for (i = 0; i < SCHRO_MEMORY_DOMAIN_SLOTS; i++) { if (!(domain->slots[i].flags & SCHRO_MEMORY_DOMAIN_SLOT_ALLOCATED)) { continue; } if (domain->slots[i].flags & SCHRO_MEMORY_DOMAIN_SLOT_IN_USE) { continue; } if (domain->slots[i].size == size) { domain->slots[i].flags |= SCHRO_MEMORY_DOMAIN_SLOT_IN_USE; SCHRO_DEBUG ("got %p", domain->slots[i].ptr); ptr = domain->slots[i].ptr; goto done; } } for (i = 0; i < SCHRO_MEMORY_DOMAIN_SLOTS; i++) { if (domain->slots[i].flags & SCHRO_MEMORY_DOMAIN_SLOT_ALLOCATED) { continue; } domain->slots[i].flags |= SCHRO_MEMORY_DOMAIN_SLOT_ALLOCATED; domain->slots[i].flags |= SCHRO_MEMORY_DOMAIN_SLOT_IN_USE; domain->slots[i].size = size; domain->slots[i].ptr = domain->alloc (size); SCHRO_DEBUG ("created %p", domain->slots[i].ptr); ptr = domain->slots[i].ptr; goto done; } SCHRO_ASSERT (0); done: schro_mutex_unlock (domain->mutex); return ptr; } void schro_memory_domain_memfree (SchroMemoryDomain * domain, void *ptr) { int i; SCHRO_ASSERT (domain != NULL); SCHRO_DEBUG ("free %p", ptr); schro_mutex_lock (domain->mutex); for (i = 0; i < SCHRO_MEMORY_DOMAIN_SLOTS; i++) { if (!(domain->slots[i].flags & SCHRO_MEMORY_DOMAIN_SLOT_ALLOCATED)) { continue; } if (!(domain->slots[i].flags & SCHRO_MEMORY_DOMAIN_SLOT_IN_USE)) { continue; } if (domain->slots[i].ptr == ptr) { #ifdef MEM_DOMAIN_ALWAYS_FREE domain->free (domain->slots[i].ptr, domain->slots[i].size); domain->slots[i].flags = 0; #else domain->slots[i].flags &= (~SCHRO_MEMORY_DOMAIN_SLOT_IN_USE); #endif schro_mutex_unlock (domain->mutex); return; } } schro_mutex_unlock (domain->mutex); SCHRO_ASSERT (0); } schroedinger-1.0.11/schroedinger/schrophasecorrelation.h0000644000175000017500000000215111320237456020417 00000000000000 #ifndef __SCHRO_PHASECORRELATION_H__ #define __SCHRO_PHASECORRELATION_H__ #include #include SCHRO_BEGIN_DECLS #ifdef SCHRO_ENABLE_UNSTABLE_API typedef struct _SchroPhaseCorr SchroPhaseCorr; typedef struct _SchroPhaseCorrLevel SchroPhaseCorrLevel; struct _SchroPhaseCorrLevel { int hshift; int vshift; int width; int height; int num_x; int num_y; int *vecs_dx; int *vecs_dy; int *vecs2_dx; int *vecs2_dy; }; struct _SchroPhaseCorr { SchroEncoderFrame *frame; SchroEncoderFrame *ref; int shift; int n; int picture_shift; int n_levels; SchroPhaseCorrLevel levels[8]; /* static tables */ float *s, *c; float *zero; float *weight; float *image1; float *image2; float *ft1r; float *ft1i; float *ft2r; float *ft2i; float *conv_r, *conv_i; float *resr, *resi; }; SchroPhaseCorr * schro_phasecorr_new (SchroEncoderFrame *frame, SchroEncoderFrame *ref); void schro_encoder_phasecorr_estimation (SchroPhaseCorr *pc); void schro_phasecorr_free (SchroPhaseCorr *pc); #endif SCHRO_END_DECLS #endif schroedinger-1.0.11/schroedinger/schro.c0000644000175000017500000000250311541755167015141 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include extern int _schro_decode_prediction_only; extern int _schro_telemetry; extern int _schro_dump_enable; extern int _schro_motion_ref; /** * schro_init: * * Intializes the Schroedinger library. This function must be called * before any other function in the library. */ void schro_init (void) { const char *s; static int inited = FALSE; if (inited) return; inited = TRUE; orc_init (); schro_orc_init (); s = getenv ("SCHRO_DEBUG"); if (s && s[0]) { char *end; int level; level = strtoul (s, &end, 0); if (end[0] == 0) { schro_debug_set_level (level); } } s = getenv ("SCHRO_DECODE_PREDICTION_ONLY"); if (s && s[0]) { _schro_decode_prediction_only = TRUE; } s = getenv ("SCHRO_TELEMETRY"); if (s && s[0]) { _schro_telemetry = TRUE; } s = getenv ("SCHRO_MOTION_REF"); if (s && s[0]) { _schro_motion_ref = TRUE; } s = getenv ("SCHRO_DUMP"); if (s && s[0]) { _schro_dump_enable = TRUE; } schro_async_init (); #ifdef HAVE_CUDA schro_cuda_init (); #endif #ifdef HAVE_OPENGL schro_opengl_init (); #endif } schroedinger-1.0.11/schroedinger/schroanalysis.h0000644000175000017500000000070611320232176016676 00000000000000 #ifndef __SCHRO_ANALYSIS_H__ #define __SCHRO_ANALYSIS_H__ #include SCHRO_BEGIN_DECLS #ifdef SCHRO_ENABLE_UNSTABLE_API void schro_encoder_frame_analyse (SchroEncoderFrame *frame); void schro_encoder_frame_downsample (SchroEncoderFrame *frame); void schro_encoder_frame_upsample (SchroEncoderFrame* frame); void schro_frame_mean_squared_error (SchroFrame *a, SchroFrame *b, double *mse); #endif SCHRO_END_DECLS #endif schroedinger-1.0.11/schroedinger/schrodecoder.c0000664000175000017500000035127611707117021016470 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #define SCHRO_ARITH_DEFINE_INLINE #include #include #include #include #include #include #include #include #include #if 0 /* Used for testing bitstream */ #define MARKER() do{ \ SCHRO_ASSERT(schro_unpack_decode_uint(unpack) == 1234567); \ } while(0) #else #define MARKER() #endif #define SCHRO_SKIP_TIME_CONSTANT 0.1 typedef struct _SchroPictureSubbandContext SchroPictureSubbandContext; struct _SchroPictureSubbandContext { int component; int index; int position; int broken; SchroFrameData *frame_data; SchroFrameData *parent_frame_data; int quant_index; int is_intra; int subband_length; SchroArith *arith; SchroUnpack unpack; int vert_codeblocks; int horiz_codeblocks; int have_zero_flags; int have_quant_offset; int ymin; int ymax; int xmin; int xmax; int quant_factor; int quant_offset; }; enum { SCHRO_DECODER_STAGE_INIT = 0, SCHRO_DECODER_STAGE_REFERENCES, SCHRO_DECODER_STAGE_MOTION_DECODE, SCHRO_DECODER_STAGE_MOTION_RENDER, SCHRO_DECODER_STAGE_RESIDUAL_DECODE, SCHRO_DECODER_STAGE_WAVELET_TRANSFORM, SCHRO_DECODER_STAGE_COMBINE, SCHRO_DECODER_STAGE_UPSAMPLE, SCHRO_DECODER_STAGE_DONE }; int _schro_decode_prediction_only; int _schro_telemetry; static void schro_decoder_x_decode_motion (SchroAsyncStage * stage); static void schro_decoder_x_render_motion (SchroAsyncStage * stage); static void schro_decoder_x_decode_residual (SchroAsyncStage * stage); static void schro_decoder_x_wavelet_transform (SchroAsyncStage * stage); static void schro_decoder_x_combine (SchroAsyncStage * stage); static void schro_decoder_x_upsample (SchroAsyncStage * stage); static void schro_decoder_reference_add (SchroDecoderInstance * instance, SchroPicture * picture); static SchroPicture *schro_decoder_reference_get (SchroDecoderInstance * instance, SchroPictureNumber frame_number); static void schro_decoder_reference_retire (SchroDecoderInstance * instance, SchroPictureNumber frame_number); static void schro_decoder_decode_subband (SchroPicture * picture, SchroPictureSubbandContext * ctx); static int schro_decoder_async_schedule (SchroDecoder * decoder, SchroExecDomain domain); static void schro_decoder_picture_complete (SchroAsyncStage * stage); static void schro_decoder_error (SchroDecoder * decoder, const char *s); static void schro_decoder_set_rob_size (SchroDecoderInstance * instance); static int schro_decoder_frame_is_twofield (SchroDecoderInstance * instance, SchroFrame * frame); static void schro_picturequeue_rob_insert (SchroQueue * queue, SchroPicture * picture, unsigned windowsize); static int schro_picture_n_before_m (SchroPictureNumber n, SchroPictureNumber m); static void schro_decoder_telemetry (SchroPicture * picture, SchroFrame * output_picture); /* API */ static SchroDecoderInstance * schro_decoder_instance_new (SchroDecoder * decoder) { SchroDecoderInstance *instance; instance = schro_malloc0 (sizeof (SchroDecoderInstance)); instance->decoder = decoder; instance->reference_queue = schro_queue_new (SCHRO_LIMIT_REFERENCE_FRAMES, (SchroQueueFreeFunc) schro_picture_unref); /* the output queue shouldn't be too large: the output queue may be * a precious resource, no point holding on to loads without reason */ instance->output_queue = schro_queue_new (4, (SchroQueueFreeFunc) schro_frame_unref); instance->reorder_queue = schro_queue_new (5, (SchroQueueFreeFunc) schro_picture_unref); schro_decoder_set_rob_size (instance); return instance; } static void schro_decoder_instance_free (SchroDecoderInstance * instance) { schro_queue_free (instance->output_queue); schro_queue_free (instance->reference_queue); schro_queue_free (instance->reorder_queue); if (instance->sequence_header_buffer) { schro_buffer_unref (instance->sequence_header_buffer); instance->sequence_header_buffer = NULL; } /* do not call instance_free(instance->next). * It must be handled by the caller if required */ schro_free (instance); } /** * schro_decoder_new: * * Creates a new decoder object. The decoder object should be freed * using @schro_decoder_free() when it is no longer needed. * * Returns: a new decoder object */ SchroDecoder * schro_decoder_new (void) { SchroDecoder *decoder; decoder = schro_malloc0 (sizeof (SchroDecoder)); schro_tables_init (); decoder->skip_value = 1.0; decoder->skip_ratio = 1.0; decoder->input_buflist = schro_buflist_new (); decoder->sps = schro_parse_sync_new (); decoder->cpu_domain = schro_memory_domain_new_local (); #ifdef HAVE_CUDA decoder->cuda_domain = schro_memory_domain_new_cuda (); #endif #ifdef HAVE_OPENGL decoder->opengl_domain = schro_memory_domain_new_opengl (); #endif decoder->async = schro_async_new (0, (SchroAsyncScheduleFunc) schro_decoder_async_schedule, (SchroAsyncCompleteFunc) schro_decoder_picture_complete, decoder); #ifdef HAVE_CUDA schro_async_add_exec_domain (decoder->async, SCHRO_EXEC_DOMAIN_CUDA); decoder->use_cuda = TRUE; #endif #ifdef HAVE_OPENGL decoder->opengl = schro_opengl_new (); if (schro_opengl_is_usable (decoder->opengl)) { schro_async_add_exec_domain (decoder->async, SCHRO_EXEC_DOMAIN_OPENGL); decoder->use_opengl = TRUE; } else { schro_opengl_free (decoder->opengl); decoder->opengl = NULL; decoder->use_opengl = FALSE; } #endif decoder->instance = schro_decoder_instance_new (decoder); return decoder; } /** * schro_decoder_free: * @decoder: decoder object * * Frees a decoder object. */ void schro_decoder_free (SchroDecoder * decoder) { if (decoder->async) { schro_async_free (decoder->async); } do { SchroDecoderInstance *next = decoder->instance->next; schro_decoder_instance_free (decoder->instance); decoder->instance = next; } while (decoder->instance); schro_buflist_free (decoder->input_buflist); schro_parse_sync_free (decoder->sps); if (decoder->error_message) schro_free (decoder->error_message); #ifdef HAVE_OPENGL if (decoder->opengl) schro_opengl_free (decoder->opengl); #endif if (decoder->cpu_domain) schro_memory_domain_free (decoder->cpu_domain); if (decoder->cuda_domain) schro_memory_domain_free (decoder->cuda_domain); if (decoder->opengl_domain) schro_memory_domain_free (decoder->opengl_domain); schro_free (decoder); } /** * schro_decoder_begin_sequence: * * Prepare the @decoder to accept a new sequence. * * Returns SCHRO_DECODER_OK * SCHRO_DECODER_ERROR: if oldest sequence hasn't been marked with * end of sequence */ int schro_decoder_begin_sequence (SchroDecoder * decoder) { SchroDecoderInstance *instance = decoder->instance; /* find newest sequence */ while (instance->next) instance = instance->next; if (!instance->flushing || !instance->end_of_stream) { return SCHRO_DECODER_ERROR; } schro_async_lock (decoder->async); instance->next = schro_decoder_instance_new (decoder); schro_async_unlock (decoder->async); return SCHRO_DECODER_OK; } /** * schro_decoder_end_sequence: * * When decoder_wait() returns SCHRO_DECODER_EOS, the sequence * that terminated must be cleaned up before the state machine * will advance. * * Returns SCHRO_DECODER_OK: * SCHRO_DECODER_ERROR: if oldest sequence has not completed. * SCHRO_DECODER_ERROR: if the decoder has not been prepared * for a new sequence. */ int schro_decoder_end_sequence (SchroDecoder * decoder) { /* oldest sequence */ SchroDecoderInstance *instance = decoder->instance; SchroDecoderInstance *old; if (!instance->flushing || !instance->end_of_stream || instance->reorder_queue->n > 0) { /* can not guarantee no threads are using the instance */ return SCHRO_DECODER_ERROR; } if (!instance->next) { /* decoder has no new instance waiting */ return SCHRO_DECODER_ERROR; } schro_async_lock (decoder->async); old = instance->next; schro_decoder_instance_free (instance); decoder->instance = old; schro_async_unlock (decoder->async); return SCHRO_DECODER_OK; } /** * schro_picture_new: * @decoder: a decoder object * * Creates a new picture for @decoder. * * Internal API. * * Returns: a new picture */ SchroPicture * schro_picture_new (SchroDecoderInstance * instance) { SchroDecoder *decoder = instance->decoder; SchroPicture *picture; SchroFrameFormat frame_format; SchroVideoFormat *video_format = &instance->video_format; int picture_width, picture_height; int iwt_width, iwt_height; int picture_chroma_width, picture_chroma_height; picture = schro_malloc0 (sizeof (SchroPicture)); picture->refcount = 1; picture->decoder_instance = instance; picture->params.video_format = video_format; if (instance->bit_depth > 8) { frame_format = schro_params_get_frame_format (32, video_format->chroma_format); } else { frame_format = schro_params_get_frame_format (16, video_format->chroma_format); } schro_video_format_get_picture_chroma_size (video_format, &picture_chroma_width, &picture_chroma_height); picture_width = video_format->width; picture_height = schro_video_format_get_picture_height (video_format); schro_video_format_get_iwt_alloc_size (video_format, &iwt_width, &iwt_height, SCHRO_LIMIT_TRANSFORM_DEPTH); if (decoder->use_cuda) { picture->transform_frame = schro_frame_new_and_alloc (decoder->cpu_domain, frame_format, iwt_width, iwt_height); #if 0 /* These get allocated later, while in the CUDA thread */ picture->mc_tmp_frame = schro_frame_new_and_alloc (decoder->cuda_domain, frame_format, frame_width, frame_height); picture->frame = schro_frame_new_and_alloc (decoder->cuda_domain, frame_format, frame_width, frame_height); picture->planar_output_frame = schro_frame_new_and_alloc (decoder->cuda_domain, frame_format, video_format->width, video_format->height); #endif } else if (decoder->use_opengl) { picture->transform_frame = schro_frame_new_and_alloc (decoder->cpu_domain, frame_format, iwt_width, iwt_height); picture->planar_output_frame = schro_frame_new_and_alloc (decoder->cpu_domain, schro_params_get_frame_format (8, video_format->chroma_format), video_format->width, video_format->height); } else { picture->mc_tmp_frame = schro_frame_new_and_alloc (decoder->cpu_domain, frame_format, picture_width, picture_height); picture->frame = schro_frame_new_and_alloc (decoder->cpu_domain, frame_format, iwt_width, iwt_height); picture->transform_frame = schro_frame_ref (picture->frame); } SCHRO_DEBUG ("planar output frame %dx%d", video_format->width, video_format->height); return picture; } SchroPicture * schro_picture_ref (SchroPicture * picture) { picture->refcount++; return picture; } void schro_picture_unref (SchroPicture * picture) { SCHRO_ASSERT (picture->refcount > 0); picture->refcount--; if (picture->refcount == 0) { int i; int component; SCHRO_DEBUG ("freeing picture %p", picture); for (component = 0; component < 3; component++) { for (i = 0; i < SCHRO_LIMIT_SUBBANDS; i++) { if (picture->subband_buffer[component][i]) { schro_buffer_unref (picture->subband_buffer[component][i]); picture->subband_buffer[component][i] = NULL; } } } for (i = 0; i < 9; i++) { if (picture->motion_buffers[i]) { schro_buffer_unref (picture->motion_buffers[i]); picture->motion_buffers[i] = NULL; } } if (picture->lowdelay_buffer) schro_buffer_unref (picture->lowdelay_buffer); if (picture->transform_frame) schro_frame_unref (picture->transform_frame); if (picture->frame) schro_frame_unref (picture->frame); if (picture->mc_tmp_frame) schro_frame_unref (picture->mc_tmp_frame); if (picture->planar_output_frame) schro_frame_unref (picture->planar_output_frame); if (picture->output_picture) schro_frame_unref (picture->output_picture); if (picture->motion) schro_motion_free (picture->motion); if (picture->input_buffer) schro_buffer_unref (picture->input_buffer); if (picture->upsampled_frame) schro_upsampled_frame_free (picture->upsampled_frame); if (picture->ref0) schro_picture_unref (picture->ref0); if (picture->ref1) schro_picture_unref (picture->ref1); if (picture->ref_output_frame) schro_frame_unref (picture->ref_output_frame); if (picture->tag) schro_tag_free (picture->tag); schro_free (picture); } } /** * schro_decoder_reset: * @decoder: a decoder object * * Resets the internal state of the decoder. This function should be * called after a discontinuity of the stream, for example, as the * result of a seek. */ void schro_decoder_reset (SchroDecoder * decoder) { schro_async_stop (decoder->async); schro_buflist_free (decoder->input_buflist); decoder->input_buflist = schro_buflist_new (); schro_parse_sync_free (decoder->sps); decoder->sps = schro_parse_sync_new (); schro_decoder_instance_free (decoder->instance); decoder->instance = schro_decoder_instance_new (decoder); decoder->error = FALSE; schro_async_start (decoder->async); } /** * schro_decoder_get_video_format: * @decoder: a decoder object * * Returns a structure containing information on the video format being * decoded by the decoder. This structure should be freed using free() * when it is no longer needed. * * Returns: a video format structure */ /* xxx: this is nolonger api/client thread safe with respect to reset */ SchroVideoFormat * schro_decoder_get_video_format (SchroDecoder * decoder) { SchroVideoFormat *format; /* FIXME check that decoder is in the right state */ format = malloc (sizeof (SchroVideoFormat)); memcpy (format, &decoder->instance->video_format, sizeof (SchroVideoFormat)); return format; } /** * schro_decoder_get_picture_number: * @decoder: a decoder object * * Returns the picture number of the next picture that will be returned * by @schro_decoder_pull(). * * Returns: a picture number */ SchroPictureNumber schro_decoder_get_picture_number (SchroDecoder * decoder) { SchroDecoderInstance *instance = decoder->instance; SchroPicture *picture = NULL; if (instance->reorder_queue->n >= instance->reorder_queue_size || instance->flushing) { picture = schro_queue_peek (instance->reorder_queue); } if (picture) return picture->picture_number; return SCHRO_PICTURE_NUMBER_INVALID; } /** * schro_decoder_get_picture_tag: * @decoder: a decoder object * * Returns any tag associated with the next picture to be returned * by @schro_decoder_pull(). Ownership of the tag is transfered to * the caller. * * Returns: a tag represented by void* or NULL */ SchroTag * schro_decoder_get_picture_tag (SchroDecoder * decoder) { SchroDecoderInstance *instance = decoder->instance; SchroPicture *picture = NULL; if (instance->reorder_queue->n >= instance->reorder_queue_size || instance->flushing) { picture = schro_queue_peek (instance->reorder_queue); } if (picture) { SchroTag *tag = picture->tag; picture->tag = NULL; return tag; } return NULL; } /** * schro_decoder_add_output_picture: * @decoder: a decoder object * @frame: the frame to add to the picture queue * * Adds a frame provided by the application to the picture queue. * Frames in the picture queue will be used for decoding images, and * are eventually returned to the application by schro_decoder_pull(). * * The caller loses its reference to @frame after calling this * function. */ void schro_decoder_add_output_picture (SchroDecoder * decoder, SchroFrame * frame) { schro_async_lock (decoder->async); schro_queue_add (decoder->instance->output_queue, frame, 0); schro_async_signal_scheduler (decoder->async); schro_async_unlock (decoder->async); } /** * schro_decoder_set_earliest_frame: * @decoder: a decoder object * @earliest_frame: the earliest frame that the application is interested in * * The application can tell the decoder the earliest frame it is * interested in by calling this function. Subsequent calls to * schro_decoder_pull() will only return pictures with picture * numbers greater than or equal to this number. The decoder will * avoid decoding pictures that will not be displayed or used as * reference pictures. * * This feature can be used for frame-accurate seeking. * * This function can be called at any time during decoding. Calling * this function with a picture number less than the current earliest * frame setting is invalid. */ void schro_decoder_set_earliest_frame (SchroDecoder * decoder, SchroPictureNumber earliest_frame) { decoder->earliest_frame = earliest_frame; } /** * schro_decoder_set_skip_ratio: * @decoder: a decoder object * @ratio: skip ratio. * * Sets the skip ratio of the decoder. The skip ratio is used by the * decoder to skip decoding of some pictures. Reference pictures are * always decoded. * * A picture is skipped when the running average of the proportion of * pictures skipped is less than the skip ratio. Reference frames are * always decoded and contribute to the running average. Thus, the * actual ratio of skipped pictures may be larger than the requested * skip ratio. * * The decoder indicates a skipped picture in the pictures returned * by @schro_decoder_pull() by a frame that has a width and height of * 0. * * The default skip ratio is 1.0, indicating that all pictures should * be decoded. A skip ratio of 0.0 indicates that no pictures should * be decoded, although as mentioned above, some pictures will be * decoded anyway. Values outside the range of 0.0 to 1.0 are quietly * clamped to that range. * * This function may be called at any time during decoding. */ void schro_decoder_set_skip_ratio (SchroDecoder * decoder, double ratio) { if (ratio > 1.0) ratio = 1.0; if (ratio < 0.0) ratio = 0.0; decoder->skip_ratio = ratio; } void schro_decoder_set_picture_order (SchroDecoder * decoder, int order) { SchroDecoderInstance *instance; decoder->coded_order = order == SCHRO_DECODER_PICTURE_ORDER_CODED; /* propagate to all instances */ for (instance = decoder->instance; instance; instance = instance->next) { if (instance->have_sequence_header) { SCHRO_ERROR ("Don't call this function after decoding has commenced"); } schro_decoder_set_rob_size (instance); } } static int schro_decoder_pull_is_ready_locked (SchroDecoder * decoder) { SchroDecoderInstance *instance = decoder->instance; SchroPicture *picture = NULL; /* Not possible to pull from the RoB if not full */ /* NB, schro's RoB implementation can be larger than the spec */ if (instance->reorder_queue->n >= instance->reorder_queue_size || instance->flushing) { picture = schro_queue_peek (instance->reorder_queue); } if (!picture || !picture->stages[SCHRO_DECODER_STAGE_DONE].is_done) { /* nothing avaliable, give up */ return FALSE; } if (!schro_decoder_frame_is_twofield (instance, picture->output_picture)) { /* one picture is avaliable, sufficient for: * - frame_coding * - field_coding and user supplies fields */ return TRUE; } /* interlaced_coding with twofiled output: must be two pictures avaliable */ if (instance->flushing) { /* except with broken streams and flushing. there may only be 1, * in which case, we are as ready as we'll ever be, and leave it * up to _pull to fix missing field issue */ if (instance->reorder_queue->n == 1) return TRUE; } SCHRO_ASSERT (instance->reorder_queue->n >= 2); /* don't check if the second field is the pair to the first, since the * RoB is full, it would cause a deadlock to block on there being a * valid pair at the front of the RoB. */ picture = instance->reorder_queue->elements[1].data; /* is second field ready ? */ return picture->stages[SCHRO_DECODER_STAGE_DONE].is_done; } /** * schro_decoder_pull: * @decoder: a decoder object * * Removes the next picture from the picture queue and returns a frame * containing the image. * * The application provides the frames that pictures are decoded into, * and the same frames are returned from this function. However, the * order of frames returned may be different than the order that the * application provides the frames to the decoder. * * An exception to this is that skipped frames are indicated by a * frame having a height and width equal to 0. This frame is created * using @schro_frame_new(), and is not one of the frames provided by * the application. * * Frames should be freed using @schro_frame_unref() when no longer * needed. The frame must not be reused by the application, since it * may contain a reference frame still in use by the decoder. * * Returns: the next picture */ SchroFrame * schro_decoder_pull (SchroDecoder * decoder) { SchroDecoderInstance *instance = decoder->instance; SchroPicture *picture = NULL; SchroPictureNumber picture_number; SchroFrame *frame; schro_async_lock (decoder->async); if (schro_decoder_pull_is_ready_locked (decoder)) { picture = schro_queue_pull (instance->reorder_queue); } if (!picture) { return NULL; } /* XXX would be nice to warn if expected picture not present */ frame = schro_frame_ref (picture->output_picture); picture_number = picture->picture_number; schro_picture_unref (picture); picture = NULL; if (schro_decoder_frame_is_twofield (instance, frame)) do { /* only consider the 2nd field if it can reference * picture->output_picture, ie frame is twofields */ if (picture_number & 1) { /* The following is voilated: * - 10.4p3 earliest field in each frame shall have an even picture number * Then the head of the reorder_queue can't be the pair to picture */ break; } picture = schro_queue_peek (decoder->instance->reorder_queue); if (!picture) { if (instance->flushing) { /* when flushing, a broken stream might not have a pair of * pictures: discard the frame, (otherwise at a broken sequence * boundry, could cause two frames to be emitted rather than one) */ schro_frame_unref (frame); frame = NULL; break; } SCHRO_ASSERT (picture); } if (picture_number + 1 != picture->picture_number) { /* The second field in the frame can only be a pair to the first if * they have consecutive picture numbers */ break; } /* second field is the pair to the first: discard it */ picture = schro_queue_pull (decoder->instance->reorder_queue); picture_number = picture->picture_number; schro_picture_unref (picture); picture = NULL; } while (0); instance->last_picture_number = picture_number; instance->last_picture_number_valid = TRUE; schro_async_unlock (decoder->async); return frame; } /** * schro_decoder_push_ready: * @decoder: a decoder object * * This function is used by the application to determine if it should push * more data to the decoder. * * Returns: TRUE if the decoder is ready for more data */ int schro_decoder_push_ready (SchroDecoder * decoder) { int ret; SchroDecoderInstance *instance = decoder->instance; /* by definition, all instances prior to the last are flushing, just * check if the final sequence not full */ while (instance->next) instance = instance->next; schro_async_lock (decoder->async); /* may not push more data if the decoder is flushing: * This occurs when an EOS is pushed and no new sequence is prepared */ ret = !instance->flushing && !schro_queue_is_full (decoder->instance->reorder_queue); schro_async_unlock (decoder->async); return ret; } static int schro_decoder_need_output_frame_locked (SchroDecoder * decoder) { /* output frames are only required to satisfy completion of the * oldest sequence. Do not iterate over instances */ SchroDecoderInstance *instance = decoder->instance; int num_frames_in_hand = instance->output_queue->n; int i; if (schro_queue_is_full (instance->output_queue)) { return 0; } if (instance->video_format.interlaced_coding) { for (i = 0; i < instance->output_queue->n; i++) { SchroFrame *output_frame = instance->output_queue->elements[i].data; if (schro_decoder_frame_is_twofield (instance, output_frame)) { /* this frame counts for two pictures */ num_frames_in_hand++; } } } for (i = 0; i < instance->reorder_queue->n; i++) { SchroPicture *picture = instance->reorder_queue->elements[i].data; if (!picture->output_picture) num_frames_in_hand--; } return num_frames_in_hand < 0; } int schro_decoder_need_output_frame (SchroDecoder * decoder) { int ret; schro_async_lock (decoder->async); ret = schro_decoder_need_output_frame_locked (decoder); schro_async_unlock (decoder->async); return ret; } static int schro_decoder_get_status_locked (SchroDecoder * decoder) { SchroDecoderInstance *instance = decoder->instance; /* NB, this function should be `pure' (no sideeffects), * since it is called in a context which should not update state */ if (!instance) { /* Under normal operation, this shouldn't be possible: * - only if the user uses the raw api in the wrong order */ schro_decoder_error (decoder, "Missing decoder instance"); return SCHRO_DECODER_ERROR; } if (instance->first_sequence_header) { return SCHRO_DECODER_FIRST_ACCESS_UNIT; } if (schro_decoder_pull_is_ready_locked (decoder)) { return SCHRO_DECODER_OK; } if (decoder->error) { return SCHRO_DECODER_ERROR; } if (instance->have_sequence_header && schro_decoder_need_output_frame_locked (decoder)) { return SCHRO_DECODER_NEED_FRAME; } if (!schro_queue_is_full (instance->reorder_queue) && !instance->flushing) { return SCHRO_DECODER_NEED_BITS; } if (instance->flushing && !instance->reorder_queue->n) { if (instance->end_of_stream) { return SCHRO_DECODER_EOS; } else { return SCHRO_DECODER_STALLED; } } return SCHRO_DECODER_WAIT; } #if 0 static int schro_decoder_get_status (SchroDecoder * decoder) { int ret; schro_async_lock (decoder->async); ret = schro_decoder_get_status_locked (decoder); schro_async_unlock (decoder->async); return ret; } #endif static void schro_decoder_dump (SchroDecoder * decoder) { SchroDecoderInstance *instance = decoder->instance; int i; SCHRO_ERROR ("index, picture_number, busy, state, needed_state, working"); for (i = 0; i < instance->reorder_queue->n; i++) { SchroPicture *picture = instance->reorder_queue->elements[i].data; int done = 0, needed = 0, j; for (j = 0; j <= SCHRO_DECODER_STAGE_DONE; j++) { done |= picture->stages[j].is_done << j; needed |= picture->stages[j].is_needed << j; } SCHRO_ERROR ("%d: %d %d %04x %04x -", i, picture->picture_number, picture->busy, done, needed); } if (instance->reorder_queue->n >= instance->reorder_queue_size || instance->flushing) { SCHRO_ERROR ("next_picture_number %d", schro_decoder_get_picture_number (decoder)); } else { SCHRO_ERROR ("reorder_queue too empty to determine next_picture_number: " "needs: %d pictures", instance->reorder_queue_size - instance->reorder_queue->n); } } /** * schro_decoder_wait: * @decoder: a decoder object * * Waits until the decoder requires the application to do something, * e.g., push more data or remove a frame from the picture queue, * and then returns the decoder status. * * Returns: decoder status */ int schro_decoder_wait (SchroDecoder * decoder) { int ret; schro_async_lock (decoder->async); while (1) { ret = schro_decoder_get_status_locked (decoder); switch (ret) { default: goto cleanup; case SCHRO_DECODER_FIRST_ACCESS_UNIT: /* clean up state for next iteration */ decoder->instance->first_sequence_header = FALSE; goto cleanup; case SCHRO_DECODER_WAIT: break; } ret = schro_async_wait_locked (decoder->async); if (!ret) { SCHRO_ERROR ("doh!"); schro_decoder_dump (decoder); /* hack */ schro_async_signal_scheduler (decoder->async); //SCHRO_ASSERT(0); } } cleanup: schro_async_unlock (decoder->async); return ret; } /** * schro_decoder_autoparse_wait: * @decoder: a decoder object * * Waits until the decoder requires the application to do something, * e.g., push more data or remove a frame from the picture queue, * and then returns the decoder status. * * When using @schro_decoder_autoparse_push, this function should * be used instead of @schro_decoder_wait. * * Returns: decoder status */ int schro_decoder_autoparse_wait (SchroDecoder * decoder) { while (1) { int ret = schro_decoder_wait (decoder); switch (ret) { default: return ret; case SCHRO_DECODER_NEED_BITS: /* see if there is anything sitting in the input_buflist * before requesting more data */ /* xxx, it would be good if this were moved to an idle thread */ ret = schro_decoder_autoparse_push (decoder, NULL); if (ret == SCHRO_DECODER_NEED_BITS) { return ret; } break; case SCHRO_DECODER_EOS: /* delete the decoder instance -- it is finished with * This is safe since for the status to be EOS * there must be: * - no work left in the decoder queue * - no pictures left to retrieve * Therefore there are no threads running in this instance. */ ret = schro_decoder_end_sequence (decoder); if (ret == SCHRO_DECODER_ERROR) { return SCHRO_DECODER_EOS; } /* try again to discover the next state: EOS never gets passed * to the user */ continue; } } } int schro_decoder_push_end_of_stream (SchroDecoder * decoder) { SchroDecoderInstance *instance = decoder->instance; /* find newest sequence */ while (instance->next) instance = instance->next; instance->flushing = TRUE; instance->end_of_stream = TRUE; return SCHRO_DECODER_EOS; } /** * schro_decoder_autoparse_push_end_of_sequence: * * Signals that the most recent sequence is to terminates: decoding * of all pictures still in progress will continue. * * The decoder state is prepared to immediately handle data for * a new sequence. * * Returns: SCHRO_DECODER_EOS */ int schro_decoder_autoparse_push_end_of_sequence (SchroDecoder * decoder) { schro_decoder_push_end_of_stream (decoder); schro_decoder_begin_sequence (decoder); return SCHRO_DECODER_EOS; } /** * schro_decoder_set_flushing: * * This function is depricated and has no effect. * If control over the picture order is required, consult * schro_decoder_set_picture_order() */ int schro_decoder_set_flushing (SchroDecoder * decoder, int value) { return SCHRO_DECODER_OK; } int schro_decoder_push (SchroDecoder * decoder, SchroBuffer * buffer) { SchroDecoderInstance *instance = decoder->instance; SchroUnpack unpack; int parse_code; if (!instance) { /* this should not be possible with the autoparse api: * - decoder is created with an instance * - instances are created eachtime an EOS is inserted * - instances are deleted when EOS is pulled. * => Next instance is created before previous one is destroyed * Assumptions: * - Only examined case where wait() and push() are called * from same thread */ return SCHRO_DECODER_ERROR; } /* find newest sequence */ while (instance->next) instance = instance->next; /* instance is now the next instance to send data to */ instance->flushing = FALSE; /* Buffers may have associated (tagged) private data. * This data is to be associated with the next(/this) picture data unit */ if (buffer->tag) { if (decoder->next_picture_tag) { schro_tag_free (decoder->next_picture_tag); } decoder->next_picture_tag = buffer->tag; } buffer->tag = NULL; schro_unpack_init_with_data (&unpack, buffer->data, buffer->length, 1); parse_code = schro_decoder_decode_parse_header (&unpack); if (parse_code == -1) { schro_buffer_unref (buffer); return SCHRO_DECODER_ERROR; } if (parse_code == SCHRO_PARSE_CODE_SEQUENCE_HEADER) { int ret; SCHRO_INFO ("decoding sequence header"); if (!instance->have_sequence_header) { schro_decoder_parse_sequence_header (instance, &unpack); /* safe to resize RoB, since nothing can be inflight in this instance */ schro_decoder_set_rob_size (instance); instance->have_sequence_header = TRUE; instance->first_sequence_header = TRUE; instance->sequence_header_buffer = schro_buffer_dup (buffer); instance->bit_depth = schro_video_format_get_bit_depth (&instance->video_format); ret = SCHRO_DECODER_FIRST_ACCESS_UNIT; } else { if (schro_decoder_compare_sequence_header_buffer (buffer, instance->sequence_header_buffer)) { ret = SCHRO_DECODER_OK; } else { schro_decoder_error (decoder, "sequence header changed"); ret = SCHRO_DECODER_ERROR; } } schro_buffer_unref (buffer); return ret; } if (parse_code == SCHRO_PARSE_CODE_AUXILIARY_DATA) { int code; code = schro_unpack_decode_bits (&unpack, 8); if (code == SCHRO_AUX_DATA_MD5_CHECKSUM) { int i; for (i = 0; i < 16; i++) { instance->md5_checksum[i] = schro_unpack_decode_bits (&unpack, 8); } instance->has_md5 = TRUE; } if (code == SCHRO_AUX_DATA_ENCODER_STRING) { char s[20]; int i; for (i = 0; i < 20; i++) { s[i] = schro_unpack_decode_bits (&unpack, 8); } if (memcmp ("Schroedinger 1.0.", s, 17) == 0) { if (s[17] >= '0' && s[17] <= '7' && (s[18] == '.' || s[18] == (char) 0xff)) { SCHRO_WARNING ("turning on codeblock quantiser compatibility mode"); instance->compat_quant_offset = TRUE; } } } schro_buffer_unref (buffer); return SCHRO_DECODER_OK; } if (SCHRO_PARSE_CODE_IS_PADDING (parse_code)) { schro_buffer_unref (buffer); return SCHRO_DECODER_OK; } if (SCHRO_PARSE_CODE_IS_END_OF_SEQUENCE (parse_code)) { SCHRO_DEBUG ("decoding end sequence"); schro_buffer_unref (buffer); instance->end_of_stream = TRUE; instance->flushing = TRUE; return SCHRO_DECODER_EOS; } if (SCHRO_PARSE_CODE_IS_PICTURE (parse_code)) { if (!instance->have_sequence_header) { SCHRO_INFO ("no sequence header -- dropping picture"); if (decoder->next_picture_tag) { schro_tag_free (decoder->next_picture_tag); } decoder->next_picture_tag = NULL; schro_buffer_unref (buffer); return SCHRO_DECODER_OK; } return schro_decoder_iterate_picture (instance, buffer, &unpack, parse_code); } schro_buffer_unref (buffer); return SCHRO_DECODER_ERROR; } /** * schro_decoder_autoparse_push: * * Appends @buffer@ to the internal input queue, extracting work * units as necessary. There are no alignment constraints on the * contents of @buffer@; it is not required to be data unit aligned, * nor contain a single whole data unit. * * Returns: if decoder ready for more data, but insufficient input buffer: * SCHRO_DECODER_NEED_BITS * otherwise SCHRO_DECODER_OK */ int schro_decoder_autoparse_push (SchroDecoder * decoder, SchroBuffer * buffer) { /* 1. buffer is added to the decoder input queue. * 2. The synchronizer extracts (if possible) a data unit for parsing */ if (buffer) schro_buflist_append (decoder->input_buflist, buffer); while (schro_decoder_push_ready (decoder)) { buffer = schro_parse_sync (decoder->sps, decoder->input_buflist); if (!buffer) return SCHRO_DECODER_NEED_BITS; switch (schro_decoder_push (decoder, buffer)) { default: break; case SCHRO_DECODER_EOS: /* Prepare decoder for immediately handling the next sequence */ schro_decoder_begin_sequence (decoder); break; } } return SCHRO_DECODER_OK; } int schro_decoder_iterate_picture (SchroDecoderInstance * instance, SchroBuffer * buffer, SchroUnpack * unpack, int parse_code) { SchroDecoder *decoder = instance->decoder; SchroPicture *picture; SchroParams *params; picture = schro_picture_new (instance); params = &picture->params; picture->input_buffer = buffer; picture->tag = decoder->next_picture_tag; decoder->next_picture_tag = NULL; params->num_refs = SCHRO_PARSE_CODE_NUM_REFS (parse_code); params->is_lowdelay = SCHRO_PARSE_CODE_IS_LOW_DELAY (parse_code); params->is_noarith = !SCHRO_PARSE_CODE_USING_AC (parse_code); picture->is_ref = SCHRO_PARSE_CODE_IS_REFERENCE (parse_code); if (instance->has_md5) { picture->has_md5 = TRUE; memcpy (picture->md5_checksum, instance->md5_checksum, 16); instance->has_md5 = FALSE; } schro_decoder_parse_picture_header (picture, unpack); SCHRO_DEBUG ("picturenumber: %u", picture->picture_number); if (picture->is_ref) { /* xxx: why is this locked? -- no decoding should actually consult the * reference buffer surely? */ schro_async_lock (instance->decoder->async); schro_decoder_reference_retire (instance, picture->retired_picture_number); schro_decoder_reference_add (instance, picture); schro_async_unlock (instance->decoder->async); } schro_decoder_parse_picture (picture, unpack); if (picture->error) { SCHRO_WARNING ("skipping because of error"); picture->skip = TRUE; } if (instance->last_picture_number_valid) { if (schro_picture_n_before_m (picture->picture_number, instance->last_picture_number)) { /* picture logically occurs before a picture that has already been * emitted. The stream must have jumped backwards. It is important * to detect this, otherwise pictures can get stuck in the reorder * buffer. NB, it isn't required to detect a forwards jump, since * this will cause the reorder buffer to flush naturally */ /* xxx: future improvements would be to also note if a sequence header * occured just before this picture, and to inject that into the new * instance */ SCHRO_WARNING ("stream jumped backwards, %u before %u, treating as EOS", picture->picture_number, instance->last_picture_number); schro_picture_unref (picture); schro_decoder_push_end_of_stream (decoder); return SCHRO_DECODER_EOS; } } /* todo: prune pictures that are inaccessible in the first gop */ if (!instance->video_format.interlaced_coding && !picture->is_ref && picture->picture_number < decoder->earliest_frame) { picture->skip = TRUE; SCHRO_INFO ("skipping frame %d (early)", picture->picture_number); } if (!instance->video_format.interlaced_coding && !picture->is_ref && decoder->skip_value > decoder->skip_ratio) { decoder->skip_value = (1 - SCHRO_SKIP_TIME_CONSTANT) * decoder->skip_value; SCHRO_INFO ("skipping frame %d", picture->picture_number); SCHRO_DEBUG ("skip value %g ratio %g", decoder->skip_value, decoder->skip_ratio); picture->skip = TRUE; } else { decoder->skip_value = (1 - SCHRO_SKIP_TIME_CONSTANT) * decoder->skip_value + SCHRO_SKIP_TIME_CONSTANT; } SCHRO_DEBUG ("skip value %g ratio %g", decoder->skip_value, decoder->skip_ratio); if (picture->skip) { picture->output_picture = schro_frame_new (); if (picture->is_ref) { SchroFrameFormat frame_format; SchroFrame *ref; frame_format = schro_params_get_frame_format (8, params->video_format->chroma_format); ref = schro_frame_new_and_alloc_full (decoder->cpu_domain, frame_format, instance->video_format.width, schro_video_format_get_picture_height (&instance->video_format), 32, TRUE); schro_frame_clear (ref); picture->upsampled_frame = schro_upsampled_frame_new (ref); } SCHRO_DEBUG ("adding %d to queue (skipped)", picture->picture_number); picture->stages[SCHRO_DECODER_STAGE_DONE].is_done = TRUE; picture->stages[SCHRO_DECODER_STAGE_DONE].is_needed = TRUE; } schro_async_lock (decoder->async); SCHRO_DEBUG ("adding %d to queue", picture->picture_number); schro_picturequeue_rob_insert (instance->reorder_queue, picture, instance->reorder_queue_size); schro_async_signal_scheduler (decoder->async); schro_async_unlock (decoder->async); return SCHRO_DECODER_OK; } void schro_decoder_parse_picture (SchroPicture * picture, SchroUnpack * unpack) { SchroParams *params = &picture->params; if (params->num_refs > 0) { SCHRO_DEBUG ("inter"); schro_async_lock (picture->decoder_instance->decoder->async); picture->ref0 = schro_decoder_reference_get (picture->decoder_instance, picture->reference1); if (picture->ref0 == NULL) { SCHRO_WARNING ("ref0 not found"); picture->error = TRUE; schro_async_unlock (picture->decoder_instance->decoder->async); return; } schro_picture_ref (picture->ref0); picture->ref1 = NULL; if (params->num_refs > 1) { picture->ref1 = schro_decoder_reference_get (picture->decoder_instance, picture->reference2); if (picture->ref1 == NULL) { SCHRO_WARNING ("ref1 not found"); picture->error = TRUE; schro_async_unlock (picture->decoder_instance->decoder->async); return; } schro_picture_ref (picture->ref1); } schro_async_unlock (picture->decoder_instance->decoder->async); schro_unpack_byte_sync (unpack); schro_decoder_parse_picture_prediction_parameters (picture, unpack); if (!picture->error) { schro_params_calculate_mc_sizes (params); } schro_unpack_byte_sync (unpack); schro_decoder_parse_block_data (picture, unpack); } schro_unpack_byte_sync (unpack); picture->zero_residual = FALSE; if (params->num_refs > 0) { picture->zero_residual = schro_unpack_decode_bit (unpack); SCHRO_DEBUG ("zero residual %d", picture->zero_residual); } if (!picture->zero_residual) { schro_decoder_parse_transform_parameters (picture, unpack); schro_params_calculate_iwt_sizes (params); schro_unpack_byte_sync (unpack); if (params->is_lowdelay) { schro_decoder_parse_lowdelay_transform_data (picture, unpack); } else { schro_decoder_parse_transform_data (picture, unpack); if (picture->decoder_instance->decoder->use_opengl) { #ifdef HAVE_OPENGL schro_decoder_init_subband_frame_data (picture); #else SCHRO_ASSERT (0); #endif } else { schro_decoder_init_subband_frame_data_interleaved (picture); } } } if (picture->error) return; picture->stages[SCHRO_DECODER_STAGE_REFERENCES].is_needed = TRUE; picture->stages[SCHRO_DECODER_STAGE_MOTION_DECODE].is_needed = TRUE; picture->stages[SCHRO_DECODER_STAGE_MOTION_RENDER].is_needed = TRUE; picture->stages[SCHRO_DECODER_STAGE_RESIDUAL_DECODE].is_needed = TRUE; picture->stages[SCHRO_DECODER_STAGE_WAVELET_TRANSFORM].is_needed = TRUE; picture->stages[SCHRO_DECODER_STAGE_COMBINE].is_needed = TRUE; } /** * schro_decoder_assign_output_picture: * @picture that needs consideration of its output_picture * @robpos position of picture in reorder buffer * * Assign an output picture to @picture, taking into account field_coding * and the sharing of a frame between fields. */ static void schro_decoder_assign_output_picture (SchroPicture * picture, int robpos) { SchroDecoderInstance *instance = picture->decoder_instance; if (picture->output_picture) return; if (instance->video_format.interlaced_coding) do { SchroPicture *pair_picture; int pair_robpos; /* field coding: one frame is shared between two field pictures. * has the pair to this field already got a frame allocated? * - If so, take a reference to the already allocated frame. * - 10.4p3 earliest field in each frame shall have an even picture number * => for even pictures, pair picture_number+1, for odd pictures, -1. * The action of the RoB guarantees that the pair will eventually be * sitting next to each other in the RoB. */ /* find which RoB position the pair to this picture should reside: */ pair_robpos = robpos + (picture->picture_number & 1 ? -1 : 1); if (pair_robpos < 0 || pair_robpos >= instance->reorder_queue->n) break; pair_picture = instance->reorder_queue->elements[pair_robpos].data; if (pair_picture->picture_number != (picture->picture_number ^ 1)) break; /* picture_pair and picture are not only next to each other * in the RoB, but also belong to the same frame. */ if (!pair_picture->output_picture) break; /* only reference the pairs output picture if its frame sized, * ie, the user supplied a frame and not a field */ if (!schro_decoder_frame_is_twofield (instance, pair_picture->output_picture)) break; /* pair_picture->output_picture is full frame */ picture->output_picture = schro_frame_ref (pair_picture->output_picture); } while (0); if (!picture->output_picture) { /* either frame coding, or first field to be decoded of a frame */ picture->output_picture = schro_queue_pull (instance->output_queue); /* NB, there may not be anything in the output_queue */ } } void schro_decoder_picture_complete (SchroAsyncStage * stage) { SchroPicture *picture = (SchroPicture *) stage->priv; SCHRO_DEBUG ("picture complete"); stage->is_done = TRUE; if (stage == picture->stages + SCHRO_DECODER_STAGE_COMBINE) { picture->stages[SCHRO_DECODER_STAGE_DONE].is_done = TRUE; } picture->busy = FALSE; schro_picture_unref (picture); } static int schro_decoder_async_schedule (SchroDecoder * decoder, SchroExecDomain exec_domain) { int i; int render_ok; int decode_ok; SCHRO_DEBUG ("schedule"); if (decoder->use_cuda || decoder->use_opengl) { if (exec_domain == SCHRO_EXEC_DOMAIN_CUDA || exec_domain == SCHRO_EXEC_DOMAIN_OPENGL) { decode_ok = FALSE; render_ok = TRUE; } else { decode_ok = TRUE; render_ok = FALSE; } } else { decode_ok = TRUE; render_ok = TRUE; } for (i = 0; i < decoder->instance->reorder_queue->n; i++) { SchroPicture *picture = decoder->instance->reorder_queue->elements[i].data; void *func = NULL; int stage = 0; if (picture->busy) continue; SCHRO_DEBUG ("picture %d", picture->picture_number); #define TODO(stage) \ (picture->stages[(stage)].is_needed && \ !picture->stages[(stage)].is_done) if (TODO (SCHRO_DECODER_STAGE_REFERENCES)) { int j; int refs_ready = TRUE; for (j = 0; j < picture->params.num_refs; j++) { SchroPicture *refpic; refpic = (j == 0) ? picture->ref0 : picture->ref1; if (refpic->busy || !(refpic->stages[SCHRO_DECODER_STAGE_DONE].is_done)) { refs_ready = FALSE; continue; } if ( #ifdef HAVE_CUDA 1 && #else picture->params.mv_precision > 0 && #endif !(refpic->stages[SCHRO_DECODER_STAGE_UPSAMPLE].is_done)) { if (!render_ok) { refs_ready = FALSE; continue; } refpic->busy = TRUE; func = schro_decoder_x_upsample; schro_picture_ref (refpic); refpic->stages[SCHRO_DECODER_STAGE_UPSAMPLE].task_func = func; refpic->stages[SCHRO_DECODER_STAGE_UPSAMPLE].priv = refpic; schro_async_run_stage_locked (decoder->async, refpic->stages + SCHRO_DECODER_STAGE_UPSAMPLE); return TRUE; } } if (refs_ready) { picture->stages[SCHRO_DECODER_STAGE_REFERENCES].is_done = TRUE; } } if (TODO (SCHRO_DECODER_STAGE_RESIDUAL_DECODE) && decode_ok) { func = schro_decoder_x_decode_residual; stage = SCHRO_DECODER_STAGE_RESIDUAL_DECODE; } else if (TODO (SCHRO_DECODER_STAGE_WAVELET_TRANSFORM) && picture->stages[SCHRO_DECODER_STAGE_RESIDUAL_DECODE].is_done && render_ok) { func = schro_decoder_x_wavelet_transform; stage = SCHRO_DECODER_STAGE_WAVELET_TRANSFORM; } else if (TODO (SCHRO_DECODER_STAGE_MOTION_DECODE) && picture->stages[SCHRO_DECODER_STAGE_REFERENCES].is_done && decode_ok) { func = schro_decoder_x_decode_motion; stage = SCHRO_DECODER_STAGE_MOTION_DECODE; } else if (TODO (SCHRO_DECODER_STAGE_MOTION_RENDER) && picture->stages[SCHRO_DECODER_STAGE_MOTION_DECODE].is_done && picture->stages[SCHRO_DECODER_STAGE_WAVELET_TRANSFORM].is_done && render_ok) { func = schro_decoder_x_render_motion; stage = SCHRO_DECODER_STAGE_MOTION_RENDER; } else if (TODO (SCHRO_DECODER_STAGE_COMBINE) && picture->stages[SCHRO_DECODER_STAGE_WAVELET_TRANSFORM].is_done && picture->stages[SCHRO_DECODER_STAGE_MOTION_RENDER].is_done && render_ok) { /* Eagerly unreference the ref picures. Otherwise they are kept * until the picture dependency chain terminates (worst case, Ponly * coding = infinite dependency chain = -ENOMEM) */ if (picture->ref0) { schro_picture_unref (picture->ref0); picture->ref0 = NULL; } if (picture->ref1) { schro_picture_unref (picture->ref1); picture->ref1 = NULL; } if (!picture->output_picture) { schro_decoder_assign_output_picture (picture, i); } if (picture->output_picture) { func = schro_decoder_x_combine; stage = SCHRO_DECODER_STAGE_COMBINE; } } if (func) { picture->busy = TRUE; schro_picture_ref (picture); picture->stages[stage].task_func = func; picture->stages[stage].priv = picture; schro_async_run_stage_locked (decoder->async, picture->stages + stage); return TRUE; } } return FALSE; } void schro_decoder_x_decode_motion (SchroAsyncStage * stage) { SchroPicture *picture = (SchroPicture *) stage->priv; SchroParams *params = &picture->params; if (params->num_refs > 0) { picture->motion = schro_motion_new (params, picture->ref0->upsampled_frame, picture->ref1 ? picture->ref1->upsampled_frame : NULL); schro_decoder_decode_block_data (picture); } } void schro_decoder_x_render_motion (SchroAsyncStage * stage) { SchroPicture *picture = (SchroPicture *) stage->priv; SchroParams *params = &picture->params; SchroDecoder *decoder = picture->decoder_instance->decoder; if (1) { SchroFrameFormat frame_format; frame_format = schro_params_get_frame_format (8, params->video_format->chroma_format); if (decoder->use_cuda) { #ifdef HAVE_CUDA picture->ref_output_frame = schro_frame_new_and_alloc (decoder->cuda_domain, frame_format, picture->decoder_instance->video_format.width, schro_video_format_get_picture_height (&picture-> decoder_instance->video_format)); #else SCHRO_ASSERT (0); #endif } else if (decoder->use_opengl) { #ifdef HAVE_OPENGL picture->ref_output_frame = schro_opengl_frame_new (decoder->opengl, decoder->opengl_domain, frame_format, picture->decoder_instance->video_format.width, schro_video_format_get_picture_height (&picture->decoder_instance->video_format)); #else SCHRO_ASSERT (0); #endif } else { if (params->num_refs > 0 || picture->is_ref || picture->has_md5) { picture->ref_output_frame = schro_frame_new_and_alloc_full (decoder->cpu_domain, frame_format, picture->decoder_instance->video_format.width, schro_video_format_get_picture_height (&picture-> decoder_instance->video_format), 32, TRUE); } } } if (params->num_refs > 0) { SCHRO_DEBUG ("motion render with %p and %p", picture->ref0, picture->ref1); if (decoder->use_cuda) { #ifdef HAVE_CUDA int frame_width; int frame_height; int frame_format; SchroVideoFormat *video_format = params->video_format; frame_format = schro_params_get_frame_format (16, video_format->chroma_format); frame_width = ROUND_UP_POW2 (video_format->width, SCHRO_LIMIT_TRANSFORM_DEPTH + SCHRO_CHROMA_FORMAT_H_SHIFT (video_format->chroma_format)); frame_height = ROUND_UP_POW2 (video_format->height, SCHRO_LIMIT_TRANSFORM_DEPTH + SCHRO_CHROMA_FORMAT_V_SHIFT (video_format->chroma_format)); picture->mc_tmp_frame = schro_frame_new_and_alloc (decoder->cuda_domain, frame_format, frame_width, frame_height); schro_motion_render_cuda (picture->motion, picture->mc_tmp_frame); #else SCHRO_ASSERT (0); #endif } else if (decoder->use_opengl) { #ifdef HAVE_OPENGL SchroFrameFormat frame_format; int picture_width; int picture_height; frame_format = schro_params_get_frame_format (16, params->video_format->chroma_format); picture_width = params->video_format->width; picture_height = schro_video_format_get_picture_height (params->video_format); picture->mc_tmp_frame = schro_opengl_frame_new (decoder->opengl, decoder->opengl_domain, frame_format, picture_width, picture_height); schro_opengl_motion_render (picture->motion, picture->mc_tmp_frame); #else SCHRO_ASSERT (0); #endif } else { schro_motion_render (picture->motion, picture->mc_tmp_frame, picture->frame, TRUE, picture->ref_output_frame); } } else { if (params->num_refs > 0 || picture->is_ref || picture->has_md5) { schro_frame_convert (picture->ref_output_frame, picture->frame); } } } void schro_decoder_x_decode_residual (SchroAsyncStage * stage) { SchroPicture *picture = (SchroPicture *) stage->priv; SchroParams *params = &picture->params; if (!picture->zero_residual) { if (params->is_lowdelay) { schro_decoder_decode_lowdelay_transform_data (picture); } else { schro_decoder_decode_transform_data (picture); } } } void schro_decoder_inverse_iwt_transform (SchroFrame * frame, SchroParams * params) { int width; int height; int level; int component; int16_t *tmp; tmp = schro_malloc (sizeof (int32_t) * (params->iwt_luma_width + 16)); for (component = 0; component < 3; component++) { SchroFrameData *comp = &frame->components[component]; if (component == 0) { width = params->iwt_luma_width; height = params->iwt_luma_height; } else { width = params->iwt_chroma_width; height = params->iwt_chroma_height; } for (level = params->transform_depth - 1; level >= 0; level--) { SchroFrameData fd_dest; SchroFrameData fd_src; fd_src.format = frame->format; fd_src.data = comp->data; fd_src.width = width >> level; fd_src.height = height >> level; fd_src.stride = comp->stride << level; fd_dest.format = frame->format; fd_dest.data = comp->data; fd_dest.width = width >> level; fd_dest.height = height >> level; fd_dest.stride = comp->stride << level; schro_wavelet_inverse_transform_2d (&fd_dest, &fd_src, params->wavelet_filter_index, tmp); } } schro_free (tmp); } void schro_decoder_x_wavelet_transform (SchroAsyncStage * stage) { SchroPicture *picture = (SchroPicture *) stage->priv; SchroDecoder *decoder = picture->decoder_instance->decoder; if (!picture->zero_residual) { if (decoder->use_cuda) { picture->frame = schro_frame_clone (decoder->cuda_domain, picture->transform_frame); #ifdef HAVE_CUDA schro_frame_inverse_iwt_transform_cuda (picture->frame, picture->transform_frame, &picture->params); #else SCHRO_ASSERT (0); #endif } else if (decoder->use_opengl) { #ifdef HAVE_OPENGL picture->frame = schro_opengl_frame_clone_and_push (decoder->opengl, decoder->opengl_domain, picture->transform_frame); schro_opengl_frame_inverse_iwt_transform (picture->frame, &picture->params); #else SCHRO_ASSERT (0); #endif } else { schro_decoder_inverse_iwt_transform (picture->frame, &picture->params); } } } void schro_decoder_x_combine (SchroAsyncStage * stage) { SchroPicture *picture = (SchroPicture *) stage->priv; SchroParams *params = &picture->params; SchroDecoder *decoder = picture->decoder_instance->decoder; #if defined(HAVE_CUDA) || defined(HAVE_OPENGL) SchroFrame *combined_frame; SchroFrame *output_frame; #endif /*> output_picture: a view of picture->output_picture, that is modified * when field coding. Be very careful referencing this, no reference to * output_picture may leave this function */ SchroFrame output_picture = *picture->output_picture; #if defined(HAVE_CUDA) || defined(HAVE_OPENGL) if (picture->zero_residual) { combined_frame = picture->mc_tmp_frame; } else { if (params->num_refs > 0) { if (decoder->use_cuda) { #ifdef HAVE_CUDA schro_gpuframe_add (picture->frame, picture->mc_tmp_frame); #else SCHRO_ASSERT (0); #endif } else if (decoder->use_opengl) { #ifdef HAVE_OPENGL schro_opengl_frame_add (picture->frame, picture->mc_tmp_frame); #else SCHRO_ASSERT (0); #endif } else { //schro_frame_add (picture->frame, picture->mc_tmp_frame); } } combined_frame = picture->frame; } if (_schro_decode_prediction_only) { if (params->num_refs > 0 && !picture->is_ref) { output_frame = picture->mc_tmp_frame; } else { output_frame = combined_frame; } } else { output_frame = combined_frame; } #endif if (picture->decoder_instance->video_format.interlaced_coding && schro_decoder_frame_is_twofield (picture->decoder_instance, &output_picture)) { /* output_picture is a frame, however the [planar_]output_frame only * contains a field. Create a view of the output_picture that corresponds * to the correct field */ /* 10.4p3 earliest field in each frame shall have an even picture number: * PicNum&1 | top_field_first=1 | top_field_first=0 * ---------+-------------------+------------------ * 0 | top | bot * 1 | bot | top*/ if ((picture->picture_number & 1) == picture->decoder_instance->video_format.top_field_first) { /* to access bot_field, data pointers for first line need moving */ output_picture.components[0].data = SCHRO_FRAME_DATA_GET_LINE (&output_picture.components[0], 1); output_picture.components[1].data = SCHRO_FRAME_DATA_GET_LINE (&output_picture.components[1], 1); output_picture.components[2].data = SCHRO_FRAME_DATA_GET_LINE (&output_picture.components[2], 1); } /* skip every other line and half heights */ output_picture.components[0].stride *= 2; output_picture.components[1].stride *= 2; output_picture.components[2].stride *= 2; output_picture.components[0].height /= 2; output_picture.components[1].height /= 2; output_picture.components[2].height /= 2; output_picture.height /= 2; } if (SCHRO_FRAME_IS_PACKED (picture->output_picture->format)) { if (decoder->use_cuda) { #ifdef HAVE_CUDA SchroFrame *cuda_output_frame; SchroFrame *planar_output_frame; planar_output_frame = schro_frame_new_and_alloc (decoder->cpu_domain, schro_params_get_frame_format (8, picture->decoder_instance->video_format.chroma_format), picture->decoder_instance->video_format.width, picture->decoder_instance->video_format.height); cuda_output_frame = schro_frame_clone (decoder->cuda_domain, &output_picture); schro_gpuframe_convert (planar_output_frame, output_frame); schro_gpuframe_convert (cuda_output_frame, planar_output_frame); schro_gpuframe_to_cpu (&output_picture, cuda_output_frame); schro_frame_unref (cuda_output_frame); cuda_output_frame = NULL; schro_frame_unref (planar_output_frame); #else SCHRO_ASSERT (0); #endif } else if (decoder->use_opengl) { #ifdef HAVE_OPENGL SchroFrame *tmp_opengl_output_frame; tmp_opengl_output_frame = schro_opengl_frame_new (decoder->opengl, decoder->opengl_domain, picture->planar_output_frame->format, picture->planar_output_frame->width, picture->planar_output_frame->height); schro_opengl_frame_convert (tmp_opengl_output_frame, output_frame); schro_opengl_frame_pull (picture->planar_output_frame, tmp_opengl_output_frame); schro_frame_unref (tmp_opengl_output_frame); tmp_opengl_output_frame = NULL; schro_frame_convert (&output_picture, picture->planar_output_frame); #else SCHRO_ASSERT (0); #endif } else { if (params->num_refs > 0 || picture->is_ref) { schro_frame_convert (&output_picture, picture->ref_output_frame); } else { int shift; shift = picture->decoder_instance->bit_depth - schro_frame_get_bit_depth (&output_picture); if (shift != 0) { schro_frame_shift_right (picture->frame, shift); } schro_frame_convert (&output_picture, picture->frame); } } } else { if (decoder->use_cuda) { #ifdef HAVE_CUDA SchroFrame *cuda_output_frame; cuda_output_frame = schro_frame_clone (decoder->cuda_domain, &output_picture); schro_gpuframe_convert (cuda_output_frame, output_frame); schro_gpuframe_to_cpu (&output_picture, cuda_output_frame); schro_frame_unref (cuda_output_frame); cuda_output_frame = NULL; #else SCHRO_ASSERT (0); #endif } else if (decoder->use_opengl) { #ifdef HAVE_OPENGL SchroFrame *tmp_opengl_output_frame; tmp_opengl_output_frame = schro_opengl_frame_new (decoder->opengl, decoder->opengl_domain, output_picture.format, output_picture.width, output_picture.height); schro_opengl_frame_convert (tmp_opengl_output_frame, output_frame); schro_opengl_frame_pull (&output_picture, tmp_opengl_output_frame); schro_frame_unref (tmp_opengl_output_frame); tmp_opengl_output_frame = NULL; #else SCHRO_ASSERT (0); #endif } else { if (params->num_refs > 0 || picture->is_ref) { schro_frame_convert (&output_picture, picture->ref_output_frame); } else { int shift; shift = picture->decoder_instance->bit_depth - schro_frame_get_bit_depth (&output_picture); if (shift != 0) { schro_frame_shift_right (picture->frame, shift); } schro_frame_convert (&output_picture, picture->frame); } if (_schro_telemetry) { schro_decoder_telemetry (picture, &output_picture); } } } if (picture->is_ref) { SchroFrame *ref; ref = schro_frame_ref (picture->ref_output_frame); if (decoder->use_cuda) { #ifdef HAVE_CUDA schro_gpuframe_convert (ref, combined_frame); #else SCHRO_ASSERT (0); #endif } else if (decoder->use_opengl) { #ifdef HAVE_OPENGL schro_opengl_frame_convert (ref, combined_frame); #else SCHRO_ASSERT (0); #endif } else { schro_frame_mc_edgeextend (ref); } picture->upsampled_frame = schro_upsampled_frame_new (ref); } if (picture->has_md5) { uint32_t state[4]; schro_frame_md5 (picture->ref_output_frame, state); if (memcmp (state, picture->md5_checksum, 16) != 0) { char a[33]; char b[33]; int i; for (i = 0; i < 16; i++) { sprintf (a + 2 * i, "%02x", ((uint8_t *) state)[i]); sprintf (b + 2 * i, "%02x", picture->md5_checksum[i]); } a[32] = 0; b[32] = 0; SCHRO_ERROR ("MD5 checksum mismatch (%s should be %s)", a, b); } } /* eagerly unreference any storage that is nolonger required */ if (picture->mc_tmp_frame) { schro_frame_unref (picture->mc_tmp_frame); picture->mc_tmp_frame = NULL; } schro_frame_unref (picture->transform_frame); picture->transform_frame = NULL; schro_frame_unref (picture->frame); picture->frame = NULL; } void schro_decoder_x_upsample (SchroAsyncStage * stage) { SchroPicture *picture = (SchroPicture *) stage->priv; SchroDecoder *decoder = picture->decoder_instance->decoder; if (decoder->use_cuda) { #ifdef HAVE_CUDA schro_upsampled_gpuframe_upsample (picture->upsampled_frame); #else SCHRO_ASSERT (0); #endif } else if (decoder->use_opengl) { #ifdef HAVE_OPENGL schro_opengl_upsampled_frame_upsample (picture->upsampled_frame); #else SCHRO_ASSERT (0); #endif } else { schro_upsampled_frame_upsample (picture->upsampled_frame); } } int schro_decoder_decode_parse_header (SchroUnpack * unpack) { int v1, v2, v3, v4; int parse_code; v1 = schro_unpack_decode_bits (unpack, 8); v2 = schro_unpack_decode_bits (unpack, 8); v3 = schro_unpack_decode_bits (unpack, 8); v4 = schro_unpack_decode_bits (unpack, 8); SCHRO_DEBUG ("parse header %02x %02x %02x %02x", v1, v2, v3, v4); if (v1 != 'B' || v2 != 'B' || v3 != 'C' || v4 != 'D') { SCHRO_ERROR ("expected parse header"); return -1; } parse_code = schro_unpack_decode_bits (unpack, 8); SCHRO_DEBUG ("parse code %02x", parse_code); v1 = schro_unpack_decode_bits (unpack, 32); SCHRO_DEBUG ("next_parse_offset %d", v1); v1 = schro_unpack_decode_bits (unpack, 32); SCHRO_DEBUG ("prev_parse_offset %d", v1); return parse_code; } static int schro_decoder_check_version (int major, int minor) { if (major == 0 && minor == 20071203) return TRUE; if (major == 1 && minor == 0) return TRUE; if (major == 2 && minor == 0) return TRUE; if (major == 2 && minor == 1) return TRUE; if (major == 2 && minor == 2) return TRUE; return FALSE; } int schro_decoder_compare_sequence_header_buffer (SchroBuffer * a, SchroBuffer * b) { return TRUE; /* FIXME */ if (a->length != b->length) { SCHRO_ERROR ("length different %d vs %d", a->length, b->length); return FALSE; } if (a->length < 13) return FALSE; { int i; for (i = 13; i < a->length; i++) { SCHRO_ERROR ("seq headers: %02x %02x", a->data[i], b->data[i]); } } if (memcmp (a->data + 13, b->data + 13, a->length - 13) != 0) return FALSE; return TRUE; } void schro_decoder_parse_sequence_header (SchroDecoderInstance * instance, SchroUnpack * unpack) { int bit; int index; SchroVideoFormat *format = &instance->video_format; SCHRO_DEBUG ("decoding sequence header"); /* parse parameters */ instance->major_version = schro_unpack_decode_uint (unpack); SCHRO_DEBUG ("major_version = %d", instance->major_version); instance->minor_version = schro_unpack_decode_uint (unpack); SCHRO_DEBUG ("minor_version = %d", instance->minor_version); instance->profile = schro_unpack_decode_uint (unpack); SCHRO_DEBUG ("profile = %d", instance->profile); instance->level = schro_unpack_decode_uint (unpack); SCHRO_DEBUG ("level = %d", instance->level); if (!schro_decoder_check_version (instance->major_version, instance->minor_version)) { SCHRO_WARNING ("Stream version number %d:%d not handled, expecting 0:20071203, 1:0, 2:0, 2:1, or 2:2", instance->major_version, instance->minor_version); } /* base video format */ index = schro_unpack_decode_uint (unpack); schro_video_format_set_std_video_format (format, index); /* source parameters */ /* frame dimensions */ bit = schro_unpack_decode_bit (unpack); if (bit) { format->width = schro_unpack_decode_uint (unpack); format->height = schro_unpack_decode_uint (unpack); } SCHRO_DEBUG ("size = %d x %d", format->width, format->height); /* chroma format */ bit = schro_unpack_decode_bit (unpack); if (bit) { format->chroma_format = schro_unpack_decode_uint (unpack); } SCHRO_DEBUG ("chroma_format %d", format->chroma_format); /* scan format */ bit = schro_unpack_decode_bit (unpack); if (bit) { format->interlaced = schro_unpack_decode_uint (unpack); } SCHRO_DEBUG ("interlaced %d top_field_first %d", format->interlaced, format->top_field_first); MARKER (); /* frame rate */ bit = schro_unpack_decode_bit (unpack); if (bit) { index = schro_unpack_decode_uint (unpack); if (index == 0) { format->frame_rate_numerator = schro_unpack_decode_uint (unpack); format->frame_rate_denominator = schro_unpack_decode_uint (unpack); } else { schro_video_format_set_std_frame_rate (format, index); } } SCHRO_DEBUG ("frame rate %d/%d", format->frame_rate_numerator, format->frame_rate_denominator); MARKER (); /* aspect ratio */ bit = schro_unpack_decode_bit (unpack); if (bit) { index = schro_unpack_decode_uint (unpack); if (index == 0) { format->aspect_ratio_numerator = schro_unpack_decode_uint (unpack); format->aspect_ratio_denominator = schro_unpack_decode_uint (unpack); } else { schro_video_format_set_std_aspect_ratio (format, index); } } SCHRO_DEBUG ("aspect ratio %d/%d", format->aspect_ratio_numerator, format->aspect_ratio_denominator); MARKER (); /* clean area */ bit = schro_unpack_decode_bit (unpack); if (bit) { format->clean_width = schro_unpack_decode_uint (unpack); format->clean_height = schro_unpack_decode_uint (unpack); format->left_offset = schro_unpack_decode_uint (unpack); format->top_offset = schro_unpack_decode_uint (unpack); } SCHRO_DEBUG ("clean offset %d %d", format->left_offset, format->top_offset); SCHRO_DEBUG ("clean size %d %d", format->clean_width, format->clean_height); MARKER (); /* signal range */ bit = schro_unpack_decode_bit (unpack); if (bit) { index = schro_unpack_decode_uint (unpack); if (index == 0) { format->luma_offset = schro_unpack_decode_uint (unpack); format->luma_excursion = schro_unpack_decode_uint (unpack); format->chroma_offset = schro_unpack_decode_uint (unpack); format->chroma_excursion = schro_unpack_decode_uint (unpack); } else { if (index <= SCHRO_SIGNAL_RANGE_12BIT_VIDEO) { schro_video_format_set_std_signal_range (format, index); } else { schro_decoder_error (instance->decoder, "signal range index out of range"); } } } SCHRO_DEBUG ("luma offset %d excursion %d", format->luma_offset, format->luma_excursion); SCHRO_DEBUG ("chroma offset %d excursion %d", format->chroma_offset, format->chroma_excursion); MARKER (); /* colour spec */ bit = schro_unpack_decode_bit (unpack); if (bit) { index = schro_unpack_decode_uint (unpack); if (index <= SCHRO_COLOUR_SPEC_CINEMA) { schro_video_format_set_std_colour_spec (format, index); } else { schro_decoder_error (instance->decoder, "colour spec index out of range"); } if (index == 0) { /* colour primaries */ bit = schro_unpack_decode_bit (unpack); if (bit) { format->colour_primaries = schro_unpack_decode_uint (unpack); } /* colour matrix */ bit = schro_unpack_decode_bit (unpack); if (bit) { format->colour_matrix = schro_unpack_decode_uint (unpack); } /* transfer function */ bit = schro_unpack_decode_bit (unpack); if (bit) { format->transfer_function = schro_unpack_decode_uint (unpack); } } } format->interlaced_coding = schro_unpack_decode_uint (unpack); MARKER (); schro_video_format_validate (format); } void schro_decoder_parse_picture_header (SchroPicture * picture, SchroUnpack * unpack) { SchroParams *params = &picture->params; schro_unpack_byte_sync (unpack); picture->picture_number = schro_unpack_decode_bits (unpack, 32); SCHRO_DEBUG ("picture number %d", picture->picture_number); if (params->num_refs > 0) { picture->reference1 = picture->picture_number + schro_unpack_decode_sint (unpack); SCHRO_DEBUG ("ref1 %d", picture->reference1); } if (params->num_refs > 1) { picture->reference2 = picture->picture_number + schro_unpack_decode_sint (unpack); SCHRO_DEBUG ("ref2 %d", picture->reference2); } if (picture->is_ref) { picture->retired_picture_number = picture->picture_number + schro_unpack_decode_sint (unpack); } } void schro_decoder_parse_picture_prediction_parameters (SchroPicture * picture, SchroUnpack * unpack) { SchroParams *params = &picture->params; int bit; int index; int ret; /* block parameters */ index = schro_unpack_decode_uint (unpack); if (index == 0) { params->xblen_luma = schro_unpack_decode_uint (unpack); params->yblen_luma = schro_unpack_decode_uint (unpack); params->xbsep_luma = schro_unpack_decode_uint (unpack); params->ybsep_luma = schro_unpack_decode_uint (unpack); if (!schro_params_verify_block_params (params)) picture->error = TRUE; } else { ret = schro_params_set_block_params (params, index); if (!ret) picture->error = TRUE; } SCHRO_DEBUG ("blen_luma %d %d bsep_luma %d %d", params->xblen_luma, params->yblen_luma, params->xbsep_luma, params->ybsep_luma); MARKER (); /* mv precision */ params->mv_precision = schro_unpack_decode_uint (unpack); SCHRO_DEBUG ("mv_precision %d", params->mv_precision); if (params->mv_precision > 3) { picture->error = TRUE; } MARKER (); /* global motion */ params->have_global_motion = schro_unpack_decode_bit (unpack); if (params->have_global_motion) { int i; for (i = 0; i < params->num_refs; i++) { SchroGlobalMotion *gm = params->global_motion + i; /* pan/tilt */ bit = schro_unpack_decode_bit (unpack); if (bit) { gm->b0 = schro_unpack_decode_sint (unpack); gm->b1 = schro_unpack_decode_sint (unpack); } else { gm->b0 = 0; gm->b1 = 0; } /* zoom/rotate/shear */ bit = schro_unpack_decode_bit (unpack); if (bit) { gm->a_exp = schro_unpack_decode_uint (unpack); gm->a00 = schro_unpack_decode_sint (unpack); gm->a01 = schro_unpack_decode_sint (unpack); gm->a10 = schro_unpack_decode_sint (unpack); gm->a11 = schro_unpack_decode_sint (unpack); } else { gm->a_exp = 0; gm->a00 = 1; gm->a01 = 0; gm->a10 = 0; gm->a11 = 1; } /* perspective */ bit = schro_unpack_decode_bit (unpack); if (bit) { gm->c_exp = schro_unpack_decode_uint (unpack); gm->c0 = schro_unpack_decode_sint (unpack); gm->c1 = schro_unpack_decode_sint (unpack); } else { gm->c_exp = 0; gm->c0 = 0; gm->c1 = 0; } SCHRO_DEBUG ("ref %d pan %d %d matrix %d %d %d %d perspective %d %d", i, gm->b0, gm->b1, gm->a00, gm->a01, gm->a10, gm->a11, gm->c0, gm->c1); } } MARKER (); /* picture prediction mode */ params->picture_pred_mode = schro_unpack_decode_uint (unpack); if (params->picture_pred_mode != 0) { picture->error = TRUE; } /* reference picture weights */ params->picture_weight_bits = 1; params->picture_weight_1 = 1; params->picture_weight_2 = 1; bit = schro_unpack_decode_bit (unpack); if (bit) { params->picture_weight_bits = schro_unpack_decode_uint (unpack); params->picture_weight_1 = schro_unpack_decode_sint (unpack); if (params->num_refs > 1) { params->picture_weight_2 = schro_unpack_decode_sint (unpack); } } MARKER (); } enum { SCHRO_DECODER_ARITH_SUPERBLOCK, SCHRO_DECODER_ARITH_PRED_MODE, SCHRO_DECODER_ARITH_VECTOR_REF1_X, SCHRO_DECODER_ARITH_VECTOR_REF1_Y, SCHRO_DECODER_ARITH_VECTOR_REF2_X, SCHRO_DECODER_ARITH_VECTOR_REF2_Y, SCHRO_DECODER_ARITH_DC_0, SCHRO_DECODER_ARITH_DC_1, SCHRO_DECODER_ARITH_DC_2 }; void schro_decoder_parse_block_data (SchroPicture * picture, SchroUnpack * unpack) { SchroParams *params = &picture->params; int i; for (i = 0; i < 9; i++) { int length; if (params->num_refs < 2 && (i == SCHRO_DECODER_ARITH_VECTOR_REF2_X || i == SCHRO_DECODER_ARITH_VECTOR_REF2_Y)) { picture->motion_buffers[i] = NULL; continue; } length = schro_unpack_decode_uint (unpack); schro_unpack_byte_sync (unpack); picture->motion_buffers[i] = schro_buffer_new_subbuffer (picture->input_buffer, schro_unpack_get_bits_read (unpack) / 8, length); schro_unpack_skip_bits (unpack, length * 8); } } void schro_decoder_decode_block_data (SchroPicture * picture) { SchroParams *params = &picture->params; SchroArith *arith[9]; SchroUnpack unpack[9]; int i, j; orc_splat_u8_ns ((uint8_t *) picture->motion->motion_vectors, 0, sizeof (SchroMotionVector) * params->y_num_blocks * params->x_num_blocks); for (i = 0; i < 9; i++) { if (params->num_refs < 2 && (i == SCHRO_DECODER_ARITH_VECTOR_REF2_X || i == SCHRO_DECODER_ARITH_VECTOR_REF2_Y)) { arith[i] = NULL; continue; } if (!params->is_noarith) { arith[i] = schro_arith_new (); schro_arith_decode_init (arith[i], picture->motion_buffers[i]); } else { schro_unpack_init_with_data (unpack + i, picture->motion_buffers[i]->data, picture->motion_buffers[i]->length, 1); } } for (j = 0; j < params->y_num_blocks; j += 4) { for (i = 0; i < params->x_num_blocks; i += 4) { schro_decoder_decode_macroblock (picture, arith, unpack, i, j); } } for (i = 0; i < 9; i++) { if (!params->is_noarith) { if (arith[i] == NULL) continue; if (arith[i]->offset < arith[i]->buffer->length) { SCHRO_DEBUG ("arith decoding %d didn't consume buffer (%d < %d)", i, arith[i]->offset, arith[i]->buffer->length); } if (arith[i]->offset > arith[i]->buffer->length + 6) { SCHRO_WARNING ("arith decoding %d overran buffer (%d > %d)", i, arith[i]->offset, arith[i]->buffer->length); } schro_arith_free (arith[i]); } else { /* FIXME complain about buffer over/underrun */ } } schro_motion_verify (picture->motion); } void schro_decoder_decode_macroblock (SchroPicture * picture, SchroArith ** arith, SchroUnpack * unpack, int i, int j) { SchroParams *params = &picture->params; SchroMotion *motion = picture->motion; SchroMotionVector *mv = &motion->motion_vectors[j * params->x_num_blocks + i]; int k, l; int split_prediction; split_prediction = schro_motion_split_prediction (motion, i, j); if (!params->is_noarith) { mv->split = (split_prediction + _schro_arith_decode_uint (arith[SCHRO_DECODER_ARITH_SUPERBLOCK], SCHRO_CTX_SB_F1, SCHRO_CTX_SB_DATA)) % 3; } else { mv->split = (split_prediction + schro_unpack_decode_uint (unpack + SCHRO_DECODER_ARITH_SUPERBLOCK)) % 3; } switch (mv->split) { default: /* this can happen if _schro_arith_decode_uint() decodes a value * that overflows. FIXME should cause a picture error. For now, * just pretend it didn't happen. */ SCHRO_ERROR ("mv->split == %d, split_prediction %d", mv->split, split_prediction); /* fall through */ case 0: schro_decoder_decode_prediction_unit (picture, arith, unpack, motion->motion_vectors, i, j); mv[1] = mv[0]; mv[2] = mv[0]; mv[3] = mv[0]; memcpy (mv + params->x_num_blocks, mv, 4 * sizeof (*mv)); memcpy (mv + 2 * params->x_num_blocks, mv, 4 * sizeof (*mv)); memcpy (mv + 3 * params->x_num_blocks, mv, 4 * sizeof (*mv)); break; case 1: schro_decoder_decode_prediction_unit (picture, arith, unpack, motion->motion_vectors, i, j); mv[1] = mv[0]; schro_decoder_decode_prediction_unit (picture, arith, unpack, motion->motion_vectors, i + 2, j); mv[2].split = 1; mv[3] = mv[2]; memcpy (mv + params->x_num_blocks, mv, 4 * sizeof (*mv)); mv += 2 * params->x_num_blocks; schro_decoder_decode_prediction_unit (picture, arith, unpack, motion->motion_vectors, i, j + 2); mv[0].split = 1; mv[1] = mv[0]; schro_decoder_decode_prediction_unit (picture, arith, unpack, motion->motion_vectors, i + 2, j + 2); mv[2].split = 1; mv[3] = mv[2]; memcpy (mv + params->x_num_blocks, mv, 4 * sizeof (*mv)); break; case 2: for (l = 0; l < 4; l++) { for (k = 0; k < 4; k++) { mv[l * params->x_num_blocks + k].split = 2; schro_decoder_decode_prediction_unit (picture, arith, unpack, motion->motion_vectors, i + k, j + l); } } break; } } void schro_decoder_decode_prediction_unit (SchroPicture * picture, SchroArith ** arith, SchroUnpack * unpack, SchroMotionVector * motion_vectors, int x, int y) { SchroParams *params = &picture->params; SchroMotion *motion = picture->motion; SchroMotionVector *mv = &motion_vectors[y * params->x_num_blocks + x]; mv->pred_mode = schro_motion_get_mode_prediction (motion, x, y); if (!params->is_noarith) { mv->pred_mode ^= _schro_arith_decode_bit (arith[SCHRO_DECODER_ARITH_PRED_MODE], SCHRO_CTX_BLOCK_MODE_REF1); } else { mv->pred_mode ^= schro_unpack_decode_bit (unpack + SCHRO_DECODER_ARITH_PRED_MODE); } if (params->num_refs > 1) { if (!params->is_noarith) { mv->pred_mode ^= _schro_arith_decode_bit (arith[SCHRO_DECODER_ARITH_PRED_MODE], SCHRO_CTX_BLOCK_MODE_REF2) << 1; } else { mv->pred_mode ^= schro_unpack_decode_bit (unpack + SCHRO_DECODER_ARITH_PRED_MODE) << 1; } } if (mv->pred_mode == 0) { int pred[3]; schro_motion_dc_prediction (motion, x, y, pred); if (!params->is_noarith) { mv->u.dc.dc[0] = pred[0] + _schro_arith_decode_sint (arith[SCHRO_DECODER_ARITH_DC_0], SCHRO_CTX_LUMA_DC_CONT_BIN1, SCHRO_CTX_LUMA_DC_VALUE, SCHRO_CTX_LUMA_DC_SIGN); mv->u.dc.dc[1] = pred[1] + _schro_arith_decode_sint (arith[SCHRO_DECODER_ARITH_DC_1], SCHRO_CTX_CHROMA1_DC_CONT_BIN1, SCHRO_CTX_CHROMA1_DC_VALUE, SCHRO_CTX_CHROMA1_DC_SIGN); mv->u.dc.dc[2] = pred[2] + _schro_arith_decode_sint (arith[SCHRO_DECODER_ARITH_DC_2], SCHRO_CTX_CHROMA2_DC_CONT_BIN1, SCHRO_CTX_CHROMA2_DC_VALUE, SCHRO_CTX_CHROMA2_DC_SIGN); } else { mv->u.dc.dc[0] = pred[0] + schro_unpack_decode_sint (unpack + SCHRO_DECODER_ARITH_DC_0); mv->u.dc.dc[1] = pred[1] + schro_unpack_decode_sint (unpack + SCHRO_DECODER_ARITH_DC_1); mv->u.dc.dc[2] = pred[2] + schro_unpack_decode_sint (unpack + SCHRO_DECODER_ARITH_DC_2); } } else { int pred_x, pred_y; if (params->have_global_motion) { int pred; pred = schro_motion_get_global_prediction (motion, x, y); if (!params->is_noarith) { mv->using_global = pred ^ _schro_arith_decode_bit (arith[SCHRO_DECODER_ARITH_PRED_MODE], SCHRO_CTX_GLOBAL_BLOCK); } else { mv->using_global = pred ^ schro_unpack_decode_bit (unpack + SCHRO_DECODER_ARITH_PRED_MODE); } } else { mv->using_global = FALSE; } if (!mv->using_global) { if (mv->pred_mode & 1) { schro_motion_vector_prediction (motion, x, y, &pred_x, &pred_y, 1); if (!params->is_noarith) { mv->u.vec.dx[0] = pred_x + _schro_arith_decode_sint (arith [SCHRO_DECODER_ARITH_VECTOR_REF1_X], SCHRO_CTX_MV_REF1_H_CONT_BIN1, SCHRO_CTX_MV_REF1_H_VALUE, SCHRO_CTX_MV_REF1_H_SIGN); mv->u.vec.dy[0] = pred_y + _schro_arith_decode_sint (arith [SCHRO_DECODER_ARITH_VECTOR_REF1_Y], SCHRO_CTX_MV_REF1_V_CONT_BIN1, SCHRO_CTX_MV_REF1_V_VALUE, SCHRO_CTX_MV_REF1_V_SIGN); } else { mv->u.vec.dx[0] = pred_x + schro_unpack_decode_sint (unpack + SCHRO_DECODER_ARITH_VECTOR_REF1_X); mv->u.vec.dy[0] = pred_y + schro_unpack_decode_sint (unpack + SCHRO_DECODER_ARITH_VECTOR_REF1_Y); } } if (mv->pred_mode & 2) { schro_motion_vector_prediction (motion, x, y, &pred_x, &pred_y, 2); if (!params->is_noarith) { mv->u.vec.dx[1] = pred_x + _schro_arith_decode_sint (arith [SCHRO_DECODER_ARITH_VECTOR_REF2_X], SCHRO_CTX_MV_REF2_H_CONT_BIN1, SCHRO_CTX_MV_REF2_H_VALUE, SCHRO_CTX_MV_REF2_H_SIGN); mv->u.vec.dy[1] = pred_y + _schro_arith_decode_sint (arith [SCHRO_DECODER_ARITH_VECTOR_REF2_Y], SCHRO_CTX_MV_REF2_V_CONT_BIN1, SCHRO_CTX_MV_REF2_V_VALUE, SCHRO_CTX_MV_REF2_V_SIGN); } else { mv->u.vec.dx[1] = pred_x + schro_unpack_decode_sint (unpack + SCHRO_DECODER_ARITH_VECTOR_REF2_X); mv->u.vec.dy[1] = pred_y + schro_unpack_decode_sint (unpack + SCHRO_DECODER_ARITH_VECTOR_REF2_Y); } } } else { mv->u.vec.dx[0] = 0; mv->u.vec.dy[0] = 0; mv->u.vec.dx[1] = 0; mv->u.vec.dy[1] = 0; } } } void schro_decoder_parse_transform_parameters (SchroPicture * picture, SchroUnpack * unpack) { int bit; int i; SchroParams *params = &picture->params; /* transform */ params->wavelet_filter_index = schro_unpack_decode_uint (unpack); SCHRO_DEBUG ("wavelet filter index %d", params->wavelet_filter_index); /* transform depth */ params->transform_depth = schro_unpack_decode_uint (unpack); SCHRO_DEBUG ("transform depth %d", params->transform_depth); if (params->transform_depth > SCHRO_LIMIT_TRANSFORM_DEPTH) { picture->error = TRUE; return; } if (!params->is_lowdelay) { /* codeblock parameters */ params->codeblock_mode_index = 0; for (i = 0; i < params->transform_depth + 1; i++) { params->horiz_codeblocks[i] = 1; params->vert_codeblocks[i] = 1; } bit = schro_unpack_decode_bit (unpack); if (bit) { for (i = 0; i < params->transform_depth + 1; i++) { params->horiz_codeblocks[i] = schro_unpack_decode_uint (unpack); params->vert_codeblocks[i] = schro_unpack_decode_uint (unpack); } params->codeblock_mode_index = schro_unpack_decode_uint (unpack); } } else { /* slice parameters */ params->n_horiz_slices = schro_unpack_decode_uint (unpack); params->n_vert_slices = schro_unpack_decode_uint (unpack); params->slice_bytes_num = schro_unpack_decode_uint (unpack); params->slice_bytes_denom = schro_unpack_decode_uint (unpack); /* quant matrix */ bit = schro_unpack_decode_bit (unpack); if (bit) { params->quant_matrix[0] = schro_unpack_decode_uint (unpack); for (i = 0; i < params->transform_depth; i++) { params->quant_matrix[1 + 3 * i] = schro_unpack_decode_uint (unpack); params->quant_matrix[2 + 3 * i] = schro_unpack_decode_uint (unpack); params->quant_matrix[3 + 3 * i] = schro_unpack_decode_uint (unpack); } } else { schro_params_set_default_quant_matrix (params); } } } void schro_decoder_init_subband_frame_data_interleaved (SchroPicture * picture) { int i; int component; SchroFrameData *fd; SchroParams *params = &picture->params; int position; if (picture->error) return; for (component = 0; component < 3; component++) { for (i = 0; i < 1 + 3 * params->transform_depth; i++) { position = schro_subband_get_position (i); fd = &picture->subband_data[component][i]; schro_subband_get_frame_data (fd, picture->transform_frame, component, position, params); } } } #ifdef HAVE_OPENGL void schro_decoder_init_subband_frame_data (SchroPicture * picture) { int i; int component; SchroFrameData *fd; SchroParams *params = &picture->params; int position; if (picture->error) return; for (component = 0; component < 3; ++component) { for (i = 0; i < 1 + 3 * params->transform_depth; ++i) { position = schro_subband_get_position (i); fd = &picture->subband_data[component][i]; schro_subband_get_frame_data (fd, picture->transform_frame, component, position, params); } } } #endif void schro_decoder_parse_lowdelay_transform_data (SchroPicture * picture, SchroUnpack * unpack) { SchroParams *params = &picture->params; int length; length = (params->slice_bytes_num * params->n_horiz_slices * params->n_vert_slices) / params->slice_bytes_denom; picture->lowdelay_buffer = schro_buffer_new_subbuffer (picture->input_buffer, schro_unpack_get_bits_read (unpack) / 8, length); schro_unpack_skip_bits (unpack, length * 8); } void schro_decoder_parse_transform_data (SchroPicture * picture, SchroUnpack * unpack) { int i; int component; SchroParams *params = &picture->params; int subband_length; if (picture->error) return; for (component = 0; component < 3; component++) { for (i = 0; i < 1 + 3 * params->transform_depth; i++) { schro_unpack_byte_sync (unpack); subband_length = schro_unpack_decode_uint (unpack); SCHRO_DEBUG ("subband %d %d length %d", component, i, subband_length); if (subband_length == 0) { SCHRO_DEBUG ("subband is zero"); schro_unpack_byte_sync (unpack); picture->subband_quant_index[component][i] = 0; picture->subband_length[component][i] = 0; picture->subband_buffer[component][i] = NULL; } else { int quant_index; quant_index = schro_unpack_decode_uint (unpack); SCHRO_DEBUG ("quant index %d", quant_index); if (quant_index < 0 || quant_index > 60) { picture->error = TRUE; return; } schro_unpack_byte_sync (unpack); picture->subband_quant_index[component][i] = quant_index; picture->subband_length[component][i] = subband_length; picture->subband_buffer[component][i] = schro_buffer_new_subbuffer (picture->input_buffer, schro_unpack_get_bits_read (unpack) / 8, subband_length); schro_unpack_skip_bits (unpack, subband_length * 8); } } } } void schro_decoder_decode_transform_data (SchroPicture * picture) { int i; int component; SchroParams *params = &picture->params; SchroPictureSubbandContext context = { 0 }, *ctx = &context; int skip_subbands; if (_schro_decode_prediction_only && params->num_refs > 0 && !picture->is_ref) { schro_frame_clear (picture->frame); return; } /* FIXME some day, hook this up into automatic degraded decoding */ skip_subbands = 0; for (component = 0; component < 3; component++) { for (i = 0; i < 1 + 3 * params->transform_depth - skip_subbands; i++) { ctx->component = component; ctx->index = i; ctx->position = schro_subband_get_position (i); schro_decoder_decode_subband (picture, ctx); } } } static void codeblock_line_decode_generic (SchroPictureSubbandContext * ctx, int16_t * line, int j, const int16_t * parent_data, const int16_t * prev) { int i; for (i = ctx->xmin; i < ctx->xmax; i++) { int v; int parent; int nhood_or; int previous_value; if (parent_data) { parent = parent_data[(i >> 1)]; } else { parent = 0; } nhood_or = 0; if (j > 0) nhood_or |= prev[i]; if (i > 0) nhood_or |= line[i - 1]; if (i > 0 && j > 0) nhood_or |= prev[i - 1]; previous_value = 0; if (SCHRO_SUBBAND_IS_HORIZONTALLY_ORIENTED (ctx->position)) { if (i > 0) previous_value = line[i - 1]; } else if (SCHRO_SUBBAND_IS_VERTICALLY_ORIENTED (ctx->position)) { if (j > 0) previous_value = prev[i]; } #define STUFF \ do { \ int cont_context, sign_context, value_context; \ \ if (parent == 0) { \ cont_context = nhood_or ? SCHRO_CTX_ZPNN_F1 : SCHRO_CTX_ZPZN_F1; \ } else { \ cont_context = nhood_or ? SCHRO_CTX_NPNN_F1 : SCHRO_CTX_NPZN_F1; \ } \ \ if (previous_value < 0) { \ sign_context = SCHRO_CTX_SIGN_NEG; \ } else { \ sign_context = (previous_value > 0) ? SCHRO_CTX_SIGN_POS : \ SCHRO_CTX_SIGN_ZERO; \ } \ \ value_context = SCHRO_CTX_COEFF_DATA; \ \ v = _schro_arith_decode_uint (ctx->arith, cont_context, \ value_context); \ if (v) { \ v = (ctx->quant_offset + ctx->quant_factor * v + 2)>>2; \ if (_schro_arith_decode_bit (ctx->arith, sign_context)) { \ v = -v; \ } \ line[i] = v; \ } else { \ line[i] = 0; \ } \ } while(0) STUFF; } } static void codeblock_line_decode_generic_s32 (SchroPictureSubbandContext * ctx, int32_t * line, int j, const int32_t * parent_data, const int32_t * prev) { int i; for (i = ctx->xmin; i < ctx->xmax; i++) { int v; int parent; int nhood_or; int previous_value; if (parent_data) { parent = parent_data[(i >> 1)]; } else { parent = 0; } nhood_or = 0; if (j > 0) nhood_or |= prev[i]; if (i > 0) nhood_or |= line[i - 1]; if (i > 0 && j > 0) nhood_or |= prev[i - 1]; previous_value = 0; if (SCHRO_SUBBAND_IS_HORIZONTALLY_ORIENTED (ctx->position)) { if (i > 0) previous_value = line[i - 1]; } else if (SCHRO_SUBBAND_IS_VERTICALLY_ORIENTED (ctx->position)) { if (j > 0) previous_value = prev[i]; } STUFF; } } static void codeblock_line_decode_p_horiz (SchroPictureSubbandContext * ctx, int16_t * line, int j, const int16_t * parent_data, const int16_t * prev) { int i = ctx->xmin; int v; int parent; int nhood_or; int previous_value; if (i == 0) { parent = parent_data[(i >> 1)]; nhood_or = prev[i]; previous_value = 0; STUFF; i++; } for (; i < ctx->xmax; i++) { parent = parent_data[(i >> 1)]; nhood_or = prev[i]; nhood_or |= line[i - 1]; nhood_or |= prev[i - 1]; previous_value = line[i - 1]; STUFF; } } static void codeblock_line_decode_p_vert (SchroPictureSubbandContext * ctx, int16_t * line, int j, const int16_t * parent_data, const int16_t * prev) { int i = ctx->xmin; int v; int parent; int nhood_or; int previous_value; if (i == 0) { parent = parent_data[(i >> 1)]; nhood_or = prev[i]; previous_value = prev[i]; STUFF; i++; } for (; i < ctx->xmax; i++) { parent = parent_data[(i >> 1)]; nhood_or = prev[i]; nhood_or |= line[i - 1]; nhood_or |= prev[i - 1]; previous_value = prev[i]; STUFF; } } static void codeblock_line_decode_p_diag (SchroPictureSubbandContext * ctx, int16_t * line, int j, const int16_t * parent_data, const int16_t * prev) { int i; int v; int parent; int nhood_or; int previous_value; i = ctx->xmin; if (i == 0) { parent = parent_data[(i >> 1)]; nhood_or = prev[i]; previous_value = 0; STUFF; i++; } for (; i < ctx->xmax; i++) { parent = parent_data[(i >> 1)]; nhood_or = prev[i]; nhood_or |= line[i - 1]; nhood_or |= prev[i - 1]; previous_value = 0; STUFF; } } void schro_decoder_subband_dc_predict (SchroFrameData * fd) { int16_t *prev_line; int16_t *line; int i, j; int pred_value; line = SCHRO_FRAME_DATA_GET_LINE (fd, 0); for (i = 1; i < fd->width; i++) { pred_value = line[i - 1]; line[i] += pred_value; } for (j = 1; j < fd->height; j++) { line = SCHRO_FRAME_DATA_GET_LINE (fd, j); prev_line = SCHRO_FRAME_DATA_GET_LINE (fd, j - 1); pred_value = prev_line[0]; line[0] += pred_value; for (i = 1; i < fd->width; i++) { pred_value = schro_divide3 (line[i - 1] + prev_line[i] + prev_line[i - 1] + 1); line[i] += pred_value; } } } void schro_decoder_subband_dc_predict_s32 (SchroFrameData * fd) { int32_t *prev_line; int32_t *line; int i, j; int pred_value; line = SCHRO_FRAME_DATA_GET_LINE (fd, 0); for (i = 1; i < fd->width; i++) { pred_value = line[i - 1]; line[i] += pred_value; } for (j = 1; j < fd->height; j++) { line = SCHRO_FRAME_DATA_GET_LINE (fd, j); prev_line = SCHRO_FRAME_DATA_GET_LINE (fd, j - 1); pred_value = prev_line[0]; line[0] += pred_value; for (i = 1; i < fd->width; i++) { pred_value = schro_divide (line[i - 1] + prev_line[i] + prev_line[i - 1] + 1, 3); line[i] += pred_value; } } } static void schro_decoder_setup_codeblocks (SchroPicture * picture, SchroPictureSubbandContext * ctx) { SchroParams *params = &picture->params; if (ctx->position == 0) { ctx->vert_codeblocks = params->vert_codeblocks[0]; ctx->horiz_codeblocks = params->horiz_codeblocks[0]; } else { ctx->vert_codeblocks = params->vert_codeblocks[SCHRO_SUBBAND_SHIFT (ctx->position) + 1]; ctx->horiz_codeblocks = params->horiz_codeblocks[SCHRO_SUBBAND_SHIFT (ctx->position) + 1]; } if (ctx->horiz_codeblocks > 1 || ctx->vert_codeblocks > 1) { ctx->have_zero_flags = TRUE; } else { ctx->have_zero_flags = FALSE; } if (params->codeblock_mode_index == 1) { ctx->have_quant_offset = TRUE; if (picture->decoder_instance->compat_quant_offset && ctx->horiz_codeblocks == 1 && ctx->vert_codeblocks == 1) { ctx->have_quant_offset = FALSE; } } else { ctx->have_quant_offset = FALSE; } } static void schro_decoder_zero_block (SchroPictureSubbandContext * ctx, int x1, int y1, int x2, int y2) { if (SCHRO_FRAME_FORMAT_DEPTH (ctx->frame_data->format) == SCHRO_FRAME_FORMAT_DEPTH_S16) { orc_splat_s16_2d (SCHRO_FRAME_DATA_GET_PIXEL_S16 (ctx->frame_data, x1, y1), ctx->frame_data->stride, 0, x2 - x1, y2 - y1); } else { orc_splat_s32_2d (SCHRO_FRAME_DATA_GET_PIXEL_S32 (ctx->frame_data, x1, y1), ctx->frame_data->stride, 0, x2 - x1, y2 - y1); } } static void schro_decoder_test_quant_offset_compat (SchroPicture * picture, SchroPictureSubbandContext * ctx) { SchroParams *params = &picture->params; int quant_index = ctx->quant_index; if (ctx->have_quant_offset && ctx->horiz_codeblocks == 1 && ctx->vert_codeblocks == 1 && ctx->index == 0 && ctx->ymin == 0 && ctx->xmin == 0) { if (params->is_noarith) { SchroUnpack unpack_copy; schro_unpack_copy (&unpack_copy, &ctx->unpack); quant_index += schro_unpack_decode_sint (&unpack_copy); } else { SchroArith arith_copy; memcpy (&arith_copy, ctx->arith, sizeof (SchroArith)); quant_index += _schro_arith_decode_sint (&arith_copy, SCHRO_CTX_QUANTISER_CONT, SCHRO_CTX_QUANTISER_VALUE, SCHRO_CTX_QUANTISER_SIGN); } if (quant_index < 0 || quant_index > 60) { SCHRO_WARNING ("turning on codeblock quantiser compatibility mode"); picture->decoder_instance->compat_quant_offset = TRUE; ctx->have_quant_offset = FALSE; } } } static void schro_decoder_decode_codeblock_noarith (SchroPicture * picture, SchroPictureSubbandContext * ctx) { SchroParams *params = &picture->params; int n = ctx->xmax - ctx->xmin; int j; if (ctx->have_zero_flags) { int bit; /* zero codeblock */ bit = schro_unpack_decode_bit (&ctx->unpack); if (bit) { #if 0 if (ctx->xmax - ctx->xmin == 8) { orc_splat_s16_2d_8xn (SCHRO_FRAME_DATA_GET_PIXEL_S16 (ctx->frame_data, ctx->xmin, ctx->ymin), ctx->frame_data->stride, 0, ctx->ymax - ctx->ymin); } else if (ctx->xmax - ctx->xmin == 4) { orc_splat_s16_2d_4xn (SCHRO_FRAME_DATA_GET_PIXEL_S16 (ctx->frame_data, ctx->xmin, ctx->ymin), ctx->frame_data->stride, 0, ctx->ymax - ctx->ymin); } else { schro_decoder_zero_block (ctx, ctx->xmin, ctx->ymin, ctx->xmax, ctx->ymax); } #else schro_decoder_zero_block (ctx, ctx->xmin, ctx->ymin, ctx->xmax, ctx->ymax); #endif return; } } schro_decoder_test_quant_offset_compat (picture, ctx); if (ctx->have_quant_offset) { ctx->quant_index += schro_unpack_decode_sint (&ctx->unpack); if (ctx->quant_index < 0 || ctx->quant_index > 60) { /* FIXME decode error */ } ctx->quant_index = CLAMP (ctx->quant_index, 0, 60); } ctx->quant_factor = schro_table_quant[ctx->quant_index]; if (params->num_refs > 0) { ctx->quant_offset = schro_table_offset_3_8[ctx->quant_index]; } else { ctx->quant_offset = schro_table_offset_1_2[ctx->quant_index]; } if (SCHRO_FRAME_FORMAT_DEPTH (ctx->frame_data->format) == SCHRO_FRAME_FORMAT_DEPTH_S16) { if (n == 8 && (ctx->ymax - ctx->ymin) <= 9) { int16_t tmp[72]; schro_unpack_decode_sint_s16 (tmp, &ctx->unpack, n * (ctx->ymax - ctx->ymin)); orc_dequantise_s16_2d_8xn (SCHRO_FRAME_DATA_GET_PIXEL_S16 (ctx->frame_data, ctx->xmin, ctx->ymin), ctx->frame_data->stride, tmp, n * sizeof (int16_t), ctx->quant_factor, ctx->quant_offset + 2, ctx->ymax - ctx->ymin); } else if (n == 4 && (ctx->ymax - ctx->ymin) <= 9) { int16_t tmp[36]; schro_unpack_decode_sint_s16 (tmp, &ctx->unpack, n * (ctx->ymax - ctx->ymin)); orc_dequantise_s16_2d_4xn (SCHRO_FRAME_DATA_GET_PIXEL_S16 (ctx->frame_data, ctx->xmin, ctx->ymin), ctx->frame_data->stride, tmp, n * sizeof (int16_t), ctx->quant_factor, ctx->quant_offset + 2, ctx->ymax - ctx->ymin); } else { for (j = ctx->ymin; j < ctx->ymax; j++) { int16_t *p = SCHRO_FRAME_DATA_GET_LINE (ctx->frame_data, j); schro_unpack_decode_sint_s16 (p + ctx->xmin, &ctx->unpack, n); } orc_dequantise_s16_ip_2d (SCHRO_FRAME_DATA_GET_PIXEL_S16 (ctx->frame_data, ctx->xmin, ctx->ymin), ctx->frame_data->stride, ctx->quant_factor, ctx->quant_offset + 2, n, ctx->ymax - ctx->ymin); } } else { for (j = ctx->ymin; j < ctx->ymax; j++) { int32_t *p = SCHRO_FRAME_DATA_GET_LINE (ctx->frame_data, j); schro_unpack_decode_sint_s32 (p + ctx->xmin, &ctx->unpack, n); } orc_dequantise_s32_ip_2d (SCHRO_FRAME_DATA_GET_PIXEL_S32 (ctx->frame_data, ctx->xmin, ctx->ymin), ctx->frame_data->stride, ctx->quant_factor, ctx->quant_offset + 2, n, ctx->ymax - ctx->ymin); } } static void schro_decoder_decode_codeblock (SchroPicture * picture, SchroPictureSubbandContext * ctx) { SchroParams *params = &picture->params; int j; if (ctx->have_zero_flags) { int bit; /* zero codeblock */ bit = _schro_arith_decode_bit (ctx->arith, SCHRO_CTX_ZERO_CODEBLOCK); if (bit) { schro_decoder_zero_block (ctx, ctx->xmin, ctx->ymin, ctx->xmax, ctx->ymax); return; } } schro_decoder_test_quant_offset_compat (picture, ctx); if (ctx->have_quant_offset) { ctx->quant_index += _schro_arith_decode_sint (ctx->arith, SCHRO_CTX_QUANTISER_CONT, SCHRO_CTX_QUANTISER_VALUE, SCHRO_CTX_QUANTISER_SIGN); if (ctx->quant_index < 0 || ctx->quant_index > 60) { /* FIXME decode error */ } ctx->quant_index = CLAMP (ctx->quant_index, 0, 60); } ctx->quant_factor = schro_table_quant[ctx->quant_index]; if (params->num_refs > 0) { ctx->quant_offset = schro_table_offset_3_8[ctx->quant_index]; } else { ctx->quant_offset = schro_table_offset_1_2[ctx->quant_index]; } for (j = ctx->ymin; j < ctx->ymax; j++) { int16_t *p = SCHRO_FRAME_DATA_GET_LINE (ctx->frame_data, j); const int16_t *parent_line; const int16_t *prev_line; if (ctx->position >= 4) { parent_line = SCHRO_FRAME_DATA_GET_LINE (ctx->parent_frame_data, (j >> 1)); } else { parent_line = NULL; } if (j == 0) { prev_line = NULL; } else { prev_line = SCHRO_FRAME_DATA_GET_LINE (ctx->frame_data, (j - 1)); } if (SCHRO_FRAME_FORMAT_DEPTH (ctx->frame_data->format) == SCHRO_FRAME_FORMAT_DEPTH_S32) { codeblock_line_decode_generic_s32 (ctx, (int32_t *)p, j, (int32_t *)parent_line, (int32_t *)prev_line); } else if (ctx->position >= 4 && j > 0) { if (SCHRO_SUBBAND_IS_HORIZONTALLY_ORIENTED (ctx->position)) { codeblock_line_decode_p_horiz (ctx, p, j, parent_line, prev_line); } else if (SCHRO_SUBBAND_IS_VERTICALLY_ORIENTED (ctx->position)) { codeblock_line_decode_p_vert (ctx, p, j, parent_line, prev_line); } else { codeblock_line_decode_p_diag (ctx, p, j, parent_line, prev_line); } } else { codeblock_line_decode_generic (ctx, p, j, parent_line, prev_line); } } } void schro_decoder_decode_subband (SchroPicture * picture, SchroPictureSubbandContext * ctx) { SchroParams *params = &picture->params; int x, y; ctx->subband_length = picture->subband_length[ctx->component][ctx->index]; ctx->quant_index = picture->subband_quant_index[ctx->component][ctx->index]; ctx->is_intra = (params->num_refs == 0); ctx->frame_data = &picture->subband_data[ctx->component][ctx->index]; if (ctx->position >= 4) { ctx->parent_frame_data = &picture->subband_data[ctx->component][ctx->index - 3]; } if (picture->subband_length[ctx->component][ctx->index] == 0) { schro_decoder_zero_block (ctx, 0, 0, ctx->frame_data->width, ctx->frame_data->height); return; } if (!params->is_noarith) { ctx->arith = schro_arith_new (); schro_arith_decode_init (ctx->arith, picture->subband_buffer[ctx->component][ctx->index]); } else { schro_unpack_init_with_data (&ctx->unpack, picture->subband_buffer[ctx->component][ctx->index]->data, picture->subband_buffer[ctx->component][ctx->index]->length, 1); } schro_decoder_setup_codeblocks (picture, ctx); for (y = 0; y < ctx->vert_codeblocks; y++) { int xmin; int acc; int codeblock_width; int inc; ctx->ymin = (ctx->frame_data->height * y) / ctx->vert_codeblocks; ctx->ymax = (ctx->frame_data->height * (y + 1)) / ctx->vert_codeblocks; xmin = 0; codeblock_width = ctx->frame_data->width / ctx->horiz_codeblocks; inc = ctx->frame_data->width - (ctx->horiz_codeblocks * codeblock_width); acc = 0; for (x = 0; x < ctx->horiz_codeblocks; x++) { ctx->xmin = xmin; xmin += codeblock_width; acc += inc; if (acc >= ctx->horiz_codeblocks) { acc -= ctx->horiz_codeblocks; xmin++; } ctx->xmax = xmin; if (params->is_noarith) { schro_decoder_decode_codeblock_noarith (picture, ctx); } else { schro_decoder_decode_codeblock (picture, ctx); } } } if (!params->is_noarith) { schro_arith_decode_flush (ctx->arith); if (ctx->arith->offset < ctx->subband_length - 1) { SCHRO_WARNING ("arith decoding didn't consume buffer (%d < %d)", ctx->arith->offset, ctx->subband_length); #ifdef DONT_DO_THIS ctx->broken = TRUE; #endif } if (ctx->arith->offset > ctx->subband_length + 4) { SCHRO_WARNING ("arith decoding overran buffer (%d > %d)", ctx->arith->offset, ctx->subband_length); #ifdef DONT_DO_THIS ctx->broken = TRUE; #endif } schro_arith_free (ctx->arith); } else { int offset = (ctx->unpack.n_bits_read + 0) / 8; if (offset < ctx->subband_length - 1) { SCHRO_WARNING ("vlc decoding didn't consume buffer (%d < %d) component=%d subband=%d", offset, ctx->subband_length, ctx->component, ctx->index); #ifdef DONT_DO_THIS ctx->broken = TRUE; #endif } if (offset > ctx->subband_length + 0) { SCHRO_WARNING ("vlc decoding overran buffer (%d > %d)", offset, ctx->subband_length); #ifdef DONT_DO_THIS ctx->broken = TRUE; #endif } } if (ctx->broken && ctx->position != 0) { schro_decoder_zero_block (ctx, 0, 0, ctx->frame_data->width, ctx->frame_data->height); } if (ctx->position == 0 && picture->params.num_refs == 0) { if (SCHRO_FRAME_FORMAT_DEPTH (ctx->frame_data->format) == SCHRO_FRAME_FORMAT_DEPTH_S16) { schro_decoder_subband_dc_predict (ctx->frame_data); } else { schro_decoder_subband_dc_predict_s32 (ctx->frame_data); } } } /* reference pool */ static void schro_decoder_reference_add (SchroDecoderInstance * instance, SchroPicture * picture) { SCHRO_DEBUG ("adding %d", picture->picture_number); if (schro_queue_is_full (instance->reference_queue)) { SCHRO_ERROR ("auto-retiring reference picture"); schro_queue_pop (instance->reference_queue); } schro_queue_add (instance->reference_queue, schro_picture_ref (picture), picture->picture_number); } static SchroPicture * schro_decoder_reference_get (SchroDecoderInstance * instance, SchroPictureNumber picture_number) { SCHRO_DEBUG ("getting %d", picture_number); return schro_queue_find (instance->reference_queue, picture_number); } static void schro_decoder_reference_retire (SchroDecoderInstance * instance, SchroPictureNumber picture_number) { SCHRO_DEBUG ("retiring %d", picture_number); schro_queue_delete (instance->reference_queue, picture_number); } static void schro_decoder_error (SchroDecoder * decoder, const char *s) { SCHRO_ERROR ("decoder error: %s", s); decoder->error = TRUE; if (!decoder->error_message) { decoder->error_message = strdup (s); } } /* compare picture numbers in a way that handles wrap around */ static int schro_picture_n_before_m (SchroPictureNumber n, SchroPictureNumber m) { /* specified as: n occurs before m if: * (m - n) mod (1<<32) < D */ return (uint32_t) (m - n) < (1u << 31); } /* model the reorder buffer */ static void schro_picturequeue_rob_insert (SchroQueue * queue, SchroPicture * picture, unsigned windowsize) { /* the implemented reorder buffer may be larger than signalled in the stream * to fix this, window the insertion sort to work on upto the last @windowsize@ * elements. */ /* NB, a window size of 1 implies coded_order */ int i = queue->n + 1 - windowsize; SCHRO_ASSERT (queue->n < queue->size); if (i < 0) i = 0; /* find the position to insert before. */ for (; i < queue->n; i++) { if (schro_picture_n_before_m (picture->picture_number, queue->elements[i].picture_number)) { break; } } /* make space and insert at i */ memmove (queue->elements + i + 1, queue->elements + i, sizeof (SchroQueueElement) * (queue->n - i)); queue->n++; queue->elements[i].data = picture; queue->elements[i].picture_number = picture->picture_number; } /** * schro_decoder_set_rob_size: * @instance a decoder instance to set the rob size * * precondition: either be using coded_order, or the instance must have * seen a sequence_header for guaranteed operation. * * caller must guarantee that modifying the RoB size is safe */ static void schro_decoder_set_rob_size (SchroDecoderInstance * instance) { if (instance->decoder->coded_order) { /* when using coded_order, the RoB size is 1 */ instance->reorder_queue_size = 1; return; } /* set default RoB sizes */ if (!instance->video_format.interlaced_coding) { instance->reorder_queue_size = 2; } else { instance->reorder_queue_size = 4; } /* todo: override rob size with value specified in sequence header */ /* Under normal operation, the value of reorder_queue_size needs to be one * greater than any spec derived value, since schro is unable to bypass the * reorder buffer in the same way a realtime h/w system would. */ instance->reorder_queue_size++; SCHRO_ASSERT (instance->reorder_queue_size <= instance->reorder_queue->size); } /** * schro_decoder_frame_is_twofield: * * Returns: TRUE if @frame can store two field picture from @instance in a * pseudo-progressive manner */ static int schro_decoder_frame_is_twofield (SchroDecoderInstance * instance, SchroFrame * frame) { int picture_height = schro_video_format_get_picture_height (&instance->video_format); if (frame->height == 0) { /* Indicates a skipped picture */ return FALSE; } if (frame->height == picture_height) return FALSE; if (!instance->video_format.interlaced_coding) { SCHRO_ERROR ("supplying non frame-sized pictures when frame_coding is not supported (%d should be %d)", frame->height, picture_height); } return TRUE; } static void schro_frame_data_draw_box (SchroFrameData * fd, int x, int y, int size_x, int size_y, SchroMotionVector * mv); static void schro_decoder_telemetry (SchroPicture * picture, SchroFrame * output_picture) { int i, j; SchroFrameData *fd = output_picture->components + 0; SchroParams *params = &picture->params; SchroMotionVector *mv; int skip; int ii, jj; for (j = 0; j < params->y_num_blocks; j += 4) { for (i = 0; i < params->x_num_blocks; i += 4) { mv = &picture->motion->motion_vectors[j * params->x_num_blocks + i]; skip = 4 >> mv->split; for (jj = 0; jj < 4; jj += skip) { for (ii = 0; ii < 4; ii += skip) { schro_frame_data_draw_box (fd, (i + ii) * params->xbsep_luma, (j + jj) * params->ybsep_luma, skip * params->xbsep_luma, skip * params->ybsep_luma, &picture->motion->motion_vectors[(j + jj) * params->x_num_blocks + (i + ii)]); } } } } if (picture->params.num_refs > 0) { uint8_t *data; int n1; int n2; data = SCHRO_FRAME_DATA_GET_LINE (fd, 0); n1 = picture->reference1 - picture->picture_number; if (picture->params.num_refs > 1) { n2 = picture->reference2 - picture->picture_number; } else { n2 = 0; } if (n2 < n1) { int x = n2; n2 = n1; n1 = x; } for (j = -4; j < -2; j++) { if (fd->width / 2 + j >= 0) data[fd->width / 2 + j] = 255; } if (n2 < 0) { for (i = n1; i < n2 - 1; i++) { for (j = i * 16; j < i * 16 + 10; j++) { if (fd->width / 2 + j >= 0) data[fd->width / 2 + j] = 255; } } for (i = n2; i < 0; i++) { for (j = i * 16; j < i * 16 + 10; j++) { if (fd->width / 2 + j >= 0) data[fd->width / 2 + j] = 255; } } } else { for (i = n1; i < 0; i++) { for (j = i * 16; j < i * 16 + 10; j++) { if (fd->width / 2 + j >= 0) data[fd->width / 2 + j] = 255; } } for (i = 0; i < n2; i++) { for (j = i * 16; j < i * 16 + 10; j++) { if (fd->width / 2 + j >= 0) data[fd->width / 2 + j] = 255; } } } } } static void schro_frame_data_draw_line (SchroFrameData * fd, int x1, int y1, int x2, int y2); static void schro_frame_data_draw_box (SchroFrameData * fd, int x, int y, int size_x, int size_y, SchroMotionVector * mv) { int i; uint8_t *data; if (y < fd->height) { data = SCHRO_FRAME_DATA_GET_LINE (fd, y); for (i = x; i < x + size_x; i++) { data[i] = 0; } } for (i = y; i < y + size_y && i < fd->height; i++) { data = SCHRO_FRAME_DATA_GET_LINE (fd, i); if (x < fd->width) data[x] = 0; } if (y + 1 < fd->height) { data = SCHRO_FRAME_DATA_GET_LINE (fd, y + 1); if (mv->pred_mode & 1) { if (x + size_x / 2 - 1 < fd->width) data[x + size_x / 2 - 1] = 0; } if (mv->pred_mode & 2) { if (x + size_x / 2 + 1 < fd->width) data[x + size_x / 2 + 1] = 0; } } #if 0 if (mv->pred_mode & 1) { data = SCHRO_FRAME_DATA_GET_LINE (fd, y + size_y / 2 + mv->u.vec.dy[0]); data[x + size_x / 2 + mv->u.vec.dx[0]] = 0; } if (mv->pred_mode & 2) { data = SCHRO_FRAME_DATA_GET_LINE (fd, y + size_y / 2 + mv->u.vec.dy[1]); data[x + size_x / 2 + mv->u.vec.dx[1]] = 0; } #endif if (mv->pred_mode & 1) { schro_frame_data_draw_line (fd, x + size_x / 2, y + size_y / 2, x + size_x / 2 + mv->u.vec.dx[0], y + size_y / 2 + mv->u.vec.dy[0]); } if (mv->pred_mode & 2) { schro_frame_data_draw_line (fd, x + size_x / 2, y + size_y / 2, x + size_x / 2 + mv->u.vec.dx[1], y + size_y / 2 + mv->u.vec.dy[1]); } } static void schro_frame_data_draw_point (SchroFrameData * fd, int x, int y) { uint8_t *data; if (y >= 0 && y < fd->height && x >= 0 && x < fd->width) { data = SCHRO_FRAME_DATA_GET_LINE (fd, y); data[x] = 0; } } static void schro_frame_data_draw_line (SchroFrameData * fd, int x1, int y1, int x2, int y2) { int dx, dy; int a = 0; int i, j; int b; dx = abs (x1 - x2); dy = abs (y1 - y2); if (dx > dy) { if (x1 < x2) { j = y1; b = (y1 < y2) ? 1 : -1; a = dy / 2; for (i = x1; i <= x2; i++) { schro_frame_data_draw_point (fd, i, j); a += dy; if (a >= dx) { a -= dx; j += b; } } } else { j = y2; b = (y2 < y1) ? 1 : -1; a = dy / 2; for (i = x2; i <= x1; i++) { schro_frame_data_draw_point (fd, i, j); a += dy; if (a > dx) { a -= dx; j += b; } } } } else { if (y1 < y2) { i = x1; b = (x1 < x2) ? 1 : -1; a = dx / 2; for (j = y1; j <= y2; j++) { schro_frame_data_draw_point (fd, i, j); a += dx; if (a >= dy) { a -= dy; i += b; } } } else { i = x2; b = (x2 < x1) ? 1 : -1; a = dx / 2; for (j = y2; j <= y1; j++) { schro_frame_data_draw_point (fd, i, j); a += dx; if (a > dy) { a -= dy; i += b; } } } } } schroedinger-1.0.11/schroedinger/dummy.cc0000644000175000017500000000004011320237456015302 00000000000000 /* Just look the other way */ schroedinger-1.0.11/schroedinger/schrotablesinit.c0000644000175000017500000000373611541755167017231 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #ifdef unused static int16_t *quantise_table_intra; static int16_t *quantise_table_inter; static int16_t *dequantise_table_intra; static int16_t *dequantise_table_inter; #endif void schro_tables_init (void) { #ifdef unused int i, j; static int inited; if (inited) return; inited = TRUE; quantise_table_intra = schro_malloc (61 * 65536 * sizeof (int16_t)); quantise_table_inter = schro_malloc (61 * 65536 * sizeof (int16_t)); dequantise_table_intra = schro_malloc (61 * 65536 * sizeof (int16_t)); dequantise_table_inter = schro_malloc (61 * 65536 * sizeof (int16_t)); for (i = 0; i < 61; i++) { int quant_factor; int quant_offset_intra; int quant_offset_inter; quant_factor = schro_table_quant[i]; quant_offset_intra = schro_table_offset_1_2[i]; quant_offset_inter = schro_table_offset_3_8[i]; for (j = 0; j < 65536; j++) { quantise_table_intra[i * 65536 + j] = schro_quantise (j - 32768, quant_factor, quant_offset_intra); quantise_table_inter[i * 65536 + j] = schro_quantise (j - 32768, quant_factor, quant_offset_inter); dequantise_table_intra[i * 65536 + j] = schro_dequantise (j - 32768, quant_factor, quant_offset_intra); dequantise_table_inter[i * 65536 + j] = schro_dequantise (j - 32768, quant_factor, quant_offset_inter); } } #endif } #ifdef unused int16_t * schro_tables_get_quantise_table (int quant_index, schro_bool is_intra) { if (is_intra) { return quantise_table_intra + quant_index * 65536; } else { return quantise_table_inter + quant_index * 65536; } } int16_t * schro_tables_get_dequantise_table (int quant_index, schro_bool is_intra) { if (is_intra) { return dequantise_table_intra + quant_index * 65536; } else { return dequantise_table_inter + quant_index * 65536; } } #endif schroedinger-1.0.11/schroedinger/schrowaveletorc.c0000664000175000017500000021507111704236153017233 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include static void schro_iwt_desl_9_3 (SchroFrameData *fd, int16_t *tmp); static void schro_iwt_5_3 (SchroFrameData *fd, int16_t *tmp); static void schro_iwt_13_5 (SchroFrameData *fd, int16_t *tmp); static void schro_iwt_haar0 (SchroFrameData *fd, int16_t *tmp); static void schro_iwt_haar1 (SchroFrameData *fd, int16_t *tmp); static void schro_iwt_fidelity (SchroFrameData *fd, int16_t *tmp); static void schro_iwt_daub_9_7 (SchroFrameData *fd, int16_t *tmp); static void schro_iwt_desl_9_3_s32 (SchroFrameData *fd, int32_t *tmp); static void schro_iwt_5_3_s32 (SchroFrameData *fd, int32_t *tmp); static void schro_iwt_13_5_s32 (SchroFrameData *fd, int32_t *tmp); static void schro_iwt_haar0_s32 (SchroFrameData *fd, int32_t *tmp); static void schro_iwt_haar1_s32 (SchroFrameData *fd, int32_t *tmp); static void schro_iwt_fidelity_s32 (SchroFrameData *fd, int32_t *tmp); static void schro_iwt_daub_9_7_s32 (SchroFrameData *fd, int32_t *tmp); static void schro_iiwt_desl_9_3 (SchroFrameData *dest, SchroFrameData *src, int16_t *tmp); static void schro_iiwt_5_3 (SchroFrameData *dest, SchroFrameData *src, int16_t *tmp); static void schro_iiwt_13_5 (SchroFrameData *dest, SchroFrameData *src, int16_t *tmp); static void schro_iiwt_haar0 (SchroFrameData *dest, SchroFrameData *src, int16_t *tmp); static void schro_iiwt_haar1 (SchroFrameData *dest, SchroFrameData *src, int16_t *tmp); static void schro_iiwt_fidelity (SchroFrameData *dest, SchroFrameData *src, int16_t *tmp); static void schro_iiwt_daub_9_7 (SchroFrameData *dest, SchroFrameData *src, int16_t *tmp); static void schro_iiwt_desl_9_3_s32 (SchroFrameData *dest, SchroFrameData *src, int32_t *tmp); static void schro_iiwt_5_3_s32 (SchroFrameData *dest, SchroFrameData *src, int32_t *tmp); static void schro_iiwt_13_5_s32 (SchroFrameData *dest, SchroFrameData *src, int32_t *tmp); static void schro_iiwt_haar0_s32 (SchroFrameData *dest, SchroFrameData *src, int32_t *tmp); static void schro_iiwt_haar1_s32 (SchroFrameData *dest, SchroFrameData *src, int32_t *tmp); static void schro_iiwt_fidelity_s32 (SchroFrameData *dest, SchroFrameData *src, int32_t *tmp); static void schro_iiwt_daub_9_7_s32 (SchroFrameData *dest, SchroFrameData *src, int32_t *tmp); /* Forward transform splitter function */ void schro_wavelet_transform_2d (SchroFrameData * fd, int filter, int16_t * tmp) { if ((SCHRO_FRAME_FORMAT_DEPTH (fd->format) == SCHRO_FRAME_FORMAT_DEPTH_S16)) { switch (filter) { case SCHRO_WAVELET_DESLAURIERS_DUBUC_9_7: schro_iwt_desl_9_3 (fd, tmp); break; case SCHRO_WAVELET_LE_GALL_5_3: schro_iwt_5_3 (fd, tmp); break; case SCHRO_WAVELET_DESLAURIERS_DUBUC_13_7: schro_iwt_13_5 (fd, tmp); break; case SCHRO_WAVELET_HAAR_0: schro_iwt_haar0 (fd, tmp); break; case SCHRO_WAVELET_HAAR_1: schro_iwt_haar1 (fd, tmp); break; case SCHRO_WAVELET_FIDELITY: schro_iwt_fidelity (fd, tmp); break; case SCHRO_WAVELET_DAUBECHIES_9_7: schro_iwt_daub_9_7 (fd, tmp); break; default: SCHRO_ASSERT (0); } } else { switch (filter) { case SCHRO_WAVELET_DESLAURIERS_DUBUC_9_7: schro_iwt_desl_9_3_s32 (fd, (orc_int32 *)tmp); break; case SCHRO_WAVELET_LE_GALL_5_3: schro_iwt_5_3_s32 (fd, (orc_int32 *)tmp); break; case SCHRO_WAVELET_DESLAURIERS_DUBUC_13_7: schro_iwt_13_5_s32 (fd, (orc_int32 *)tmp); break; case SCHRO_WAVELET_HAAR_0: schro_iwt_haar0_s32 (fd, (orc_int32 *)tmp); break; case SCHRO_WAVELET_HAAR_1: schro_iwt_haar1_s32 (fd, (orc_int32 *)tmp); break; case SCHRO_WAVELET_FIDELITY: schro_iwt_fidelity_s32 (fd, (orc_int32 *)tmp); break; case SCHRO_WAVELET_DAUBECHIES_9_7: schro_iwt_daub_9_7_s32 (fd, (orc_int32 *)tmp); break; default: SCHRO_ASSERT (0); } } } /* Inverse transform splitter function */ void schro_wavelet_inverse_transform_2d (SchroFrameData * fd_dest, SchroFrameData *fd_src, int filter, int16_t * tmp) { if ((SCHRO_FRAME_FORMAT_DEPTH (fd_dest->format) == SCHRO_FRAME_FORMAT_DEPTH_S16)) { SCHRO_ASSERT (SCHRO_FRAME_FORMAT_DEPTH (fd_src->format) == SCHRO_FRAME_FORMAT_DEPTH_S16); switch (filter) { case SCHRO_WAVELET_DESLAURIERS_DUBUC_9_7: schro_iiwt_desl_9_3 (fd_dest, fd_src, tmp); break; case SCHRO_WAVELET_LE_GALL_5_3: schro_iiwt_5_3 (fd_dest, fd_src, tmp); break; case SCHRO_WAVELET_DESLAURIERS_DUBUC_13_7: schro_iiwt_13_5 (fd_dest, fd_src, tmp); break; case SCHRO_WAVELET_HAAR_0: schro_iiwt_haar0 (fd_dest, fd_src, tmp); break; case SCHRO_WAVELET_HAAR_1: schro_iiwt_haar1 (fd_dest, fd_src, tmp); break; case SCHRO_WAVELET_FIDELITY: schro_iiwt_fidelity (fd_dest, fd_src, tmp); break; case SCHRO_WAVELET_DAUBECHIES_9_7: schro_iiwt_daub_9_7 (fd_dest, fd_src, tmp); break; default: SCHRO_ASSERT (0); } } else if ((SCHRO_FRAME_FORMAT_DEPTH (fd_dest->format) == SCHRO_FRAME_FORMAT_DEPTH_S32)) { SCHRO_ASSERT (SCHRO_FRAME_FORMAT_DEPTH (fd_src->format) == SCHRO_FRAME_FORMAT_DEPTH_S32); switch (filter) { case SCHRO_WAVELET_DESLAURIERS_DUBUC_9_7: schro_iiwt_desl_9_3_s32 (fd_dest, fd_src, (int32_t *)tmp); break; case SCHRO_WAVELET_LE_GALL_5_3: schro_iiwt_5_3_s32 (fd_dest, fd_src, (int32_t *)tmp); break; case SCHRO_WAVELET_DESLAURIERS_DUBUC_13_7: schro_iiwt_13_5_s32 (fd_dest, fd_src, (int32_t *)tmp); break; case SCHRO_WAVELET_HAAR_0: schro_iiwt_haar0_s32 (fd_dest, fd_src, (int32_t *)tmp); break; case SCHRO_WAVELET_HAAR_1: schro_iiwt_haar1_s32 (fd_dest, fd_src, (int32_t *)tmp); break; case SCHRO_WAVELET_FIDELITY: schro_iiwt_fidelity_s32 (fd_dest, fd_src, (int32_t *)tmp); break; case SCHRO_WAVELET_DAUBECHIES_9_7: schro_iiwt_daub_9_7_s32 (fd_dest, fd_src, (int32_t *)tmp); break; default: SCHRO_ASSERT (0); } } } /* some utility functions */ static void extend_1_2 (orc_int16 *data, int n) { data[-1] = data[0]; data[n] = data[n - 1]; data[n + 1] = data[n - 1]; } static void extend_2_1 (orc_int16 *data, int n) { data[-2] = data[0]; data[-1] = data[0]; data[n] = data[n - 1]; } static void extend_1_1 (orc_int16 *data, int n) { data[-1] = data[0]; data[n] = data[n - 1]; } static void extend_1_0 (orc_int16 *data, int n) { data[-1] = data[0]; } static void extend_2_2 (orc_int16 *data, int n) { data[-2] = data[0]; data[-1] = data[0]; data[n] = data[n - 1]; data[n+1] = data[n - 1]; } #define extend_4_3 extend_4_4 #define extend_3_4 extend_4_4 static void extend_4_4 (orc_int16 *data, int n) { data[-4] = data[0]; data[-3] = data[0]; data[-2] = data[0]; data[-1] = data[0]; data[n] = data[n - 1]; data[n+1] = data[n - 1]; data[n+2] = data[n - 1]; data[n+3] = data[n - 1]; } #define extend_1_0_s32 extend_4_4_s32 #define extend_1_1_s32 extend_4_4_s32 #define extend_2_2_s32 extend_4_4_s32 #define extend_1_2_s32 extend_4_4_s32 #define extend_2_1_s32 extend_4_4_s32 #define extend_4_3_s32 extend_4_4_s32 #define extend_3_4_s32 extend_4_4_s32 static void extend_4_4_s32 (orc_int32 *data, int n) { data[-4] = data[0]; data[-3] = data[0]; data[-2] = data[0]; data[-1] = data[0]; data[n] = data[n - 1]; data[n+1] = data[n - 1]; data[n+2] = data[n - 1]; data[n+3] = data[n - 1]; } static void join (orc_int16 *dest, orc_int16 *src1, orc_int16 *src2, int width) { orc_memcpy (dest, src1, width / 2 * sizeof (int16_t)); orc_memcpy (dest + width / 2, src2, width / 2 * sizeof (int16_t)); } static void join_s32 (orc_int32 *dest, orc_int32 *src1, orc_int32 *src2, int width) { orc_memcpy (dest, src1, width / 2 * sizeof (int32_t)); orc_memcpy (dest + width / 2, src2, width / 2 * sizeof (int32_t)); } /* Forward, 16-bit, Wavelet #0: Deslauriers-Dubuc 9,7 */ static void wavelet_iwt_desl_9_3_horiz (SchroFrameData * fd, int i, orc_int16 *tmp) { int width = fd->width; int16_t *line = SCHRO_FRAME_DATA_GET_LINE (fd, i); int16_t *hi = tmp + 4; int16_t *lo = tmp + width/2 + 12; orc_deinterleave2_lshift1_s16 (hi, lo, line, width / 2); extend_1_2 (hi, width/2); orc_mas4_horiz_sub_s16_1991_ip (lo, hi - 1, 1 << 3, 4, width/2); extend_1_0 (lo, width/2); orc_add2_rshift_add_s16_22 (hi, lo - 1, width/2); join (line, hi, lo, width); } static void wavelet_iwt_desl_9_3_vert_odd (SchroFrameData *fd, int i) { int width = fd->width; int height = fd->height; if (i & 1) { if (i < 3 || i >= height - 3) { orc_mas4_vert_sub_s16_1991 ( SCHRO_FRAME_DATA_GET_LINE (fd, i), SCHRO_FRAME_DATA_GET_LINE (fd, CLAMP (i - 3, 0, height - 2)), SCHRO_FRAME_DATA_GET_LINE (fd, CLAMP (i - 1, 0, height - 2)), SCHRO_FRAME_DATA_GET_LINE (fd, CLAMP (i + 1, 0, height - 2)), SCHRO_FRAME_DATA_GET_LINE (fd, CLAMP (i + 3, 0, height - 2)), 1 << 3, 4, width); } else { orc_mas4_vert_sub_s16_1991 ( SCHRO_FRAME_DATA_GET_LINE (fd, i), SCHRO_FRAME_DATA_GET_LINE (fd, i - 3), SCHRO_FRAME_DATA_GET_LINE (fd, i - 1), SCHRO_FRAME_DATA_GET_LINE (fd, i + 1), SCHRO_FRAME_DATA_GET_LINE (fd, i + 3), 1 << 3, 4, width); } } } static void wavelet_iwt_desl_9_3_vert_even (SchroFrameData *fd, int i) { int width = fd->width; if ((i & 1) == 0) { int16_t *lo; int16_t *hi1, *hi2; lo = SCHRO_FRAME_DATA_GET_LINE (fd, i); if (i == 0) { hi1 = SCHRO_FRAME_DATA_GET_LINE (fd, 1); } else { hi1 = SCHRO_FRAME_DATA_GET_LINE (fd, i-1); } hi2 = SCHRO_FRAME_DATA_GET_LINE (fd, i+1); orc_add2_rshift_add_s16_22_vert (lo, hi1, hi2, width); } } void schro_iwt_desl_9_3 (SchroFrameData *fd, int16_t * tmp) { int i; int j; for(i=-6;iheight;i++) { j = i+6; if (j >= 0 && j < fd->height) { wavelet_iwt_desl_9_3_horiz (fd, j, tmp); } j = i+3; if (j >= 0 && j < fd->height && (j&1) == 1) { wavelet_iwt_desl_9_3_vert_odd (fd, j); } j = i; if (j >= 0 && j < fd->height && (j&1) == 0) { wavelet_iwt_desl_9_3_vert_even (fd, j); } } } /* Forward, 16-bit, Wavelet #1: LeGall 5,3 */ static void wavelet_iwt_5_3_horiz (SchroFrameData *fd, int i, orc_int16 *tmp) { int width = fd->width; int16_t *line = SCHRO_FRAME_DATA_GET_LINE (fd, i); int16_t *hi = tmp + 4; int16_t *lo = tmp + width/2 + 12; orc_deinterleave2_lshift1_s16 (hi, lo, line, width / 2); extend_1_1 (hi, width/2); orc_add2_rshift_sub_s16_11 (lo, hi, width/2); extend_1_1 (lo, width/2); orc_add2_rshift_add_s16_22 (hi, lo - 1, width/2); join (line, hi, lo, width); } static void wavelet_iwt_5_3_vert_odd (SchroFrameData * fd, int i) { if (i & 1) { int16_t *hi; int16_t *lo1, *lo2; hi = SCHRO_FRAME_DATA_GET_LINE (fd, i); lo1 = SCHRO_FRAME_DATA_GET_LINE (fd, i - 1); if (i + 1 < fd->height) { lo2 = SCHRO_FRAME_DATA_GET_LINE (fd, i + 1); } else { lo2 = lo1; } orc_add2_rshift_sub_s16_11_vert (hi, lo1, lo2, fd->width); } } static void wavelet_iwt_5_3_vert_even (SchroFrameData *fd, int i) { if ((i & 1) == 0) { int16_t *lo; int16_t *hi1, *hi2; lo = SCHRO_FRAME_DATA_GET_LINE (fd, i); if (i == 0) { hi1 = SCHRO_FRAME_DATA_GET_LINE (fd, 1); } else { hi1 = SCHRO_FRAME_DATA_GET_LINE (fd, i - 1); } hi2 = SCHRO_FRAME_DATA_GET_LINE (fd, i + 1); orc_add2_rshift_add_s16_22_vert (lo, hi1, hi2, fd->width); } } void schro_iwt_5_3 (SchroFrameData *fd, int16_t * tmp) { int i; int j; for(i=-2;iheight;i++) { j = i+2; if (j >= 0 && j < fd->height) { wavelet_iwt_5_3_horiz (fd, j, tmp); } j = i+1; if (j >= 0 && j < fd->height && (j&1) == 1) { wavelet_iwt_5_3_vert_odd (fd, j); } j = i; if (j >= 0 && j < fd->height && (j&1) == 0) { wavelet_iwt_5_3_vert_even (fd, j); } } } /* Forward, 16-bit, Wavelet #2: Deslauriers-Dubuc 13,7 */ static void wavelet_iwt_13_5_horiz (SchroFrameData *fd, int i, orc_int16 *tmp) { int width = fd->width; int16_t *line = SCHRO_FRAME_DATA_GET_LINE (fd, i); int16_t *hi = tmp + 4; int16_t *lo = tmp + width/2 + 12; orc_deinterleave2_lshift1_s16 (hi, lo, line, width / 2); extend_1_2 (hi, width/2); orc_mas4_horiz_sub_s16_1991_ip (lo, hi - 1, 1 << 3, 4, width/2); extend_2_1 (lo, width/2); orc_mas4_horiz_add_s16_1991_ip (hi, lo - 2, 1 << 4, 5, width/2); join (line, hi, lo, width); } static void wavelet_iwt_13_5_vert_odd (SchroFrameData *fd, int i) { int16_t *dest, *s1, *s2, *s3, *s4; if (i & 1) { if (i < 3 || i >= fd->height - 3) { s1 = SCHRO_FRAME_DATA_GET_LINE(fd, CLAMP (i - 3, 0, fd->height - 2)); s2 = SCHRO_FRAME_DATA_GET_LINE(fd, CLAMP (i - 1, 0, fd->height - 2)); s3 = SCHRO_FRAME_DATA_GET_LINE(fd, CLAMP (i + 1, 0, fd->height - 2)); s4 = SCHRO_FRAME_DATA_GET_LINE(fd, CLAMP (i + 3, 0, fd->height - 2)); } else { s1 = SCHRO_FRAME_DATA_GET_LINE(fd, i - 3); s2 = SCHRO_FRAME_DATA_GET_LINE(fd, i - 1); s3 = SCHRO_FRAME_DATA_GET_LINE(fd, i + 1); s4 = SCHRO_FRAME_DATA_GET_LINE(fd, i + 3); } dest = SCHRO_FRAME_DATA_GET_LINE(fd, i); orc_mas4_vert_sub_s16_1991 (dest, s1, s2, s3, s4, 1 << 3, 4, fd->width); } } static void wavelet_iwt_13_5_vert_even (SchroFrameData *fd, int i) { int16_t *dest, *s1, *s2, *s3, *s4; if ((i & 1) == 0) { if (i < 3 || i >= fd->height - 3) { s1 = SCHRO_FRAME_DATA_GET_LINE(fd, CLAMP (i - 3, 1, fd->height - 1)); s2 = SCHRO_FRAME_DATA_GET_LINE(fd, CLAMP (i - 1, 1, fd->height - 1)); s3 = SCHRO_FRAME_DATA_GET_LINE(fd, CLAMP (i + 1, 1, fd->height - 1)); s4 = SCHRO_FRAME_DATA_GET_LINE(fd, CLAMP (i + 3, 1, fd->height - 1)); } else { s1 = SCHRO_FRAME_DATA_GET_LINE(fd, i - 3); s2 = SCHRO_FRAME_DATA_GET_LINE(fd, i - 1); s3 = SCHRO_FRAME_DATA_GET_LINE(fd, i + 1); s4 = SCHRO_FRAME_DATA_GET_LINE(fd, i + 3); } dest = SCHRO_FRAME_DATA_GET_LINE(fd, i); orc_mas4_vert_add_s16_1991 (dest, s1, s2, s3, s4, 1 << 4, 5, fd->width); } } void schro_iwt_13_5 (SchroFrameData *fd, int16_t * tmp) { int i; int j; for(i=-6;iheight;i++) { j = i+6; if (j >= 0 && j < fd->height) { wavelet_iwt_13_5_horiz (fd, j, tmp); } j = i+3; if (j >= 0 && j < fd->height && (j&1) == 1) { wavelet_iwt_13_5_vert_odd (fd, j); } j = i; if (j >= 0 && j < fd->height && (j&1) == 0) { wavelet_iwt_13_5_vert_even (fd, j); } } } /* Forward, 16-bit, Wavelet #3,4: Haar 0 and Haar 1 */ static void wavelet_iwt_haar_horiz (SchroFrameData *fd, int i, orc_int16 *tmp) { int width = fd->width; int16_t *line = SCHRO_FRAME_DATA_GET_LINE (fd, i); int16_t *hi = tmp + width / 2; int16_t *lo = tmp; orc_haar_deint_split_s16 (lo, hi, line, width / 2); join (line, hi, lo, width); } static void wavelet_iwt_haar_shift1_horiz (SchroFrameData *fd, int i, orc_int16 *tmp) { int width = fd->width; int16_t *line = SCHRO_FRAME_DATA_GET_LINE (fd, i); int16_t *hi = tmp + width / 2; int16_t *lo = tmp; orc_haar_deint_lshift1_split_s16 (lo, hi, line, width / 2); join (line, hi, lo, width); } static void wavelet_iwt_haar_vert (SchroFrameData *fd, int i, orc_int16 *tmp) { int16_t *hi = SCHRO_FRAME_DATA_GET_LINE (fd, i); int16_t *lo = SCHRO_FRAME_DATA_GET_LINE (fd, i + 1); orc_haar_split_s16_op (hi, lo, tmp, tmp + fd->width, fd->width); } static void schro_iwt_haar0 (SchroFrameData *fd, int16_t * tmp) { int i; for(i=0;iheight;i+=2) { wavelet_iwt_haar_horiz (fd, i, tmp); wavelet_iwt_haar_horiz (fd, i+1, tmp + fd->width); wavelet_iwt_haar_vert (fd, i, tmp); } } static void schro_iwt_haar1 (SchroFrameData *fd, int16_t * tmp) { int i; for(i=0;iheight;i+=2) { wavelet_iwt_haar_shift1_horiz (fd, i, tmp); wavelet_iwt_haar_shift1_horiz (fd, i+1, tmp + fd->width); wavelet_iwt_haar_vert (fd, i, tmp); } } /* Forward, 16-bit, Wavelet #5: Fidelity */ static void mas8_add_s16 (int16_t * dest, const int16_t * src, const int16_t * weights, int offset, int shift, int n) { int i; for (i = 0; i < n; i++) { int x = offset; x += src[i + 0] * weights[0]; x += src[i + 1] * weights[1]; x += src[i + 2] * weights[2]; x += src[i + 3] * weights[3]; x += src[i + 4] * weights[4]; x += src[i + 5] * weights[5]; x += src[i + 6] * weights[6]; x += src[i + 7] * weights[7]; dest[i] += x >> shift; } } static void schro_split_ext_fidelity (int16_t * hi, int16_t * lo, int n) { static const int16_t stage1_weights[] = { -8, 21, -46, 161, 161, -46, 21, -8 }; static const int16_t stage2_weights[] = { 2, -10, 25, -81, -81, 25, -10, 2 }; extend_4_3 (lo, n); mas8_add_s16 (hi, lo - 4, stage1_weights, 128, 8, n); extend_3_4 (hi, n); mas8_add_s16 (lo, hi - 3, stage2_weights, 127, 8, n); } static void wavelet_iwt_fidelity_horiz (SchroFrameData *fd, int i, orc_int16 *tmp) { int width = fd->width; int16_t *line = SCHRO_FRAME_DATA_GET_LINE (fd, i); int16_t *hi = tmp + 4; int16_t *lo = tmp + width/2 + 12; orc_deinterleave2_s16 (hi, lo, line, width / 2); schro_split_ext_fidelity (hi, lo, width / 2); join (line, hi, lo, width); } static void mas8_vert_add_s16_2 (int16_t * dest, const int16_t * src, int16_t ** s, const int *weights, int offset, int shift, int n) { int i; int j; for (i = 0; i < n; i++) { int x = offset; for (j = 0; j < 8; j++) { x += s[j][i] * weights[j]; } dest[i] = src[i] + (x >> shift); } } static void wavelet_iwt_fidelity_vert_odd (SchroFrameData *fd, int i) { int width = fd->width; int height = fd->height; int16_t *s[8]; int j; if (i & 1) { static const int weights[] = { 2, -10, 25, -81, -81, 25, -10, 2 }; for (j = 0; j < 8; j++) { s[j] = SCHRO_FRAME_DATA_GET_LINE (fd, CLAMP (i - 7 + j * 2, 0, height - 2)); } mas8_vert_add_s16_2 (SCHRO_FRAME_DATA_GET_LINE (fd, i), SCHRO_FRAME_DATA_GET_LINE (fd, i), s, weights, 127, 8, width); } } static void wavelet_iwt_fidelity_vert_even (SchroFrameData *fd, int i) { int width = fd->width; int height = fd->height; int16_t *s[8]; int j; if ((i & 1) == 0) { static const int weights[] = { -8, 21, -46, 161, 161, -46, 21, -8 }; for (j = 0; j < 8; j++) { s[j] = SCHRO_FRAME_DATA_GET_LINE (fd, CLAMP (i - 7 + j * 2, 1, height - 1)); } mas8_vert_add_s16_2 (SCHRO_FRAME_DATA_GET_LINE (fd, i), SCHRO_FRAME_DATA_GET_LINE (fd, i), s, weights, 128, 8, width); } } void schro_iwt_fidelity (SchroFrameData *fd, int16_t * tmp) { int i; int j; for(i=-14;iheight;i++) { j = i+14; if (j >= 0 && j < fd->height) { wavelet_iwt_fidelity_horiz (fd, j, tmp); } j = i+7; if (j >= 0 && j < fd->height && (j&1) == 0) { wavelet_iwt_fidelity_vert_even (fd, j); } j = i; if (j >= 0 && j < fd->height && (j&1) == 1) { wavelet_iwt_fidelity_vert_odd (fd, j); } } } /* Forward, 16-bit, Wavelet #6: Daubechies 9,7 */ static void schro_split_ext_daub97 (int16_t * hi, int16_t * lo, int n) { extend_1_1 (hi, n); orc_mas2_sub_s16_ip (lo, hi, 6497, 2048, 12, n); extend_1_1 (lo, n); orc_mas2_sub_s16_ip (hi, lo - 1, 217, 2048, 12, n); extend_1_1 (hi, n); orc_mas2_add_s16_ip (lo, hi, 3616, 2048, 12, n); extend_1_1 (lo, n); orc_mas2_add_s16_ip (hi, lo - 1, 1817, 2048, 12, n); } static void wavelet_iwt_daub97_horiz (SchroFrameData *fd, int i, orc_int16 *tmp) { int width = fd->width; int16_t *line = SCHRO_FRAME_DATA_GET_LINE (fd, i); int16_t *hi = tmp + 4; int16_t *lo = tmp + width/2 + 12; orc_deinterleave2_lshift1_s16 (hi, lo, line, width / 2); schro_split_ext_daub97 (hi, lo, width / 2); join (line, hi, lo, width); } static void wavelet_iwt_daub97_vert1_odd (SchroFrameData *fd, int i) { int width = fd->width; if (i & 1) { int16_t *hi; int16_t *lo1, *lo2; hi = SCHRO_FRAME_DATA_GET_LINE(fd, i); lo1 = SCHRO_FRAME_DATA_GET_LINE(fd, i - 1); if (i + 1 < fd->height) { lo2 = SCHRO_FRAME_DATA_GET_LINE(fd, i + 1); } else { lo2 = lo1; } orc_mas2_sub_s16_op (hi, hi, lo1, lo2, 6497, 2048, 12, width); } } static void wavelet_iwt_daub97_vert1_even (SchroFrameData *fd, int i) { int width = fd->width; if ((i & 1) == 0) { int16_t *lo; int16_t *hi1, *hi2; lo = SCHRO_FRAME_DATA_GET_LINE(fd, i); if (i == 0) { hi1 = SCHRO_FRAME_DATA_GET_LINE (fd, 1); } else { hi1 = SCHRO_FRAME_DATA_GET_LINE (fd, i-1); } hi2 = SCHRO_FRAME_DATA_GET_LINE (fd, i + 1); orc_mas2_sub_s16_op (lo, lo, hi1, hi2, 217, 2048, 12, width); } } static void wavelet_iwt_daub97_vert2_odd (SchroFrameData *fd, int i) { int width = fd->width; if (i & 1) { int16_t *hi; int16_t *lo1, *lo2; hi = SCHRO_FRAME_DATA_GET_LINE(fd, i); lo1 = SCHRO_FRAME_DATA_GET_LINE(fd, i - 1); if (i + 1 < fd->height) { lo2 = SCHRO_FRAME_DATA_GET_LINE(fd, i + 1); } else { lo2 = lo1; } orc_mas2_add_s16_op (hi, hi, lo1, lo2, 3616, 2048, 12, width); } } static void wavelet_iwt_daub97_vert2_even (SchroFrameData *fd, int i) { int width = fd->width; if ((i & 1) == 0) { int16_t *lo; int16_t *hi1, *hi2; lo = SCHRO_FRAME_DATA_GET_LINE(fd, i); if (i == 0) { hi1 = SCHRO_FRAME_DATA_GET_LINE (fd, 1); } else { hi1 = SCHRO_FRAME_DATA_GET_LINE (fd, i-1); } hi2 = SCHRO_FRAME_DATA_GET_LINE (fd, i + 1); orc_mas2_add_s16_op (lo, lo, hi1, hi2, 1817, 2048, 12, width); } } void schro_iwt_daub_9_7 (SchroFrameData *fd, int16_t * tmp) { int i; int j; for(i=-4;iheight;i++) { j = i+4; if (j >= 0 && j < fd->height) { wavelet_iwt_daub97_horiz (fd, j, tmp); } j = i+3; if (j >= 0 && j < fd->height && (j&1) == 1) { wavelet_iwt_daub97_vert1_odd (fd, j); } j = i+2; if (j >= 0 && j < fd->height && (j&1) == 0) { wavelet_iwt_daub97_vert1_even (fd, j); } j = i+1; if (j >= 0 && j < fd->height && (j&1) == 1) { wavelet_iwt_daub97_vert2_odd (fd, j); } j = i; if (j >= 0 && j < fd->height && (j&1) == 0) { wavelet_iwt_daub97_vert2_even (fd, j); } } } /* Forward, 32-bit, Wavelet #0: Deslauriers-Dubuc 9,7 */ static void wavelet_iwt_desl_9_3_horiz_s32 (SchroFrameData * fd, int i, orc_int32 *tmp) { int width = fd->width; int32_t *line = SCHRO_FRAME_DATA_GET_LINE (fd, i); int32_t *hi = tmp + 4; int32_t *lo = tmp + width/2 + 12; orc_deinterleave2_lshift1_s32 (hi, lo, line, width / 2); extend_1_2_s32 (hi, width/2); orc_mas4_horiz_sub_s32_1991_ip (lo, hi - 1, 1 << 3, 4, width/2); extend_1_0_s32 (lo, width/2); orc_add2_rshift_add_s32_22 (hi, lo - 1, width/2); join_s32 (line, hi, lo, width); } static void wavelet_iwt_desl_9_3_vert_odd_s32 (SchroFrameData *fd, int i) { int width = fd->width; int height = fd->height; if (i & 1) { if (i < 3 || i >= height - 3) { orc_mas4_vert_sub_s32_1991 ( SCHRO_FRAME_DATA_GET_LINE (fd, i), SCHRO_FRAME_DATA_GET_LINE (fd, CLAMP (i - 3, 0, height - 2)), SCHRO_FRAME_DATA_GET_LINE (fd, CLAMP (i - 1, 0, height - 2)), SCHRO_FRAME_DATA_GET_LINE (fd, CLAMP (i + 1, 0, height - 2)), SCHRO_FRAME_DATA_GET_LINE (fd, CLAMP (i + 3, 0, height - 2)), 1 << 3, 4, width); } else { orc_mas4_vert_sub_s32_1991 ( SCHRO_FRAME_DATA_GET_LINE (fd, i), SCHRO_FRAME_DATA_GET_LINE (fd, i - 3), SCHRO_FRAME_DATA_GET_LINE (fd, i - 1), SCHRO_FRAME_DATA_GET_LINE (fd, i + 1), SCHRO_FRAME_DATA_GET_LINE (fd, i + 3), 1 << 3, 4, width); } } } static void wavelet_iwt_desl_9_3_vert_even_s32 (SchroFrameData *fd, int i) { int width = fd->width; if ((i & 1) == 0) { int32_t *lo; int32_t *hi1, *hi2; lo = SCHRO_FRAME_DATA_GET_LINE (fd, i); if (i == 0) { hi1 = SCHRO_FRAME_DATA_GET_LINE (fd, 1); } else { hi1 = SCHRO_FRAME_DATA_GET_LINE (fd, i-1); } hi2 = SCHRO_FRAME_DATA_GET_LINE (fd, i+1); orc_add2_rshift_add_s32_22_vert (lo, hi1, hi2, width); } } void schro_iwt_desl_9_3_s32 (SchroFrameData *fd, int32_t * tmp) { int i; int j; for(i=-6;iheight;i++) { j = i+6; if (j >= 0 && j < fd->height) { wavelet_iwt_desl_9_3_horiz_s32 (fd, j, tmp); } j = i+3; if (j >= 0 && j < fd->height && (j&1) == 1) { wavelet_iwt_desl_9_3_vert_odd_s32 (fd, j); } j = i; if (j >= 0 && j < fd->height && (j&1) == 0) { wavelet_iwt_desl_9_3_vert_even_s32 (fd, j); } } } /* Forward, 32-bit, Wavelet #1: LeGall 5,3 */ static void wavelet_iwt_5_3_horiz_s32 (SchroFrameData *fd, int i, orc_int32 *tmp) { int width = fd->width; int32_t *line = SCHRO_FRAME_DATA_GET_LINE (fd, i); int32_t *hi = tmp + 4; int32_t *lo = tmp + width/2 + 12; orc_deinterleave2_lshift1_s32 (hi, lo, line, width / 2); extend_1_1_s32 (hi, width/2); orc_add2_rshift_sub_s32_11 (lo, hi, width/2); extend_1_1_s32 (lo, width/2); orc_add2_rshift_add_s32_22 (hi, lo - 1, width/2); join_s32 (line, hi, lo, width); } static void wavelet_iwt_5_3_vert_odd_s32 (SchroFrameData * fd, int i) { if (i & 1) { int32_t *hi; int32_t *lo1, *lo2; hi = SCHRO_FRAME_DATA_GET_LINE (fd, i); lo1 = SCHRO_FRAME_DATA_GET_LINE (fd, i - 1); if (i + 1 < fd->height) { lo2 = SCHRO_FRAME_DATA_GET_LINE (fd, i + 1); } else { lo2 = lo1; } orc_add2_rshift_sub_s32_11_vert (hi, lo1, lo2, fd->width); } } static void wavelet_iwt_5_3_vert_even_s32 (SchroFrameData *fd, int i) { if ((i & 1) == 0) { int32_t *lo; int32_t *hi1, *hi2; lo = SCHRO_FRAME_DATA_GET_LINE (fd, i); if (i == 0) { hi1 = SCHRO_FRAME_DATA_GET_LINE (fd, 1); } else { hi1 = SCHRO_FRAME_DATA_GET_LINE (fd, i - 1); } hi2 = SCHRO_FRAME_DATA_GET_LINE (fd, i + 1); orc_add2_rshift_add_s32_22_vert (lo, hi1, hi2, fd->width); } } void schro_iwt_5_3_s32 (SchroFrameData *fd, int32_t * tmp) { int i; int j; for(i=-6;iheight;i++) { j = i+6; if (j >= 0 && j < fd->height) { wavelet_iwt_5_3_horiz_s32 (fd, j, tmp); } j = i+3; if (j >= 0 && j < fd->height && (j&1) == 1) { wavelet_iwt_5_3_vert_odd_s32 (fd, j); } j = i; if (j >= 0 && j < fd->height && (j&1) == 0) { wavelet_iwt_5_3_vert_even_s32 (fd, j); } } } /* Forward, 32-bit, Wavelet #2: Deslauriers-Dubuc 13,7 */ static void wavelet_iwt_13_5_horiz_s32 (SchroFrameData *fd, int i, orc_int32 *tmp) { int width = fd->width; int32_t *line = SCHRO_FRAME_DATA_GET_LINE (fd, i); int32_t *hi = tmp + 4; int32_t *lo = tmp + width/2 + 12; orc_deinterleave2_lshift1_s32 (hi, lo, line, width / 2); extend_1_2_s32 (hi, width/2); orc_mas4_horiz_sub_s32_1991_ip (lo, hi - 1, 1 << 3, 4, width/2); extend_2_1_s32 (lo, width/2); orc_mas4_horiz_add_s32_1991_ip (hi, lo - 2, 1 << 4, 5, width/2); join_s32 (line, hi, lo, width); } static void wavelet_iwt_13_5_vert_odd_s32 (SchroFrameData *fd, int i) { int32_t *dest, *s1, *s2, *s3, *s4; if (i & 1) { if (i < 3 || i >= fd->height - 3) { s1 = SCHRO_FRAME_DATA_GET_LINE(fd, CLAMP (i - 3, 0, fd->height - 2)); s2 = SCHRO_FRAME_DATA_GET_LINE(fd, CLAMP (i - 1, 0, fd->height - 2)); s3 = SCHRO_FRAME_DATA_GET_LINE(fd, CLAMP (i + 1, 0, fd->height - 2)); s4 = SCHRO_FRAME_DATA_GET_LINE(fd, CLAMP (i + 3, 0, fd->height - 2)); } else { s1 = SCHRO_FRAME_DATA_GET_LINE(fd, i - 3); s2 = SCHRO_FRAME_DATA_GET_LINE(fd, i - 1); s3 = SCHRO_FRAME_DATA_GET_LINE(fd, i + 1); s4 = SCHRO_FRAME_DATA_GET_LINE(fd, i + 3); } dest = SCHRO_FRAME_DATA_GET_LINE(fd, i); orc_mas4_vert_sub_s32_1991 (dest, s1, s2, s3, s4, 1 << 3, 4, fd->width); } } static void wavelet_iwt_13_5_vert_even_s32 (SchroFrameData *fd, int i) { int32_t *dest, *s1, *s2, *s3, *s4; if ((i & 1) == 0) { if (i < 3 || i >= fd->height - 3) { s1 = SCHRO_FRAME_DATA_GET_LINE(fd, CLAMP (i - 3, 1, fd->height - 1)); s2 = SCHRO_FRAME_DATA_GET_LINE(fd, CLAMP (i - 1, 1, fd->height - 1)); s3 = SCHRO_FRAME_DATA_GET_LINE(fd, CLAMP (i + 1, 1, fd->height - 1)); s4 = SCHRO_FRAME_DATA_GET_LINE(fd, CLAMP (i + 3, 1, fd->height - 1)); } else { s1 = SCHRO_FRAME_DATA_GET_LINE(fd, i - 3); s2 = SCHRO_FRAME_DATA_GET_LINE(fd, i - 1); s3 = SCHRO_FRAME_DATA_GET_LINE(fd, i + 1); s4 = SCHRO_FRAME_DATA_GET_LINE(fd, i + 3); } dest = SCHRO_FRAME_DATA_GET_LINE(fd, i); orc_mas4_vert_add_s32_1991 (dest, s1, s2, s3, s4, 1 << 4, 5, fd->width); } } void schro_iwt_13_5_s32 (SchroFrameData *fd, int32_t * tmp) { int i; int j; for(i=-6;iheight;i++) { j = i+6; if (j >= 0 && j < fd->height) { wavelet_iwt_13_5_horiz_s32 (fd, j, tmp); } j = i+3; if (j >= 0 && j < fd->height && (j&1) == 1) { wavelet_iwt_13_5_vert_odd_s32 (fd, j); } j = i; if (j >= 0 && j < fd->height && (j&1) == 0) { wavelet_iwt_13_5_vert_even_s32 (fd, j); } } } /* Forward, 32-bit, Wavelet #3,4: Haar 0 and Haar 1 */ static void wavelet_iwt_haar_horiz_s32 (SchroFrameData *fd, int i, orc_int32 *tmp) { int width = fd->width; int32_t *line = SCHRO_FRAME_DATA_GET_LINE (fd, i); int32_t *hi = tmp + width / 2; int32_t *lo = tmp; orc_haar_deint_split_s32 (lo, hi, line, width / 2); join_s32 (line, hi, lo, width); } static void wavelet_iwt_haar_shift1_horiz_s32 (SchroFrameData *fd, int i, orc_int32 *tmp) { int width = fd->width; int32_t *line = SCHRO_FRAME_DATA_GET_LINE (fd, i); int32_t *hi = tmp + width / 2; int32_t *lo = tmp; orc_haar_deint_lshift1_split_s32 (lo, hi, line, width / 2); join_s32 (line, hi, lo, width); } static void wavelet_iwt_haar_vert_s32 (SchroFrameData *fd, int i, orc_int32 *tmp) { int32_t *hi = SCHRO_FRAME_DATA_GET_LINE (fd, i); int32_t *lo = SCHRO_FRAME_DATA_GET_LINE (fd, i + 1); orc_haar_split_s32_op (hi, lo, tmp, tmp + fd->width, fd->width); } static void schro_iwt_haar0_s32 (SchroFrameData *fd, int32_t * tmp) { int i; for(i=0;iheight;i+=2) { wavelet_iwt_haar_horiz_s32 (fd, i, tmp); wavelet_iwt_haar_horiz_s32 (fd, i+1, tmp + fd->width); wavelet_iwt_haar_vert_s32 (fd, i, tmp); } } static void schro_iwt_haar1_s32 (SchroFrameData *fd, int32_t * tmp) { int i; for(i=0;iheight;i+=2) { wavelet_iwt_haar_shift1_horiz_s32 (fd, i, tmp); wavelet_iwt_haar_shift1_horiz_s32 (fd, i+1, tmp + fd->width); wavelet_iwt_haar_vert_s32 (fd, i, tmp); } } /* Forward, 32-bit, Wavelet #5: Fidelity */ static void mas8_add_s32 (int32_t * dest, const int32_t * src, const int32_t * weights, int offset, int shift, int n) { int i; for (i = 0; i < n; i++) { int x = offset; x += src[i + 0] * weights[0]; x += src[i + 1] * weights[1]; x += src[i + 2] * weights[2]; x += src[i + 3] * weights[3]; x += src[i + 4] * weights[4]; x += src[i + 5] * weights[5]; x += src[i + 6] * weights[6]; x += src[i + 7] * weights[7]; dest[i] += x >> shift; } } static void schro_split_ext_fidelity_s32 (int32_t * hi, int32_t * lo, int n) { static const int32_t stage1_weights[] = { -8, 21, -46, 161, 161, -46, 21, -8 }; static const int32_t stage2_weights[] = { 2, -10, 25, -81, -81, 25, -10, 2 }; extend_4_3_s32 (lo, n); mas8_add_s32 (hi, lo - 4, stage1_weights, 128, 8, n); extend_3_4_s32 (hi, n); mas8_add_s32 (lo, hi - 3, stage2_weights, 127, 8, n); } static void wavelet_iwt_fidelity_horiz_s32 (SchroFrameData *fd, int i, orc_int32 *tmp) { int width = fd->width; int32_t *line = SCHRO_FRAME_DATA_GET_LINE (fd, i); int32_t *hi = tmp + 4; int32_t *lo = tmp + width/2 + 12; orc_deinterleave2_s32 (hi, lo, line, width / 2); schro_split_ext_fidelity_s32 (hi, lo, width / 2); join_s32 (line, hi, lo, width); } static void mas8_vert_add_s32_2 (int32_t * dest, const int32_t * src, int32_t ** s, const int32_t *weights, int offset, int shift, int n) { int i; int j; for (i = 0; i < n; i++) { int x = offset; for (j = 0; j < 8; j++) { x += s[j][i] * weights[j]; } dest[i] = src[i] + (x >> shift); } } static void wavelet_iwt_fidelity_vert_odd_s32 (SchroFrameData *fd, int i) { int width = fd->width; int height = fd->height; int32_t *s[8]; int j; if (i & 1) { static const int32_t weights[] = { 2, -10, 25, -81, -81, 25, -10, 2 }; for (j = 0; j < 8; j++) { s[j] = SCHRO_FRAME_DATA_GET_LINE (fd, CLAMP (i - 7 + j * 2, 0, height - 2)); } mas8_vert_add_s32_2 (SCHRO_FRAME_DATA_GET_LINE (fd, i), SCHRO_FRAME_DATA_GET_LINE (fd, i), s, weights, 127, 8, width); } } static void wavelet_iwt_fidelity_vert_even_s32 (SchroFrameData *fd, int i) { int width = fd->width; int height = fd->height; int32_t *s[8]; int j; if ((i & 1) == 0) { static const int32_t weights[] = { -8, 21, -46, 161, 161, -46, 21, -8 }; for (j = 0; j < 8; j++) { s[j] = SCHRO_FRAME_DATA_GET_LINE (fd, CLAMP (i - 7 + j * 2, 1, height - 1)); } mas8_vert_add_s32_2 (SCHRO_FRAME_DATA_GET_LINE (fd, i), SCHRO_FRAME_DATA_GET_LINE (fd, i), s, weights, 128, 8, width); } } void schro_iwt_fidelity_s32 (SchroFrameData *fd, int32_t * tmp) { int i; int j; for(i=-14;iheight;i++) { j = i+14; if (j >= 0 && j < fd->height) { wavelet_iwt_fidelity_horiz_s32 (fd, j, tmp); } j = i+7; if (j >= 0 && j < fd->height && (j&1) == 0) { wavelet_iwt_fidelity_vert_even_s32 (fd, j); } j = i; if (j >= 0 && j < fd->height && (j&1) == 1) { wavelet_iwt_fidelity_vert_odd_s32 (fd, j); } } } /* Forward, 32-bit, Wavelet #6: Daubechies 9,7 */ static void schro_split_ext_daub97_s32 (int32_t * hi, int32_t * lo, int n) { extend_1_1_s32 (hi, n); orc_mas2_sub_s32_ip (lo, hi, 6497, 2048, 12, n); extend_1_1_s32 (lo, n); orc_mas2_sub_s32_ip (hi, lo - 1, 217, 2048, 12, n); extend_1_1_s32 (hi, n); orc_mas2_add_s32_ip (lo, hi, 3616, 2048, 12, n); extend_1_1_s32 (lo, n); orc_mas2_add_s32_ip (hi, lo - 1, 1817, 2048, 12, n); } static void wavelet_iwt_daub97_horiz_s32 (SchroFrameData *fd, int i, orc_int32 *tmp) { int width = fd->width; int32_t *line = SCHRO_FRAME_DATA_GET_LINE (fd, i); int32_t *hi = tmp + 4; int32_t *lo = tmp + width/2 + 12; orc_deinterleave2_lshift1_s32 (hi, lo, line, width / 2); schro_split_ext_daub97_s32 (hi, lo, width / 2); join_s32 (line, hi, lo, width); } static void wavelet_iwt_daub97_vert1_odd_s32 (SchroFrameData *fd, int i) { int width = fd->width; if (i & 1) { int32_t *hi; int32_t *lo1, *lo2; hi = SCHRO_FRAME_DATA_GET_LINE(fd, i); lo1 = SCHRO_FRAME_DATA_GET_LINE(fd, i - 1); if (i + 1 < fd->height) { lo2 = SCHRO_FRAME_DATA_GET_LINE(fd, i + 1); } else { lo2 = lo1; } orc_mas2_sub_s32_op (hi, hi, lo1, lo2, 6497, 2048, 12, width); } } static void wavelet_iwt_daub97_vert1_even_s32 (SchroFrameData *fd, int i) { int width = fd->width; if ((i & 1) == 0) { int32_t *lo; int32_t *hi1, *hi2; lo = SCHRO_FRAME_DATA_GET_LINE(fd, i); if (i == 0) { hi1 = SCHRO_FRAME_DATA_GET_LINE (fd, 1); } else { hi1 = SCHRO_FRAME_DATA_GET_LINE (fd, i-1); } hi2 = SCHRO_FRAME_DATA_GET_LINE (fd, i + 1); orc_mas2_sub_s32_op (lo, lo, hi1, hi2, 217, 2048, 12, width); } } static void wavelet_iwt_daub97_vert2_odd_s32 (SchroFrameData *fd, int i) { int width = fd->width; if (i & 1) { int32_t *hi; int32_t *lo1, *lo2; hi = SCHRO_FRAME_DATA_GET_LINE(fd, i); lo1 = SCHRO_FRAME_DATA_GET_LINE(fd, i - 1); if (i + 1 < fd->height) { lo2 = SCHRO_FRAME_DATA_GET_LINE(fd, i + 1); } else { lo2 = lo1; } orc_mas2_add_s32_op (hi, hi, lo1, lo2, 3616, 2048, 12, width); } } static void wavelet_iwt_daub97_vert2_even_s32 (SchroFrameData *fd, int i) { int width = fd->width; if ((i & 1) == 0) { int32_t *lo; int32_t *hi1, *hi2; lo = SCHRO_FRAME_DATA_GET_LINE(fd, i); if (i == 0) { hi1 = SCHRO_FRAME_DATA_GET_LINE (fd, 1); } else { hi1 = SCHRO_FRAME_DATA_GET_LINE (fd, i-1); } hi2 = SCHRO_FRAME_DATA_GET_LINE (fd, i + 1); orc_mas2_add_s32_op (lo, lo, hi1, hi2, 1817, 2048, 12, width); } } void schro_iwt_daub_9_7_s32 (SchroFrameData *fd, int32_t * tmp) { int i; int j; for(i=-4;iheight;i++) { j = i+4; if (j >= 0 && j < fd->height) { wavelet_iwt_daub97_horiz_s32 (fd, j, tmp); } j = i+3; if (j >= 0 && j < fd->height && (j&1) == 1) { wavelet_iwt_daub97_vert1_odd_s32 (fd, j); } j = i+2; if (j >= 0 && j < fd->height && (j&1) == 0) { wavelet_iwt_daub97_vert1_even_s32 (fd, j); } j = i+1; if (j >= 0 && j < fd->height && (j&1) == 1) { wavelet_iwt_daub97_vert2_odd_s32 (fd, j); } j = i; if (j >= 0 && j < fd->height && (j&1) == 0) { wavelet_iwt_daub97_vert2_even_s32 (fd, j); } } } /* Reverse transforms */ /* Reverse, 16-bit, Wavelet #0: Deslauriers-Dubuc 9,7 */ static void schro_synth_ext_desl93 (int16_t * hi, int16_t * lo, int n) { extend_2_2 (lo, n); orc_add2_rshift_sub_s16_22 (hi, lo - 1, n); extend_2_2 (hi, n); orc_mas4_horiz_add_s16_1991_ip (lo, hi - 1, 1 << 3, 4, n); } void schro_iiwt_desl_9_3 (SchroFrameData *dest, SchroFrameData *src, int16_t * tmp) { int i; int j; for(i=-7;iheight;i++){ j = i + 7; if (j == CLAMP(j,0,src->height-1)) { if (!(j & 1)) { int16_t *lo; int16_t *hi1, *hi2; lo = SCHRO_FRAME_DATA_GET_LINE (src, j); if (j == 0) { hi1 = SCHRO_FRAME_DATA_GET_LINE (src, 1); } else { hi1 = SCHRO_FRAME_DATA_GET_LINE (src, j-1); } hi2 = SCHRO_FRAME_DATA_GET_LINE (src, j+1); orc_add2_rshift_sub_s16_22_vert (lo, hi1, hi2, src->width); } } j = i + 3; if (j == CLAMP(j,0,src->height-1)) { if (j & 1) { if (j < 3 || j >= src->height - 3) { orc_mas4_vert_add_s16_1991 ( SCHRO_FRAME_DATA_GET_LINE (src, j), SCHRO_FRAME_DATA_GET_LINE (src, CLAMP (j - 3, 0, src->height - 2)), SCHRO_FRAME_DATA_GET_LINE (src, CLAMP (j - 1, 0, src->height - 2)), SCHRO_FRAME_DATA_GET_LINE (src, CLAMP (j + 1, 0, src->height - 2)), SCHRO_FRAME_DATA_GET_LINE (src, CLAMP (j + 3, 0, src->height - 2)), 1 << 3, 4, src->width); } else { orc_mas4_vert_add_s16_1991 ( SCHRO_FRAME_DATA_GET_LINE (src, j), SCHRO_FRAME_DATA_GET_LINE (src, j - 3), SCHRO_FRAME_DATA_GET_LINE (src, j - 1), SCHRO_FRAME_DATA_GET_LINE (src, j + 1), SCHRO_FRAME_DATA_GET_LINE (src, j + 3), 1 << 3, 4, src->width); } } } j = i; /* horizontal wavelet */ if (j == CLAMP(j,0,src->height-1)) { int16_t *hi = tmp + 4; int16_t *lo = tmp + src->width/2 + 12; orc_memcpy (hi, SCHRO_FRAME_DATA_GET_PIXEL_S16(src, 0, j), src->width / 2 * sizeof (int16_t)); orc_memcpy (lo, SCHRO_FRAME_DATA_GET_PIXEL_S16(src, src->width/2, j), src->width / 2 * sizeof (int16_t)); schro_synth_ext_desl93 (hi, lo, src->width / 2); orc_interleave2_rrshift1_s16 ( SCHRO_FRAME_DATA_GET_PIXEL_S16 (dest, 0, j), hi, lo, src->width / 2); } } } /* Reverse, 16-bit, Wavelet #1: LeGall 5,3 */ static void schro_synth_ext_53 (int16_t * hi, int16_t * lo, int n) { extend_1_1 (lo, n); orc_add2_rshift_sub_s16_22 (hi, lo - 1, n); extend_1_1 (hi, n); orc_add2_rshift_add_s16_11 (lo, hi, n); } void schro_iiwt_5_3 (SchroFrameData *dest, SchroFrameData *src, int16_t * tmp) { int i; int j; for(i=-2;iheight;i++){ j = i + 2; if (j == CLAMP(j,0,src->height-1)) { if (!(j & 1)) { int16_t *lo; int16_t *hi1, *hi2; lo = SCHRO_FRAME_DATA_GET_LINE (src, j); if (j == 0) { hi1 = SCHRO_FRAME_DATA_GET_LINE (src, 1); } else { hi1 = SCHRO_FRAME_DATA_GET_LINE (src, j-1); } hi2 = SCHRO_FRAME_DATA_GET_LINE (src, j+1); orc_add2_rshift_sub_s16_22_vert (lo, hi1, hi2, src->width); } } j = i + 1; if (j == CLAMP(j,0,src->height-1)) { if (j & 1) { int16_t *hi; int16_t *lo1, *lo2; hi = SCHRO_FRAME_DATA_GET_LINE (src, j); lo1 = SCHRO_FRAME_DATA_GET_LINE (src, j-1); if (j + 1 < src->height) { lo2 = SCHRO_FRAME_DATA_GET_LINE (src, j + 1); } else { lo2 = lo1; } orc_add2_rshift_add_s16_11_op (SCHRO_FRAME_DATA_GET_LINE (src, j), hi, lo1, lo2, src->width); } } j = i; /* horizontal wavelet */ if (j == CLAMP(j,0,src->height-1)) { int16_t *hi = tmp + 4; int16_t *lo = tmp + src->width/2 + 12; orc_memcpy (hi, SCHRO_FRAME_DATA_GET_PIXEL_S16(src, 0, j), src->width / 2 * sizeof (int16_t)); orc_memcpy (lo, SCHRO_FRAME_DATA_GET_PIXEL_S16(src, src->width/2, j), src->width / 2 * sizeof (int16_t)); schro_synth_ext_53 (hi, lo, src->width / 2); orc_interleave2_rrshift1_s16 ( SCHRO_FRAME_DATA_GET_PIXEL_S16 (dest, 0, j), hi, lo, src->width / 2); } } } /* Reverse, 16-bit, Wavelet #2: */ static void schro_synth_ext_135 (int16_t * hi, int16_t * lo, int n) { extend_2_1 (lo, n); orc_mas4_horiz_sub_s16_1991_ip (hi, lo - 2, 1 << 4, 5, n); extend_1_2 (hi, n); orc_mas4_horiz_add_s16_1991_ip (lo, hi - 1, 1 << 3, 4, n); } void schro_iiwt_13_5 (SchroFrameData *dest, SchroFrameData *src, int16_t * tmp) { int i; int j; int16_t *srcline, *s1, *s2, *s3, *s4; int height = src->height; int width = src->width; #define ROW(x) SCHRO_FRAME_DATA_GET_LINE (src, (x)) for(i=-8;iheight;i++){ j = i + 8; if (j == CLAMP(j,0,src->height-1)) { if (!(j & 1)) { if (j < 3 || j >= height - 3) { s1 = ROW (CLAMP (j - 3, 1, height - 1)); s2 = ROW (CLAMP (j - 1, 1, height - 1)); srcline = ROW (j); s3 = ROW (CLAMP (j + 1, 1, height - 1)); s4 = ROW (CLAMP (j + 3, 1, height - 1)); } else { s1 = ROW (j - 3); s2 = ROW (j - 1); srcline = ROW (j); s3 = ROW (j + 1); s4 = ROW (j + 3); } orc_mas4_vert_sub_s16_1991 (srcline, s1, s2, s3, s4, 1 << 4, 5, width); } } j = i + 4; if (j == CLAMP(j,0,src->height-1)) { if (j & 1) { if (j < 3 || j >= height - 3) { s1 = ROW (CLAMP (j - 3, 0, height - 2)); s2 = ROW (CLAMP (j - 1, 0, height - 2)); srcline = ROW (j); s3 = ROW (CLAMP (j + 1, 0, height - 2)); s4 = ROW (CLAMP (j + 3, 0, height - 2)); } else { s1 = ROW (j - 3); s2 = ROW (j - 1); srcline = ROW (j); s3 = ROW (j + 1); s4 = ROW (j + 3); } orc_mas4_vert_add_s16_1991 (srcline, s1, s2, s3, s4, 1 << 3, 4, width); } } #undef ROW j = i; if (j == CLAMP(j,0,src->height-1)) { int16_t *hi = tmp + 4; int16_t *lo = tmp + width/2 + 12; srcline = SCHRO_FRAME_DATA_GET_LINE(dest, j); orc_memcpy (hi, srcline, width / 2 * sizeof (int16_t)); orc_memcpy (lo, srcline + width / 2, width / 2 * sizeof (int16_t)); schro_synth_ext_135 (hi, lo, width / 2); orc_interleave2_rrshift1_s16 ( SCHRO_FRAME_DATA_GET_LINE(dest, j), hi, lo, width / 2); } } } /* Reverse, 16-bit, Wavelet #3,4: Haar 0 and Haar 1 */ void schro_iiwt_haar0 (SchroFrameData *dest, SchroFrameData *src, int16_t * tmp) { int i; int j; int width = src->width; for(i=-8;iheight;i++){ j = i + 1; if (j == CLAMP(j,0,src->height-1)) { if (!(j & 1)) { orc_haar_synth_s16 ( SCHRO_FRAME_DATA_GET_LINE (src, j), SCHRO_FRAME_DATA_GET_LINE (src, j+1), width); } } j = i; if (j == CLAMP(j,0,src->height-1)) { int16_t *hi = tmp + 4; int16_t *lo = tmp + width/2 + 12; orc_memcpy (lo, SCHRO_FRAME_DATA_GET_LINE(dest,j), width / 2 * sizeof (int16_t)); orc_memcpy (hi, SCHRO_FRAME_DATA_GET_PIXEL_S16(src, src->width/2, j), width / 2 * sizeof (int16_t)); orc_haar_synth_int_s16 ( SCHRO_FRAME_DATA_GET_PIXEL_S16(dest, 0, j), lo, hi, width / 2); } } } void schro_iiwt_haar1 (SchroFrameData *dest, SchroFrameData *src, int16_t * tmp) { int i; int j; int width = src->width; for(i=-8;iheight;i++){ j = i + 1; if (j == CLAMP(j,0,src->height-1)) { if (!(j & 1)) { orc_haar_synth_s16 ( SCHRO_FRAME_DATA_GET_LINE (src, j), SCHRO_FRAME_DATA_GET_LINE (src, j+1), width); } } j = i; if (j == CLAMP(j,0,src->height-1)) { int16_t *hi = tmp + 4; int16_t *lo = tmp + width/2 + 12; orc_memcpy (lo, SCHRO_FRAME_DATA_GET_LINE(dest,j), width / 2 * sizeof (int16_t)); orc_memcpy (hi, SCHRO_FRAME_DATA_GET_PIXEL_S16(src, src->width/2, j), width / 2 * sizeof (int16_t)); orc_haar_synth_rrshift1_int_s16 ( SCHRO_FRAME_DATA_GET_PIXEL_S16(dest, 0, j), lo, hi, width / 2); } } } /* Reverse, 16-bit, Wavelet #5: Fidelity */ static void schro_synth_ext_fidelity (int16_t * hi, int16_t * lo, int n) { static const int16_t stage1_weights[] = { -2, 10, -25, 81, 81, -25, 10, -2 }; static const int16_t stage2_weights[] = { 8, -21, 46, -161, -161, 46, -21, 8 }; extend_3_4 (hi, n); mas8_add_s16 (lo, hi - 3, stage1_weights, 128, 8, n); extend_4_3 (lo, n); mas8_add_s16 (hi, lo - 4, stage2_weights, 127, 8, n); } static void wavelet_iiwt_fidelity_horiz (SchroFrame * frame, void *_dest, int component, int i) { int16_t *dest = _dest; int width = frame->components[component].width; int16_t *tmp = frame->virt_priv2; int16_t *src = schro_virt_frame_get_line (frame->virt_frame1, component, i); int16_t *hi = tmp + 4; int16_t *lo = tmp + width/2 + 12; orc_memcpy (hi, src, width / 2 * sizeof (int16_t)); orc_memcpy (lo, src + width / 2, width / 2 * sizeof (int16_t)); schro_synth_ext_fidelity (hi, lo, width / 2); orc_interleave2_s16 (dest, hi, lo, width / 2); } static void mas8_vert_sub_s16_2 (int16_t * dest, const int16_t * src, int16_t ** s, const int *weights, int offset, int shift, int n) { int i; int j; for (i = 0; i < n; i++) { int x = offset; for (j = 0; j < 8; j++) { x += s[j][i] * weights[j]; } dest[i] = src[i] - (x >> shift); } } static void wavelet_iiwt_fidelity_vert (SchroFrame * frame, void *_dest, int component, int i) { int16_t *dest = _dest; int width = frame->components[component].width; int height = frame->components[component].height; int16_t *s[8]; int j; if (i & 1) { static const int weights[] = { 2, -10, 25, -81, -81, 25, -10, 2 }; #define ROW(x) \ schro_virt_frame_get_line (frame->virt_frame1, component, (x)) #define ROW2(x) \ schro_virt_frame_get_line (frame, component, (x)) for (j = 0; j < 8; j++) { s[j] = ROW (CLAMP (i - 7 + j * 2, 0, height - 2)); } mas8_vert_sub_s16_2 (dest, ROW (i), s, weights, 127, 8, width); } else { static const int weights[] = { -8, 21, -46, 161, 161, -46, 21, -8 }; for (j = 0; j < 8; j++) { s[j] = ROW2 (CLAMP (i - 7 + j * 2, 1, height - 1)); } mas8_vert_sub_s16_2 (dest, ROW (i), s, weights, 128, 8, width); } #undef ROW #undef ROW2 } void schro_iiwt_fidelity (SchroFrameData *dest, SchroFrameData *src, int16_t * tmp) { SchroFrame *frame; SchroFrame *frame2; SchroFrame *vf1; SchroFrame *vf2; frame = schro_frame_new (); frame->format = SCHRO_FRAME_FORMAT_S16_444; frame->width = src->width; frame->height = src->height; frame->components[0].format = SCHRO_FRAME_FORMAT_S16_444; frame->components[0].width = src->width; frame->components[0].height = src->height; frame->components[0].stride = src->stride; frame->components[0].data = src->data; vf1 = schro_frame_new_virtual (NULL, frame->format, src->width, src->height); vf1->virt_frame1 = frame; vf1->render_line = wavelet_iiwt_fidelity_vert; vf2 = schro_frame_new_virtual (NULL, frame->format, src->width, src->height); vf2->virt_frame1 = vf1; vf2->virt_priv2 = tmp; vf2->render_line = wavelet_iiwt_fidelity_horiz; frame2 = schro_frame_new (); frame2->format = SCHRO_FRAME_FORMAT_S16_444; frame2->width = dest->width; frame2->height = dest->height; frame2->components[0].format = SCHRO_FRAME_FORMAT_S16_444; frame2->components[0].width = dest->width; frame2->components[0].height = dest->height; frame2->components[0].stride = dest->stride; frame2->components[0].data = dest->data; schro_virt_frame_render (vf2, frame2); schro_frame_unref (vf2); schro_frame_unref (frame2); } /* Reverse, 16-bit, Wavelet #6: Daubechies 9,7 */ static void schro_synth_ext_daub97 (int16_t * hi, int16_t * lo, int n) { extend_1_1 (lo, n); orc_mas2_sub_s16_ip (hi, lo - 1, 1817, 2048, 12, n); extend_1_1 (hi, n); orc_mas2_sub_s16_ip (lo, hi, 3616, 2048, 12, n); extend_1_1 (lo, n); orc_mas2_add_s16_ip (hi, lo - 1, 217, 2048, 12, n); extend_1_1 (hi, n); orc_mas2_add_s16_ip (lo, hi, 6497, 2048, 12, n); } static void wavelet_iiwt_daub97_horiz (SchroFrame * frame, void *_dest, int component, int i) { int16_t *dest = _dest; int width = frame->components[component].width; int16_t *tmp = frame->virt_priv2; int16_t *src = schro_virt_frame_get_line (frame->virt_frame1, component, i); int16_t *hi = tmp + 4; int16_t *lo = tmp + width/2 + 12; orc_memcpy (hi, src, width / 2 * sizeof (int16_t)); orc_memcpy (lo, src + width / 2, width / 2 * sizeof (int16_t)); schro_synth_ext_daub97 (hi, lo, width / 2); orc_interleave2_rrshift1_s16 (dest, hi, lo, width / 2); } static void wavelet_iiwt_daub97_vert1 (SchroFrame * frame, void *_dest, int component, int i) { int16_t *dest = _dest; int width = frame->components[component].width; if (i & 1) { int16_t *hi; int16_t *lo1, *lo2; hi = schro_virt_frame_get_line (frame->virt_frame1, component, i); lo1 = schro_virt_frame_get_line (frame, component, i - 1); if (i + 1 < frame->height) { lo2 = schro_virt_frame_get_line (frame, component, i + 1); } else { lo2 = lo1; } orc_mas2_add_s16_op (dest, hi, lo1, lo2, 6497, 2048, 12, width); } else { int16_t *lo; int16_t *hi1, *hi2; lo = schro_virt_frame_get_line (frame->virt_frame1, component, i); if (i == 0) { hi1 = schro_virt_frame_get_line (frame->virt_frame1, component, 1); } else { hi1 = schro_virt_frame_get_line (frame->virt_frame1, component, i - 1); } hi2 = schro_virt_frame_get_line (frame->virt_frame1, component, i + 1); orc_mas2_add_s16_op (dest, lo, hi1, hi2, 217, 2048, 12, width); } } static void wavelet_iiwt_daub97_vert2 (SchroFrame * frame, void *_dest, int component, int i) { int16_t *dest = _dest; int width = frame->components[component].width; if (i & 1) { int16_t *hi; int16_t *lo1, *lo2; hi = schro_virt_frame_get_line (frame->virt_frame1, component, i); lo1 = schro_virt_frame_get_line (frame, component, i - 1); if (i + 1 < frame->height) { lo2 = schro_virt_frame_get_line (frame, component, i + 1); } else { lo2 = lo1; } orc_mas2_sub_s16_op (dest, hi, lo1, lo2, 3616, 2048, 12, width); } else { int16_t *lo; int16_t *hi1, *hi2; lo = schro_virt_frame_get_line (frame->virt_frame1, component, i); if (i == 0) { hi1 = schro_virt_frame_get_line (frame->virt_frame1, component, 1); } else { hi1 = schro_virt_frame_get_line (frame->virt_frame1, component, i - 1); } hi2 = schro_virt_frame_get_line (frame->virt_frame1, component, i + 1); orc_mas2_sub_s16_op (dest, lo, hi1, hi2, 1817, 2048, 12, width); } } void schro_iiwt_daub_9_7 (SchroFrameData *dest, SchroFrameData *src, int16_t * tmp) { SchroFrame *frame; SchroFrame *frame2; SchroFrame *vf1; SchroFrame *vf2; SchroFrame *vf3; frame = schro_frame_new (); frame->format = SCHRO_FRAME_FORMAT_S16_444; frame->width = src->width; frame->height = src->height; frame->components[0].format = SCHRO_FRAME_FORMAT_S16_444; frame->components[0].width = src->width; frame->components[0].height = src->height; frame->components[0].stride = src->stride; frame->components[0].data = src->data; vf1 = schro_frame_new_virtual (NULL, frame->format, src->width, src->height); vf1->virt_frame1 = frame; vf1->virt_priv2 = tmp; vf1->render_line = wavelet_iiwt_daub97_vert2; vf2 = schro_frame_new_virtual (NULL, frame->format, src->width, src->height); vf2->virt_frame1 = vf1; vf2->virt_priv2 = tmp; vf2->render_line = wavelet_iiwt_daub97_vert1; vf3 = schro_frame_new_virtual (NULL, frame->format, src->width, src->height); vf3->virt_frame1 = vf2; vf3->virt_priv2 = tmp; vf3->render_line = wavelet_iiwt_daub97_horiz; frame2 = schro_frame_new (); frame2->format = SCHRO_FRAME_FORMAT_S16_444; frame2->width = dest->width; frame2->height = dest->height; frame2->components[0].format = SCHRO_FRAME_FORMAT_S16_444; frame2->components[0].width = dest->width; frame2->components[0].height = dest->height; frame2->components[0].stride = dest->stride; frame2->components[0].data = dest->data; schro_virt_frame_render (vf3, frame2); schro_frame_unref (vf3); schro_frame_unref (frame2); } /* 32 bit versions */ /* Reverse, 32-bit, Wavelet #0: Deslauriers-Dubuc 9,7 */ static void schro_synth_ext_desl93_s32 (int32_t * hi, int32_t * lo, int n) { extend_2_2_s32 (lo, n); orc_add2_rshift_sub_s32_22 (hi, lo - 1, n); extend_2_2_s32 (hi, n); orc_mas4_horiz_add_s32_1991_ip (lo, hi - 1, 1 << 3, 4, n); } void schro_iiwt_desl_9_3_s32 (SchroFrameData *dest, SchroFrameData *src, int32_t * tmp) { int i; int j; for(i=-7;iheight;i++){ j = i + 7; if (j == CLAMP(j,0,src->height-1)) { if (!(j & 1)) { int32_t *lo; int32_t *hi1, *hi2; lo = SCHRO_FRAME_DATA_GET_LINE (src, j); if (j == 0) { hi1 = SCHRO_FRAME_DATA_GET_LINE (src, 1); } else { hi1 = SCHRO_FRAME_DATA_GET_LINE (src, j-1); } hi2 = SCHRO_FRAME_DATA_GET_LINE (src, j+1); orc_add2_rshift_sub_s32_22_op (SCHRO_FRAME_DATA_GET_LINE (src, j), lo, hi1, hi2, src->width); } } j = i + 3; if (j == CLAMP(j,0,src->height-1)) { if (j & 1) { if (j < 3 || j >= src->height - 3) { orc_mas4_vert_add_s32_1991_op ( SCHRO_FRAME_DATA_GET_LINE (src, j), SCHRO_FRAME_DATA_GET_LINE (src, j), SCHRO_FRAME_DATA_GET_LINE (src, CLAMP (j - 3, 0, src->height - 2)), SCHRO_FRAME_DATA_GET_LINE (src, CLAMP (j - 1, 0, src->height - 2)), SCHRO_FRAME_DATA_GET_LINE (src, CLAMP (j + 1, 0, src->height - 2)), SCHRO_FRAME_DATA_GET_LINE (src, CLAMP (j + 3, 0, src->height - 2)), 1 << 3, 4, src->width); } else { orc_mas4_vert_add_s32_1991_op ( SCHRO_FRAME_DATA_GET_LINE (src, j), SCHRO_FRAME_DATA_GET_LINE (src, j), SCHRO_FRAME_DATA_GET_LINE (src, j - 3), SCHRO_FRAME_DATA_GET_LINE (src, j - 1), SCHRO_FRAME_DATA_GET_LINE (src, j + 1), SCHRO_FRAME_DATA_GET_LINE (src, j + 3), 1 << 3, 4, src->width); } } } j = i; /* horizontal wavelet */ if (j == CLAMP(j,0,src->height-1)) { int32_t *hi = tmp + 4; int32_t *lo = tmp + src->width/2 + 12; orc_memcpy (hi, SCHRO_FRAME_DATA_GET_PIXEL_S32(src, 0, j), src->width / 2 * sizeof (int32_t)); orc_memcpy (lo, SCHRO_FRAME_DATA_GET_PIXEL_S32(src, src->width/2, j), src->width / 2 * sizeof (int32_t)); schro_synth_ext_desl93_s32 (hi, lo, src->width / 2); orc_interleave2_rrshift1_s32 ( SCHRO_FRAME_DATA_GET_PIXEL_S32 (dest, 0, j), hi, lo, src->width / 2); } } } /* Reverse, 32-bit, Wavelet #1: LeGall 5,3 */ static void schro_synth_ext_53_s32 (int32_t * hi, int32_t * lo, int n) { extend_1_1_s32 (lo, n); orc_add2_rshift_sub_s32_22 (hi, lo - 1, n); extend_1_1_s32 (hi, n); orc_add2_rshift_add_s32_11 (lo, hi, n); } void schro_iiwt_5_3_s32 (SchroFrameData *dest, SchroFrameData *src, int32_t * tmp) { int i; int j; for(i=-2;iheight;i++){ j = i + 2; if (j == CLAMP(j,0,src->height-1)) { if (!(j & 1)) { int32_t *lo; int32_t *hi1, *hi2; lo = SCHRO_FRAME_DATA_GET_LINE (src, j); if (j == 0) { hi1 = SCHRO_FRAME_DATA_GET_LINE (src, 1); } else { hi1 = SCHRO_FRAME_DATA_GET_LINE (src, j-1); } hi2 = SCHRO_FRAME_DATA_GET_LINE (src, j+1); orc_add2_rshift_sub_s32_22_op (SCHRO_FRAME_DATA_GET_LINE (src, j), lo, hi1, hi2, src->width); } } j = i + 1; if (j == CLAMP(j,0,src->height-1)) { if (j & 1) { int32_t *hi; int32_t *lo1, *lo2; hi = SCHRO_FRAME_DATA_GET_LINE (src, j); lo1 = SCHRO_FRAME_DATA_GET_LINE (src, j-1); if (j + 1 < src->height) { lo2 = SCHRO_FRAME_DATA_GET_LINE (src, j + 1); } else { lo2 = lo1; } orc_add2_rshift_add_s32_11_op (SCHRO_FRAME_DATA_GET_LINE (src, j), hi, lo1, lo2, src->width); } } j = i; /* horizontal wavelet */ if (j == CLAMP(j,0,src->height-1)) { int32_t *hi = tmp + 4; int32_t *lo = tmp + src->width/2 + 12; orc_memcpy (hi, SCHRO_FRAME_DATA_GET_PIXEL_S32(src, 0, j), src->width / 2 * sizeof (int32_t)); orc_memcpy (lo, SCHRO_FRAME_DATA_GET_PIXEL_S32(src, src->width/2, j), src->width / 2 * sizeof (int32_t)); schro_synth_ext_53_s32 (hi, lo, src->width / 2); orc_interleave2_rrshift1_s32 ( SCHRO_FRAME_DATA_GET_PIXEL_S32 (dest, 0, j), hi, lo, src->width / 2); } } } /* Reverse, 32-bit, Wavelet #2: */ static void schro_synth_ext_135_s32 (int32_t * hi, int32_t * lo, int n) { extend_2_1_s32 (lo, n); orc_mas4_horiz_sub_s32_1991_ip (hi, lo - 2, 1 << 4, 5, n); extend_1_2_s32 (hi, n); orc_mas4_horiz_add_s32_1991_ip (lo, hi - 1, 1 << 3, 4, n); } void schro_iiwt_13_5_s32 (SchroFrameData *dest, SchroFrameData *src, int32_t * tmp) { int i; int j; int32_t *srcline, *s1, *s2, *s3, *s4; int height = src->height; int width = src->width; #define ROW(x) SCHRO_FRAME_DATA_GET_LINE (src, (x)) for(i=-8;iheight;i++){ j = i + 8; if (j == CLAMP(j,0,src->height-1)) { if (!(j & 1)) { if (j < 3 || j >= height - 3) { s1 = ROW (CLAMP (j - 3, 1, height - 1)); s2 = ROW (CLAMP (j - 1, 1, height - 1)); srcline = ROW (j); s3 = ROW (CLAMP (j + 1, 1, height - 1)); s4 = ROW (CLAMP (j + 3, 1, height - 1)); } else { s1 = ROW (j - 3); s2 = ROW (j - 1); srcline = ROW (j); s3 = ROW (j + 1); s4 = ROW (j + 3); } orc_mas4_vert_sub_s32_1991_op (srcline, srcline, s1, s2, s3, s4, 1 << 4, 5, width); } } j = i + 4; if (j == CLAMP(j,0,src->height-1)) { if (j & 1) { if (j < 3 || j >= height - 3) { s1 = ROW (CLAMP (j - 3, 0, height - 2)); s2 = ROW (CLAMP (j - 1, 0, height - 2)); srcline = ROW (j); s3 = ROW (CLAMP (j + 1, 0, height - 2)); s4 = ROW (CLAMP (j + 3, 0, height - 2)); } else { s1 = ROW (j - 3); s2 = ROW (j - 1); srcline = ROW (j); s3 = ROW (j + 1); s4 = ROW (j + 3); } orc_mas4_vert_add_s32_1991_op (srcline, srcline, s1, s2, s3, s4, 1 << 3, 4, width); } } #undef ROW j = i; if (j == CLAMP(j,0,src->height-1)) { int32_t *hi = tmp + 4; int32_t *lo = tmp + width/2 + 12; srcline = SCHRO_FRAME_DATA_GET_LINE(dest, j); orc_memcpy (hi, srcline, width / 2 * sizeof (int32_t)); orc_memcpy (lo, srcline + width / 2, width / 2 * sizeof (int32_t)); schro_synth_ext_135_s32 (hi, lo, width / 2); orc_interleave2_rrshift1_s32 ( SCHRO_FRAME_DATA_GET_LINE(dest, j), hi, lo, width / 2); } } } /* Reverse, 32-bit, Wavelet #3,4: Haar 0 and Haar 1 */ void schro_iiwt_haar0_s32 (SchroFrameData *dest, SchroFrameData *src, int32_t * tmp) { int i; int j; int width = src->width; for(i=-8;iheight;i++){ j = i + 1; if (j == CLAMP(j,0,src->height-1)) { if (!(j & 1)) { orc_haar_synth_s32 ( SCHRO_FRAME_DATA_GET_LINE (src, j), SCHRO_FRAME_DATA_GET_LINE (src, j+1), width); } } j = i; if (j == CLAMP(j,0,src->height-1)) { int32_t *hi = tmp + 4; int32_t *lo = tmp + width/2 + 12; orc_memcpy (lo, SCHRO_FRAME_DATA_GET_LINE(dest,j), width / 2 * sizeof (int32_t)); orc_memcpy (hi, SCHRO_FRAME_DATA_GET_PIXEL_S32(src, src->width/2, j), width / 2 * sizeof (int32_t)); orc_haar_synth_int_s32 ( SCHRO_FRAME_DATA_GET_PIXEL_S32(dest, 0, j), lo, hi, width / 2); } } } void schro_iiwt_haar1_s32 (SchroFrameData *dest, SchroFrameData *src, int32_t * tmp) { int i; int j; int width = src->width; for(i=-8;iheight;i++){ j = i + 1; if (j == CLAMP(j,0,src->height-1)) { if (!(j & 1)) { orc_haar_synth_s32 ( SCHRO_FRAME_DATA_GET_LINE (src, j), SCHRO_FRAME_DATA_GET_LINE (src, j+1), width); } } j = i; if (j == CLAMP(j,0,src->height-1)) { int32_t *hi = tmp + 4; int32_t *lo = tmp + width/2 + 12; orc_memcpy (lo, SCHRO_FRAME_DATA_GET_LINE(dest,j), width / 2 * sizeof (int32_t)); orc_memcpy (hi, SCHRO_FRAME_DATA_GET_PIXEL_S32(src, src->width/2, j), width / 2 * sizeof (int32_t)); orc_haar_synth_rrshift1_int_s32 ( SCHRO_FRAME_DATA_GET_PIXEL_S32(dest, 0, j), lo, hi, width / 2); } } } /* Reverse, 32-bit, Wavelet #5: Fidelity */ #if 0 /* already defined as part of forward transform */ static void mas8_add_s32 (int32_t * dest, const int32_t * src, const int32_t * weights, int offset, int shift, int n) { int i; for (i = 0; i < n; i++) { int x = offset; x += src[i + 0] * weights[0]; x += src[i + 1] * weights[1]; x += src[i + 2] * weights[2]; x += src[i + 3] * weights[3]; x += src[i + 4] * weights[4]; x += src[i + 5] * weights[5]; x += src[i + 6] * weights[6]; x += src[i + 7] * weights[7]; dest[i] += x >> shift; } } #endif static void schro_synth_ext_fidelity_s32 (int32_t * hi, int32_t * lo, int n) { static const int32_t stage1_weights[] = { -2, 10, -25, 81, 81, -25, 10, -2 }; static const int32_t stage2_weights[] = { 8, -21, 46, -161, -161, 46, -21, 8 }; extend_3_4_s32 (hi, n); mas8_add_s32 (lo, hi - 3, stage1_weights, 128, 8, n); extend_4_3_s32 (lo, n); mas8_add_s32 (hi, lo - 4, stage2_weights, 127, 8, n); } static void wavelet_iiwt_fidelity_horiz_s32 (SchroFrame * frame, void *_dest, int component, int i) { int32_t *dest = _dest; int width = frame->components[component].width; int32_t *tmp = frame->virt_priv2; int32_t *src = schro_virt_frame_get_line (frame->virt_frame1, component, i); int32_t *hi = tmp + 4; int32_t *lo = tmp + width/2 + 12; orc_memcpy (hi, src, width / 2 * sizeof (int32_t)); orc_memcpy (lo, src + width / 2, width / 2 * sizeof (int32_t)); schro_synth_ext_fidelity_s32 (hi, lo, width / 2); orc_interleave2_s32 (dest, hi, lo, width / 2); } static void mas8_vert_sub_s32_2 (int32_t * dest, const int32_t * src, int32_t ** s, const int *weights, int offset, int shift, int n) { int i; int j; for (i = 0; i < n; i++) { int x = offset; for (j = 0; j < 8; j++) { x += s[j][i] * weights[j]; } dest[i] = src[i] - (x >> shift); } } static void wavelet_iiwt_fidelity_vert_s32 (SchroFrame * frame, void *_dest, int component, int i) { int32_t *dest = _dest; int width = frame->components[component].width; int height = frame->components[component].height; int32_t *s[8]; int j; if (i & 1) { static const int weights[] = { 2, -10, 25, -81, -81, 25, -10, 2 }; #define ROW(x) \ schro_virt_frame_get_line (frame->virt_frame1, component, (x)) #define ROW2(x) \ schro_virt_frame_get_line (frame, component, (x)) for (j = 0; j < 8; j++) { s[j] = ROW (CLAMP (i - 7 + j * 2, 0, height - 2)); } mas8_vert_sub_s32_2 (dest, ROW (i), s, weights, 127, 8, width); } else { static const int weights[] = { -8, 21, -46, 161, 161, -46, 21, -8 }; for (j = 0; j < 8; j++) { s[j] = ROW2 (CLAMP (i - 7 + j * 2, 1, height - 1)); } mas8_vert_sub_s32_2 (dest, ROW (i), s, weights, 128, 8, width); } #undef ROW #undef ROW2 } void schro_iiwt_fidelity_s32 (SchroFrameData *dest, SchroFrameData *src, int32_t * tmp) { SchroFrame *frame; SchroFrame *frame2; SchroFrame *vf1; SchroFrame *vf2; frame = schro_frame_new (); frame->format = SCHRO_FRAME_FORMAT_S32_444; frame->width = src->width; frame->height = src->height; frame->components[0].format = SCHRO_FRAME_FORMAT_S32_444; frame->components[0].width = src->width; frame->components[0].height = src->height; frame->components[0].stride = src->stride; frame->components[0].data = src->data; vf1 = schro_frame_new_virtual (NULL, frame->format, src->width, src->height); vf1->virt_frame1 = frame; vf1->render_line = wavelet_iiwt_fidelity_vert_s32; vf2 = schro_frame_new_virtual (NULL, frame->format, src->width, src->height); vf2->virt_frame1 = vf1; vf2->virt_priv2 = tmp; vf2->render_line = wavelet_iiwt_fidelity_horiz_s32; frame2 = schro_frame_new (); frame2->format = SCHRO_FRAME_FORMAT_S32_444; frame2->width = dest->width; frame2->height = dest->height; frame2->components[0].format = SCHRO_FRAME_FORMAT_S32_444; frame2->components[0].width = dest->width; frame2->components[0].height = dest->height; frame2->components[0].stride = dest->stride; frame2->components[0].data = dest->data; schro_virt_frame_render (vf2, frame2); schro_frame_unref (vf2); schro_frame_unref (frame2); } /* Reverse, 32-bit, Wavelet #6: Daubechies 9,7 */ static void schro_synth_ext_daub97_s32 (int32_t * hi, int32_t * lo, int n) { extend_1_1_s32 (lo, n); orc_mas2_sub_s32_ip (hi, lo - 1, 1817, 2048, 12, n); extend_1_1_s32 (hi, n); orc_mas2_sub_s32_ip (lo, hi, 3616, 2048, 12, n); extend_1_1_s32 (lo, n); orc_mas2_add_s32_ip (hi, lo - 1, 217, 2048, 12, n); extend_1_1_s32 (hi, n); orc_mas2_add_s32_ip (lo, hi, 6497, 2048, 12, n); } static void wavelet_iiwt_daub97_horiz_s32 (SchroFrame * frame, void *_dest, int component, int i) { int32_t *dest = _dest; int width = frame->components[component].width; int32_t *tmp = frame->virt_priv2; int32_t *src = schro_virt_frame_get_line (frame->virt_frame1, component, i); int32_t *hi = tmp + 4; int32_t *lo = tmp + width/2 + 12; orc_memcpy (hi, src, width / 2 * sizeof (int32_t)); orc_memcpy (lo, src + width / 2, width / 2 * sizeof (int32_t)); schro_synth_ext_daub97_s32 (hi, lo, width / 2); orc_interleave2_rrshift1_s32 (dest, hi, lo, width / 2); } static void wavelet_iiwt_daub97_vert1_s32 (SchroFrame * frame, void *_dest, int component, int i) { int32_t *dest = _dest; int width = frame->components[component].width; if (i & 1) { int32_t *hi; int32_t *lo1, *lo2; hi = schro_virt_frame_get_line (frame->virt_frame1, component, i); lo1 = schro_virt_frame_get_line (frame, component, i - 1); if (i + 1 < frame->height) { lo2 = schro_virt_frame_get_line (frame, component, i + 1); } else { lo2 = lo1; } orc_mas2_add_s32_op (dest, hi, lo1, lo2, 6497, 2048, 12, width); } else { int32_t *lo; int32_t *hi1, *hi2; lo = schro_virt_frame_get_line (frame->virt_frame1, component, i); if (i == 0) { hi1 = schro_virt_frame_get_line (frame->virt_frame1, component, 1); } else { hi1 = schro_virt_frame_get_line (frame->virt_frame1, component, i - 1); } hi2 = schro_virt_frame_get_line (frame->virt_frame1, component, i + 1); orc_mas2_add_s32_op (dest, lo, hi1, hi2, 217, 2048, 12, width); } } static void wavelet_iiwt_daub97_vert2_s32 (SchroFrame * frame, void *_dest, int component, int i) { int32_t *dest = _dest; int width = frame->components[component].width; if (i & 1) { int32_t *hi; int32_t *lo1, *lo2; hi = schro_virt_frame_get_line (frame->virt_frame1, component, i); lo1 = schro_virt_frame_get_line (frame, component, i - 1); if (i + 1 < frame->height) { lo2 = schro_virt_frame_get_line (frame, component, i + 1); } else { lo2 = lo1; } orc_mas2_sub_s32_op (dest, hi, lo1, lo2, 3616, 2048, 12, width); } else { int32_t *lo; int32_t *hi1, *hi2; lo = schro_virt_frame_get_line (frame->virt_frame1, component, i); if (i == 0) { hi1 = schro_virt_frame_get_line (frame->virt_frame1, component, 1); } else { hi1 = schro_virt_frame_get_line (frame->virt_frame1, component, i - 1); } hi2 = schro_virt_frame_get_line (frame->virt_frame1, component, i + 1); orc_mas2_sub_s32_op (dest, lo, hi1, hi2, 1817, 2048, 12, width); } } void schro_iiwt_daub_9_7_s32 (SchroFrameData *dest, SchroFrameData *src, int32_t * tmp) { SchroFrame *frame; SchroFrame *frame2; SchroFrame *vf1; SchroFrame *vf2; SchroFrame *vf3; frame = schro_frame_new (); frame->format = SCHRO_FRAME_FORMAT_S32_444; frame->width = src->width; frame->height = src->height; frame->components[0].format = SCHRO_FRAME_FORMAT_S32_444; frame->components[0].width = src->width; frame->components[0].height = src->height; frame->components[0].stride = src->stride; frame->components[0].data = src->data; vf1 = schro_frame_new_virtual (NULL, frame->format, src->width, src->height); vf1->virt_frame1 = frame; vf1->virt_priv2 = tmp; vf1->render_line = wavelet_iiwt_daub97_vert2_s32; vf2 = schro_frame_new_virtual (NULL, frame->format, src->width, src->height); vf2->virt_frame1 = vf1; vf2->virt_priv2 = tmp; vf2->render_line = wavelet_iiwt_daub97_vert1_s32; vf3 = schro_frame_new_virtual (NULL, frame->format, src->width, src->height); vf3->virt_frame1 = vf2; vf3->virt_priv2 = tmp; vf3->render_line = wavelet_iiwt_daub97_horiz_s32; frame2 = schro_frame_new (); frame2->format = SCHRO_FRAME_FORMAT_S32_444; frame2->width = dest->width; frame2->height = dest->height; frame2->components[0].format = SCHRO_FRAME_FORMAT_S32_444; frame2->components[0].width = dest->width; frame2->components[0].height = dest->height; frame2->components[0].stride = dest->stride; frame2->components[0].data = dest->data; schro_virt_frame_render (vf3, frame2); schro_frame_unref (vf3); schro_frame_unref (frame2); } schroedinger-1.0.11/schroedinger/Makefile.am0000644000175000017500000000613511556115124015705 00000000000000 if HAVE_CUDA SUBDIRS = cuda endif if HAVE_OPENGL SUBDIRS = opengl endif ORC_SOURCE=schroorc include $(top_srcdir)/orc.mak pkgincludedir = $(includedir)/schroedinger-@SCHRO_MAJORMINOR@/schroedinger lib_LTLIBRARIES = libschroedinger-@SCHRO_MAJORMINOR@.la BUILT_SOURCES += \ schroversion.h DISTCLEANFILES = schroversion.h EXTRA_DIST += schroarith-i386.c \ schroasync-none.c \ schroasync-pthread.c \ schroasync-gthread.c \ schroasync-win32.c pkginclude_HEADERS = \ schro.h \ schrobuffer.h \ schrobufferlist.h \ schrodecoder.h \ schroencoder.h \ schroengine.h \ schrofilter.h \ schroframe.h \ schro-stdint.h \ schroarith.h \ schroanalysis.h \ schroasync.h \ schrobitstream.h \ schrodebug.h \ schrodomain.h \ schrofft.h \ schrohistogram.h \ schrolimits.h \ schrolist.h \ schrometric.h \ schromotion.h \ schromotionest.h \ schropack.h \ schroparams.h \ schroparse.h \ schrophasecorrelation.h \ schroqueue.h \ schrossim.h \ schrotables.h \ schrounpack.h \ schroutils.h \ schrovideoformat.h \ schrovirtframe.h \ schrowavelet.h nodist_pkginclude_HEADERS = \ schroversion.h noinst_HEADERS = \ schrogpuframe.h if HAVE_CUDA cuda_sources = \ schrocuda.c \ schrocuda.h \ schrogpuframe.c \ schrogpumotion.c \ dummy.cc cuda_libs = cuda/libdcuda.la endif if HAVE_OPENGL opengl_libs = opengl/libopengl.la endif libschroedinger_@SCHRO_MAJORMINOR@_la_SOURCES = \ schro.c \ schroarith.c \ schrodecoder.c \ schrodebug.c \ schrodomain.c \ schroframe.c \ schrohistogram.c \ schrobuffer.c \ schrobufferlist.c \ schrolowdelay.c \ schromotion.c \ schromotion8.c \ schromotionfast.c \ schroparams.c \ schroroughmotion.c \ schroparse.c \ schroqueue.c \ schrotables.c \ schrotablesinit.c \ schrounpack.c \ schrounpacktables.c \ schroutils.c \ schrovideoformat.c \ schrovirtframe.c \ schrowaveletorc.c \ $(cuda_sources) \ schroasync-@THREAD_IMPL@.c nodist_libschroedinger_@SCHRO_MAJORMINOR@_la_SOURCES = $(ORC_NODIST_SOURCES) if ENABLE_MOTION_REF libschroedinger_@SCHRO_MAJORMINOR@_la_SOURCES += \ schromotionref.c endif encoder_sources = \ schroanalysis.c \ schroencoder.c \ schroengine.c \ schrofft.c \ schrofilter.c \ schroglobalest.c \ schrohierbm.c \ schrolist.c \ schrometric.c \ schromotionest.c \ schropack.c \ schrophasecorrelation.c \ schroquantiser.c \ schrossim.c \ schrowavelettables.c if ENABLE_ENCODER libschroedinger_@SCHRO_MAJORMINOR@_la_SOURCES += \ $(encoder_sources) endif libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS = \ $(SCHRO_CFLAGS) $(ORC_CFLAGS) $(ERROR_CFLAGS) \ -DSCHRO_ENABLE_UNSTABLE_API \ $(GTHREAD_CFLAGS) \ $(GCOV_CFLAGS) \ $(CUDA_CFLAGS) -I$(srcdir)/cuda -I$(srcdir)/opengl libschroedinger_@SCHRO_MAJORMINOR@_la_LIBADD = \ $(cuda_libs) \ $(CUDA_LIBS) \ $(opengl_libs) \ $(OPENGL_LIBS) \ $(ORC_LIBS) \ $(GCOV_LIBS) \ $(PTHREAD_LIBS) libschroedinger_@SCHRO_MAJORMINOR@_la_LDFLAGS = \ -no-undefined \ -version-info $(SCHRO_LIBVERSION) \ -export-symbols-regex '^schro_' %.c.gcov: .libs/libschroedinger_@SCHRO_MAJORMINOR@_la-%.gcda %.c $(GCOV) -b -f -o $^ > $@.out gcov: $(libschroedinger_1.0_la_SOURCES:=.gcov) $(encoder_sources:=.gcov) schroedinger-1.0.11/schroedinger/schrowavelet.h0000644000175000017500000000063511702411603016521 00000000000000 #ifndef _SCHRO_WAVELET_H_ #define _SCHRO_WAVELET_H_ #include #include SCHRO_BEGIN_DECLS #ifdef SCHRO_ENABLE_UNSTABLE_API void schro_wavelet_transform_2d (SchroFrameData *fd, int type, int16_t *tmp); void schro_wavelet_inverse_transform_2d (SchroFrameData *fd_dest, SchroFrameData *fd_src, int type, int16_t *tmp); #endif SCHRO_END_DECLS #endif schroedinger-1.0.11/schroedinger/Makefile.in0000664000175000017500000031060211707140261015713 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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 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 '+='. # VPATH = @srcdir@ pkgdatadir = $(datadir)/@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@ DIST_COMMON = $(noinst_HEADERS) $(pkginclude_HEADERS) \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/schroversion.h.in $(top_srcdir)/orc.mak @ENABLE_MOTION_REF_TRUE@am__append_1 = \ @ENABLE_MOTION_REF_TRUE@ schromotionref.c @ENABLE_ENCODER_TRUE@am__append_2 = \ @ENABLE_ENCODER_TRUE@ $(encoder_sources) subdir = schroedinger ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-auto-alt.m4 \ $(top_srcdir)/m4/as-compiler-flag.m4 \ $(top_srcdir)/m4/as-host-defines.m4 \ $(top_srcdir)/m4/as-version.m4 $(top_srcdir)/m4/gst-args.m4 \ $(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)/m4/pkg.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = schroversion.h 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__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgincludedir)" \ "$(DESTDIR)$(pkgincludedir)" LTLIBRARIES = $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = libschroedinger_@SCHRO_MAJORMINOR@_la_DEPENDENCIES = $(cuda_libs) \ $(am__DEPENDENCIES_1) $(opengl_libs) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) am__libschroedinger_@SCHRO_MAJORMINOR@_la_SOURCES_DIST = schro.c \ schroarith.c schrodecoder.c schrodebug.c schrodomain.c \ schroframe.c schrohistogram.c schrobuffer.c schrobufferlist.c \ schrolowdelay.c schromotion.c schromotion8.c schromotionfast.c \ schroparams.c schroroughmotion.c schroparse.c schroqueue.c \ schrotables.c schrotablesinit.c schrounpack.c \ schrounpacktables.c schroutils.c schrovideoformat.c \ schrovirtframe.c schrowaveletorc.c schrocuda.c schrocuda.h \ schrogpuframe.c schrogpumotion.c dummy.cc \ schroasync-@THREAD_IMPL@.c schromotionref.c schroanalysis.c \ schroencoder.c schroengine.c schrofft.c schrofilter.c \ schroglobalest.c schrohierbm.c schrolist.c schrometric.c \ schromotionest.c schropack.c schrophasecorrelation.c \ schroquantiser.c schrossim.c schrowavelettables.c @HAVE_CUDA_TRUE@am__objects_1 = libschroedinger_@SCHRO_MAJORMINOR@_la-schrocuda.lo \ @HAVE_CUDA_TRUE@ libschroedinger_@SCHRO_MAJORMINOR@_la-schrogpuframe.lo \ @HAVE_CUDA_TRUE@ libschroedinger_@SCHRO_MAJORMINOR@_la-schrogpumotion.lo \ @HAVE_CUDA_TRUE@ dummy.lo @ENABLE_MOTION_REF_TRUE@am__objects_2 = libschroedinger_@SCHRO_MAJORMINOR@_la-schromotionref.lo am__objects_3 = \ libschroedinger_@SCHRO_MAJORMINOR@_la-schroanalysis.lo \ libschroedinger_@SCHRO_MAJORMINOR@_la-schroencoder.lo \ libschroedinger_@SCHRO_MAJORMINOR@_la-schroengine.lo \ libschroedinger_@SCHRO_MAJORMINOR@_la-schrofft.lo \ libschroedinger_@SCHRO_MAJORMINOR@_la-schrofilter.lo \ libschroedinger_@SCHRO_MAJORMINOR@_la-schroglobalest.lo \ libschroedinger_@SCHRO_MAJORMINOR@_la-schrohierbm.lo \ libschroedinger_@SCHRO_MAJORMINOR@_la-schrolist.lo \ libschroedinger_@SCHRO_MAJORMINOR@_la-schrometric.lo \ libschroedinger_@SCHRO_MAJORMINOR@_la-schromotionest.lo \ libschroedinger_@SCHRO_MAJORMINOR@_la-schropack.lo \ libschroedinger_@SCHRO_MAJORMINOR@_la-schrophasecorrelation.lo \ libschroedinger_@SCHRO_MAJORMINOR@_la-schroquantiser.lo \ libschroedinger_@SCHRO_MAJORMINOR@_la-schrossim.lo \ libschroedinger_@SCHRO_MAJORMINOR@_la-schrowavelettables.lo @ENABLE_ENCODER_TRUE@am__objects_4 = $(am__objects_3) am_libschroedinger_@SCHRO_MAJORMINOR@_la_OBJECTS = \ libschroedinger_@SCHRO_MAJORMINOR@_la-schro.lo \ libschroedinger_@SCHRO_MAJORMINOR@_la-schroarith.lo \ libschroedinger_@SCHRO_MAJORMINOR@_la-schrodecoder.lo \ libschroedinger_@SCHRO_MAJORMINOR@_la-schrodebug.lo \ libschroedinger_@SCHRO_MAJORMINOR@_la-schrodomain.lo \ libschroedinger_@SCHRO_MAJORMINOR@_la-schroframe.lo \ libschroedinger_@SCHRO_MAJORMINOR@_la-schrohistogram.lo \ libschroedinger_@SCHRO_MAJORMINOR@_la-schrobuffer.lo \ libschroedinger_@SCHRO_MAJORMINOR@_la-schrobufferlist.lo \ libschroedinger_@SCHRO_MAJORMINOR@_la-schrolowdelay.lo \ libschroedinger_@SCHRO_MAJORMINOR@_la-schromotion.lo \ libschroedinger_@SCHRO_MAJORMINOR@_la-schromotion8.lo \ libschroedinger_@SCHRO_MAJORMINOR@_la-schromotionfast.lo \ libschroedinger_@SCHRO_MAJORMINOR@_la-schroparams.lo \ libschroedinger_@SCHRO_MAJORMINOR@_la-schroroughmotion.lo \ libschroedinger_@SCHRO_MAJORMINOR@_la-schroparse.lo \ libschroedinger_@SCHRO_MAJORMINOR@_la-schroqueue.lo \ libschroedinger_@SCHRO_MAJORMINOR@_la-schrotables.lo \ libschroedinger_@SCHRO_MAJORMINOR@_la-schrotablesinit.lo \ libschroedinger_@SCHRO_MAJORMINOR@_la-schrounpack.lo \ libschroedinger_@SCHRO_MAJORMINOR@_la-schrounpacktables.lo \ libschroedinger_@SCHRO_MAJORMINOR@_la-schroutils.lo \ libschroedinger_@SCHRO_MAJORMINOR@_la-schrovideoformat.lo \ libschroedinger_@SCHRO_MAJORMINOR@_la-schrovirtframe.lo \ libschroedinger_@SCHRO_MAJORMINOR@_la-schrowaveletorc.lo \ $(am__objects_1) \ libschroedinger_@SCHRO_MAJORMINOR@_la-schroasync-@THREAD_IMPL@.lo \ $(am__objects_2) $(am__objects_4) am__objects_5 = libschroedinger_@SCHRO_MAJORMINOR@_la-tmp-orc.lo nodist_libschroedinger_@SCHRO_MAJORMINOR@_la_OBJECTS = \ $(am__objects_5) libschroedinger_@SCHRO_MAJORMINOR@_la_OBJECTS = \ $(am_libschroedinger_@SCHRO_MAJORMINOR@_la_OBJECTS) \ $(nodist_libschroedinger_@SCHRO_MAJORMINOR@_la_OBJECTS) libschroedinger_@SCHRO_MAJORMINOR@_la_LINK = $(LIBTOOL) --tag=CXX \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ $(AM_CXXFLAGS) $(CXXFLAGS) \ $(libschroedinger_@SCHRO_MAJORMINOR@_la_LDFLAGS) $(LDFLAGS) -o \ $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libschroedinger_@SCHRO_MAJORMINOR@_la_SOURCES) \ $(nodist_libschroedinger_@SCHRO_MAJORMINOR@_la_SOURCES) DIST_SOURCES = \ $(am__libschroedinger_@SCHRO_MAJORMINOR@_la_SOURCES_DIST) RECURSIVE_TARGETS = all-recursive check-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 uninstall-recursive HEADERS = $(nodist_pkginclude_HEADERS) $(noinst_HEADERS) \ $(pkginclude_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = cuda opengl 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" pkgincludedir = $(includedir)/schroedinger-@SCHRO_MAJORMINOR@/schroedinger ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUDA_CFLAGS = @CUDA_CFLAGS@ CUDA_LIBS = @CUDA_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ GCOV = @GCOV@ GCOV_CFLAGS = @GCOV_CFLAGS@ GCOV_LIBS = @GCOV_LIBS@ GREP = @GREP@ GTHREAD_CFLAGS = @GTHREAD_CFLAGS@ GTHREAD_LIBS = @GTHREAD_LIBS@ GTKDOC_CHECK = @GTKDOC_CHECK@ 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@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ NVCC = @NVCC@ NVCCFLAGS = @NVCCFLAGS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENGL_CFLAGS = @OPENGL_CFLAGS@ OPENGL_LIBS = @OPENGL_LIBS@ ORCC = @ORCC@ ORC_CFLAGS = @ORC_CFLAGS@ ORC_LIBS = @ORC_LIBS@ 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@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SCHRO_CFLAGS = @SCHRO_CFLAGS@ SCHRO_LIBS = @SCHRO_LIBS@ SCHRO_LIBVERSION = @SCHRO_LIBVERSION@ SCHRO_MAJORMINOR = @SCHRO_MAJORMINOR@ SCHRO_PKG_DEPS = @SCHRO_PKG_DEPS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ THREAD_IMPL = @THREAD_IMPL@ VERSION = @VERSION@ 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_CXX = @ac_ct_CXX@ 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@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @HAVE_CUDA_TRUE@SUBDIRS = cuda @HAVE_OPENGL_TRUE@SUBDIRS = opengl ORC_SOURCE = schroorc EXTRA_DIST = $(ORC_SOURCE).orc schroarith-i386.c schroasync-none.c \ schroasync-pthread.c schroasync-gthread.c schroasync-win32.c ORC_NODIST_SOURCES = tmp-orc.c $(ORC_SOURCE).h BUILT_SOURCES = tmp-orc.c $(ORC_SOURCE).h schroversion.h orcc_v_gen = cp_v_gen = lib_LTLIBRARIES = libschroedinger-@SCHRO_MAJORMINOR@.la DISTCLEANFILES = schroversion.h pkginclude_HEADERS = \ schro.h \ schrobuffer.h \ schrobufferlist.h \ schrodecoder.h \ schroencoder.h \ schroengine.h \ schrofilter.h \ schroframe.h \ schro-stdint.h \ schroarith.h \ schroanalysis.h \ schroasync.h \ schrobitstream.h \ schrodebug.h \ schrodomain.h \ schrofft.h \ schrohistogram.h \ schrolimits.h \ schrolist.h \ schrometric.h \ schromotion.h \ schromotionest.h \ schropack.h \ schroparams.h \ schroparse.h \ schrophasecorrelation.h \ schroqueue.h \ schrossim.h \ schrotables.h \ schrounpack.h \ schroutils.h \ schrovideoformat.h \ schrovirtframe.h \ schrowavelet.h nodist_pkginclude_HEADERS = \ schroversion.h noinst_HEADERS = \ schrogpuframe.h @HAVE_CUDA_TRUE@cuda_sources = \ @HAVE_CUDA_TRUE@ schrocuda.c \ @HAVE_CUDA_TRUE@ schrocuda.h \ @HAVE_CUDA_TRUE@ schrogpuframe.c \ @HAVE_CUDA_TRUE@ schrogpumotion.c \ @HAVE_CUDA_TRUE@ dummy.cc @HAVE_CUDA_TRUE@cuda_libs = cuda/libdcuda.la @HAVE_OPENGL_TRUE@opengl_libs = opengl/libopengl.la libschroedinger_@SCHRO_MAJORMINOR@_la_SOURCES = schro.c schroarith.c \ schrodecoder.c schrodebug.c schrodomain.c schroframe.c \ schrohistogram.c schrobuffer.c schrobufferlist.c \ schrolowdelay.c schromotion.c schromotion8.c schromotionfast.c \ schroparams.c schroroughmotion.c schroparse.c schroqueue.c \ schrotables.c schrotablesinit.c schrounpack.c \ schrounpacktables.c schroutils.c schrovideoformat.c \ schrovirtframe.c schrowaveletorc.c $(cuda_sources) \ schroasync-@THREAD_IMPL@.c $(am__append_1) $(am__append_2) nodist_libschroedinger_@SCHRO_MAJORMINOR@_la_SOURCES = $(ORC_NODIST_SOURCES) encoder_sources = \ schroanalysis.c \ schroencoder.c \ schroengine.c \ schrofft.c \ schrofilter.c \ schroglobalest.c \ schrohierbm.c \ schrolist.c \ schrometric.c \ schromotionest.c \ schropack.c \ schrophasecorrelation.c \ schroquantiser.c \ schrossim.c \ schrowavelettables.c libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS = \ $(SCHRO_CFLAGS) $(ORC_CFLAGS) $(ERROR_CFLAGS) \ -DSCHRO_ENABLE_UNSTABLE_API \ $(GTHREAD_CFLAGS) \ $(GCOV_CFLAGS) \ $(CUDA_CFLAGS) -I$(srcdir)/cuda -I$(srcdir)/opengl libschroedinger_@SCHRO_MAJORMINOR@_la_LIBADD = \ $(cuda_libs) \ $(CUDA_LIBS) \ $(opengl_libs) \ $(OPENGL_LIBS) \ $(ORC_LIBS) \ $(GCOV_LIBS) \ $(PTHREAD_LIBS) libschroedinger_@SCHRO_MAJORMINOR@_la_LDFLAGS = \ -no-undefined \ -version-info $(SCHRO_LIBVERSION) \ -export-symbols-regex '^schro_' all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: .SUFFIXES: .c .cc .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/orc.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) --foreign schroedinger/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign schroedinger/Makefile .PRECIOUS: 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): schroversion.h: $(top_builddir)/config.status $(srcdir)/schroversion.h.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" @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 " $(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)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libschroedinger-@SCHRO_MAJORMINOR@.la: $(libschroedinger_@SCHRO_MAJORMINOR@_la_OBJECTS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_DEPENDENCIES) $(libschroedinger_@SCHRO_MAJORMINOR@_la_LINK) -rpath $(libdir) $(libschroedinger_@SCHRO_MAJORMINOR@_la_OBJECTS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dummy.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schro.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schroanalysis.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schroarith.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schroasync-@THREAD_IMPL@.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrobuffer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrobufferlist.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrocuda.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrodebug.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrodecoder.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrodomain.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schroencoder.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schroengine.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrofft.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrofilter.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schroframe.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schroglobalest.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrogpuframe.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrogpumotion.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrohierbm.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrohistogram.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrolist.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrolowdelay.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrometric.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schromotion.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schromotion8.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schromotionest.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schromotionfast.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schromotionref.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schropack.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schroparams.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schroparse.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrophasecorrelation.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schroquantiser.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schroqueue.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schroroughmotion.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrossim.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrotables.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrotablesinit.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrounpack.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrounpacktables.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schroutils.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrovideoformat.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrovirtframe.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrowaveletorc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrowavelettables.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-tmp-orc.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< libschroedinger_@SCHRO_MAJORMINOR@_la-schro.lo: schro.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT libschroedinger_@SCHRO_MAJORMINOR@_la-schro.lo -MD -MP -MF $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schro.Tpo -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schro.lo `test -f 'schro.c' || echo '$(srcdir)/'`schro.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schro.Tpo $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schro.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='schro.c' object='libschroedinger_@SCHRO_MAJORMINOR@_la-schro.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schro.lo `test -f 'schro.c' || echo '$(srcdir)/'`schro.c libschroedinger_@SCHRO_MAJORMINOR@_la-schroarith.lo: schroarith.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT libschroedinger_@SCHRO_MAJORMINOR@_la-schroarith.lo -MD -MP -MF $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schroarith.Tpo -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schroarith.lo `test -f 'schroarith.c' || echo '$(srcdir)/'`schroarith.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schroarith.Tpo $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schroarith.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='schroarith.c' object='libschroedinger_@SCHRO_MAJORMINOR@_la-schroarith.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schroarith.lo `test -f 'schroarith.c' || echo '$(srcdir)/'`schroarith.c libschroedinger_@SCHRO_MAJORMINOR@_la-schrodecoder.lo: schrodecoder.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT libschroedinger_@SCHRO_MAJORMINOR@_la-schrodecoder.lo -MD -MP -MF $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrodecoder.Tpo -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schrodecoder.lo `test -f 'schrodecoder.c' || echo '$(srcdir)/'`schrodecoder.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrodecoder.Tpo $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrodecoder.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='schrodecoder.c' object='libschroedinger_@SCHRO_MAJORMINOR@_la-schrodecoder.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schrodecoder.lo `test -f 'schrodecoder.c' || echo '$(srcdir)/'`schrodecoder.c libschroedinger_@SCHRO_MAJORMINOR@_la-schrodebug.lo: schrodebug.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT libschroedinger_@SCHRO_MAJORMINOR@_la-schrodebug.lo -MD -MP -MF $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrodebug.Tpo -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schrodebug.lo `test -f 'schrodebug.c' || echo '$(srcdir)/'`schrodebug.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrodebug.Tpo $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrodebug.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='schrodebug.c' object='libschroedinger_@SCHRO_MAJORMINOR@_la-schrodebug.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schrodebug.lo `test -f 'schrodebug.c' || echo '$(srcdir)/'`schrodebug.c libschroedinger_@SCHRO_MAJORMINOR@_la-schrodomain.lo: schrodomain.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT libschroedinger_@SCHRO_MAJORMINOR@_la-schrodomain.lo -MD -MP -MF $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrodomain.Tpo -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schrodomain.lo `test -f 'schrodomain.c' || echo '$(srcdir)/'`schrodomain.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrodomain.Tpo $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrodomain.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='schrodomain.c' object='libschroedinger_@SCHRO_MAJORMINOR@_la-schrodomain.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schrodomain.lo `test -f 'schrodomain.c' || echo '$(srcdir)/'`schrodomain.c libschroedinger_@SCHRO_MAJORMINOR@_la-schroframe.lo: schroframe.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT libschroedinger_@SCHRO_MAJORMINOR@_la-schroframe.lo -MD -MP -MF $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schroframe.Tpo -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schroframe.lo `test -f 'schroframe.c' || echo '$(srcdir)/'`schroframe.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schroframe.Tpo $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schroframe.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='schroframe.c' object='libschroedinger_@SCHRO_MAJORMINOR@_la-schroframe.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schroframe.lo `test -f 'schroframe.c' || echo '$(srcdir)/'`schroframe.c libschroedinger_@SCHRO_MAJORMINOR@_la-schrohistogram.lo: schrohistogram.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT libschroedinger_@SCHRO_MAJORMINOR@_la-schrohistogram.lo -MD -MP -MF $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrohistogram.Tpo -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schrohistogram.lo `test -f 'schrohistogram.c' || echo '$(srcdir)/'`schrohistogram.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrohistogram.Tpo $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrohistogram.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='schrohistogram.c' object='libschroedinger_@SCHRO_MAJORMINOR@_la-schrohistogram.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schrohistogram.lo `test -f 'schrohistogram.c' || echo '$(srcdir)/'`schrohistogram.c libschroedinger_@SCHRO_MAJORMINOR@_la-schrobuffer.lo: schrobuffer.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT libschroedinger_@SCHRO_MAJORMINOR@_la-schrobuffer.lo -MD -MP -MF $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrobuffer.Tpo -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schrobuffer.lo `test -f 'schrobuffer.c' || echo '$(srcdir)/'`schrobuffer.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrobuffer.Tpo $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrobuffer.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='schrobuffer.c' object='libschroedinger_@SCHRO_MAJORMINOR@_la-schrobuffer.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schrobuffer.lo `test -f 'schrobuffer.c' || echo '$(srcdir)/'`schrobuffer.c libschroedinger_@SCHRO_MAJORMINOR@_la-schrobufferlist.lo: schrobufferlist.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT libschroedinger_@SCHRO_MAJORMINOR@_la-schrobufferlist.lo -MD -MP -MF $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrobufferlist.Tpo -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schrobufferlist.lo `test -f 'schrobufferlist.c' || echo '$(srcdir)/'`schrobufferlist.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrobufferlist.Tpo $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrobufferlist.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='schrobufferlist.c' object='libschroedinger_@SCHRO_MAJORMINOR@_la-schrobufferlist.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schrobufferlist.lo `test -f 'schrobufferlist.c' || echo '$(srcdir)/'`schrobufferlist.c libschroedinger_@SCHRO_MAJORMINOR@_la-schrolowdelay.lo: schrolowdelay.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT libschroedinger_@SCHRO_MAJORMINOR@_la-schrolowdelay.lo -MD -MP -MF $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrolowdelay.Tpo -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schrolowdelay.lo `test -f 'schrolowdelay.c' || echo '$(srcdir)/'`schrolowdelay.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrolowdelay.Tpo $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrolowdelay.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='schrolowdelay.c' object='libschroedinger_@SCHRO_MAJORMINOR@_la-schrolowdelay.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schrolowdelay.lo `test -f 'schrolowdelay.c' || echo '$(srcdir)/'`schrolowdelay.c libschroedinger_@SCHRO_MAJORMINOR@_la-schromotion.lo: schromotion.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT libschroedinger_@SCHRO_MAJORMINOR@_la-schromotion.lo -MD -MP -MF $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schromotion.Tpo -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schromotion.lo `test -f 'schromotion.c' || echo '$(srcdir)/'`schromotion.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schromotion.Tpo $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schromotion.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='schromotion.c' object='libschroedinger_@SCHRO_MAJORMINOR@_la-schromotion.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schromotion.lo `test -f 'schromotion.c' || echo '$(srcdir)/'`schromotion.c libschroedinger_@SCHRO_MAJORMINOR@_la-schromotion8.lo: schromotion8.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT libschroedinger_@SCHRO_MAJORMINOR@_la-schromotion8.lo -MD -MP -MF $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schromotion8.Tpo -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schromotion8.lo `test -f 'schromotion8.c' || echo '$(srcdir)/'`schromotion8.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schromotion8.Tpo $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schromotion8.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='schromotion8.c' object='libschroedinger_@SCHRO_MAJORMINOR@_la-schromotion8.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schromotion8.lo `test -f 'schromotion8.c' || echo '$(srcdir)/'`schromotion8.c libschroedinger_@SCHRO_MAJORMINOR@_la-schromotionfast.lo: schromotionfast.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT libschroedinger_@SCHRO_MAJORMINOR@_la-schromotionfast.lo -MD -MP -MF $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schromotionfast.Tpo -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schromotionfast.lo `test -f 'schromotionfast.c' || echo '$(srcdir)/'`schromotionfast.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schromotionfast.Tpo $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schromotionfast.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='schromotionfast.c' object='libschroedinger_@SCHRO_MAJORMINOR@_la-schromotionfast.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schromotionfast.lo `test -f 'schromotionfast.c' || echo '$(srcdir)/'`schromotionfast.c libschroedinger_@SCHRO_MAJORMINOR@_la-schroparams.lo: schroparams.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT libschroedinger_@SCHRO_MAJORMINOR@_la-schroparams.lo -MD -MP -MF $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schroparams.Tpo -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schroparams.lo `test -f 'schroparams.c' || echo '$(srcdir)/'`schroparams.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schroparams.Tpo $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schroparams.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='schroparams.c' object='libschroedinger_@SCHRO_MAJORMINOR@_la-schroparams.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schroparams.lo `test -f 'schroparams.c' || echo '$(srcdir)/'`schroparams.c libschroedinger_@SCHRO_MAJORMINOR@_la-schroroughmotion.lo: schroroughmotion.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT libschroedinger_@SCHRO_MAJORMINOR@_la-schroroughmotion.lo -MD -MP -MF $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schroroughmotion.Tpo -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schroroughmotion.lo `test -f 'schroroughmotion.c' || echo '$(srcdir)/'`schroroughmotion.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schroroughmotion.Tpo $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schroroughmotion.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='schroroughmotion.c' object='libschroedinger_@SCHRO_MAJORMINOR@_la-schroroughmotion.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schroroughmotion.lo `test -f 'schroroughmotion.c' || echo '$(srcdir)/'`schroroughmotion.c libschroedinger_@SCHRO_MAJORMINOR@_la-schroparse.lo: schroparse.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT libschroedinger_@SCHRO_MAJORMINOR@_la-schroparse.lo -MD -MP -MF $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schroparse.Tpo -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schroparse.lo `test -f 'schroparse.c' || echo '$(srcdir)/'`schroparse.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schroparse.Tpo $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schroparse.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='schroparse.c' object='libschroedinger_@SCHRO_MAJORMINOR@_la-schroparse.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schroparse.lo `test -f 'schroparse.c' || echo '$(srcdir)/'`schroparse.c libschroedinger_@SCHRO_MAJORMINOR@_la-schroqueue.lo: schroqueue.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT libschroedinger_@SCHRO_MAJORMINOR@_la-schroqueue.lo -MD -MP -MF $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schroqueue.Tpo -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schroqueue.lo `test -f 'schroqueue.c' || echo '$(srcdir)/'`schroqueue.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schroqueue.Tpo $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schroqueue.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='schroqueue.c' object='libschroedinger_@SCHRO_MAJORMINOR@_la-schroqueue.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schroqueue.lo `test -f 'schroqueue.c' || echo '$(srcdir)/'`schroqueue.c libschroedinger_@SCHRO_MAJORMINOR@_la-schrotables.lo: schrotables.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT libschroedinger_@SCHRO_MAJORMINOR@_la-schrotables.lo -MD -MP -MF $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrotables.Tpo -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schrotables.lo `test -f 'schrotables.c' || echo '$(srcdir)/'`schrotables.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrotables.Tpo $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrotables.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='schrotables.c' object='libschroedinger_@SCHRO_MAJORMINOR@_la-schrotables.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schrotables.lo `test -f 'schrotables.c' || echo '$(srcdir)/'`schrotables.c libschroedinger_@SCHRO_MAJORMINOR@_la-schrotablesinit.lo: schrotablesinit.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT libschroedinger_@SCHRO_MAJORMINOR@_la-schrotablesinit.lo -MD -MP -MF $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrotablesinit.Tpo -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schrotablesinit.lo `test -f 'schrotablesinit.c' || echo '$(srcdir)/'`schrotablesinit.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrotablesinit.Tpo $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrotablesinit.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='schrotablesinit.c' object='libschroedinger_@SCHRO_MAJORMINOR@_la-schrotablesinit.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schrotablesinit.lo `test -f 'schrotablesinit.c' || echo '$(srcdir)/'`schrotablesinit.c libschroedinger_@SCHRO_MAJORMINOR@_la-schrounpack.lo: schrounpack.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT libschroedinger_@SCHRO_MAJORMINOR@_la-schrounpack.lo -MD -MP -MF $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrounpack.Tpo -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schrounpack.lo `test -f 'schrounpack.c' || echo '$(srcdir)/'`schrounpack.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrounpack.Tpo $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrounpack.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='schrounpack.c' object='libschroedinger_@SCHRO_MAJORMINOR@_la-schrounpack.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schrounpack.lo `test -f 'schrounpack.c' || echo '$(srcdir)/'`schrounpack.c libschroedinger_@SCHRO_MAJORMINOR@_la-schrounpacktables.lo: schrounpacktables.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT libschroedinger_@SCHRO_MAJORMINOR@_la-schrounpacktables.lo -MD -MP -MF $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrounpacktables.Tpo -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schrounpacktables.lo `test -f 'schrounpacktables.c' || echo '$(srcdir)/'`schrounpacktables.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrounpacktables.Tpo $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrounpacktables.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='schrounpacktables.c' object='libschroedinger_@SCHRO_MAJORMINOR@_la-schrounpacktables.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schrounpacktables.lo `test -f 'schrounpacktables.c' || echo '$(srcdir)/'`schrounpacktables.c libschroedinger_@SCHRO_MAJORMINOR@_la-schroutils.lo: schroutils.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT libschroedinger_@SCHRO_MAJORMINOR@_la-schroutils.lo -MD -MP -MF $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schroutils.Tpo -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schroutils.lo `test -f 'schroutils.c' || echo '$(srcdir)/'`schroutils.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schroutils.Tpo $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schroutils.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='schroutils.c' object='libschroedinger_@SCHRO_MAJORMINOR@_la-schroutils.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schroutils.lo `test -f 'schroutils.c' || echo '$(srcdir)/'`schroutils.c libschroedinger_@SCHRO_MAJORMINOR@_la-schrovideoformat.lo: schrovideoformat.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT libschroedinger_@SCHRO_MAJORMINOR@_la-schrovideoformat.lo -MD -MP -MF $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrovideoformat.Tpo -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schrovideoformat.lo `test -f 'schrovideoformat.c' || echo '$(srcdir)/'`schrovideoformat.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrovideoformat.Tpo $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrovideoformat.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='schrovideoformat.c' object='libschroedinger_@SCHRO_MAJORMINOR@_la-schrovideoformat.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schrovideoformat.lo `test -f 'schrovideoformat.c' || echo '$(srcdir)/'`schrovideoformat.c libschroedinger_@SCHRO_MAJORMINOR@_la-schrovirtframe.lo: schrovirtframe.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT libschroedinger_@SCHRO_MAJORMINOR@_la-schrovirtframe.lo -MD -MP -MF $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrovirtframe.Tpo -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schrovirtframe.lo `test -f 'schrovirtframe.c' || echo '$(srcdir)/'`schrovirtframe.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrovirtframe.Tpo $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrovirtframe.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='schrovirtframe.c' object='libschroedinger_@SCHRO_MAJORMINOR@_la-schrovirtframe.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schrovirtframe.lo `test -f 'schrovirtframe.c' || echo '$(srcdir)/'`schrovirtframe.c libschroedinger_@SCHRO_MAJORMINOR@_la-schrowaveletorc.lo: schrowaveletorc.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT libschroedinger_@SCHRO_MAJORMINOR@_la-schrowaveletorc.lo -MD -MP -MF $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrowaveletorc.Tpo -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schrowaveletorc.lo `test -f 'schrowaveletorc.c' || echo '$(srcdir)/'`schrowaveletorc.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrowaveletorc.Tpo $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrowaveletorc.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='schrowaveletorc.c' object='libschroedinger_@SCHRO_MAJORMINOR@_la-schrowaveletorc.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schrowaveletorc.lo `test -f 'schrowaveletorc.c' || echo '$(srcdir)/'`schrowaveletorc.c libschroedinger_@SCHRO_MAJORMINOR@_la-schrocuda.lo: schrocuda.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT libschroedinger_@SCHRO_MAJORMINOR@_la-schrocuda.lo -MD -MP -MF $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrocuda.Tpo -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schrocuda.lo `test -f 'schrocuda.c' || echo '$(srcdir)/'`schrocuda.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrocuda.Tpo $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrocuda.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='schrocuda.c' object='libschroedinger_@SCHRO_MAJORMINOR@_la-schrocuda.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schrocuda.lo `test -f 'schrocuda.c' || echo '$(srcdir)/'`schrocuda.c libschroedinger_@SCHRO_MAJORMINOR@_la-schrogpuframe.lo: schrogpuframe.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT libschroedinger_@SCHRO_MAJORMINOR@_la-schrogpuframe.lo -MD -MP -MF $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrogpuframe.Tpo -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schrogpuframe.lo `test -f 'schrogpuframe.c' || echo '$(srcdir)/'`schrogpuframe.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrogpuframe.Tpo $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrogpuframe.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='schrogpuframe.c' object='libschroedinger_@SCHRO_MAJORMINOR@_la-schrogpuframe.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schrogpuframe.lo `test -f 'schrogpuframe.c' || echo '$(srcdir)/'`schrogpuframe.c libschroedinger_@SCHRO_MAJORMINOR@_la-schrogpumotion.lo: schrogpumotion.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT libschroedinger_@SCHRO_MAJORMINOR@_la-schrogpumotion.lo -MD -MP -MF $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrogpumotion.Tpo -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schrogpumotion.lo `test -f 'schrogpumotion.c' || echo '$(srcdir)/'`schrogpumotion.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrogpumotion.Tpo $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrogpumotion.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='schrogpumotion.c' object='libschroedinger_@SCHRO_MAJORMINOR@_la-schrogpumotion.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schrogpumotion.lo `test -f 'schrogpumotion.c' || echo '$(srcdir)/'`schrogpumotion.c libschroedinger_@SCHRO_MAJORMINOR@_la-schroasync-@THREAD_IMPL@.lo: schroasync-@THREAD_IMPL@.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT libschroedinger_@SCHRO_MAJORMINOR@_la-schroasync-@THREAD_IMPL@.lo -MD -MP -MF $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schroasync-@THREAD_IMPL@.Tpo -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schroasync-@THREAD_IMPL@.lo `test -f 'schroasync-@THREAD_IMPL@.c' || echo '$(srcdir)/'`schroasync-@THREAD_IMPL@.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schroasync-@THREAD_IMPL@.Tpo $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schroasync-@THREAD_IMPL@.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='schroasync-@THREAD_IMPL@.c' object='libschroedinger_@SCHRO_MAJORMINOR@_la-schroasync-@THREAD_IMPL@.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schroasync-@THREAD_IMPL@.lo `test -f 'schroasync-@THREAD_IMPL@.c' || echo '$(srcdir)/'`schroasync-@THREAD_IMPL@.c libschroedinger_@SCHRO_MAJORMINOR@_la-schromotionref.lo: schromotionref.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT libschroedinger_@SCHRO_MAJORMINOR@_la-schromotionref.lo -MD -MP -MF $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schromotionref.Tpo -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schromotionref.lo `test -f 'schromotionref.c' || echo '$(srcdir)/'`schromotionref.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schromotionref.Tpo $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schromotionref.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='schromotionref.c' object='libschroedinger_@SCHRO_MAJORMINOR@_la-schromotionref.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schromotionref.lo `test -f 'schromotionref.c' || echo '$(srcdir)/'`schromotionref.c libschroedinger_@SCHRO_MAJORMINOR@_la-schroanalysis.lo: schroanalysis.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT libschroedinger_@SCHRO_MAJORMINOR@_la-schroanalysis.lo -MD -MP -MF $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schroanalysis.Tpo -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schroanalysis.lo `test -f 'schroanalysis.c' || echo '$(srcdir)/'`schroanalysis.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schroanalysis.Tpo $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schroanalysis.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='schroanalysis.c' object='libschroedinger_@SCHRO_MAJORMINOR@_la-schroanalysis.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schroanalysis.lo `test -f 'schroanalysis.c' || echo '$(srcdir)/'`schroanalysis.c libschroedinger_@SCHRO_MAJORMINOR@_la-schroencoder.lo: schroencoder.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT libschroedinger_@SCHRO_MAJORMINOR@_la-schroencoder.lo -MD -MP -MF $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schroencoder.Tpo -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schroencoder.lo `test -f 'schroencoder.c' || echo '$(srcdir)/'`schroencoder.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schroencoder.Tpo $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schroencoder.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='schroencoder.c' object='libschroedinger_@SCHRO_MAJORMINOR@_la-schroencoder.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schroencoder.lo `test -f 'schroencoder.c' || echo '$(srcdir)/'`schroencoder.c libschroedinger_@SCHRO_MAJORMINOR@_la-schroengine.lo: schroengine.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT libschroedinger_@SCHRO_MAJORMINOR@_la-schroengine.lo -MD -MP -MF $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schroengine.Tpo -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schroengine.lo `test -f 'schroengine.c' || echo '$(srcdir)/'`schroengine.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schroengine.Tpo $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schroengine.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='schroengine.c' object='libschroedinger_@SCHRO_MAJORMINOR@_la-schroengine.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schroengine.lo `test -f 'schroengine.c' || echo '$(srcdir)/'`schroengine.c libschroedinger_@SCHRO_MAJORMINOR@_la-schrofft.lo: schrofft.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT libschroedinger_@SCHRO_MAJORMINOR@_la-schrofft.lo -MD -MP -MF $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrofft.Tpo -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schrofft.lo `test -f 'schrofft.c' || echo '$(srcdir)/'`schrofft.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrofft.Tpo $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrofft.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='schrofft.c' object='libschroedinger_@SCHRO_MAJORMINOR@_la-schrofft.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schrofft.lo `test -f 'schrofft.c' || echo '$(srcdir)/'`schrofft.c libschroedinger_@SCHRO_MAJORMINOR@_la-schrofilter.lo: schrofilter.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT libschroedinger_@SCHRO_MAJORMINOR@_la-schrofilter.lo -MD -MP -MF $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrofilter.Tpo -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schrofilter.lo `test -f 'schrofilter.c' || echo '$(srcdir)/'`schrofilter.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrofilter.Tpo $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrofilter.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='schrofilter.c' object='libschroedinger_@SCHRO_MAJORMINOR@_la-schrofilter.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schrofilter.lo `test -f 'schrofilter.c' || echo '$(srcdir)/'`schrofilter.c libschroedinger_@SCHRO_MAJORMINOR@_la-schroglobalest.lo: schroglobalest.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT libschroedinger_@SCHRO_MAJORMINOR@_la-schroglobalest.lo -MD -MP -MF $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schroglobalest.Tpo -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schroglobalest.lo `test -f 'schroglobalest.c' || echo '$(srcdir)/'`schroglobalest.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schroglobalest.Tpo $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schroglobalest.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='schroglobalest.c' object='libschroedinger_@SCHRO_MAJORMINOR@_la-schroglobalest.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schroglobalest.lo `test -f 'schroglobalest.c' || echo '$(srcdir)/'`schroglobalest.c libschroedinger_@SCHRO_MAJORMINOR@_la-schrohierbm.lo: schrohierbm.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT libschroedinger_@SCHRO_MAJORMINOR@_la-schrohierbm.lo -MD -MP -MF $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrohierbm.Tpo -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schrohierbm.lo `test -f 'schrohierbm.c' || echo '$(srcdir)/'`schrohierbm.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrohierbm.Tpo $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrohierbm.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='schrohierbm.c' object='libschroedinger_@SCHRO_MAJORMINOR@_la-schrohierbm.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schrohierbm.lo `test -f 'schrohierbm.c' || echo '$(srcdir)/'`schrohierbm.c libschroedinger_@SCHRO_MAJORMINOR@_la-schrolist.lo: schrolist.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT libschroedinger_@SCHRO_MAJORMINOR@_la-schrolist.lo -MD -MP -MF $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrolist.Tpo -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schrolist.lo `test -f 'schrolist.c' || echo '$(srcdir)/'`schrolist.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrolist.Tpo $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrolist.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='schrolist.c' object='libschroedinger_@SCHRO_MAJORMINOR@_la-schrolist.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schrolist.lo `test -f 'schrolist.c' || echo '$(srcdir)/'`schrolist.c libschroedinger_@SCHRO_MAJORMINOR@_la-schrometric.lo: schrometric.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT libschroedinger_@SCHRO_MAJORMINOR@_la-schrometric.lo -MD -MP -MF $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrometric.Tpo -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schrometric.lo `test -f 'schrometric.c' || echo '$(srcdir)/'`schrometric.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrometric.Tpo $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrometric.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='schrometric.c' object='libschroedinger_@SCHRO_MAJORMINOR@_la-schrometric.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schrometric.lo `test -f 'schrometric.c' || echo '$(srcdir)/'`schrometric.c libschroedinger_@SCHRO_MAJORMINOR@_la-schromotionest.lo: schromotionest.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT libschroedinger_@SCHRO_MAJORMINOR@_la-schromotionest.lo -MD -MP -MF $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schromotionest.Tpo -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schromotionest.lo `test -f 'schromotionest.c' || echo '$(srcdir)/'`schromotionest.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schromotionest.Tpo $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schromotionest.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='schromotionest.c' object='libschroedinger_@SCHRO_MAJORMINOR@_la-schromotionest.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schromotionest.lo `test -f 'schromotionest.c' || echo '$(srcdir)/'`schromotionest.c libschroedinger_@SCHRO_MAJORMINOR@_la-schropack.lo: schropack.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT libschroedinger_@SCHRO_MAJORMINOR@_la-schropack.lo -MD -MP -MF $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schropack.Tpo -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schropack.lo `test -f 'schropack.c' || echo '$(srcdir)/'`schropack.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schropack.Tpo $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schropack.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='schropack.c' object='libschroedinger_@SCHRO_MAJORMINOR@_la-schropack.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schropack.lo `test -f 'schropack.c' || echo '$(srcdir)/'`schropack.c libschroedinger_@SCHRO_MAJORMINOR@_la-schrophasecorrelation.lo: schrophasecorrelation.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT libschroedinger_@SCHRO_MAJORMINOR@_la-schrophasecorrelation.lo -MD -MP -MF $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrophasecorrelation.Tpo -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schrophasecorrelation.lo `test -f 'schrophasecorrelation.c' || echo '$(srcdir)/'`schrophasecorrelation.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrophasecorrelation.Tpo $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrophasecorrelation.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='schrophasecorrelation.c' object='libschroedinger_@SCHRO_MAJORMINOR@_la-schrophasecorrelation.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schrophasecorrelation.lo `test -f 'schrophasecorrelation.c' || echo '$(srcdir)/'`schrophasecorrelation.c libschroedinger_@SCHRO_MAJORMINOR@_la-schroquantiser.lo: schroquantiser.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT libschroedinger_@SCHRO_MAJORMINOR@_la-schroquantiser.lo -MD -MP -MF $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schroquantiser.Tpo -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schroquantiser.lo `test -f 'schroquantiser.c' || echo '$(srcdir)/'`schroquantiser.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schroquantiser.Tpo $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schroquantiser.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='schroquantiser.c' object='libschroedinger_@SCHRO_MAJORMINOR@_la-schroquantiser.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schroquantiser.lo `test -f 'schroquantiser.c' || echo '$(srcdir)/'`schroquantiser.c libschroedinger_@SCHRO_MAJORMINOR@_la-schrossim.lo: schrossim.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT libschroedinger_@SCHRO_MAJORMINOR@_la-schrossim.lo -MD -MP -MF $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrossim.Tpo -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schrossim.lo `test -f 'schrossim.c' || echo '$(srcdir)/'`schrossim.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrossim.Tpo $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrossim.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='schrossim.c' object='libschroedinger_@SCHRO_MAJORMINOR@_la-schrossim.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schrossim.lo `test -f 'schrossim.c' || echo '$(srcdir)/'`schrossim.c libschroedinger_@SCHRO_MAJORMINOR@_la-schrowavelettables.lo: schrowavelettables.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT libschroedinger_@SCHRO_MAJORMINOR@_la-schrowavelettables.lo -MD -MP -MF $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrowavelettables.Tpo -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schrowavelettables.lo `test -f 'schrowavelettables.c' || echo '$(srcdir)/'`schrowavelettables.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrowavelettables.Tpo $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-schrowavelettables.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='schrowavelettables.c' object='libschroedinger_@SCHRO_MAJORMINOR@_la-schrowavelettables.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-schrowavelettables.lo `test -f 'schrowavelettables.c' || echo '$(srcdir)/'`schrowavelettables.c libschroedinger_@SCHRO_MAJORMINOR@_la-tmp-orc.lo: tmp-orc.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT libschroedinger_@SCHRO_MAJORMINOR@_la-tmp-orc.lo -MD -MP -MF $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-tmp-orc.Tpo -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-tmp-orc.lo `test -f 'tmp-orc.c' || echo '$(srcdir)/'`tmp-orc.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-tmp-orc.Tpo $(DEPDIR)/libschroedinger_@SCHRO_MAJORMINOR@_la-tmp-orc.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tmp-orc.c' object='libschroedinger_@SCHRO_MAJORMINOR@_la-tmp-orc.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libschroedinger_@SCHRO_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o libschroedinger_@SCHRO_MAJORMINOR@_la-tmp-orc.lo `test -f 'tmp-orc.c' || echo '$(srcdir)/'`tmp-orc.c .cc.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cc.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-nodist_pkgincludeHEADERS: $(nodist_pkginclude_HEADERS) @$(NORMAL_INSTALL) test -z "$(pkgincludedir)" || $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" @list='$(nodist_pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ 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)$(pkgincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(pkgincludedir)" || exit $$?; \ done uninstall-nodist_pkgincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(nodist_pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(pkgincludedir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(pkgincludedir)" && rm -f $$files install-pkgincludeHEADERS: $(pkginclude_HEADERS) @$(NORMAL_INSTALL) test -z "$(pkgincludedir)" || $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ 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)$(pkgincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(pkgincludedir)" || exit $$?; \ done uninstall-pkgincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(pkgincludedir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(pkgincludedir)" && rm -f $$files # 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. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; 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" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ 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: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-recursive all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgincludedir)" "$(DESTDIR)$(pkgincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-recursive clean-am: clean-generic clean-libLTLIBRARIES clean-libtool clean-local \ mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-nodist_pkgincludeHEADERS \ install-pkgincludeHEADERS install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-libLTLIBRARIES 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 -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-libLTLIBRARIES \ uninstall-nodist_pkgincludeHEADERS uninstall-pkgincludeHEADERS .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check \ ctags-recursive install install-am install-strip \ tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool clean-local ctags \ ctags-recursive 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-nodist_pkgincludeHEADERS install-pdf \ install-pdf-am install-pkgincludeHEADERS install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-recursive uninstall uninstall-am \ uninstall-libLTLIBRARIES uninstall-nodist_pkgincludeHEADERS \ uninstall-pkgincludeHEADERS orc-update: tmp-orc.c $(ORC_SOURCE).h cp tmp-orc.c $(srcdir)/$(ORC_SOURCE)-dist.c cp $(ORC_SOURCE).h $(srcdir)/$(ORC_SOURCE)-dist.h @HAVE_ORCC_TRUE@tmp-orc.c: $(srcdir)/$(ORC_SOURCE).orc @HAVE_ORCC_TRUE@ $(orcc_v_gen)$(ORCC) $(ORCC_FLAGS) --inline --implementation -o tmp-orc.c $(srcdir)/$(ORC_SOURCE).orc @HAVE_ORCC_TRUE@$(ORC_SOURCE).h: $(srcdir)/$(ORC_SOURCE).orc @HAVE_ORCC_TRUE@ $(orcc_v_gen)$(ORCC) $(ORCC_FLAGS) --inline --header -o $(ORC_SOURCE).h $(srcdir)/$(ORC_SOURCE).orc @HAVE_ORCC_FALSE@tmp-orc.c: $(srcdir)/$(ORC_SOURCE).orc @HAVE_ORCC_FALSE@ $(cp_v_gen)cp $(srcdir)/$(ORC_SOURCE)-dist.c tmp-orc.c @HAVE_ORCC_FALSE@$(ORC_SOURCE).h: $(srcdir)/$(ORC_SOURCE).orc @HAVE_ORCC_FALSE@ $(cp_v_gen)cp $(srcdir)/$(ORC_SOURCE)-dist.h $(ORC_SOURCE).h 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 dist-hook-orc: tmp-orc.c $(ORC_SOURCE).h rm -f tmp-orc.c~ cmp -s tmp-orc.c $(srcdir)/$(ORC_SOURCE)-dist.c || \ cp tmp-orc.c $(srcdir)/$(ORC_SOURCE)-dist.c cmp -s $(ORC_SOURCE).h $(srcdir)/$(ORC_SOURCE)-dist.h || \ cp $(ORC_SOURCE).h $(srcdir)/$(ORC_SOURCE)-dist.h cp -p $(srcdir)/$(ORC_SOURCE)-dist.c $(distdir)/ cp -p $(srcdir)/$(ORC_SOURCE)-dist.h $(distdir)/ %.c.gcov: .libs/libschroedinger_@SCHRO_MAJORMINOR@_la-%.gcda %.c $(GCOV) -b -f -o $^ > $@.out gcov: $(libschroedinger_1.0_la_SOURCES:=.gcov) $(encoder_sources:=.gcov) # 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: schroedinger-1.0.11/schroedinger/schrodebug.c0000644000175000017500000000457211541755167016160 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include static const char *schro_debug_level_names[] = { "NONE", "ERROR", "WARNING", "INFO", "DEBUG", "LOG" }; static int schro_debug_level = SCHRO_LEVEL_ERROR; int _schro_dump_enable; static void schro_debug_log_valist (int level, const char *file, const char *func, int line, const char *format, va_list varargs); static SchroDebugLogFunc _schro_debug_log_func = schro_debug_log_valist; static void schro_debug_log_valist (int level, const char *file, const char *func, int line, const char *format, va_list varargs) { #ifdef HAVE_GLIB char *s; if (level > schro_debug_level) return; s = g_strdup_vprintf (format, varargs); fprintf (stderr, "SCHRO: %s: %s(%d): %s: %s\n", schro_debug_level_names[level], file, line, func, s); g_free (s); #else char s[4096]; if (level > schro_debug_level) return; vsnprintf (s, sizeof (s) - 1, format, varargs); fprintf (stderr, "SCHRO: %s: %s(%d): %s: %s\n", schro_debug_level_names[level], file, line, func, s); #endif } void schro_debug_log (int level, const char *file, const char *func, int line, const char *format, ...) { va_list var_args; va_start (var_args, format); _schro_debug_log_func (level, file, func, line, format, var_args); va_end (var_args); } void schro_debug_set_level (int level) { schro_debug_level = level; } int schro_debug_get_level (void) { return schro_debug_level; } static FILE *dump_files[SCHRO_DUMP_LAST]; static const char *dump_file_names[SCHRO_DUMP_LAST] = { "schro_dump.subband_curve", "schro_dump.subband_est", "schro_dump.picture", "schro_dump.psnr", "schro_dump.ssim", "schro_dump.lambda_curve", "schro_dump.hist_test", "schro_dump.scene_change", "schro_dump.phase_correlation", "schro_dump.motionest" }; void schro_dump (int type, const char *format, ...) { va_list varargs; if (!_schro_dump_enable) return; if (dump_files[type] == NULL) { dump_files[type] = fopen (dump_file_names[type], "w"); } va_start (varargs, format); vfprintf (dump_files[type], format, varargs); va_end (varargs); fflush (dump_files[type]); } void schro_debug_set_log_function (SchroDebugLogFunc func) { if (func) { _schro_debug_log_func = func; } else { _schro_debug_log_func = schro_debug_log_valist; } } schroedinger-1.0.11/schroedinger/schroarith-i386.c0000644000175000017500000001274511541755167016671 00000000000000 static int __schro_arith_context_decode_bit (SchroArith * arith, int i) { SchroArithContext *context = arith->contexts + i; #include "schrooffsets.h" __asm__ __volatile__ ( //calc_count_range(arith); " movzwl a_range(%0), %%ecx\n" " movzwl a_code(%0), %%eax\n" " movzwl a_range+2(%0), %%edx\n" #if 0 " subl $1, %%ecx\n" " subl %%ecx, %%esi\n" " subl %%ecx, %%edx\n" #else " negl %%ecx\n" " leal 1(%%eax,%%ecx,1), %%eax\n" " leal 1(%%edx,%%ecx,1), %%ecx\n" #endif " movl %%eax, a_count(%0)\n" //" movl %%ecx, a_range_value(%0)\n" //calc_prob0(arith, context); " movzwl c_count(%1), %%eax\n" " addw (c_count + 2)(%1), %%ax\n" " movzwl a_division_factor(%0,%%eax,2), %%eax\n" #if 1 " mulw c_count(%1)\n" #else " movzwl c_count(%1), %%edx\n" " imul %%edx, %%eax\n" #endif // calc_value() #if 1 " imul %%ecx, %%eax\n" " shrl $16, %%eax\n" #else " cmp $0x10000, %%ecx\n" " je .Lskipmul\n" " mul %%cx\n" " mov %%dx, %%ax\n" ".Lskipmul:\n" #endif " mov a_count(%0), %%ecx\n" #if 0 " subl %%eax, %%ecx\n" " neg %%ecx\n" " shrl $31, %%ecx\n" " and $1, %%ecx\n" #else " cmpl %%eax, %%ecx\n" " setg %%cl\n" " movzbl %%cl, %%ecx\n" #endif " xor $1, %%ecx\n" " addw a_range(%0), %%ax\n" " subw %%cx, %%ax\n" " movw %%ax, a_range(%0,%%ecx,2)\n" " xor $1, %%ecx\n" " addw $1, c_count(%1, %%ecx, 2)\n" " movw %%cx, a_value(%0)\n" //maybe_shift_context(context); #if 0 " movw c_count(%1), %%cx\n" " addw c_count + 2(%1), %%cx\n" " shrw $8, %%cx\n" #if 0 " shrw %%cl, c_count(%1)\n" " addw %%cx, c_count(%1)\n" " shrw %%cl, c_count+2(%1)\n" " addw %%cx, c_count+2(%1)\n" #else " movw %%cx, %%ax\n" " shl $16, %%eax\n" " orl %%ecx, %%eax\n" " movl c_count(%1), %%edx\n" " shrl %%cl, %%edx\n" " addl %%eax, %%edx\n" " and $0x00ff00ff, %%edx\n" " movl %%edx, c_count(%1)\n" #endif #else " movw c_count(%1), %%cx\n" " addw c_count + 2(%1), %%cx\n" " cmp $255, %%cx\n" " jle .Lnoshift\n" #if 0 " shrw $1, c_count(%1)\n" " addw $1, c_count(%1)\n" " shrw $1, c_count+2(%1)\n" " addw $1, c_count+2(%1)\n" #else " movl c_count(%1), %%ecx\n" " shrl $1, %%ecx\n" " addl $0x00010001, %%ecx\n" " and $0x00ff00ff, %%ecx\n" " mov %%ecx, c_count(%1)\n" #endif ".Lnoshift:\n" #endif //fixup_range(arith); // i = ((arith->range[1]&0xf000)>>8) | ((arith->range[0]&0xf000)>>12); // fixup = arith->fixup_shift[i]; " movw a_range + 2(%0), %%ax\n" " shrw $12, %%ax\n" " movw a_range(%0), %%cx\n" " shldw $4, %%cx, %%ax\n" " movzwl a_fixup_shift(%0,%%eax,2), %%eax\n" // if (n == 0) return; " test %%eax, %%eax\n" " je .Lfixup_done\n" // n = arith->fixup_shift[i] & 0xf; " movl %%eax, %%ecx\n" " andw $0x1f, %%cx\n" // arith->range[0] <<= n; " shlw %%cl, a_range(%0)\n" // arith->range[1] <<= n; // arith->range[1] |= (1<code <<= n; // arith->code |= (arith->nextcode >> ((32-n)&0x1f)); " movw a_nextcode+2(%0), %%dx\n" " shldw %%cl, %%dx, a_code(%0)\n" // arith->nextcode <<= n; " shll %%cl, a_nextcode(%0)\n" // arith->nextbits-=n; " subl %%ecx, a_nextbits(%0)\n" // flip = arith->fixup_shift[i] & 0x8000; " andw $0x8000, %%ax\n" // arith->code ^= flip; " xorw %%ax, a_code(%0)\n" // arith->range[0] ^= flip; " xorw %%ax, a_range(%0)\n" // arith->range[1] ^= flip; " xorw %%ax, a_range+2(%0)\n" " cmpw $3, %%cx\n" " jl .Lfixup_nextcode\n" ".Lfixup_loop:\n" " movzwl a_range+2(%0), %%eax\n" " shrw $12, %%ax\n" " movw a_range(%0), %%cx\n" " shldw $4, %%cx, %%ax\n" " movzwl a_fixup_shift(%0,%%eax,2), %%eax\n" " test %%eax, %%eax\n" " je .Lfixup_nextcode\n" " movl %%eax, %%ecx\n" " andw $0x1f, %%cx\n" " shlw %%cl, a_range(%0)\n" " addw $1, a_range+2(%0)\n" " shlw %%cl, a_range+2(%0)\n" " addw $-1, a_range+2(%0)\n" " movw a_nextcode+2(%0), %%dx\n" " shldw %%cl, %%dx, a_code(%0)\n" " shll %%cl, a_nextcode(%0)\n" " subl %%ecx, a_nextbits(%0)\n" " andw $0x8000, %%ax\n" " xorw %%ax, a_code(%0)\n" " xorw %%ax, a_range(%0)\n" " xorw %%ax, a_range+2(%0)\n" " cmpw $3, %%cx\n" " jge .Lfixup_loop\n" ".Lfixup_nextcode:\n" " movl $24, %%ecx\n" " subl a_nextbits(%0), %%ecx\n" " jb .Lfixup_done\n" " movl a_dataptr(%0), %%eax\n" " cmpl a_maxdataptr(%0), %%eax\n" " jge .Lpast_end\n" " movzbl 0(%%eax), %%edx\n" " jmp .Lcont\n" ".Lpast_end:\n" " movl $0xff, %%edx\n" ".Lcont:\n" " shll %%cl, %%edx\n" " orl %%edx, a_nextcode(%0)\n" " addl $8, a_nextbits(%0)\n" " addl $1, a_dataptr(%0)\n" " addl $1, a_offset(%0)\n" " jmp .Lfixup_nextcode\n" ".Lfixup_done:\n" : : "r" (arith), "r" (context) : "eax", "ecx", "edx", "memory"); return arith->value; } schroedinger-1.0.11/schroedinger/schromotionest.h0000644000175000017500000001351311541755167017113 00000000000000 #ifndef __SCHRO_MOTIONEST_H__ #define __SCHRO_MOTIONEST_H__ #include SCHRO_BEGIN_DECLS typedef struct _SchroMotionEst SchroMotionEst; typedef struct _SchroRoughME SchroRoughME; typedef struct _SchroBlock SchroBlock; /* supports hierarchical block-matching motion estimation */ typedef struct _SchroHierBm SchroHierBm; /* supports motion estimation */ typedef struct _SchroMe SchroMe; #ifdef SCHRO_ENABLE_UNSTABLE_API #define SCHRO_MAX_HIER_LEVELS 8 struct _SchroHierBm { int ref_count; int ref; int hierarchy_levels; SchroParams* params; SchroFrame** downsampled_src; SchroFrame** downsampled_ref; SchroMotionField** downsampled_mf; schro_bool use_chroma; }; struct _SchroMotionEst { SchroEncoderFrame *encoder_frame; SchroParams *params; double lambda; SchroFrame *downsampled_src0[SCHRO_MAX_HIER_LEVELS]; SchroFrame *downsampled_src1[SCHRO_MAX_HIER_LEVELS]; SchroMotion *motion; int scan_distance; int badblocks; double hier_score; }; struct _SchroRoughME { SchroEncoderFrame *encoder_frame; SchroEncoderFrame *ref_frame; SchroMotionField *motion_fields[SCHRO_MAX_HIER_LEVELS]; }; struct _SchroBlock { int valid; int error; int entropy; double score; SchroMotionVector mv[4][4]; }; SchroMotionEst *schro_motionest_new (SchroEncoderFrame *frame); void schro_motionest_free (SchroMotionEst *me); SchroRoughME * schro_rough_me_new (SchroEncoderFrame *frame, SchroEncoderFrame *ref); void schro_rough_me_free (SchroRoughME *rme); void schro_rough_me_heirarchical_scan (SchroRoughME *rme); void schro_rough_me_heirarchical_scan_nohint (SchroRoughME *rme, int shift, int distance); void schro_rough_me_heirarchical_scan_hint (SchroRoughME *rme, int shift, int distance); void schro_encoder_hierarchical_block_matching (SchroEncoderFrame* frame); void schro_encoder_motion_predict_rough (SchroEncoderFrame *frame); void schro_encoder_motion_predict_pel (SchroEncoderFrame *frame); void schro_encoder_motion_predict_subpel (SchroEncoderFrame *frame); void schro_encoder_motion_predict_subpel_deep (SchroMe *me); void schro_encoder_global_estimation (SchroEncoderFrame *frame); SchroMotionField * schro_motion_field_new (int x_num_blocks, int y_num_blocks); void schro_motion_field_free (SchroMotionField *field); void schro_motion_field_scan (SchroMotionField *field, SchroParams *params, SchroFrame *frame, SchroFrame *ref, int dist); void schro_motion_field_inherit (SchroMotionField *field, SchroMotionField *parent); void schro_motion_field_copy (SchroMotionField *field, SchroMotionField *parent); void schro_motion_field_set (SchroMotionField *field, int split, int pred_mode); int schro_frame_get_metric (SchroFrame *frame1, int x1, int y1, SchroFrame *frame2, int x2, int y2); void schro_motion_field_lshift (SchroMotionField *mf, int n); int schro_motion_estimate_entropy (SchroMotion *motion); int schro_motion_block_estimate_entropy (SchroMotion *motion, int i, int j); int schro_motion_superblock_estimate_entropy (SchroMotion *motion, int i, int j); int schro_motion_superblock_try_estimate_entropy (SchroMotion *motion, int i, int j, SchroBlock *block); int schro_motionest_superblock_get_metric (SchroMotionEst *me, SchroBlock *block, int i, int j); void schro_motion_copy_from (SchroMotion *motion, int i, int j, SchroBlock *block); void schro_motion_copy_to (SchroMotion *motion, int i, int j, SchroBlock *block); void schro_block_fixup (SchroBlock *block); int schro_block_check (SchroBlock *block); /* SchroHierBm *interface */ SchroHierBm *schro_hbm_new ( SchroEncoderFrame* frame, int ref_number ); SchroHierBm *schro_hbm_ref ( SchroHierBm *schro_hbm ); void schro_hbm_unref ( SchroHierBm* schro_hbm ); void schro_hbm_scan ( SchroHierBm *schro_hbm ); void schro_hierarchical_bm_scan_hint ( SchroHierBm *schro_hbm, int shift, int h_range ); SchroMotionField* schro_hbm_best_mf ( SchroHierBm *schro_hbm ); SchroMotionField* schro_hbm_motion_field ( SchroHierBm *schro_hbm, int level); /* SchroMe interface */ SchroMe *schro_me_new (SchroEncoderFrame* framer ); void schro_me_free (SchroMe* me ); SchroFrame* schro_me_src (SchroMe *me ); SchroUpsampledFrame* schro_me_ref (SchroMe *me, int ref_number ); SchroMotionField* schro_me_subpel_mf ( SchroMe *me, int ref_number ); void schro_me_set_subpel_mf ( SchroMe *me, SchroMotionField* mf, int ref_number ); SchroMotionField* schro_me_split2_mf ( SchroMe *me, int ref_number ); void schro_me_set_split2_mf ( SchroMe *me, SchroMotionField* mf, int ref_number ); SchroMotionField* schro_me_split1_mf ( SchroMe *me, int ref_number ); void schro_me_set_split1_mf ( SchroMe *me, SchroMotionField* mf, int ref_number ); SchroMotionField* schro_me_split0_mf ( SchroMe *me, int ref_number ); void schro_me_set_split0_mf ( SchroMe *me, SchroMotionField* mf, int ref_number ); SchroHierBm *schro_me_hbm (SchroMe *me, int ref_number); void schro_me_set_lambda ( SchroMe *me, double lambda ); double schro_me_lambda ( SchroMe *me ); SchroParams* schro_me_params ( SchroMe *me ); SchroMotion* schro_me_motion ( SchroMe *me ); void schro_me_set_motion ( SchroMe *me, SchroMotion* motion ); void schro_me_set_mc_error ( SchroMe *me, double mc_err ); double schro_me_mc_error ( SchroMe *me ); void schro_me_set_badblock_ratio ( SchroMe *me, double badblocks_ratio ); double schro_me_badblocks_ratio ( SchroMe *me ); void schro_me_set_dcblock_ratio ( SchroMe *me, double dcblock_ratio ); double schro_me_dcblock_ratio ( SchroMe *me ); void schro_mode_decision (SchroMe *me); void schro_motion_calculate_stats (SchroMotion *motion, SchroEncoderFrame *frame); void schro_motionest_superblock_phasecorr1 (SchroMotionEst *me, int ref, SchroBlock *block, int i, int j); void schro_motionest_superblock_global (SchroMotionEst *me, int ref, SchroBlock *block, int i, int j); #endif SCHRO_END_DECLS #endif schroedinger-1.0.11/schroedinger/schroencoder.h0000644000175000017500000003737711704360050016507 00000000000000 #ifndef __SCHRO_ENCODER_H__ #define __SCHRO_ENCODER_H__ #include #include #include #include #include #include #include #include #include #include SCHRO_BEGIN_DECLS typedef struct _SchroEncoder SchroEncoder; typedef struct _SchroEncoderFrame SchroEncoderFrame; typedef struct _SchroEncoderSetting SchroEncoderSetting; typedef enum { SCHRO_STATE_NEED_FRAME, SCHRO_STATE_HAVE_BUFFER, SCHRO_STATE_AGAIN, SCHRO_STATE_END_OF_STREAM } SchroStateEnum; #ifdef SCHRO_ENABLE_UNSTABLE_API typedef enum { SCHRO_ENCODER_FRAME_STAGE_NEW = 0, SCHRO_ENCODER_FRAME_STAGE_ANALYSE, SCHRO_ENCODER_FRAME_STAGE_SC_DETECT_1, SCHRO_ENCODER_FRAME_STAGE_SC_DETECT_2, SCHRO_ENCODER_FRAME_STAGE_HAVE_GOP, SCHRO_ENCODER_FRAME_STAGE_HAVE_PARAMS, SCHRO_ENCODER_FRAME_STAGE_PREDICT_ROUGH, SCHRO_ENCODER_FRAME_STAGE_PREDICT_PEL, SCHRO_ENCODER_FRAME_STAGE_PREDICT_SUBPEL, SCHRO_ENCODER_FRAME_STAGE_MODE_DECISION, SCHRO_ENCODER_FRAME_STAGE_HAVE_REFS, SCHRO_ENCODER_FRAME_STAGE_HAVE_QUANTS, SCHRO_ENCODER_FRAME_STAGE_ENCODING, SCHRO_ENCODER_FRAME_STAGE_RECONSTRUCT, SCHRO_ENCODER_FRAME_STAGE_POSTANALYSE, SCHRO_ENCODER_FRAME_STAGE_DONE, SCHRO_ENCODER_FRAME_STAGE_FREE, SCHRO_ENCODER_FRAME_STAGE_LAST /* this should be last */ } SchroEncoderFrameStateEnum; #endif typedef enum { SCHRO_ENCODER_PERCEPTUAL_CONSTANT, SCHRO_ENCODER_PERCEPTUAL_CCIR959, SCHRO_ENCODER_PERCEPTUAL_MOO, SCHRO_ENCODER_PERCEPTUAL_MANOS_SAKRISON } SchroEncoderPerceptualEnum; typedef enum { SCHRO_ENCODER_RATE_CONTROL_CONSTANT_NOISE_THRESHOLD, SCHRO_ENCODER_RATE_CONTROL_CONSTANT_BITRATE, SCHRO_ENCODER_RATE_CONTROL_LOW_DELAY, SCHRO_ENCODER_RATE_CONTROL_LOSSLESS, SCHRO_ENCODER_RATE_CONTROL_CONSTANT_LAMBDA, SCHRO_ENCODER_RATE_CONTROL_CONSTANT_ERROR, SCHRO_ENCODER_RATE_CONTROL_CONSTANT_QUALITY } SchroEncoderRateControlEnum; typedef enum { SCHRO_ENCODER_GOP_ADAPTIVE, SCHRO_ENCODER_GOP_INTRA_ONLY, SCHRO_ENCODER_GOP_BACKREF, SCHRO_ENCODER_GOP_CHAINED_BACKREF, SCHRO_ENCODER_GOP_BIREF, SCHRO_ENCODER_GOP_CHAINED_BIREF, } SchroEncoderGOPEnum; typedef enum { SCHRO_ENCODER_PROFILE_AUTO, SCHRO_ENCODER_PROFILE_VC2_LOW_DELAY, SCHRO_ENCODER_PROFILE_VC2_SIMPLE, SCHRO_ENCODER_PROFILE_VC2_MAIN, SCHRO_ENCODER_PROFILE_MAIN } SchroEncoderProfile; #ifdef SCHRO_ENABLE_UNSTABLE_API typedef int (*SchroEngineIterateFunc) (SchroEncoder *encoder); /* forward declaration */ struct _SchroMotionEst; struct _SchroRoughME; struct _SchroEncoderFrame { /*< private >*/ int refcount; //SchroEncoderFrameStateEnum state; //SchroEncoderFrameStateEnum needed_state; SchroEncoderFrameStateEnum working; int busy; void *priv; unsigned int expired_reference; /* Bits telling the engine stages which stuff needs to happen */ unsigned int need_extension; unsigned int need_downsampling; unsigned int need_upsampling; unsigned int need_filtering; unsigned int need_average_luma; unsigned int need_mad; /* bits indicating that a particular analysis has happened. Mainly * for verification */ unsigned int have_estimate_tables; unsigned int have_histograms; unsigned int have_scene_change_score; unsigned int have_downsampling; unsigned int have_upsampling; unsigned int have_average_luma; unsigned int have_mad; SchroAsyncStage stages[SCHRO_ENCODER_FRAME_STAGE_LAST]; /* other stuff */ int start_sequence_header; int gop_length; SchroPictureNumber frame_number; SchroFrame *original_frame; SchroFrame *filtered_frame; SchroFrame *downsampled_frames[8]; SchroUpsampledFrame *reconstructed_frame; SchroUpsampledFrame *upsampled_original_frame; int sc_mad; /* shot change mean absolute difference */ double sc_threshold; /* shot change threshold */ SchroBuffer *sequence_header_buffer; SchroList *inserted_buffers; int output_buffer_size; SchroBuffer *output_buffer; int presentation_frame; int slot; int last_frame; int is_ref; int num_refs; SchroPictureNumber picture_number_ref[2]; SchroPictureNumber retired_picture_number; int16_t slice_y_dc_values[100]; int16_t slice_u_dc_values[100]; int16_t slice_v_dc_values[100]; int slice_y_n; int slice_uv_n; int slice_y_bits; int slice_uv_bits; int slice_y_trailing_zeros; int slice_uv_trailing_zeros; SchroFrameData luma_subbands[SCHRO_LIMIT_SUBBANDS]; SchroFrameData chroma1_subbands[SCHRO_LIMIT_SUBBANDS]; SchroFrameData chroma2_subbands[SCHRO_LIMIT_SUBBANDS]; /* from the old SchroEncoderTask */ int stats_dc; int stats_global; int stats_motion; int subband_size; SchroBuffer *subband_buffer; int16_t *quant_data; int *quant_indices[3][SCHRO_LIMIT_SUBBANDS]; double est_entropy[3][SCHRO_LIMIT_SUBBANDS][60]; double actual_subband_bits[3][SCHRO_LIMIT_SUBBANDS]; double est_error[3][SCHRO_LIMIT_SUBBANDS][60]; SchroPack *pack; SchroParams params; SchroEncoder *encoder; SchroFrame *iwt_frame; SchroFrame *quant_frame; SchroFrame *prediction_frame; SchroEncoderFrame *previous_frame; SchroEncoderFrame *ref_frame[2]; struct _SchroMotionEst *me; struct _SchroRoughME *rme[2]; struct _SchroPhaseCorr *phasecorr[2]; struct _SchroHierBm *hier_bm[2]; struct _SchroMe *deep_me; SchroMotion *motion; SchroHistogram subband_hists[3][SCHRO_LIMIT_SUBBANDS]; SchroHistogram hist_test; /* statistics */ double picture_weight; double scene_change_score; double average_luma; int hard_limit_bits; int allocated_residual_bits; int allocated_mc_bits; double frame_lambda; double frame_me_lambda; int estimated_residual_bits; int estimated_mc_bits; int actual_residual_bits; int actual_mc_bits; double mc_error; double mean_squared_error_luma; double mean_squared_error_chroma; double mssim; double estimated_arith_context_ratio; double badblock_ratio; double dcblock_ratio; double hist_slope; }; struct _SchroEncoder { /*< private >*/ SchroAsync *async; SchroPictureNumber next_frame_number; SchroQueue *frame_queue; SchroEncoderFrame *reference_pictures[SCHRO_LIMIT_REFERENCE_FRAMES]; SchroEncoderFrame *last_frame; int assemble_packets; int need_rap; SchroVideoFormat video_format; int version_major; int version_minor; int bit_depth; int input_frame_depth; int intermediate_frame_depth; /* configuration */ int rate_control; int bitrate; int max_bitrate; int min_bitrate; // Buffer model parameters for CBR and (TODO) constrained VBR coding int buffer_size; int buffer_level; double quality; double noise_threshold; int gop_structure; int queue_depth; int perceptual_weighting; double perceptual_distance; int filtering; double filter_value; SchroEncoderProfile force_profile; int profile; int level; int open_gop; int au_distance; int max_refs; schro_bool enable_psnr; schro_bool enable_ssim; schro_bool enable_md5; int transform_depth; int intra_wavelet; int inter_wavelet; int mv_precision; int motion_block_size; int motion_block_overlap; schro_bool interlaced_coding; schro_bool enable_internal_testing; schro_bool enable_noarith; schro_bool enable_fullscan_estimation; schro_bool enable_hierarchical_estimation; schro_bool enable_zero_estimation; schro_bool enable_phasecorr_estimation; schro_bool enable_bigblock_estimation; schro_bool enable_multiquant; schro_bool enable_dc_multiquant; schro_bool enable_global_motion; schro_bool enable_scene_change_detection; schro_bool enable_deep_estimation; schro_bool enable_rdo_cbr; schro_bool enable_chroma_me; int horiz_slices; int vert_slices; int codeblock_size; double magic_dc_metric_offset; double magic_subband0_lambda_scale; double magic_chroma_lambda_scale; double magic_nonref_lambda_scale; double magic_I_lambda_scale; double magic_P_lambda_scale; double magic_B_lambda_scale; double magic_me_lambda_scale; double magic_allocation_scale; double magic_inter_cpd_scale; double magic_keyframe_weight; double magic_scene_change_threshold; double magic_inter_p_weight; double magic_inter_b_weight; double magic_me_bailout_limit; double magic_bailout_weight; double magic_error_power; double magic_subgroup_length; double magic_badblock_multiplier_nonref; double magic_badblock_multiplier_ref; double magic_block_search_threshold; double magic_scan_distance; double magic_diagonal_lambda_scale; /* hooks */ void (*init_frame) (SchroEncoderFrame *frame); void (*handle_gop) (SchroEncoder *encoder, int i); int (*setup_frame) (SchroEncoderFrame *frame); int (*handle_quants) (SchroEncoder *encoder, int i); /* other */ int end_of_stream; int end_of_stream_handled; int end_of_stream_pulled; int completed_eos; int prev_offset; int force_sequence_header; SchroPictureNumber au_frame; int next_slot; int output_slot; SchroList *inserted_buffers; int queue_changed; int engine_init; SchroEngineIterateFunc engine_iterate; int quantiser_engine; double start_time; int downsample_levels; /* internal stuff */ double cycles_per_degree_horiz; double cycles_per_degree_vert; double intra_subband_weights[SCHRO_N_WAVELETS][SCHRO_LIMIT_TRANSFORM_DEPTH][SCHRO_LIMIT_SUBBANDS]; double inter_subband_weights[SCHRO_N_WAVELETS][SCHRO_LIMIT_TRANSFORM_DEPTH][SCHRO_LIMIT_SUBBANDS]; SchroHistogramTable intra_hist_tables[60]; /* statistics */ double average_arith_context_ratios_intra[3][SCHRO_LIMIT_SUBBANDS]; double average_arith_context_ratios_inter[3][SCHRO_LIMIT_SUBBANDS]; double frame_stats[21]; /* engine specific stuff */ int bits_per_picture; int subgroup_position; int I_complexity; int P_complexity; int B_complexity; int B_complexity_sum; long int I_frame_alloc; long int P_frame_alloc; long int B_frame_alloc; long int gop_target; // Current qf, from which is derived ... double qf; // lambda to use for intra pictures in CBR mode double intra_cbr_lambda; int gop_picture; int quant_slot; int last_ref; }; #endif typedef enum { SCHRO_ENCODER_SETTING_TYPE_BOOLEAN, SCHRO_ENCODER_SETTING_TYPE_INT, SCHRO_ENCODER_SETTING_TYPE_ENUM, SCHRO_ENCODER_SETTING_TYPE_DOUBLE, SCHRO_ENCODER_SETTING_TYPE_LAST } SchroEncoderSettingTypeEnum; struct _SchroEncoderSetting { const char *name; SchroEncoderSettingTypeEnum type; double min; double max; double default_value; const char **enum_list; }; enum { SCHRO_MOTION_FIELD_HIER_REF0, SCHRO_MOTION_FIELD_HIER1_REF0, SCHRO_MOTION_FIELD_HIER2_REF0, SCHRO_MOTION_FIELD_HIER3_REF0, SCHRO_MOTION_FIELD_HIER_REF1, SCHRO_MOTION_FIELD_HIER1_REF1, SCHRO_MOTION_FIELD_HIER2_REF1, SCHRO_MOTION_FIELD_HIER3_REF1, SCHRO_MOTION_FIELD_PHASECORR_REF0, SCHRO_MOTION_FIELD_PHASECORR_REF1, SCHRO_MOTION_FIELD_DC, SCHRO_MOTION_FIELD_GLOBAL_REF0, SCHRO_MOTION_FIELD_GLOBAL_REF1, SCHRO_MOTION_FIELD_ZERO_REF0, SCHRO_MOTION_FIELD_ZERO_REF1, SCHRO_MOTION_FIELD_FULLSCAN_REF0, SCHRO_MOTION_FIELD_FULLSCAN_REF1, SCHRO_MOTION_FIELD_LAST }; SchroEncoder * schro_encoder_new (void); void schro_encoder_free (SchroEncoder *encoder); SchroVideoFormat * schro_encoder_get_video_format (SchroEncoder *encoder); void schro_encoder_set_video_format (SchroEncoder *encoder, SchroVideoFormat *video_format); void schro_encoder_set_frame_lambda (SchroEncoderFrame* frame); void schro_encoder_end_of_stream (SchroEncoder *encoder); int schro_encoder_push_ready (SchroEncoder *encoder); void schro_encoder_push_frame (SchroEncoder *encoder, SchroFrame *frame); void schro_encoder_push_frame_full (SchroEncoder *encoder, SchroFrame *frame, void *priv); void schro_encoder_force_sequence_header (SchroEncoder *encoder); SchroBuffer * schro_encoder_encode_auxiliary_data (SchroEncoder *encoder, SchroAuxiliaryDataID id, const void *data, int size); void schro_encoder_encode_parse_info (SchroPack *bits, int parse_code); void schro_encoder_insert_buffer (SchroEncoder *encoder, SchroBuffer *buffer); void schro_encoder_frame_insert_buffer (SchroEncoderFrame *frame, SchroBuffer *buffer); void schro_encoder_start (SchroEncoder *encoder); void schro_encoder_set_packet_assembly (SchroEncoder *encoder, int value); SchroStateEnum schro_encoder_wait (SchroEncoder *encoder); SchroBuffer * schro_encoder_pull (SchroEncoder *encoder, int *n_decodable_frames); SchroBuffer * schro_encoder_pull_full (SchroEncoder *encoder, int *presentation_frame, void **priv); SchroBuffer * schro_encoder_encode_sequence_header (SchroEncoder *encoder); int schro_encoder_get_n_settings (void); const SchroEncoderSetting *schro_encoder_get_setting_info (int i); void schro_encoder_setting_set_double (SchroEncoder *encoder, const char *name, double d); double schro_encoder_setting_get_double (SchroEncoder *encoder, const char *name); int schro_encoder_get_frame_stats_size (SchroEncoder *encoder); void schro_encoder_get_frame_stats (SchroEncoder *encoder, double *dest, int n); #ifdef SCHRO_ENABLE_UNSTABLE_API void schro_encoder_set_default_subband_weights (SchroEncoder *encoder); void schro_encoder_calculate_subband_weights (SchroEncoder *encoder, double (*perceptual_weight)(double)); double schro_encoder_perceptual_weight_constant (double cpd); double schro_encoder_perceptual_weight_ccir959 (double cpd); double schro_encoder_perceptual_weight_moo (double cpd); double schro_encoder_perceptual_weight_manos_sakrison (double cpd); void schro_encoder_init_subbands (SchroEncoderFrame *frame); void schro_encoder_encode_subband (SchroEncoderFrame *frame, int component, int index); void schro_encoder_encode_subband_noarith (SchroEncoderFrame *frame, int component, int index); void schro_encoder_analyse_picture (SchroAsyncStage *stage); void schro_encoder_predict_rough_picture (SchroAsyncStage *stage); void schro_encoder_predict_pel_picture (SchroAsyncStage *stage); void schro_encoder_predict_subpel_picture (SchroAsyncStage *stage); void schro_encoder_fullpel_predict_picture (SchroAsyncStage *stage); void schro_encoder_mode_decision (SchroAsyncStage *stage); void schro_encoder_encode_picture (SchroAsyncStage *stage); void schro_encoder_reconstruct_picture (SchroAsyncStage *stage); void schro_encoder_postanalyse_picture (SchroAsyncStage *stage); SchroFrame * schro_encoder_frame_queue_get (SchroEncoder *encoder, SchroPictureNumber frame_number); void schro_encoder_frame_queue_remove (SchroEncoder *encoder, SchroPictureNumber frame_number); SchroEncoderFrame * schro_encoder_reference_get (SchroEncoder *encoder, SchroPictureNumber frame_number); void schro_encoder_encode_picture_header (SchroEncoderFrame *frame); SchroBuffer * schro_encoder_encode_end_of_stream (SchroEncoder *encoder); void schro_encoder_clean_up_transform (SchroEncoderFrame *frame); void schro_encoder_choose_quantisers (SchroEncoderFrame *frame); void schro_encoder_output_push (SchroEncoder *encoder, SchroBuffer *buffer, int slot, int presentation_frame); SchroEncoderFrame * schro_encoder_frame_new (SchroEncoder *encoder); void schro_encoder_frame_ref (SchroEncoderFrame *frame); void schro_encoder_frame_unref (SchroEncoderFrame *frame); int schro_encoder_frame_is_B_frame (SchroEncoderFrame* frame); void schro_encoder_encode_lowdelay_transform_data (SchroEncoderFrame *frame); void schro_encoder_estimate_entropy (SchroEncoderFrame *frame); void schro_encoder_recalculate_allocations (SchroEncoder *encoder); void schro_encoder_calculate_test_info (SchroEncoderFrame *frame); void schro_encoder_init_error_tables (SchroEncoder *encoder); int schro_encoder_frame_get_quant_index (SchroEncoderFrame *frame, int component, int index, int x, int y); void schro_encoder_frame_set_quant_index (SchroEncoderFrame *frame, int component, int index, int x, int y, int quant_index); #endif SCHRO_END_DECLS #endif schroedinger-1.0.11/schroedinger/schrogpuframe.h0000644000175000017500000000224011426074213016657 00000000000000 #ifndef __SCHRO_GPUFRAME_H__ #define __SCHRO_GPUFRAME_H__ #include #include SCHRO_BEGIN_DECLS #ifdef SCHRO_ENABLE_UNSTABLE_API #define SCHRO_FRAME_IS_CUDA(frame) ((frame)->domain && ((frame)->domain->flags & SCHRO_MEMORY_DOMAIN_CUDA)) void schro_gpuframe_to_cpu (SchroFrame *dest, SchroFrame *src); void schro_frame_to_gpu (SchroFrame *dest, SchroFrame *src); void schro_gpuframe_convert (SchroFrame *dest, SchroFrame *src); void schro_gpuframe_add (SchroFrame *dest, SchroFrame *src); void schro_gpuframe_subtract (SchroFrame *dest, SchroFrame *src); void schro_gpuframe_iwt_transform (SchroFrame *frame, SchroParams *params); void schro_gpuframe_inverse_iwt_transform (SchroFrame *frame, SchroParams *params); void schro_gpuframe_compare (SchroFrame *a, SchroFrame *b); void schro_gpuframe_upsample(SchroFrame *dst, SchroFrame *src); SchroUpsampledFrame *schro_upsampled_gpuframe_new(SchroVideoFormat *fmt); void schro_upsampled_gpuframe_upsample(SchroUpsampledFrame *rv); void schro_upsampled_gpuframe_free(SchroUpsampledFrame *x); void schro_gpuframe_zero (SchroFrame *dest); #endif SCHRO_END_DECLS #endif schroedinger-1.0.11/schroedinger/schrohistogram.c0000644000175000017500000002012611541755167017060 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include static int ilogx (int x) { int i = 0; if (x < 0) x = -x; while (x >= 2 << SCHRO_HISTOGRAM_SHIFT) { x >>= 1; i++; } return x + (i << SCHRO_HISTOGRAM_SHIFT); } static int iexpx (int x) { if (x < (1 << SCHRO_HISTOGRAM_SHIFT)) return x; return ((1 << SCHRO_HISTOGRAM_SHIFT) | (x & ((1 << SCHRO_HISTOGRAM_SHIFT) - 1))) << ((x >> SCHRO_HISTOGRAM_SHIFT) - 1); } static int ilogx_size (int i) { if (i < (1 << SCHRO_HISTOGRAM_SHIFT)) return 1; return 1 << ((i >> SCHRO_HISTOGRAM_SHIFT) - 1); } double schro_histogram_get_range (SchroHistogram * hist, int start, int end) { int i; int iend; int size; double x; if (start >= end) return 0; i = ilogx (start); size = ilogx_size (i); x = (double) (iexpx (i + 1) - start) / size * hist->bins[i]; i++; iend = ilogx (end); while (i <= iend) { x += hist->bins[i]; i++; } size = ilogx_size (iend); x -= (double) (iexpx (iend + 1) - end) / size * hist->bins[iend]; return x; } void schro_histogram_table_generate (SchroHistogramTable * table, double (*func) (int value, void *priv), void *priv) { int i; int j; for (i = 0; i < SCHRO_HISTOGRAM_SIZE; i++) { int jmin, jmax; double sum; jmin = iexpx (i); jmax = iexpx (i + 1); sum = 0; for (j = jmin; j < jmax; j++) { sum += func (j, priv); } table->weights[i] = sum / ilogx_size (i); } } double schro_histogram_apply_table (SchroHistogram * hist, SchroHistogramTable * table) { int i; double sum; sum = 0; for (i = 0; i < SCHRO_HISTOGRAM_SIZE; i++) { sum += hist->bins[i] * table->weights[i]; } return sum; } #ifdef unused double schro_histogram_apply_table_range (SchroHistogram * hist, SchroHistogramTable * table, int start, int end) { int i; int iend; int size; double sum; if (start >= end) return 0; i = ilogx (start); size = ilogx_size (i); sum = (double) (iexpx (i + 1) - start) / size * hist->bins[i] * table->weights[i]; i++; iend = ilogx (end); while (i <= iend) { sum += hist->bins[i] * table->weights[i]; i++; } size = ilogx_size (iend); sum -= (double) (iexpx (iend + 1) - end) / size * hist->bins[iend] * table->weights[iend]; return sum; } #endif void schro_histogram_init (SchroHistogram * hist) { memset (hist, 0, sizeof (*hist)); } void schro_histogram_add (SchroHistogram * hist, int value) { hist->bins[ilogx (value)]++; hist->n++; } void schro_histogram_add_array_s16 (SchroHistogram * hist, int16_t * src, int n) { int i; for (i = 0; i < n; i++) { hist->bins[ilogx (src[i])]++; } hist->n += n; } void schro_histogram_scale (SchroHistogram * hist, double scale) { int i; for (i = 0; i < SCHRO_HISTOGRAM_SIZE; i++) { hist->bins[i] *= scale; } hist->n *= scale; } #ifdef unused static double pow2 (int i, void *priv) { return i * i; } double schro_histogram_estimate_noise_level (SchroHistogram * hist) { static SchroHistogramTable table; static int table_inited; int i; int j; int n; double sigma; if (!table_inited) { schro_histogram_table_generate (&table, pow2, NULL); table_inited = TRUE; } sigma = sqrt (schro_histogram_apply_table (hist, &table) / hist->n); SCHRO_DEBUG ("sigma %g", sigma); for (i = 0; i < 5; i++) { j = ceil (sigma * 2.0); n = schro_histogram_get_range (hist, 0, j); sigma = 1.14 * sqrt (schro_histogram_apply_table_range (hist, &table, 0, j) / n); SCHRO_DEBUG ("sigma %g (%d)", sigma, j); } SCHRO_DEBUG ("sigma %g n %d", sigma, n); return sigma; } #endif double schro_histogram_estimate_slope (SchroHistogram * hist) { int i; int n; double x, y; double m_x; double m_y; double m_xx; double m_xy; double ave_x, ave_y; double slope, y0; m_x = 0; m_y = 0; m_xx = 0; m_xy = 0; n = 0; for (i = 0; i < SCHRO_HISTOGRAM_SIZE; i++) { if (i > 0 && hist->bins[i] > 0) { x = sqrt (iexpx (i)); y = log (hist->bins[i] / ilogx_size (i)); m_x += x; m_y += y; m_xy += x * y; m_xx += x * x; n++; } } ave_x = m_x / n; ave_y = m_y / n; slope = (n * m_xy - m_x * m_y) / (n * m_xx - m_x * m_x); y0 = ave_y - slope * ave_x; SCHRO_DEBUG ("n %d slope %g y0 %g", n, slope, y0); #if 0 for (i = 0; i < SCHRO_HISTOGRAM_SIZE; i++) { //if (hist->bins[i]/ilogx_size(i) >= hist->n*0.0003 && // hist->bins[i]/ilogx_size(i) < hist->n*0.03) { if (i > 0 && hist->bins[i] > 0) { x = sqrt (iexpx (i)); y = y0 + slope * x; hist->bins[i] = exp (y) * ilogx_size (i); } } #endif return slope; } double schro_histogram_estimate_entropy (SchroHistogram * hist, int quant_index, int noarith) { #define N 12 double estimated_entropy = 0; double bin[N]; int quant_factor; int i; double post5; quant_factor = schro_table_quant[quant_index]; bin[0] = schro_histogram_get_range (hist, 0, 32000); for (i = 0; i < N; i++) { bin[i] = schro_histogram_get_range (hist, (quant_factor * ((1 << i) - 1) + 3) / 4, 32000); } if (!noarith) { double ones, zeros; /* entropy of sign bit */ estimated_entropy += bin[1]; /* entropy of continue bits */ estimated_entropy += schro_utils_entropy (bin[1], bin[0]); estimated_entropy += schro_utils_entropy (bin[2], bin[1]); estimated_entropy += schro_utils_entropy (bin[3], bin[2]); estimated_entropy += schro_utils_entropy (bin[4], bin[3]); estimated_entropy += schro_utils_entropy (bin[5], bin[4]); post5 = 0; for (i = 6; i < N; i++) { post5 += bin[i]; } estimated_entropy += schro_utils_entropy (post5, post5 + bin[5]); /* data entropy */ ones = schro_histogram_apply_table (hist, (SchroHistogramTable *) (schro_table_onebits_hist_shift3_1_2[quant_index])); zeros = schro_histogram_apply_table (hist, (SchroHistogramTable *) (schro_table_zerobits_hist_shift3_1_2[quant_index])); estimated_entropy += schro_utils_entropy (ones, zeros + ones); } else { double x; /* When the proportion of 0's gets very large, codeblocks are * skipped, dropping the contribution from bin[0]. This is a * gross hack estimate. */ /* proportion of non-zero coefficients */ x = (double) bin[1] / bin[0]; /* probability that a codeblock is entirely zero. 25 (5x5) is the * size of the codeblocks created by init_small_codeblocks, and 0.5 * is a magic factor */ x = 1.0 - exp (-0.5 * 25 * x); /* entropy of first continue bit */ estimated_entropy += x * bin[0] + (1 - x) * bin[1]; /* entropy of sign bit */ estimated_entropy += bin[1]; /* entropy of continue and data bits */ for (i = 1; i < N; i++) { estimated_entropy += 2 * bin[i]; } } return estimated_entropy; } void schro_frame_data_generate_histogram (SchroFrameData * fd, SchroHistogram * hist, int skip) { int j; schro_histogram_init (hist); for (j = 0; j < fd->height; j += skip) { schro_histogram_add_array_s16 (hist, SCHRO_FRAME_DATA_GET_LINE (fd, j), fd->width); } schro_histogram_scale (hist, skip); } void schro_frame_data_generate_histogram_dc_predict (SchroFrameData * fd, SchroHistogram * hist, int skip, int x, int y) { int i, j; int16_t *prev_line; int16_t *line; schro_histogram_init (hist); for (j = 0; j < fd->height; j += skip) { prev_line = SCHRO_FRAME_DATA_GET_LINE (fd, j - 1); line = SCHRO_FRAME_DATA_GET_LINE (fd, j); for (i = 0; i < fd->width; i++) { int pred_value; if (y + j > 0) { if (x + i > 0) { pred_value = schro_divide3 (line[i - 1] + prev_line[i] + prev_line[i - 1] + 1); } else { pred_value = prev_line[i]; } } else { if (x + i > 0) { pred_value = line[i - 1]; } else { pred_value = 0; } } schro_histogram_add (hist, line[i] - pred_value); } } schro_histogram_scale (hist, skip); } schroedinger-1.0.11/schroedinger/schrogpuframe.c0000644000175000017500000007011211541755167016671 00000000000000#ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include "cudawavelet.h" #include "cudaframe.h" #include "cudaupsample.h" #include "cudamotion.h" #include #define CUDA_STREAM 0 int schro_bpp (int format) { int bytes_pp; if (SCHRO_FRAME_IS_PACKED (format)) { switch (format) { case SCHRO_FRAME_FORMAT_YUYV: case SCHRO_FRAME_FORMAT_UYVY: bytes_pp = 2; break; case SCHRO_FRAME_FORMAT_AYUV: bytes_pp = 4; break; default: SCHRO_ASSERT (0); } } else { switch (SCHRO_FRAME_FORMAT_DEPTH (format)) { case SCHRO_FRAME_FORMAT_DEPTH_U8: bytes_pp = 1; break; case SCHRO_FRAME_FORMAT_DEPTH_S16: bytes_pp = 2; break; case SCHRO_FRAME_FORMAT_DEPTH_S32: bytes_pp = 4; break; default: SCHRO_ASSERT (0); bytes_pp = 0; break; } } return bytes_pp; } int schro_components (int format) { int comp; if (SCHRO_FRAME_IS_PACKED (format)) { // packed return 1; } else { // planar return 3; } return comp; } #if 0 SchroFrame * schro_gpuframe_new_clone (SchroFrame * src) { SchroFrame *frame = schro_frame_new (); int i, length; void *ptr; SCHRO_ASSERT (!SCHRO_FRAME_IS_CUDA (src)); frame->format = src->format; frame->width = src->width; frame->height = src->height; length = src->components[0].length + src->components[1].length + src->components[2].length; cudaMalloc ((void **) &frame->gregions[0], length); SCHRO_DEBUG ("schro_gpuframe_new_clone %i %i %i (%i)", frame->format, frame->width, frame->height, length); /** Copy components and allocate space */ ptr = frame->gregions[0]; for (i = 0; i < 3; ++i) { frame->components[i].width = src->components[i].width; frame->components[i].height = src->components[i].height; frame->components[i].stride = src->components[i].stride; frame->components[i].length = src->components[i].length; frame->components[i].v_shift = src->components[i].v_shift; frame->components[i].h_shift = src->components[i].h_shift; if (frame->components[i].length) { frame->components[i].data = ptr; cudaMemcpy (ptr, src->components[i].data, frame->components[i].length, cudaMemcpyHostToDevice); ptr += frame->components[i].length; } } return frame; } void _schro_gpuframe_free (SchroFrame * frame) { if (frame->gregions[0]) { cudaFree (frame->gregions[0]); } } #endif void schro_gpuframe_convert (SchroFrame * dest, SchroFrame * src) { int i; int ret; SCHRO_ASSERT (dest != NULL); SCHRO_ASSERT (src != NULL); SCHRO_ASSERT (SCHRO_FRAME_IS_CUDA (dest)); SCHRO_ASSERT (SCHRO_FRAME_IS_CUDA (src)); SCHRO_DEBUG ("schro_gpuframe_convert %ix%i(format %i) <- %ix%i(format %i)", dest->width, dest->height, dest->format, src->width, src->height, src->format); if ((src->format == SCHRO_FRAME_FORMAT_S16_444 && dest->format == SCHRO_FRAME_FORMAT_U8_444) || (src->format == SCHRO_FRAME_FORMAT_S16_422 && dest->format == SCHRO_FRAME_FORMAT_U8_422) || (src->format == SCHRO_FRAME_FORMAT_S16_420 && dest->format == SCHRO_FRAME_FORMAT_U8_420)) { // S16 to U8 for (i = 0; i < 3; ++i) cuda_convert_u8_s16 (dest->components[i].data, dest->components[i].stride, dest->components[i].width, dest->components[i].height, src->components[i].data, src->components[i].stride, src->components[i].width, src->components[i].height, CUDA_STREAM); } else if ((src->format == SCHRO_FRAME_FORMAT_U8_444 && dest->format == SCHRO_FRAME_FORMAT_S16_444) || (src->format == SCHRO_FRAME_FORMAT_U8_422 && dest->format == SCHRO_FRAME_FORMAT_S16_422) || (src->format == SCHRO_FRAME_FORMAT_U8_420 && dest->format == SCHRO_FRAME_FORMAT_S16_420)) { // U8 to S16 for (i = 0; i < 3; ++i) cuda_convert_s16_u8 (dest->components[i].data, dest->components[i].stride, dest->components[i].width, dest->components[i].height, src->components[i].data, src->components[i].stride, src->components[i].width, src->components[i].height, CUDA_STREAM); } else if ((src->format == SCHRO_FRAME_FORMAT_U8_444 && dest->format == SCHRO_FRAME_FORMAT_U8_444) || (src->format == SCHRO_FRAME_FORMAT_U8_422 && dest->format == SCHRO_FRAME_FORMAT_U8_422) || (src->format == SCHRO_FRAME_FORMAT_U8_420 && dest->format == SCHRO_FRAME_FORMAT_U8_420)) { // U8 to U8 for (i = 0; i < 3; ++i) cuda_convert_u8_u8 (dest->components[i].data, dest->components[i].stride, dest->components[i].width, dest->components[i].height, src->components[i].data, src->components[i].stride, src->components[i].width, src->components[i].height, CUDA_STREAM); } else if ((src->format == SCHRO_FRAME_FORMAT_S16_444 && dest->format == SCHRO_FRAME_FORMAT_S16_444) || (src->format == SCHRO_FRAME_FORMAT_S16_422 && dest->format == SCHRO_FRAME_FORMAT_S16_422) || (src->format == SCHRO_FRAME_FORMAT_S16_420 && dest->format == SCHRO_FRAME_FORMAT_S16_420)) { // S16 to S16 for (i = 0; i < 3; ++i) cuda_convert_s16_s16 (dest->components[i].data, dest->components[i].stride, dest->components[i].width, dest->components[i].height, src->components[i].data, src->components[i].stride, src->components[i].width, src->components[i].height, CUDA_STREAM); } else if (src->format == SCHRO_FRAME_FORMAT_YUYV && dest->format == SCHRO_FRAME_FORMAT_U8_422) { // deinterleave YUYV cuda_convert_u8_422_yuyv (dest->components[0].data, dest->components[0].stride, dest->components[1].data, dest->components[1].stride, dest->components[2].data, dest->components[2].stride, dest->width, dest->height, src->components[0].data, src->components[0].stride, src->width, src->height, CUDA_STREAM); } else if (src->format == SCHRO_FRAME_FORMAT_UYVY && dest->format == SCHRO_FRAME_FORMAT_U8_422) { // deinterleave UYVY cuda_convert_u8_422_uyvy (dest->components[0].data, dest->components[0].stride, dest->components[1].data, dest->components[1].stride, dest->components[2].data, dest->components[2].stride, dest->width, dest->height, src->components[0].data, src->components[0].stride, src->width, src->height, CUDA_STREAM); } else if (src->format == SCHRO_FRAME_FORMAT_AYUV && dest->format == SCHRO_FRAME_FORMAT_U8_444) { // deinterleave AYUV cuda_convert_u8_444_ayuv (dest->components[0].data, dest->components[0].stride, dest->components[1].data, dest->components[1].stride, dest->components[2].data, dest->components[2].stride, dest->width, dest->height, src->components[0].data, src->components[0].stride, src->width, src->height, CUDA_STREAM); } else if (src->format == SCHRO_FRAME_FORMAT_U8_422 && dest->format == SCHRO_FRAME_FORMAT_YUYV) { // interleave YUYV cuda_convert_yuyv_u8_422 (dest->components[0].data, dest->components[0].stride, dest->width, dest->height, src->components[0].data, src->components[0].stride, src->components[1].data, src->components[1].stride, src->components[2].data, src->components[2].stride, src->width, src->height, CUDA_STREAM); } else if (src->format == SCHRO_FRAME_FORMAT_U8_422 && dest->format == SCHRO_FRAME_FORMAT_UYVY) { // interleave UYVY cuda_convert_uyvy_u8_422 (dest->components[0].data, dest->components[0].stride, dest->width, dest->height, src->components[0].data, src->components[0].stride, src->components[1].data, src->components[1].stride, src->components[2].data, src->components[2].stride, src->width, src->height, CUDA_STREAM); } else if (src->format == SCHRO_FRAME_FORMAT_U8_444 && dest->format == SCHRO_FRAME_FORMAT_AYUV) { // interleave AYUV cuda_convert_ayuv_u8_444 (dest->components[0].data, dest->components[0].stride, dest->width, dest->height, src->components[0].data, src->components[0].stride, src->components[1].data, src->components[1].stride, src->components[2].data, src->components[2].stride, src->width, src->height, CUDA_STREAM); } else { SCHRO_ERROR ("conversion unimplemented"); SCHRO_ASSERT (0); } ret = cudaThreadSynchronize (); if (ret != 0) { SCHRO_ERROR ("thread sync %d", ret); } SCHRO_ASSERT (ret == 0); } void schro_gpuframe_add (SchroFrame * dest, SchroFrame * src) { int i; int ret; //SCHRO_ASSERT(schro_async_get_exec_domain () == SCHRO_EXEC_DOMAIN_CUDA); SCHRO_ASSERT (dest != NULL); SCHRO_ASSERT (src != NULL); SCHRO_ASSERT (SCHRO_FRAME_IS_CUDA (dest)); SCHRO_ASSERT (SCHRO_FRAME_IS_CUDA (src)); SCHRO_DEBUG ("schro_gpuframe_add %ix%i(format %i) <- %ix%i(format %i)", dest->width, dest->height, dest->format, src->width, src->height, src->format); if ((src->format == SCHRO_FRAME_FORMAT_U8_444 && dest->format == SCHRO_FRAME_FORMAT_S16_444) || (src->format == SCHRO_FRAME_FORMAT_U8_422 && dest->format == SCHRO_FRAME_FORMAT_S16_422) || (src->format == SCHRO_FRAME_FORMAT_U8_420 && dest->format == SCHRO_FRAME_FORMAT_S16_420)) { // U8 to S16 for (i = 0; i < 3; ++i) cuda_add_s16_u8 (dest->components[i].data, dest->components[i].stride, dest->components[i].width, dest->components[i].height, src->components[i].data, src->components[i].stride, src->components[i].width, src->components[i].height, CUDA_STREAM); } else if ((src->format == SCHRO_FRAME_FORMAT_S16_444 && dest->format == SCHRO_FRAME_FORMAT_S16_444) || (src->format == SCHRO_FRAME_FORMAT_S16_422 && dest->format == SCHRO_FRAME_FORMAT_S16_422) || (src->format == SCHRO_FRAME_FORMAT_S16_420 && dest->format == SCHRO_FRAME_FORMAT_S16_420)) { // S16 to S16 for (i = 0; i < 3; ++i) cuda_add_s16_s16 (dest->components[i].data, dest->components[i].stride, dest->components[i].width, dest->components[i].height, src->components[i].data, src->components[i].stride, src->components[i].width, src->components[i].height, CUDA_STREAM); } else { SCHRO_ERROR ("add function unimplemented"); SCHRO_ASSERT (0); } ret = cudaThreadSynchronize (); if (ret != 0) { SCHRO_ERROR ("thread sync %d", ret); } SCHRO_ASSERT (ret == 0); } void schro_gpuframe_subtract (SchroFrame * dest, SchroFrame * src) { int i; //SCHRO_ASSERT(schro_async_get_exec_domain () == SCHRO_EXEC_DOMAIN_CUDA); SCHRO_ASSERT (dest != NULL); SCHRO_ASSERT (src != NULL); SCHRO_ASSERT (SCHRO_FRAME_IS_CUDA (dest)); SCHRO_ASSERT (SCHRO_FRAME_IS_CUDA (src)); SCHRO_DEBUG ("schro_gpuframe_subtract %ix%i(format %i) <- %ix%i(format %i)", dest->width, dest->height, dest->format, src->width, src->height, src->format); if ((src->format == SCHRO_FRAME_FORMAT_U8_444 && dest->format == SCHRO_FRAME_FORMAT_S16_444) || (src->format == SCHRO_FRAME_FORMAT_U8_422 && dest->format == SCHRO_FRAME_FORMAT_S16_422) || (src->format == SCHRO_FRAME_FORMAT_U8_420 && dest->format == SCHRO_FRAME_FORMAT_S16_420)) { // U8 to S16 for (i = 0; i < 3; ++i) cuda_subtract_s16_u8 (dest->components[i].data, dest->components[i].stride, dest->components[i].width, dest->components[i].height, src->components[i].data, src->components[i].stride, src->components[i].width, src->components[i].height, CUDA_STREAM); } else if ((src->format == SCHRO_FRAME_FORMAT_S16_444 && dest->format == SCHRO_FRAME_FORMAT_S16_444) || (src->format == SCHRO_FRAME_FORMAT_S16_422 && dest->format == SCHRO_FRAME_FORMAT_S16_422) || (src->format == SCHRO_FRAME_FORMAT_S16_420 && dest->format == SCHRO_FRAME_FORMAT_S16_420)) { // S16 to S16 for (i = 0; i < 3; ++i) cuda_subtract_s16_s16 (dest->components[i].data, dest->components[i].stride, dest->components[i].width, dest->components[i].height, src->components[i].data, src->components[i].stride, src->components[i].width, src->components[i].height, CUDA_STREAM); } else { SCHRO_ERROR ("add function unimplemented"); SCHRO_ASSERT (0); } } void schro_gpuframe_iwt_transform (SchroFrame * frame, SchroParams * params) { int16_t *frame_data; int component; int width; int height; int level; //SCHRO_ASSERT(schro_async_get_exec_domain () == SCHRO_EXEC_DOMAIN_CUDA); SCHRO_DEBUG ("schro_gpuframe_iwt_transform %ix%i (%i levels)", frame->width, frame->height, params->transform_depth); SCHRO_ASSERT (SCHRO_FRAME_IS_CUDA (frame)); for (component = 0; component < 3; component++) { SchroFrameData *comp = &frame->components[component]; if (component == 0) { width = params->iwt_luma_width; height = params->iwt_luma_height; } else { width = params->iwt_chroma_width; height = params->iwt_chroma_height; } frame_data = (int16_t *) comp->data; for (level = 0; level < params->transform_depth; level++) { int w; int h; int stride; w = width >> level; h = height >> level; stride = comp->stride << level; cuda_wavelet_transform_2d (params->wavelet_filter_index, frame_data, stride, w, h, CUDA_STREAM); } } } void schro_gpuframe_inverse_iwt_transform (SchroFrame * frame, SchroParams * params) { int16_t *frame_data; int width; int height; int level; int component; int ret; //SCHRO_ASSERT(schro_async_get_exec_domain () == SCHRO_EXEC_DOMAIN_CUDA); SCHRO_DEBUG ("schro_gpuframe_inverse_iwt_transform %ix%i, filter %i, %i levels", frame->width, frame->height, params->wavelet_filter_index, params->transform_depth); #ifdef TEST int16_t *c_data; int x; c_data = schro_malloc (frame->components[0].stride * params->iwt_luma_height); #endif SCHRO_ASSERT (SCHRO_FRAME_IS_CUDA (frame)); for (component = 0; component < 3; component++) { SchroFrameData *comp = &frame->components[component]; if (component == 0) { width = params->iwt_luma_width; height = params->iwt_luma_height; } else { width = params->iwt_chroma_width; height = params->iwt_chroma_height; } frame_data = (int16_t *) comp->data; #ifdef TEST /// Copy frame from GPU cudaMemcpy (c_data, frame_data, height * comp->stride, cudaMemcpyDeviceToHost); for (x = 0; x < width; ++x) { fprintf (stderr, "%i ", c_data[x]); } fprintf (stderr, "\n"); #endif for (level = params->transform_depth - 1; level >= 0; level--) { int w; int h; int stride; w = width >> level; h = height >> level; stride = comp->stride << level; cuda_wavelet_inverse_transform_2d (params->wavelet_filter_index, frame_data, stride, w, h, CUDA_STREAM); } #ifdef TEST /// Copy frame from GPU cudaMemcpy (c_data, frame_data, height * comp->stride, cudaMemcpyDeviceToHost); for (x = 0; x < width; ++x) { fprintf (stderr, "%i ", c_data[x]); } fprintf (stderr, "\n"); fprintf (stderr, "---------------------\n"); #endif } #ifdef TEST schro_free (c_data); #endif ret = cudaThreadSynchronize (); if (ret != 0) { SCHRO_ERROR ("thread sync %d", ret); } SCHRO_ASSERT (ret == 0); } void schro_gpuframe_to_cpu (SchroFrame * dest, SchroFrame * src) { int i; int bpp; int ret; //SCHRO_ASSERT(schro_async_get_exec_domain () == SCHRO_EXEC_DOMAIN_CUDA); SCHRO_ASSERT (SCHRO_FRAME_IS_CUDA (src)); SCHRO_ASSERT (!SCHRO_FRAME_IS_CUDA (dest)); bpp = schro_bpp (dest->format); SCHRO_DEBUG ("schro_gpuframe_to_cpu %ix%i (%d)", dest->width, dest->height); /** Format, components and dimensions must match exactly */ SCHRO_ASSERT (src->format == dest->format); for (i = 0; i < 3; ++i) { if (src->components[i].data) { SCHRO_ASSERT (dest->components[i].data); //SCHRO_ASSERT(dest->components[i].stride==src->components[i].stride && dest->components[i].length==src->components[i].length); SCHRO_ASSERT (dest->components[i].width == src->components[i].width && dest->components[i].height == src->components[i].height); } } /** If the buffer is consecutive, move it in one pass */ if (src->components[1].data == (src->components[0].data + src->components[0].length) && src->components[2].data == (src->components[1].data + src->components[1].length) && dest->components[1].data == (dest->components[0].data + dest->components[0].length) && dest->components[2].data == (dest->components[1].data + dest->components[1].length) && src->components[0].length == dest->components[0].length && src->components[1].length == dest->components[1].length && src->components[2].length == dest->components[2].length) { SCHRO_DEBUG ("consecutive %i+%i+%i", src->components[0].length, src->components[1].length, src->components[2].length); cudaMemcpy (dest->components[0].data, src->components[0].data, src->components[0].length + src->components[1].length + src->components[2].length, cudaMemcpyDeviceToHost); } else { for (i = 0; i < 3; ++i) { if (src->components[i].data) { SCHRO_DEBUG ("component %i: %p %i %p %i %i %i", i, dest->components[i].data, dest->components[i].stride, src->components[i].data, src->components[i].stride, src->components[i].width * bpp, src->components[i].height); cudaMemcpy2D (dest->components[i].data, dest->components[i].stride, src->components[i].data, src->components[i].stride, src->components[i].width * bpp, src->components[i].height, cudaMemcpyDeviceToHost); } } } ret = cudaThreadSynchronize (); if (ret != 0) { SCHRO_ERROR ("thread sync %d", ret); } SCHRO_ASSERT (ret == 0); } void schro_frame_to_gpu (SchroFrame * dest, SchroFrame * src) { int i; int bpp; int ret; //SCHRO_ASSERT(schro_async_get_exec_domain () == SCHRO_EXEC_DOMAIN_CUDA); SCHRO_ASSERT (!SCHRO_FRAME_IS_CUDA (src)); SCHRO_ASSERT (SCHRO_FRAME_IS_CUDA (dest)); bpp = schro_bpp (dest->format); SCHRO_DEBUG ("schro_frame_to_gpu %ix%i (%d)", dest->width, dest->height); /** Format, components and dimensions must match exactly */ SCHRO_ASSERT (src->format == dest->format); for (i = 0; i < 3; ++i) { if (src->components[i].data) { SCHRO_ASSERT (dest->components[i].data); //SCHRO_ASSERT(dest->components[i].stride==src->components[i].stride && dest->components[i].length==src->components[i].length); SCHRO_ASSERT (dest->components[i].width == src->components[i].width && dest->components[i].height == src->components[i].height); } } /** If the buffer is consecutive, move it in one pass */ if (src->components[1].data == (src->components[0].data + src->components[0].length) && src->components[2].data == (src->components[1].data + src->components[1].length) && dest->components[1].data == (dest->components[0].data + dest->components[0].length) && dest->components[2].data == (dest->components[1].data + dest->components[1].length) && src->components[0].length == dest->components[0].length && src->components[1].length == dest->components[1].length && src->components[2].length == dest->components[2].length) { SCHRO_DEBUG ("consecutive %i+%i+%i", src->components[0].length, src->components[1].length, src->components[2].length); cudaMemcpy (dest->components[0].data, src->components[0].data, src->components[0].length + src->components[1].length + src->components[2].length, cudaMemcpyHostToDevice); } else { for (i = 0; i < 3; ++i) { if (src->components[i].data) { //cudaMemcpy(dest->components[i].data, src->components[i].data, src->components[i].length, cudaMemcpyHostToDevice); SCHRO_DEBUG ("component %i: %p %i %p %i %i %i", i, dest->components[i].data, dest->components[i].stride, src->components[i].data, src->components[i].stride, src->components[i].width * bpp, src->components[i].height); cudaMemcpy2D (dest->components[i].data, dest->components[i].stride, src->components[i].data, src->components[i].stride, src->components[i].width * bpp, src->components[i].height, cudaMemcpyHostToDevice); } } } ret = cudaThreadSynchronize (); if (ret != 0) { SCHRO_ERROR ("thread sync %d", ret); } SCHRO_ASSERT (ret == 0); } void schro_gpuframe_compare (SchroFrame * a, SchroFrame * b) { void *temp; int i, bpp; SCHRO_ASSERT (a->format == b->format); /// Temp buffer temp = schro_malloc (b->components[0].length); bpp = schro_bpp (a->format); SCHRO_ASSERT (SCHRO_FRAME_IS_CUDA (a)); SCHRO_ASSERT (!SCHRO_FRAME_IS_CUDA (b)); SCHRO_DEBUG ("schro_gpuframe_compare %ix%ix%i", a->width, a->height, bpp); for (i = 0; i < 3; ++i) { int y; if (a->components[i].data == NULL) continue; SCHRO_ASSERT (a->components[i].length <= a->components[0].length); SCHRO_ASSERT (a->components[i].length == b->components[i].length && a->components[i].width == b->components[i].width); cudaMemcpy (temp, a->components[i].data, a->components[i].length, cudaMemcpyDeviceToHost); for (y = 0; y < a->components[i].height; ++y) { void *bofs = b->components[i].data + y * b->components[i].stride; void *aofs = temp + y * a->components[i].stride; int diff = memcmp (bofs, aofs, a->components[i].width * bpp); if (diff != 0) { int x; for (x = 0; x < a->components[i].width; ++x) { fprintf (stderr, "%i ", ((int16_t *) aofs)[x]); } fprintf (stderr, "\n"); for (x = 0; x < a->components[i].width; ++x) { fprintf (stderr, "%i ", ((int16_t *) bofs)[x]); } fprintf (stderr, "\n"); SCHRO_ERROR ("Error on line %i of component %i", y, i); } SCHRO_ASSERT (diff == 0); } } schro_free (temp); } void schro_gpuframe_zero (SchroFrame * dest) { int i; SCHRO_ASSERT (SCHRO_FRAME_IS_CUDA (dest)); /** If the buffer is consecutive, fill it in one pass */ if (dest->components[1].data == (dest->components[0].data + dest->components[0].length) && dest->components[2].data == (dest->components[1].data + dest->components[1].length)) { cudaMemset (dest->components[0].data, 0, dest->components[0].length + dest->components[1].length + dest->components[2].length); } else { /** Otherwise, fill per component */ for (i = 0; i < 3; ++i) { if (dest->components[i].data) cudaMemset (dest->components[i].data, 0, dest->components[i].length); } } } void schro_gpuframe_upsample (SchroFrame * dst, SchroFrame * src) { int i; SCHRO_ASSERT (SCHRO_FRAME_IS_CUDA (dst)); SCHRO_ASSERT (SCHRO_FRAME_IS_CUDA (src)); SCHRO_ASSERT (dst->width == src->width * 2 && dst->height == src->height * 2); SCHRO_ASSERT (SCHRO_FRAME_FORMAT_DEPTH (src->format) == SCHRO_FRAME_FORMAT_DEPTH_U8); SCHRO_ASSERT (src->format == dst->format); for (i = 0; i < 3; ++i) { uint8_t *dst_data = (uint8_t *) dst->components[i].data; int dst_stride = dst->components[i].stride; uint8_t *src_data = (uint8_t *) src->components[i].data; int src_stride = src->components[i].stride; int width = src->components[i].width; int height = src->components[i].height; cuda_upsample_horizontal (dst_data, dst_stride * 2, src_data, src_stride, width, height, CUDA_STREAM); cuda_upsample_vertical (dst_data + dst_stride, dst_stride * 2, dst_data, dst_stride * 2, width * 2, height, CUDA_STREAM); } } SchroUpsampledFrame * schro_upsampled_gpuframe_new (SchroVideoFormat * fmt) { SchroUpsampledFrame *rv; SCHRO_DEBUG ("schro_upsampled_gpuframe_new"); rv = schro_malloc0 (sizeof (SchroUpsampledFrame)); return rv; } void schro_upsampled_gpuframe_upsample (SchroUpsampledFrame * uf) { struct cudaChannelFormatDesc channelDesc = cudaCreateChannelDesc (8, 0, 0, 0, cudaChannelFormatKindUnsigned); SchroFrame *tmp_frame; SchroFrame *src = uf->frames[0]; struct cudaArray *ca; int k; //SCHRO_ASSERT(schro_async_get_exec_domain () == SCHRO_EXEC_DOMAIN_CUDA); SCHRO_ASSERT (SCHRO_FRAME_IS_CUDA (src)); tmp_frame = schro_frame_new_and_alloc (src->domain, src->format, src->width * 2, src->height * 2); /** Make an 8 bit texture for each component */ for (k = 0; k < 3; k++) { cudaMallocArray (&ca, &channelDesc, src->components[k].width * 2, src->components[k].height * 2); uf->components[k] = ca; } /** Temporary texture must have two times the size of a frame in each dimension */ schro_gpuframe_upsample (tmp_frame, src); /** Copy data to texture */ for (k = 0; k < 3; k++) { cudaMemcpy2DToArray (uf->components[k], 0, 0, tmp_frame->components[k].data, tmp_frame->components[k].stride, tmp_frame->components[k].width, tmp_frame->components[k].height, cudaMemcpyDeviceToDevice); } schro_frame_unref (tmp_frame); } void schro_upsampled_gpuframe_free (SchroUpsampledFrame * x) { int i; SCHRO_DEBUG ("schro_upsampled_gpuframe_free -- freed"); for (i = 0; i < 3; ++i) cudaFreeArray (x->components[i]); //active --; schro_free (x); //SCHRO_DEBUG("active is now %i", active); } #if 0 SchroFrame * schro_frame_new_and_alloc_locked (SchroFrameFormat format, int width, int height) { SchroFrame *frame = schro_frame_new (); int bytes_pp; int h_shift, v_shift; int chroma_width; int chroma_height; SCHRO_ASSERT (width > 0); SCHRO_ASSERT (height > 0); /* FIXME this function allocates with cudaMallocHost() but doesn't * set the free() function, which means it will be freed using free(). */ frame->format = format; frame->width = width; frame->height = height; frame->is_cuda_frame = FALSE; frame->is_cuda_shared = TRUE; switch (SCHRO_FRAME_FORMAT_DEPTH (format)) { case SCHRO_FRAME_FORMAT_DEPTH_U8: bytes_pp = 1; break; case SCHRO_FRAME_FORMAT_DEPTH_S16: bytes_pp = 2; break; case SCHRO_FRAME_FORMAT_DEPTH_S32: bytes_pp = 4; break; default: SCHRO_ASSERT (0); bytes_pp = 0; break; } h_shift = SCHRO_FRAME_FORMAT_H_SHIFT (format); v_shift = SCHRO_FRAME_FORMAT_V_SHIFT (format); chroma_width = ROUND_UP_SHIFT (width, h_shift); chroma_height = ROUND_UP_SHIFT (height, v_shift); frame->components[0].width = width; frame->components[0].height = height; frame->components[0].stride = ROUND_UP_64 (width * bytes_pp); frame->components[0].length = frame->components[0].stride * frame->components[0].height; frame->components[0].v_shift = 0; frame->components[0].h_shift = 0; frame->components[1].width = chroma_width; frame->components[1].height = chroma_height; frame->components[1].stride = ROUND_UP_64 (chroma_width * bytes_pp); frame->components[1].length = frame->components[1].stride * frame->components[1].height; frame->components[1].v_shift = v_shift; frame->components[1].h_shift = h_shift; frame->components[2].width = chroma_width; frame->components[2].height = chroma_height; frame->components[2].stride = ROUND_UP_64 (chroma_width * bytes_pp); frame->components[2].length = frame->components[2].stride * frame->components[2].height; frame->components[2].v_shift = v_shift; frame->components[2].h_shift = h_shift; cudaMallocHost ((void **) &frame->regions[0], frame->components[0].length + frame->components[1].length + frame->components[2].length); //frame->regions[0] = schro_malloc (frame->components[0].length + // frame->components[1].length + frame->components[2].length); frame->components[0].data = frame->regions[0]; frame->components[1].data = frame->components[0].data + frame->components[0].length; frame->components[2].data = frame->components[1].data + frame->components[1].length; return frame; } #endif schroedinger-1.0.11/schroedinger/schrobuffer.h0000644000175000017500000000173711320237456016337 00000000000000 #ifndef __SCHRO_BUFFER_H__ #define __SCHRO_BUFFER_H__ #include SCHRO_BEGIN_DECLS typedef struct _SchroBuffer SchroBuffer; typedef struct _SchroTag SchroTag; struct _SchroBuffer { /*< private >*/ unsigned char *data; unsigned int length; int ref_count; SchroBuffer *parent; void (*free) (SchroBuffer *, void *); void *priv; SchroTag* tag; }; struct _SchroTag { void (*free) (void *); void *value; }; SchroBuffer *schro_buffer_new (void); SchroBuffer *schro_buffer_new_and_alloc (int size); SchroBuffer *schro_buffer_new_with_data (void *data, int size); SchroBuffer *schro_buffer_new_subbuffer (SchroBuffer * buffer, int offset, int length); SchroBuffer *schro_buffer_dup (SchroBuffer * buffer); SchroBuffer * schro_buffer_ref (SchroBuffer * buffer); void schro_buffer_unref (SchroBuffer * buffer); SchroTag *schro_tag_new (void *value, void (*free_func) (void *)); void schro_tag_free (SchroTag *tag); SCHRO_END_DECLS #endif schroedinger-1.0.11/schroedinger/schrohistogram.h0000644000175000017500000000333611320237456017060 00000000000000 #ifndef __SCHRO_SCHRO_HISTOGRAM_H__ #define __SCHRO_SCHRO_HISTOGRAM_H__ #include #include SCHRO_BEGIN_DECLS #define SCHRO_HISTOGRAM_SHIFT 3 #define SCHRO_HISTOGRAM_SIZE ((16-SCHRO_HISTOGRAM_SHIFT)*(1<*/ int n; double bins[SCHRO_HISTOGRAM_SIZE]; }; struct _SchroHistogramTable { /*< private >*/ double weights[SCHRO_HISTOGRAM_SIZE]; }; #ifdef SCHRO_ENABLE_UNSTABLE_API double schro_histogram_get_range (SchroHistogram *hist, int start, int end); void schro_histogram_init (SchroHistogram *hist); void schro_histogram_add (SchroHistogram *hist, int value); void schro_histogram_add_array_s16 (SchroHistogram *hist, int16_t *src, int n); void schro_histogram_scale (SchroHistogram *hist, double scale); void schro_histogram_table_generate (SchroHistogramTable *table, double (*func)(int value, void *priv), void *priv); double schro_histogram_apply_table (SchroHistogram *hist, SchroHistogramTable *table); double schro_histogram_apply_table_range (SchroHistogram *hist, SchroHistogramTable *table, int start, int end); double schro_histogram_estimate_noise_level (SchroHistogram *hist); double schro_histogram_estimate_slope (SchroHistogram *hist); double schro_histogram_estimate_entropy (SchroHistogram *hist, int quant_index, int noarith); void schro_frame_data_generate_histogram (SchroFrameData *fd, SchroHistogram *hist, int skip); void schro_frame_data_generate_histogram_dc_predict (SchroFrameData *fd, SchroHistogram *hist, int skip, int x, int y); #endif SCHRO_END_DECLS #endif schroedinger-1.0.11/schroedinger/schroroughmotion.c0000644000175000017500000002113511541755167017436 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #define DC_BIAS 50 #define DC_METRIC 50 #define BIDIR_LIMIT (10*8*8) #define SCHRO_METRIC_INVALID_2 0x7fffffff #define motion_field_get(mf,x,y) \ ((mf)->motion_vectors + (y)*(mf)->x_num_blocks + (x)) static SchroFrame *get_downsampled (SchroEncoderFrame * frame, int i); SchroRoughME * schro_rough_me_new (SchroEncoderFrame * frame, SchroEncoderFrame * ref) { SchroRoughME *rme; rme = schro_malloc0 (sizeof (SchroRoughME)); rme->encoder_frame = frame; rme->ref_frame = ref; return rme; } void schro_rough_me_free (SchroRoughME * rme) { int i; for (i = 0; i < SCHRO_MAX_HIER_LEVELS; i++) { if (rme->motion_fields[i]) schro_motion_field_free (rme->motion_fields[i]); } schro_free (rme); } void schro_rough_me_heirarchical_scan (SchroRoughME * rme) { SchroParams *params = &rme->encoder_frame->params; int i; int n_levels = rme->encoder_frame->encoder->downsample_levels; SCHRO_ASSERT (params->x_num_blocks != 0); SCHRO_ASSERT (params->y_num_blocks != 0); SCHRO_ASSERT (params->num_refs > 0); schro_rough_me_heirarchical_scan_nohint (rme, n_levels, 12); for (i = n_levels - 1; i >= 1; i--) { schro_rough_me_heirarchical_scan_hint (rme, i, 4); } } void schro_rough_me_heirarchical_scan_nohint (SchroRoughME * rme, int shift, int distance) { SchroMetricScan scan; SchroMotionVector *mv; SchroMotionField *mf; SchroParams *params = &rme->encoder_frame->params; int i; int j; int skip; /* I need to determine which reference I'm working on * to process the candidates MVs - note I've already checked * that ref_frame != NULL */ int ref = rme->ref_frame == rme->encoder_frame->ref_frame[0] ? 0 : (rme->ref_frame == rme->encoder_frame->ref_frame[1] ? 1 : -1); SCHRO_ASSERT (ref != -1); scan.frame = get_downsampled (rme->encoder_frame, shift); scan.ref_frame = get_downsampled (rme->ref_frame, shift); mf = schro_motion_field_new (params->x_num_blocks, params->y_num_blocks); schro_motion_field_set (mf, 0, 1); scan.block_width = params->xbsep_luma; scan.block_height = params->ybsep_luma; scan.gravity_scale = 0; scan.gravity_x = 0; scan.gravity_y = 0; skip = 1 << shift; for (j = 0; j < params->y_num_blocks; j += skip) { for (i = 0; i < params->x_num_blocks; i += skip) { int dx, dy; uint32_t dummy; scan.x = (i >> shift) * params->xbsep_luma; scan.y = (j >> shift) * params->ybsep_luma; scan.block_width = MIN (scan.frame->width - scan.x, params->xbsep_luma); scan.block_height = MIN (scan.frame->height - scan.y, params->ybsep_luma); schro_metric_scan_setup (&scan, 0, 0, distance, FALSE); dx = scan.ref_x + 0 - scan.x; dy = scan.ref_y + 0 - scan.y; scan.gravity_x = dx; scan.gravity_y = dy; mv = motion_field_get (mf, i, j); if (scan.scan_width <= 0 || scan.scan_height <= 0) { mv->u.vec.dx[0] = 0 << shift; mv->u.vec.dy[0] = 0 << shift; mv->metric = SCHRO_METRIC_INVALID; continue; } #if 0 /* this code skips blocks that are off the edge. Instead, we * scan smaller block sizes */ if (scan.x + scan.block_width >= scan.ref_frame->width || scan.y + scan.block_height >= scan.ref_frame->height) { mv->u.vec.dx[0] = 0 << shift; mv->u.vec.dy[0] = 0 << shift; mv->metric = SCHRO_METRIC_INVALID; continue; } #endif schro_metric_scan_do_scan (&scan); mv->metric = schro_metric_scan_get_min (&scan, &dx, &dy, &dummy); dx <<= shift; dy <<= shift; mv->u.vec.dx[ref] = dx; mv->u.vec.dy[ref] = dy; } } rme->motion_fields[shift] = mf; } void schro_rough_me_heirarchical_scan_hint (SchroRoughME * rme, int shift, int distance) { SchroMetricScan scan; SchroMotionVector *mv; SchroMotionField *mf; SchroMotionField *hint_mf; SchroParams *params = &rme->encoder_frame->params; SchroMotionVector zero_mv; int i; int j; int skip; unsigned int hint_mask; /* I need to determine which reference I'm working on * to process the candidates MVs - note I've already checked * that ref_frame != NULL */ int ref = rme->ref_frame == rme->encoder_frame->ref_frame[0] ? 0 : (rme->ref_frame == rme->encoder_frame->ref_frame[1] ? 1 : -1); SCHRO_ASSERT (ref != -1); scan.frame = get_downsampled (rme->encoder_frame, shift); scan.ref_frame = get_downsampled (rme->ref_frame, shift); mf = schro_motion_field_new (params->x_num_blocks, params->y_num_blocks); hint_mf = rme->motion_fields[shift + 1]; schro_motion_field_set (mf, 0, 1); scan.block_width = params->xbsep_luma; scan.block_height = params->ybsep_luma; scan.gravity_scale = 0; scan.gravity_x = 0; scan.gravity_y = 0; memset (&zero_mv, 0, sizeof (zero_mv)); hint_mask = ~((1 << (shift + 1)) - 1); skip = 1 << shift; for (j = 0; j < params->y_num_blocks; j += skip) { for (i = 0; i < params->x_num_blocks; i += skip) { SchroFrameData orig; SchroFrameData ref_data; #define LIST_LENGTH 10 SchroMotionVector *hint_mv[LIST_LENGTH]; int m; int n = 0; int dx, dy; int min_m; int min_metric; uint32_t dummy; schro_frame_get_subdata (scan.frame, &orig, 0, i * params->xbsep_luma >> shift, j * params->ybsep_luma >> shift); /* always test the zero vector */ hint_mv[n] = &zero_mv; n++; /* inherit from nearby parents */ /* This overly clever bit of code checks the parents of the diagonal * neighbors, which corresponds to the nearest parents. */ for (m = 0; m < 4; m++) { int l = (i + skip * (-1 + 2 * (m & 1))) & hint_mask; int k = (j + skip * (-1 + (m & 2))) & hint_mask; if (l >= 0 && l < params->x_num_blocks && k >= 0 && k < params->y_num_blocks) { hint_mv[n] = motion_field_get (hint_mf, l, k); n++; } } /* inherit from neighbors (only towards SE) */ if (i > 0) { hint_mv[n] = motion_field_get (mf, i - skip, j); n++; } if (j > 0) { hint_mv[n] = motion_field_get (mf, i, j - skip); n++; } if (i > 0 && j > 0) { hint_mv[n] = motion_field_get (mf, i - skip, j - skip); n++; } SCHRO_ASSERT (n <= LIST_LENGTH); min_m = 0; min_metric = SCHRO_METRIC_INVALID; for (m = 0; m < n; m++) { int metric; int width, height; int x, y; dx = hint_mv[m]->u.vec.dx[ref]; dy = hint_mv[m]->u.vec.dy[ref]; x = (i * params->xbsep_luma + dx) >> shift; y = (j * params->ybsep_luma + dy) >> shift; if (x < 0 || y < 0) { //SCHRO_ERROR("ij %d %d dx dy %d %d", i, j, dx, dy); continue; } schro_frame_get_subdata (scan.ref_frame, &ref_data, 0, (i * params->xbsep_luma + dx) >> shift, (j * params->ybsep_luma + dy) >> shift); width = MIN (params->xbsep_luma, orig.width); height = MIN (params->ybsep_luma, orig.height); if (width == 0 || height == 0) continue; if (ref_data.width < width || ref_data.height < height) continue; metric = schro_metric_get (&orig, &ref_data, width, height); if (metric < min_metric) { min_metric = metric; min_m = m; } } dx = hint_mv[min_m]->u.vec.dx[ref] >> shift; dy = hint_mv[min_m]->u.vec.dy[ref] >> shift; scan.gravity_x = dx; scan.gravity_y = dy; scan.x = (i >> shift) * params->xbsep_luma; scan.y = (j >> shift) * params->ybsep_luma; scan.block_width = MIN (scan.frame->width - scan.x, params->xbsep_luma); scan.block_height = MIN (scan.frame->height - scan.y, params->ybsep_luma); schro_metric_scan_setup (&scan, dx, dy, distance, FALSE); mv = motion_field_get (mf, i, j); if (scan.scan_width <= 0 || scan.scan_height <= 0) { mv->u.vec.dx[ref] = 0; mv->u.vec.dy[ref] = 0; mv->metric = SCHRO_METRIC_INVALID; continue; } schro_metric_scan_do_scan (&scan); mv->metric = schro_metric_scan_get_min (&scan, &dx, &dy, &dummy); dx <<= shift; dy <<= shift; mv->u.vec.dx[ref] = dx; mv->u.vec.dy[ref] = dy; } } rme->motion_fields[shift] = mf; } static SchroFrame * get_downsampled (SchroEncoderFrame * frame, int i) { SCHRO_ASSERT (frame->have_downsampling); if (i == 0) { return frame->filtered_frame; } return frame->downsampled_frames[i - 1]; } schroedinger-1.0.11/schroedinger/schrobuffer.c0000644000175000017500000000600711541755167016336 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include static void schro_buffer_free_mem (SchroBuffer * buffer, void *); static void schro_buffer_free_subbuffer (SchroBuffer * buffer, void *priv); SchroBuffer * schro_buffer_new (void) { SchroBuffer *buffer; buffer = schro_malloc0 (sizeof (SchroBuffer)); buffer->ref_count = 1; return buffer; } SchroBuffer * schro_buffer_new_and_alloc (int size) { SchroBuffer *buffer = schro_buffer_new (); buffer->data = schro_malloc (size); buffer->length = size; buffer->free = schro_buffer_free_mem; SCHRO_DEBUG ("%p %i", buffer, size); return buffer; } SchroBuffer * schro_buffer_new_with_data (void *data, int size) { SchroBuffer *buffer = schro_buffer_new (); buffer->data = data; buffer->length = size; return buffer; } SchroBuffer * schro_buffer_new_subbuffer (SchroBuffer * buffer, int offset, int length) { SchroBuffer *subbuffer = schro_buffer_new (); if (buffer->parent) { schro_buffer_ref (buffer->parent); subbuffer->parent = buffer->parent; } else { schro_buffer_ref (buffer); subbuffer->parent = buffer; } subbuffer->data = buffer->data + offset; subbuffer->length = length; subbuffer->free = schro_buffer_free_subbuffer; return subbuffer; } SchroBuffer * schro_buffer_ref (SchroBuffer * buffer) { buffer->ref_count++; return buffer; } void schro_buffer_unref (SchroBuffer * buffer) { SCHRO_ASSERT (buffer->ref_count > 0); buffer->ref_count--; if (buffer->ref_count == 0) { SCHRO_DEBUG ("free %p", buffer); if (buffer->free) buffer->free (buffer, buffer->priv); if (buffer->tag) schro_tag_free (buffer->tag); schro_free (buffer); } } static void schro_buffer_free_mem (SchroBuffer * buffer, void *priv) { schro_free (buffer->data); } static void schro_buffer_free_subbuffer (SchroBuffer * buffer, void *priv) { schro_buffer_unref (buffer->parent); buffer->parent = NULL; } SchroBuffer * schro_buffer_dup (SchroBuffer * buffer) { SchroBuffer *dup; dup = schro_buffer_new_and_alloc (buffer->length); orc_memcpy (dup->data, buffer->data, buffer->length); return dup; } /** * schro_tag_new: * @value: initial value for the tag * @free_func: function to free value, may be NULL. this function must * allow being called as free_func(NULL). * * Returns: An a decoder tag structure, with an initial value */ SchroTag * schro_tag_new (void *value, void (*free_func) (void *)) { SchroTag *tag = schro_malloc0 (sizeof (*tag)); if (!tag) { if (free_func) { free_func (value); } return NULL; } tag->free = free_func; tag->value = value; return tag; } /** * schro_tag_free: * * Frees storage associated with @tag. Calls tag's free_func to free * private data if free_func is non zero. */ void schro_tag_free (SchroTag * tag) { if (tag->free) { tag->free (tag->value); } schro_free (tag); } schroedinger-1.0.11/schroedinger/schrolowdelay.c0000644000175000017500000011024211702127124016663 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include /* When defined, this trims -1's and 1's from the end of slices by * converting them to 0's. (Zeros get trimmed by default.) It * doesn't seem to affect psnr any. (limited testing) */ //#define USE_TRAILING_DEAD_ZONE 1 typedef struct _SchroLowDelay SchroLowDelay; typedef struct _SchroLDSubband SchroLDSubband; struct _SchroLDSubband { int16_t *data; int x_stride; int y_stride; int slice_width; int slice_height; }; struct _SchroLowDelay { SchroFrame *frame; SchroParams *params; int n_subbands; int n_vert_slices; int n_horiz_slices; SchroFrameData luma_subbands[SCHRO_LIMIT_SUBBANDS]; SchroFrameData chroma1_subbands[SCHRO_LIMIT_SUBBANDS]; SchroFrameData chroma2_subbands[SCHRO_LIMIT_SUBBANDS]; SchroFrame *reconstructed_frame; int16_t *quant_y_data; int16_t *quant_uv_data; int slice_y_size; int slice_uv_size; int slice_y_width; int slice_y_height; int slice_uv_width; int slice_uv_height; int16_t *saved_dc_values; //int16_t *quant_data; int subband_shift[SCHRO_LIMIT_SUBBANDS]; SchroLDSubband subbands[SCHRO_LIMIT_SUBBANDS][3]; int16_t *y_quants; int16_t *y_offsets; int16_t *uv_quants; int16_t *uv_offsets; int *y_memoffsets; int *uv_memoffsets; int length_bits; }; #if 0 void schro_encoder_init_subbands (SchroEncoderFrame * frame) { int i; int pos; SchroParams *params = &frame->params; for (i = 0; i < 1 + 3 * params->transform_depth; i++) { pos = schro_subband_get_position (i); schro_subband_get_frame_data (frame->luma_subbands + i, frame->iwt_frame, 0, pos, params); schro_subband_get_frame_data (frame->chroma1_subbands + i, frame->iwt_frame, 0, pos, params); schro_subband_get_frame_data (frame->chroma2_subbands + i, frame->iwt_frame, 0, pos, params); } } #endif static int ilog2up (unsigned int x) { int i; for (i = 0; i < 32; i++) { if (x == 0) return i; x >>= 1; } return 0; } static void schro_decoder_decode_slice_slow (SchroPicture * picture, SchroLowDelay * lowdelay, int slice_x, int slice_y, int offset, int slice_bytes) { SchroParams *params = &picture->params; SchroUnpack y_unpack; SchroUnpack uv_unpack; int quant_index; int base_index; int length_bits; int slice_y_length; int i; int x, y; int value; schro_unpack_init_with_data (&y_unpack, OFFSET (picture->lowdelay_buffer->data, offset), slice_bytes, 1); base_index = schro_unpack_decode_bits (&y_unpack, 7); length_bits = ilog2up (8 * slice_bytes); slice_y_length = schro_unpack_decode_bits (&y_unpack, length_bits); schro_unpack_copy (&uv_unpack, &y_unpack); schro_unpack_limit_bits_remaining (&y_unpack, slice_y_length); schro_unpack_skip_bits (&uv_unpack, slice_y_length); for (i = 0; i < 1 + 3 * params->transform_depth; i++) { int quant_factor; int quant_offset; int16_t *line; SchroFrameData block; schro_frame_data_get_codeblock (&block, lowdelay->luma_subbands + i, slice_x, slice_y, lowdelay->n_horiz_slices, lowdelay->n_vert_slices); quant_index = CLAMP (base_index - params->quant_matrix[i], 0, 60); quant_factor = schro_table_quant[quant_index]; quant_offset = schro_table_offset_1_2[quant_index]; for (y = 0; y < block.height; y++) { line = SCHRO_FRAME_DATA_GET_LINE (&block, y); for (x = 0; x < block.width; x++) { value = schro_unpack_decode_sint (&y_unpack); line[x] = schro_dequantise (value, quant_factor, quant_offset); } } } for (i = 0; i < 1 + 3 * params->transform_depth; i++) { int quant_factor; int quant_offset; int16_t *line1; int16_t *line2; SchroFrameData block1; SchroFrameData block2; schro_frame_data_get_codeblock (&block1, lowdelay->chroma1_subbands + i, slice_x, slice_y, lowdelay->n_horiz_slices, lowdelay->n_vert_slices); schro_frame_data_get_codeblock (&block2, lowdelay->chroma2_subbands + i, slice_x, slice_y, lowdelay->n_horiz_slices, lowdelay->n_vert_slices); quant_index = CLAMP (base_index - params->quant_matrix[i], 0, 60); quant_factor = schro_table_quant[quant_index]; quant_offset = schro_table_offset_1_2[quant_index]; for (y = 0; y < block1.height; y++) { line1 = SCHRO_FRAME_DATA_GET_LINE (&block1, y); line2 = SCHRO_FRAME_DATA_GET_LINE (&block2, y); for (x = 0; x < block1.width; x++) { value = schro_unpack_decode_sint (&uv_unpack); line1[x] = schro_dequantise (value, quant_factor, quant_offset); value = schro_unpack_decode_sint (&uv_unpack); line2[x] = schro_dequantise (value, quant_factor, quant_offset); } } } } static void schro_decoder_decode_slice_slow_s32 (SchroPicture * picture, SchroLowDelay * lowdelay, int slice_x, int slice_y, int offset, int slice_bytes) { SchroParams *params = &picture->params; SchroUnpack y_unpack; SchroUnpack uv_unpack; int quant_index; int base_index; int length_bits; int slice_y_length; int i; int x, y; int value; schro_unpack_init_with_data (&y_unpack, OFFSET (picture->lowdelay_buffer->data, offset), slice_bytes, 1); base_index = schro_unpack_decode_bits (&y_unpack, 7); length_bits = ilog2up (8 * slice_bytes); slice_y_length = schro_unpack_decode_bits (&y_unpack, length_bits); schro_unpack_copy (&uv_unpack, &y_unpack); schro_unpack_limit_bits_remaining (&y_unpack, slice_y_length); schro_unpack_skip_bits (&uv_unpack, slice_y_length); for (i = 0; i < 1 + 3 * params->transform_depth; i++) { int quant_factor; int quant_offset; int32_t *line; SchroFrameData block; schro_frame_data_get_codeblock (&block, lowdelay->luma_subbands + i, slice_x, slice_y, lowdelay->n_horiz_slices, lowdelay->n_vert_slices); quant_index = CLAMP (base_index - params->quant_matrix[i], 0, 60); quant_factor = schro_table_quant[quant_index]; quant_offset = schro_table_offset_1_2[quant_index]; for (y = 0; y < block.height; y++) { line = SCHRO_FRAME_DATA_GET_LINE (&block, y); for (x = 0; x < block.width; x++) { value = schro_unpack_decode_sint (&y_unpack); line[x] = schro_dequantise (value, quant_factor, quant_offset); } } } for (i = 0; i < 1 + 3 * params->transform_depth; i++) { int quant_factor; int quant_offset; int32_t *line1; int32_t *line2; SchroFrameData block1; SchroFrameData block2; schro_frame_data_get_codeblock (&block1, lowdelay->chroma1_subbands + i, slice_x, slice_y, lowdelay->n_horiz_slices, lowdelay->n_vert_slices); schro_frame_data_get_codeblock (&block2, lowdelay->chroma2_subbands + i, slice_x, slice_y, lowdelay->n_horiz_slices, lowdelay->n_vert_slices); quant_index = CLAMP (base_index - params->quant_matrix[i], 0, 60); quant_factor = schro_table_quant[quant_index]; quant_offset = schro_table_offset_1_2[quant_index]; for (y = 0; y < block1.height; y++) { line1 = SCHRO_FRAME_DATA_GET_LINE (&block1, y); line2 = SCHRO_FRAME_DATA_GET_LINE (&block2, y); for (x = 0; x < block1.width; x++) { value = schro_unpack_decode_sint (&uv_unpack); line1[x] = schro_dequantise (value, quant_factor, quant_offset); value = schro_unpack_decode_sint (&uv_unpack); line2[x] = schro_dequantise (value, quant_factor, quant_offset); } } } } static void schro_decoder_decode_slice_fast (SchroPicture * picture, SchroLowDelay * lowdelay, int slice_x, int slice_y, int offset, int slice_bytes) { SchroUnpack y_unpack; SchroUnpack uv_unpack; int base_index; int slice_y_length; int16_t *quant_data; schro_unpack_init_with_data (&y_unpack, OFFSET (picture->lowdelay_buffer->data, offset), slice_bytes, 1); base_index = schro_unpack_decode_bits (&y_unpack, 7); slice_y_length = schro_unpack_decode_bits (&y_unpack, lowdelay->length_bits); schro_unpack_copy (&uv_unpack, &y_unpack); schro_unpack_limit_bits_remaining (&y_unpack, slice_y_length); schro_unpack_skip_bits (&uv_unpack, slice_y_length); quant_data = lowdelay->quant_y_data + slice_x * lowdelay->slice_y_size; schro_unpack_decode_sint_s16 (quant_data, &y_unpack, lowdelay->slice_y_size); orc_dequantise_var_s16_ip (quant_data, lowdelay->y_quants + base_index * lowdelay->slice_y_size, lowdelay->y_offsets + base_index * lowdelay->slice_y_size, lowdelay->slice_y_size); quant_data = lowdelay->quant_uv_data + slice_x * lowdelay->slice_uv_size; schro_unpack_decode_sint_s16 (quant_data, &uv_unpack, lowdelay->slice_uv_size); orc_dequantise_var_s16_ip (quant_data, lowdelay->uv_quants + base_index * lowdelay->slice_uv_size, lowdelay->uv_offsets + base_index * lowdelay->slice_uv_size, lowdelay->slice_uv_size); } static void schro_lowdelay_restride_slices (SchroPicture * picture, SchroLowDelay * lowdelay, int slice_y) { int k; int j; int x, y; int i; int16_t *quant_data; quant_data = lowdelay->quant_y_data; j = 0; for (i = 0; i < lowdelay->n_subbands; i++) { int16_t *line; SchroFrameData block; block.data = SCHRO_FRAME_DATA_GET_PIXEL_S16 (lowdelay->luma_subbands + i, 0, (lowdelay->slice_y_height >> lowdelay->subband_shift[i]) * slice_y); block.stride = lowdelay->luma_subbands[i].stride; for (y = 0; y < lowdelay->subbands[i][0].slice_height; y++) { line = SCHRO_FRAME_DATA_GET_LINE (&block, y); switch (lowdelay->subbands[i][0].slice_width) { case 1: for (k = 0; k < lowdelay->n_horiz_slices; k++) { line[k] = quant_data[k * lowdelay->slice_y_size + j]; } j++; break; case 2: for (k = 0; k < lowdelay->n_horiz_slices; k++) { line[k * 2 + 0] = quant_data[k * lowdelay->slice_y_size + j + 0]; line[k * 2 + 1] = quant_data[k * lowdelay->slice_y_size + j + 1]; } j += 2; break; case 4: for (k = 0; k < lowdelay->n_horiz_slices; k++) { memcpy (line + k * 4, quant_data + k * lowdelay->slice_y_size + j, sizeof (int16_t) * 4); } j += 4; break; case 8: for (k = 0; k < lowdelay->n_horiz_slices; k++) { memcpy (line + k * 8, quant_data + k * lowdelay->slice_y_size + j, sizeof (int16_t) * 8); } j += 8; break; default: for (k = 0; k < lowdelay->n_horiz_slices; k++) { memcpy (line + k * lowdelay->subbands[i][0].slice_width, quant_data + k * lowdelay->slice_y_size + j, sizeof (int16_t) * lowdelay->subbands[i][0].slice_width); } j += lowdelay->subbands[i][0].slice_width; break; } } } quant_data = lowdelay->quant_uv_data; j = 0; for (i = 0; i < lowdelay->n_subbands; i++) { int16_t *line1; int16_t *line2; SchroFrameData block1; SchroFrameData block2; block1.data = SCHRO_FRAME_DATA_GET_PIXEL_S16 (lowdelay->chroma1_subbands + i, 0, (lowdelay->slice_uv_height >> lowdelay->subband_shift[i]) * slice_y); block1.stride = lowdelay->chroma1_subbands[i].stride; block2.data = SCHRO_FRAME_DATA_GET_PIXEL_S16 (lowdelay->chroma2_subbands + i, 0, (lowdelay->slice_uv_height >> lowdelay->subband_shift[i]) * slice_y); block2.stride = lowdelay->chroma2_subbands[i].stride; for (y = 0; y < lowdelay->subbands[i][1].slice_height; y++) { line1 = SCHRO_FRAME_DATA_GET_LINE (&block1, y); line2 = SCHRO_FRAME_DATA_GET_LINE (&block2, y); for (k = 0; k < lowdelay->n_horiz_slices; k++) { for (x = 0; x < lowdelay->subbands[i][1].slice_width; x++) { line1[k * lowdelay->subbands[i][1].slice_width + x] = quant_data[k * lowdelay->slice_uv_size + j + x * 2 + 0]; line2[k * lowdelay->subbands[i][1].slice_width + x] = quant_data[k * lowdelay->slice_uv_size + j + x * 2 + 1]; } } j += lowdelay->subbands[i][1].slice_width * 2; } } } static void schro_lowdelay_init (SchroLowDelay * lowdelay, SchroFrame * frame, SchroParams * params) { int i; int size; lowdelay->params = params; lowdelay->frame = frame; lowdelay->n_subbands = 1 + 3 * params->transform_depth; lowdelay->n_horiz_slices = params->n_horiz_slices; lowdelay->n_vert_slices = params->n_vert_slices; for (i = 0; i < 1 + 3 * params->transform_depth; i++) { int position = schro_subband_get_position (i); SchroFrameData fd; schro_subband_get_frame_data (lowdelay->luma_subbands + i, frame, 0, position, params); schro_subband_get_frame_data (lowdelay->chroma1_subbands + i, frame, 1, position, params); schro_subband_get_frame_data (lowdelay->chroma2_subbands + i, frame, 2, position, params); schro_frame_data_get_codeblock (&fd, lowdelay->luma_subbands + i, 0, 0, lowdelay->n_horiz_slices, lowdelay->n_vert_slices); lowdelay->subbands[i][0].data = fd.data; lowdelay->subbands[i][0].slice_width = fd.width; lowdelay->subbands[i][0].slice_height = fd.height; lowdelay->subbands[i][0].x_stride = fd.width * sizeof (int16_t); lowdelay->subbands[i][0].y_stride = fd.height * fd.stride; schro_frame_data_get_codeblock (&fd, lowdelay->chroma1_subbands + i, 0, 0, lowdelay->n_horiz_slices, lowdelay->n_vert_slices); lowdelay->subbands[i][1].data = fd.data; lowdelay->subbands[i][1].slice_width = fd.width; lowdelay->subbands[i][1].slice_height = fd.height; lowdelay->subbands[i][1].x_stride = fd.width * sizeof (int16_t); lowdelay->subbands[i][1].y_stride = fd.height * fd.stride; lowdelay->subband_shift[i] = params->transform_depth - SCHRO_SUBBAND_SHIFT (position); } size = 1000; lowdelay->saved_dc_values = schro_malloc (sizeof (int16_t) * size); } static void schro_lowdelay_cleanup (SchroLowDelay * lowdelay) { schro_free (lowdelay->saved_dc_values); } static void schro_lowdelay_init_quant_arrays (SchroLowDelay * lowdelay) { int base_index; int i; int j; int x, y; j = 0; for (base_index = 0; base_index < 60; base_index++) { for (i = 0; i < lowdelay->n_subbands; i++) { int quant_factor; int quant_offset; int quant_index; quant_index = CLAMP (base_index - lowdelay->params->quant_matrix[i], 0, 60); quant_factor = schro_table_quant[quant_index]; quant_offset = schro_table_offset_1_2[quant_index]; for (y = 0; y < lowdelay->subbands[i][0].slice_height; y++) { for (x = 0; x < lowdelay->subbands[i][0].slice_width; x++) { lowdelay->y_quants[j] = quant_factor; lowdelay->y_offsets[j] = quant_offset + 2; j++; } } } } j = 0; for (base_index = 0; base_index < 60; base_index++) { for (i = 0; i < lowdelay->n_subbands; i++) { int quant_index; int quant_factor; int quant_offset; SchroFrameData block1; schro_frame_data_get_codeblock (&block1, lowdelay->chroma1_subbands + i, 0, 0, lowdelay->n_horiz_slices, lowdelay->n_vert_slices); quant_index = CLAMP (base_index - lowdelay->params->quant_matrix[i], 0, 60); quant_factor = schro_table_quant[quant_index]; quant_offset = schro_table_offset_1_2[quant_index]; for (y = 0; y < block1.height; y++) { for (x = 0; x < block1.width; x++) { lowdelay->uv_quants[j] = quant_factor; lowdelay->uv_offsets[j] = quant_offset + 2; j++; lowdelay->uv_quants[j] = quant_factor; lowdelay->uv_offsets[j] = quant_offset + 2; j++; } } } } } static void schro_lowdelay_init_memoffsets (SchroLowDelay * lowdelay) { int i, j; int x, y; int16_t *baseptr; baseptr = lowdelay->frame->components[0].data; j = 0; for (i = 0; i < 1 + 3 * lowdelay->params->transform_depth; i++) { int16_t *line; SchroFrameData block; schro_frame_data_get_codeblock (&block, lowdelay->luma_subbands + i, 0, 0, lowdelay->n_horiz_slices, lowdelay->n_vert_slices); for (y = 0; y < lowdelay->subbands[i][0].slice_height; y++) { line = SCHRO_FRAME_DATA_GET_LINE (&block, y); for (x = 0; x < lowdelay->subbands[i][0].slice_width; x++) { lowdelay->y_memoffsets[j] = ((char *) (line + x)) - ((char *) baseptr); j++; } } } } void schro_decoder_decode_lowdelay_transform_data_fast (SchroPicture * picture) { SchroParams *params = &picture->params; SchroLowDelay lowdelay; int x, y; int n_bytes; int remainder; int accumulator; int extra; int offset; memset (&lowdelay, 0, sizeof (SchroLowDelay)); lowdelay.n_horiz_slices = params->n_horiz_slices; lowdelay.n_vert_slices = params->n_vert_slices; schro_lowdelay_init (&lowdelay, picture->transform_frame, params); n_bytes = params->slice_bytes_num / params->slice_bytes_denom; remainder = params->slice_bytes_num % params->slice_bytes_denom; lowdelay.length_bits = ilog2up (8 * n_bytes); SCHRO_ASSERT ((params->iwt_luma_width % params->n_horiz_slices) == 0); SCHRO_ASSERT ((params->iwt_luma_height % params->n_vert_slices) == 0); SCHRO_ASSERT ((params->iwt_chroma_width % params->n_horiz_slices) == 0); SCHRO_ASSERT ((params->iwt_chroma_height % params->n_vert_slices) == 0); lowdelay.slice_y_size = (params->iwt_luma_width / params->n_horiz_slices) * (params->iwt_luma_height / params->n_vert_slices); lowdelay.slice_uv_size = (params->iwt_chroma_width / params->n_horiz_slices) * (params->iwt_chroma_height / params->n_vert_slices) * 2; lowdelay.slice_y_width = (params->iwt_luma_width / params->n_horiz_slices); lowdelay.slice_y_height = (params->iwt_luma_height / params->n_vert_slices); lowdelay.slice_uv_width = (params->iwt_chroma_width / params->n_horiz_slices); lowdelay.slice_uv_height = (params->iwt_chroma_height / params->n_vert_slices); lowdelay.quant_y_data = schro_malloc (sizeof (int16_t) * lowdelay.slice_y_size * params->n_horiz_slices); lowdelay.quant_uv_data = schro_malloc (sizeof (int16_t) * lowdelay.slice_uv_size * params->n_horiz_slices); lowdelay.y_quants = schro_malloc (60 * sizeof (int16_t) * lowdelay.slice_y_size); lowdelay.y_offsets = schro_malloc (60 * sizeof (int16_t) * lowdelay.slice_y_size); lowdelay.y_memoffsets = schro_malloc (sizeof (int) * lowdelay.slice_y_size); lowdelay.uv_quants = schro_malloc (60 * sizeof (int16_t) * lowdelay.slice_uv_size); lowdelay.uv_offsets = schro_malloc (60 * sizeof (int16_t) * lowdelay.slice_uv_size); lowdelay.uv_memoffsets = schro_malloc (sizeof (int) * lowdelay.slice_uv_size); schro_lowdelay_init_quant_arrays (&lowdelay); schro_lowdelay_init_memoffsets (&lowdelay); offset = 0; accumulator = 0; for (y = 0; y < lowdelay.n_vert_slices; y++) { for (x = 0; x < lowdelay.n_horiz_slices; x++) { accumulator += remainder; if (accumulator >= params->slice_bytes_denom) { extra = 1; accumulator -= params->slice_bytes_denom; } else { extra = 0; } schro_decoder_decode_slice_fast (picture, &lowdelay, x, y, offset, n_bytes + extra); offset += n_bytes + extra; } schro_lowdelay_restride_slices (picture, &lowdelay, y); } schro_decoder_subband_dc_predict (lowdelay.luma_subbands + 0); schro_decoder_subband_dc_predict (lowdelay.chroma1_subbands + 0); schro_decoder_subband_dc_predict (lowdelay.chroma2_subbands + 0); schro_free (lowdelay.quant_y_data); schro_free (lowdelay.quant_uv_data); schro_free (lowdelay.y_quants); schro_free (lowdelay.y_offsets); schro_free (lowdelay.y_memoffsets); schro_free (lowdelay.uv_quants); schro_free (lowdelay.uv_offsets); schro_free (lowdelay.uv_memoffsets); schro_lowdelay_cleanup (&lowdelay); } void schro_decoder_decode_lowdelay_transform_data_slow (SchroPicture * picture) { SchroParams *params = &picture->params; SchroLowDelay lowdelay; int x, y; int n_bytes; int remainder; int accumulator; int extra; int offset; memset (&lowdelay, 0, sizeof (SchroLowDelay)); schro_lowdelay_init (&lowdelay, picture->transform_frame, params); lowdelay.n_horiz_slices = params->n_horiz_slices; lowdelay.n_vert_slices = params->n_vert_slices; n_bytes = params->slice_bytes_num / params->slice_bytes_denom; remainder = params->slice_bytes_num % params->slice_bytes_denom; offset = 0; accumulator = 0; for (y = 0; y < lowdelay.n_vert_slices; y++) { for (x = 0; x < lowdelay.n_horiz_slices; x++) { accumulator += remainder; if (accumulator >= params->slice_bytes_denom) { extra = 1; accumulator -= params->slice_bytes_denom; } else { extra = 0; } schro_decoder_decode_slice_slow (picture, &lowdelay, x, y, offset, n_bytes + extra); offset += n_bytes + extra; } } schro_decoder_subband_dc_predict (lowdelay.luma_subbands + 0); schro_decoder_subband_dc_predict (lowdelay.chroma1_subbands + 0); schro_decoder_subband_dc_predict (lowdelay.chroma2_subbands + 0); schro_lowdelay_cleanup (&lowdelay); } void schro_decoder_decode_lowdelay_transform_data_slow_s32 (SchroPicture * picture) { SchroParams *params = &picture->params; SchroLowDelay lowdelay; int x, y; int n_bytes; int remainder; int accumulator; int extra; int offset; memset (&lowdelay, 0, sizeof (SchroLowDelay)); schro_lowdelay_init (&lowdelay, picture->transform_frame, params); lowdelay.n_horiz_slices = params->n_horiz_slices; lowdelay.n_vert_slices = params->n_vert_slices; n_bytes = params->slice_bytes_num / params->slice_bytes_denom; remainder = params->slice_bytes_num % params->slice_bytes_denom; offset = 0; accumulator = 0; for (y = 0; y < lowdelay.n_vert_slices; y++) { for (x = 0; x < lowdelay.n_horiz_slices; x++) { accumulator += remainder; if (accumulator >= params->slice_bytes_denom) { extra = 1; accumulator -= params->slice_bytes_denom; } else { extra = 0; } schro_decoder_decode_slice_slow_s32 (picture, &lowdelay, x, y, offset, n_bytes + extra); offset += n_bytes + extra; } } schro_decoder_subband_dc_predict_s32 (lowdelay.luma_subbands + 0); schro_decoder_subband_dc_predict_s32 (lowdelay.chroma1_subbands + 0); schro_decoder_subband_dc_predict_s32 (lowdelay.chroma2_subbands + 0); schro_lowdelay_cleanup (&lowdelay); } void schro_decoder_decode_lowdelay_transform_data (SchroPicture * picture) { SchroParams *params = &picture->params; if (SCHRO_FRAME_FORMAT_DEPTH (picture->transform_frame->format) == SCHRO_FRAME_FORMAT_DEPTH_S32) { return schro_decoder_decode_lowdelay_transform_data_slow_s32 (picture); } else if ((params->iwt_chroma_width >> params->transform_depth) % params->n_horiz_slices == 0 && (params->iwt_chroma_height >> params->transform_depth) % params->n_vert_slices == 0) { return schro_decoder_decode_lowdelay_transform_data_fast (picture); } else { return schro_decoder_decode_lowdelay_transform_data_slow (picture); } } #ifdef ENABLE_ENCODER static int schro_dc_predict (int16_t * line, int stride, int x, int y) { int16_t *prev_line = OFFSET (line, -stride); if (y > 0) { if (x > 0) { return schro_divide3 (line[-1] + prev_line[0] + prev_line[-1] + 1); } else { return prev_line[0]; } } else { if (x > 0) { return line[-1]; } else { return 0; } } } static int schro_encoder_encode_slice (SchroEncoderFrame * frame, SchroLowDelay * lowdelay, int slice_x, int slice_y, int slice_bytes, int base_index) { int length_bits; int slice_y_length; int i; int start_bits; int end_bits; int16_t *quant_data = frame->quant_data; start_bits = schro_pack_get_bit_offset (frame->pack); schro_pack_encode_bits (frame->pack, 7, base_index); length_bits = ilog2up (8 * slice_bytes); slice_y_length = frame->slice_y_bits - frame->slice_y_trailing_zeros; schro_pack_encode_bits (frame->pack, length_bits, slice_y_length); for (i = 0; i < lowdelay->slice_y_size - frame->slice_y_trailing_zeros; i++) { schro_pack_encode_sint (frame->pack, quant_data[i]); } quant_data += lowdelay->slice_y_size; for (i = 0; i < lowdelay->slice_uv_size - frame->slice_uv_trailing_zeros / 2; i++) { schro_pack_encode_sint (frame->pack, quant_data[i]); schro_pack_encode_sint (frame->pack, quant_data[i + lowdelay->slice_uv_size]); } end_bits = schro_pack_get_bit_offset (frame->pack); SCHRO_DEBUG ("total bits %d used bits %d expected %d", slice_bytes * 8, end_bits - start_bits, 7 + length_bits + frame->slice_y_bits + frame->slice_uv_bits - frame->slice_y_trailing_zeros - frame->slice_uv_trailing_zeros); SCHRO_ASSERT (end_bits - start_bits == 7 + length_bits + frame->slice_y_bits + frame->slice_uv_bits - frame->slice_y_trailing_zeros - frame->slice_uv_trailing_zeros); if (end_bits - start_bits > slice_bytes * 8) { SCHRO_ERROR ("slice overran buffer by %d bits (slice_bytes %d base_index %d)", end_bits - start_bits - slice_bytes * 8, slice_bytes, base_index); SCHRO_ASSERT (0); } else { int left = slice_bytes * 8 - (end_bits - start_bits); for (i = 0; i < left; i++) { schro_pack_encode_bit (frame->pack, 1); } } return end_bits - start_bits; } static int estimate_array (int16_t * data, int n) { int i; int n_bits = 0; for (i = 0; i < n; i++) { n_bits += schro_pack_estimate_sint (data[i]); } return n_bits; } static void quantise_block (SchroFrameData * block, int16_t * quant_data, int quant_index) { int quant_factor; int quant_offset; int x, y; int n = 0; int16_t *line; quant_factor = schro_table_quant[quant_index]; quant_offset = schro_table_offset_1_2[quant_index]; for (y = 0; y < block->height; y++) { line = SCHRO_FRAME_DATA_GET_LINE (block, y); for (x = 0; x < block->width; x++) { quant_data[n] = schro_quantise (line[x], quant_factor, quant_offset); n++; } } } static void quantise_dc_block (SchroFrameData * block, int16_t * quant_data, int quant_index, int slice_x, int slice_y, SchroFrameData *reconstructed_block) { int quant_factor; int quant_offset; int x, y; int n = 0; int pred_value; int16_t *line; int16_t *rline; quant_factor = schro_table_quant[quant_index]; quant_offset = schro_table_offset_1_2[quant_index]; for (y = 0; y < block->height; y++) { line = SCHRO_FRAME_DATA_GET_LINE (block, y); rline = SCHRO_FRAME_DATA_GET_LINE (reconstructed_block, y); for (x = 0; x < block->width; x++) { rline[x] = line[x]; pred_value = schro_dc_predict (rline + x, reconstructed_block->stride, slice_x + x, slice_y + y); quant_data[n] = schro_quantise (line[x] - pred_value, quant_factor, quant_offset); rline[x] = pred_value + schro_dequantise (quant_data[n], quant_factor, quant_offset); n++; } } } static void dequantise_block (SchroFrameData * block, int16_t * quant_data, int quant_index) { int quant_factor; int quant_offset; int x, y; int n = 0; int16_t *line; quant_factor = schro_table_quant[quant_index]; quant_offset = schro_table_offset_1_2[quant_index]; for (y = 0; y < block->height; y++) { line = SCHRO_FRAME_DATA_GET_LINE (block, y); for (x = 0; x < block->width; x++) { line[x] = schro_dequantise (quant_data[n], quant_factor, quant_offset); n++; } } } static int schro_encoder_estimate_slice (SchroEncoderFrame * frame, SchroLowDelay * lowdelay, int slice_x, int slice_y, int slice_bytes, int base_index) { SchroParams *params = &frame->params; int quant_index; int i; int n_bits; int n; int16_t *quant_data = frame->quant_data; n_bits = 7 + ilog2up (8 * slice_bytes); /* Figure out how many values are in each component. */ /* FIXME this should go somewhere else or be elimitated */ lowdelay->slice_y_size = 0; lowdelay->slice_uv_size = 0; for (i = 0; i < 1 + 3 * params->transform_depth; i++) { SchroFrameData block; schro_frame_data_get_codeblock (&block, lowdelay->luma_subbands + i, slice_x, slice_y, lowdelay->n_horiz_slices, lowdelay->n_vert_slices); lowdelay->slice_y_size += block.height * block.width; schro_frame_data_get_codeblock (&block, lowdelay->chroma1_subbands + i, slice_x, slice_y, lowdelay->n_horiz_slices, lowdelay->n_vert_slices); lowdelay->slice_uv_size += block.height * block.width; } /* Estimate Y */ n = 0; for (i = 0; i < 1 + 3 * params->transform_depth; i++) { SchroFrameData block; schro_frame_data_get_codeblock (&block, lowdelay->luma_subbands + i, slice_x, slice_y, lowdelay->n_horiz_slices, lowdelay->n_vert_slices); quant_index = CLAMP (base_index - params->quant_matrix[i], 0, 60); if (i == 0) { SchroFrameData reconstructed_block; schro_frame_data_get_codeblock (&reconstructed_block, lowdelay->reconstructed_frame->components + 0, slice_x, slice_y, lowdelay->n_horiz_slices, lowdelay->n_vert_slices); quantise_dc_block (&block, quant_data + n, quant_index, (lowdelay->luma_subbands[i].width * slice_x) / lowdelay->n_horiz_slices, (lowdelay->luma_subbands[i].height * slice_y) / lowdelay->n_vert_slices, &reconstructed_block); } else { quantise_block (&block, quant_data + n, quant_index); } n += block.height * block.width; } #ifdef USE_TRAILING_DEAD_ZONE for (i = 0; i < n; i++) { if (quant_data[n - 1 - i] < -1 || quant_data[n - 1 - i] > 1) break; quant_data[n - 1 - i] = 0; } #endif frame->slice_y_bits = estimate_array (quant_data, n); for (i = 0; i < n; i++) { if (quant_data[n - 1 - i] != 0) break; } frame->slice_y_trailing_zeros = i; /* Estimate UV */ n = 0; quant_data += lowdelay->slice_y_size; for (i = 0; i < 1 + 3 * params->transform_depth; i++) { SchroFrameData block1; SchroFrameData block2; schro_frame_data_get_codeblock (&block1, lowdelay->chroma1_subbands + i, slice_x, slice_y, lowdelay->n_horiz_slices, lowdelay->n_vert_slices); schro_frame_data_get_codeblock (&block2, lowdelay->chroma2_subbands + i, slice_x, slice_y, lowdelay->n_horiz_slices, lowdelay->n_vert_slices); quant_index = CLAMP (base_index - params->quant_matrix[i], 0, 60); if (i == 0) { SchroFrameData reconstructed_block; schro_frame_data_get_codeblock (&reconstructed_block, lowdelay->reconstructed_frame->components + 1, slice_x, slice_y, lowdelay->n_horiz_slices, lowdelay->n_vert_slices); quantise_dc_block (&block1, quant_data + n, quant_index, (lowdelay->chroma1_subbands[i].width * slice_x) / lowdelay->n_horiz_slices, (lowdelay->chroma1_subbands[i].height * slice_y) / lowdelay->n_vert_slices, &reconstructed_block); schro_frame_data_get_codeblock (&reconstructed_block, lowdelay->reconstructed_frame->components + 2, slice_x, slice_y, lowdelay->n_horiz_slices, lowdelay->n_vert_slices); quantise_dc_block (&block2, quant_data + n + lowdelay->slice_uv_size, quant_index, (lowdelay->chroma1_subbands[i].width * slice_x) / lowdelay->n_horiz_slices, (lowdelay->chroma1_subbands[i].height * slice_y) / lowdelay->n_vert_slices, &reconstructed_block); } else { quantise_block (&block1, quant_data + n, quant_index); quantise_block (&block2, quant_data + n + lowdelay->slice_uv_size, quant_index); } n += block1.height * block1.width; } #ifdef USE_TRAILING_DEAD_ZONE for (i = 0; i < n; i++) { if (quant_data[n - 1 - i] < -1 || quant_data[n - 1 - i] > 1) break; if (quant_data[2 * n - 1 - i] < -1 || quant_data[2 * n - 1 - i] > 1) break; quant_data[n - 1 - i] = 0; quant_data[2 * n - 1 - i] = 0; } #endif frame->slice_uv_bits = estimate_array (quant_data, n * 2); for (i = 0; i < n; i++) { if (quant_data[n - 1 - i] != 0) break; if (quant_data[2 * n - 1 - i] != 0) break; } frame->slice_uv_trailing_zeros = 2 * i; return n_bits + frame->slice_y_bits + frame->slice_uv_bits - frame->slice_y_trailing_zeros - frame->slice_uv_trailing_zeros; } static void schro_encoder_dequantise_slice (SchroEncoderFrame * frame, SchroLowDelay * lowdelay, int slice_x, int slice_y, int slice_bytes, int base_index) { SchroParams *params = &frame->params; int quant_index; int i; int n; int16_t *quant_data = frame->quant_data; n = 0; for (i = 0; i < 1 + 3 * params->transform_depth; i++) { SchroFrameData block; schro_frame_data_get_codeblock (&block, lowdelay->luma_subbands + i, slice_x, slice_y, lowdelay->n_horiz_slices, lowdelay->n_vert_slices); quant_index = CLAMP (base_index - params->quant_matrix[i], 0, 60); if (i == 0) { /* dc dequant is handled by estimation */ } else { dequantise_block (&block, quant_data + n, quant_index); } n += block.height * block.width; } n = 0; quant_data += lowdelay->slice_y_size; for (i = 0; i < 1 + 3 * params->transform_depth; i++) { SchroFrameData block1; SchroFrameData block2; schro_frame_data_get_codeblock (&block1, lowdelay->chroma1_subbands + i, slice_x, slice_y, lowdelay->n_horiz_slices, lowdelay->n_vert_slices); schro_frame_data_get_codeblock (&block2, lowdelay->chroma2_subbands + i, slice_x, slice_y, lowdelay->n_horiz_slices, lowdelay->n_vert_slices); quant_index = CLAMP (base_index - params->quant_matrix[i], 0, 60); if (i == 0) { /* dc dequant is handled by estimation */ } else { dequantise_block (&block1, quant_data + n, quant_index); dequantise_block (&block2, quant_data + n + lowdelay->slice_uv_size, quant_index); } n += block1.height * block1.width; } } static int schro_encoder_pick_slice_index (SchroEncoderFrame * frame, SchroLowDelay * lowdelay, int slice_x, int slice_y, int slice_bytes) { int i; int n; int size; i = 0; n = schro_encoder_estimate_slice (frame, lowdelay, slice_x, slice_y, slice_bytes, i); if (n <= slice_bytes * 8) { schro_encoder_dequantise_slice (frame, lowdelay, slice_x, slice_y, slice_bytes, i); return i; } size = 32; while (size >= 1) { n = schro_encoder_estimate_slice (frame, lowdelay, slice_x, slice_y, slice_bytes, i + size); if (n >= slice_bytes * 8) { i += size; } size >>= 1; } schro_encoder_estimate_slice (frame, lowdelay, slice_x, slice_y, slice_bytes, i + 1); schro_encoder_dequantise_slice (frame, lowdelay, slice_x, slice_y, slice_bytes, i + 1); return i + 1; } void schro_encoder_encode_lowdelay_transform_data (SchroEncoderFrame * frame) { SchroParams *params = &frame->params; SchroLowDelay lowdelay; int x, y; int n_bytes; int remainder; int accumulator; int extra; int base_index; int total_bits; schro_lowdelay_init (&lowdelay, frame->iwt_frame, params); lowdelay.reconstructed_frame = schro_frame_new_and_alloc (NULL, frame->iwt_frame->format, lowdelay.luma_subbands[0].width, lowdelay.luma_subbands[0].height); lowdelay.n_horiz_slices = params->n_horiz_slices; lowdelay.n_vert_slices = params->n_vert_slices; n_bytes = params->slice_bytes_num / params->slice_bytes_denom; remainder = params->slice_bytes_num % params->slice_bytes_denom; accumulator = 0; total_bits = 0; for (y = 0; y < lowdelay.n_vert_slices; y++) { for (x = 0; x < lowdelay.n_horiz_slices; x++) { accumulator += remainder; if (accumulator >= params->slice_bytes_denom) { extra = 1; accumulator -= params->slice_bytes_denom; } else { extra = 0; } base_index = schro_encoder_pick_slice_index (frame, &lowdelay, x, y, n_bytes + extra); total_bits += schro_encoder_encode_slice (frame, &lowdelay, x, y, n_bytes + extra, base_index); } } SCHRO_INFO ("used bits %d of %d", total_bits, lowdelay.n_horiz_slices * lowdelay.n_vert_slices * params->slice_bytes_num * 8 / params->slice_bytes_denom); schro_frame_unref (lowdelay.reconstructed_frame); schro_lowdelay_cleanup (&lowdelay); } #endif schroedinger-1.0.11/schroedinger/opengl/0000775000175000017500000000000011707140272015212 500000000000000schroedinger-1.0.11/schroedinger/opengl/schroopenglshader.c0000644000175000017500000017727311320232176021023 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include static char* schro_opengl_shader_add_linenumbers (const char* code) { const char *src = code; char *dest; char *linenumbered_code; char number[16]; int lines = 1; int size; while (*src) { if (*src == '\n') { ++lines; } ++src; } snprintf (number, sizeof (number) - 1, "%3i: ", lines); size = strlen (code) + 1 + lines * strlen (number); linenumbered_code = schro_malloc0 (size); src = code; dest = linenumbered_code; strcpy (dest, " 1: "); dest += strlen (" 1: "); lines = 2; while (*src) { *dest++ = *src; if (*src == '\n') { snprintf (number, sizeof (number) - 1, "%3i: ", lines); strcpy (dest, number); dest += strlen (number); ++lines; } ++src; } return linenumbered_code; } static int schro_opengl_shader_check_status (GLhandleARB handle, GLenum status, const char* code, const char* name) { GLint result; GLint length; char* infolog; char* linenumbered_code; glGetObjectParameterivARB (handle, status, &result); glGetObjectParameterivARB (handle, GL_OBJECT_INFO_LOG_LENGTH_ARB, &length); if (length < 1) { SCHRO_ERROR ("invalid infolog length %i", length); return FALSE; } infolog = schro_malloc0 (length * sizeof (char)); glGetInfoLogARB (handle, length, &length, infolog); if (length > 0) { linenumbered_code = schro_opengl_shader_add_linenumbers (code); SCHRO_ERROR ("\nshadername:\n%s\nshadercode:\n%s\ninfolog:\n%s", name, linenumbered_code, infolog); schro_free (linenumbered_code); } schro_free (infolog); return result != 0; } static SchroOpenGLShader * schro_opengl_shader_new (const char* code, const char* name) { SchroOpenGLShader *shader; GLhandleARB handle; int ok; shader = schro_malloc0 (sizeof (SchroOpenGLShader)); handle = glCreateShaderObjectARB (GL_FRAGMENT_SHADER_ARB); glShaderSourceARB (handle, 1, (const char**)&code, 0); glCompileShaderARB (handle); ok = schro_opengl_shader_check_status (handle, GL_OBJECT_COMPILE_STATUS_ARB, code, name); SCHRO_ASSERT (ok); shader->program = glCreateProgramObjectARB (); glAttachObjectARB (shader->program, handle); glDeleteObjectARB (handle); glLinkProgramARB (shader->program); ok = schro_opengl_shader_check_status (shader->program, GL_OBJECT_LINK_STATUS_ARB, code, name); SCHRO_ASSERT (ok); glValidateProgramARB (shader->program); ok = schro_opengl_shader_check_status (shader->program, GL_OBJECT_VALIDATE_STATUS_ARB, code, name); SCHRO_ASSERT (ok); #define UNIFORM_LOCATION_SAMPLER(_name, _member) \ do { \ if (strstr (code, "uniform sampler2DRect "#_name";") || \ strstr (code, "uniform usampler2DRect "#_name";") || \ strstr (code, "uniform isampler2DRect "#_name";")) { \ shader->_member = glGetUniformLocationARB (shader->program, #_name); \ } else { \ shader->_member = -1; \ } \ } while (0) #define UNIFORM_LOCATION(_type, _name, _member) \ do { \ if (strstr (code, "uniform "#_type" "#_name";")) { \ shader->_member = glGetUniformLocationARB (shader->program, #_name); \ } else { \ shader->_member = -1; \ } \ } while (0) UNIFORM_LOCATION_SAMPLER (texture1, textures[0]); UNIFORM_LOCATION_SAMPLER (texture2, textures[1]); UNIFORM_LOCATION_SAMPLER (texture3, textures[2]); UNIFORM_LOCATION (vec2, offset, offset); UNIFORM_LOCATION (vec2, origin, origin); UNIFORM_LOCATION (vec2, size, size); UNIFORM_LOCATION (vec2, four_decrease, four_decrease); UNIFORM_LOCATION (vec2, three_decrease, three_decrease); UNIFORM_LOCATION (vec2, two_decrease, two_decrease); UNIFORM_LOCATION (vec2, one_decrease, one_decrease); UNIFORM_LOCATION (vec2, one_increase, one_increase); UNIFORM_LOCATION (vec2, two_increase, two_increase); UNIFORM_LOCATION (vec2, three_increase, three_increase); UNIFORM_LOCATION (vec2, four_increase, four_increase); UNIFORM_LOCATION (float, dc, dc); UNIFORM_LOCATION (float, weight, weight); UNIFORM_LOCATION (float, addend, addend); UNIFORM_LOCATION (float, divisor, divisor); #undef UNIFORM_LOCATION_SAMPLER #undef UNIFORM_LOCATION if (GLEW_EXT_gpu_shader4) { if (strstr (code, "varying out uvec4 fragcolor_u8;")) { glBindFragDataLocationEXT (shader->program, 0, "fragcolor_u8"); } else if (strstr (code, "varying out ivec4 fragcolor_s16;")) { glBindFragDataLocationEXT (shader->program, 0, "fragcolor_s16"); } } return shader; } static void schro_opengl_shader_free (SchroOpenGLShader *shader) { SCHRO_ASSERT (shader != NULL); glDeleteObjectARB (shader->program); schro_free (shader); } struct ShaderCode { int index; const char *name; unsigned int flags; const char *code; const char *code_integer; }; #define SHADER_FLAG_USE_U8 (1 << 0) #define SHADER_FLAG_USE_S16 (1 << 1) #define SHADER_HEADER \ "#version 110\n" \ "#extension GL_ARB_draw_buffers : require\n" \ "#extension GL_ARB_texture_rectangle : require\n" #define SHADER_HEADER_INTEGER \ "#version 120\n" \ "#extension GL_ARB_draw_buffers : require\n" \ "#extension GL_ARB_texture_rectangle : require\n" \ "#extension GL_EXT_gpu_shader4 : require\n" \ "#define uint unsigned int\n" #define SHADER_READ_U8(_texture, _postfix) \ "uniform sampler2DRect "_texture";\n" \ "float read"_postfix"_u8 (vec2 offset = vec2 (0.0)) {\n" \ " float fp = texture2DRect ("_texture", gl_TexCoord[0].xy + offset).r;\n" \ /* scale from FP [0..1] to real U8 [0..255] and apply proper rounding */ \ " return floor (fp * 255.0 + 0.5);\n" \ "}\n" #define SHADER_WRITE_U8 \ "void write_u8 (float u8) {\n" \ /* scale from real U8 [0..255] to FP [0..1] */ \ " gl_FragColor = vec4 (u8 / 255.0);\n" \ "}\n" #define SHADER_READ_U8_INTEGER(_texture, _postfix) \ "uniform usampler2DRect "_texture";\n" \ "uint read"_postfix"_u8 (vec2 offset = vec2 (0.0)) {\n" \ " return texture2DRect ("_texture", gl_TexCoord[0].xy + offset).a;\n" \ "}\n" #define SHADER_WRITE_U8_INTEGER \ "varying out uvec4 fragcolor_u8;\n" \ "void write_u8 (uint u8) {\n" \ " fragcolor_u8 = uvec4 (u8);\n" \ "}\n" #define SHADER_WRITE_U8_VEC4_INTEGER \ "varying out uvec4 fragcolor_u8;\n" \ "void write_u8_vec4 (uvec4 u8) {\n" \ " fragcolor_u8 = u8;\n" \ "}\n" #define SHADER_WRITE_U16_INTEGER \ "varying out ivec4 fragcolor_s16;\n" \ "void write_u16 (int u16) {\n" \ " fragcolor_s16 = ivec4 (u16);\n" \ "}\n" #define SHADER_READ_S16(_texture, _postfix) \ "uniform sampler2DRect "_texture";\n" \ "float read"_postfix"_s16 (vec2 offset = vec2 (0.0)) {\n" \ /* scale and bias from FP range [0..1] to S16 range [-32768..32767] */ \ " return floor (texture2DRect ("_texture", gl_TexCoord[0].xy + offset).r\n" \ " * 65535.0 + 0.5) - 32768.0;\n" \ "}\n" #define SHADER_WRITE_S16 \ "void write_s16 (float s16) {\n" \ /* scale and bias from S16 range [-32768..32767] to FP range [0..1] */ \ " gl_FragColor = vec4 ((s16 + 32768.0) / 65535.0);\n" \ "}\n" #define SHADER_READ_S16_INTEGER(_texture, _postfix) \ "uniform isampler2DRect "_texture";\n" \ "int read"_postfix"_s16 (vec2 offset = vec2 (0.0)) {\n" \ " return texture2DRect ("_texture", gl_TexCoord[0].xy + offset).a - 32768;\n" \ "}\n" #define SHADER_WRITE_S16_INTEGER \ "varying out ivec4 fragcolor_s16;\n" \ "void write_s16 (int s16) {\n" \ " fragcolor_s16 = ivec4 (s16 + 32768);\n" \ "}\n" #define SHADER_CAST_S16_U8_INTEGER \ "int cast_s16_u8 (uint u8) {\n" \ " return int (u8);\n" \ "}\n" #define SHADER_CAST_U8_S16_INTEGER \ "uint cast_u8_s16 (int s16) {\n" \ " return uint (clamp (s16, 0, 255));\n" \ "}\n" #define SHADER_DIVIDE_S16 \ "float divide_s16 (float value, float divisor) {\n" \ " return floor (value / divisor);\n" \ "}\n" #if 0 #define SHADER_DIVIDE_S16_INTEGER \ "int divide_s16 (int value, int divisor) {\n" \ " return value < 0 ? (value - (divisor - ((-value) % divisor))) / divisor\n" \ " : value / divisor;\n" \ "}\n" #else #define SHADER_DIVIDE_S16_INTEGER \ "int divide_s16 (int value, int divisor) {\n" \ " return int (floor (float (value) / float (divisor)));\n" \ "}\n" #endif #define SHADER_RSHIFT(_a, _b) \ "float rshift (float value) {\n" \ " return floor ((value + ("#_a")) / ("#_b"));\n" \ "}\n" #define SHADER_RSHIFT_U8_INTEGER(_a, _b) \ "uint rshift_u8 (uint value) {\n" \ " return (value + ("#_a") / ("#_b");\n" \ "}\n" #define SHADER_RSHIFT_S16_INTEGER(_a, _b) \ SHADER_DIVIDE_S16_INTEGER \ "int rshift_s16 (int value) {\n" \ " return divide_s16 (value + ("#_a"), "#_b");\n" \ "}\n" static struct ShaderCode schro_opengl_shader_code_list[] = { { SCHRO_OPENGL_SHADER_COPY_U8, "copy_u8", SHADER_FLAG_USE_U8, SHADER_HEADER "uniform sampler2DRect texture1;\n" /* U8 */ "void main (void) {\n" " gl_FragColor = texture2DRect (texture1, gl_TexCoord[0].xy);\n" "}\n", SHADER_HEADER_INTEGER SHADER_READ_U8_INTEGER ("texture1", "") /* U8 */ SHADER_WRITE_U8_INTEGER "void main (void) {\n" " write_u8 (read_u8 ());\n" "}\n" }, { SCHRO_OPENGL_SHADER_COPY_S16, "copy_s16", SHADER_FLAG_USE_S16, SHADER_HEADER "uniform sampler2DRect texture1;\n" /* S16 */ "void main (void) {\n" " gl_FragColor = texture2DRect (texture1, gl_TexCoord[0].xy);\n" "}\n", SHADER_HEADER_INTEGER SHADER_READ_S16_INTEGER ("texture1", "") /* S16 */ SHADER_WRITE_S16_INTEGER "void main (void) {\n" " write_s16 (read_s16 ());\n" "}\n" }, { SCHRO_OPENGL_SHADER_CONVERT_U8_S16, "convert_u8_s16", SHADER_FLAG_USE_U8 | SHADER_FLAG_USE_S16, SHADER_HEADER "uniform sampler2DRect texture1;\n" /* S16 */ "const float scale = 255.0 / 65535.0;\n" "const float bias = (32767.0 - 127.0) / 65535.0;\n" "void main (void) {\n" " gl_FragColor\n" " = (texture2DRect (texture1, gl_TexCoord[0].xy) - bias) / scale;\n" "}\n", SHADER_HEADER_INTEGER SHADER_READ_S16_INTEGER ("texture1", "") /* S16 */ SHADER_WRITE_U8_INTEGER SHADER_CAST_U8_S16_INTEGER "void main (void) {\n" " write_u8 (cast_u8_s16 (read_s16 () + 128));\n" "}\n" }, { SCHRO_OPENGL_SHADER_CONVERT_S16_U8, "convert_s16_u8", SHADER_FLAG_USE_U8 | SHADER_FLAG_USE_S16, SHADER_HEADER "uniform sampler2DRect texture1;\n" /* U8 */ "const float scale = 255.0 / 65535.0;\n" "const float bias = (32767.0 - 127.0) / 65535.0;\n" "void main (void) {\n" " gl_FragColor\n" " = texture2DRect (texture1, gl_TexCoord[0].xy) * scale + bias;\n" "}\n", SHADER_HEADER_INTEGER SHADER_READ_U8_INTEGER ("texture1", "") /* U8 */ SHADER_WRITE_S16_INTEGER SHADER_CAST_S16_U8_INTEGER "void main (void) {\n" " write_s16 (cast_s16_u8 (read_u8 ()) - 128);\n" "}\n" }, { SCHRO_OPENGL_SHADER_CONVERT_U8_U8, "convert_u8_u8", SHADER_FLAG_USE_U8, SHADER_HEADER "uniform sampler2DRect texture1;\n" /* U8 */ "void main (void) {\n" " gl_FragColor = texture2DRect (texture1, gl_TexCoord[0].xy);\n" "}\n", SHADER_HEADER_INTEGER SHADER_READ_U8_INTEGER ("texture1", "") /* U8 */ SHADER_WRITE_U8_INTEGER "void main (void) {\n" " write_u8 (read_u8 ());\n" "}\n" }, { SCHRO_OPENGL_SHADER_CONVERT_S16_S16, "convert_s16_s16", SHADER_FLAG_USE_S16, SHADER_HEADER "uniform sampler2DRect texture1;\n" /* S16 */ "void main (void) {\n" " gl_FragColor = texture2DRect (texture1, gl_TexCoord[0].xy);\n" "}\n", SHADER_HEADER_INTEGER SHADER_READ_S16_INTEGER ("texture1", "") /* S16 */ SHADER_WRITE_S16_INTEGER "void main (void) {\n" " write_s16 (read_s16 ());\n" "}\n" }, { SCHRO_OPENGL_SHADER_CONVERT_U8_Y4_YUYV, "convert_u8_y4_yuyv", SHADER_FLAG_USE_U8, SHADER_HEADER "uniform sampler2DRect texture1;\n" /* YUYV */ "void main (void) {\n" /* round x coordinate down from texel center n.5 to texel edge n.0 */ " float x = floor (gl_TexCoord[0].x) / 2.0;\n" " float y = gl_TexCoord[0].y;\n" /* shift x coordinate from texel edge n.0 to texel center n.5 */ " vec2 coordinate = vec2 (floor (x) + 0.5, y);\n" " vec4 yuyv = texture2DRect (texture1, coordinate);\n" " if (fract (x) < 0.25) {\n" " gl_FragColor = vec4 (yuyv.r);\n" " } else {\n" " gl_FragColor = vec4 (yuyv.b);\n" " }\n" "}\n", SHADER_HEADER_INTEGER SHADER_WRITE_U8_INTEGER "uniform usampler2DRect texture1;\n" /* YUYV */ "void main (void) {\n" /* round x coordinate down from texel center n.5 to texel edge n.0 */ " float x = floor (gl_TexCoord[0].x) / 2.0;\n" " float y = gl_TexCoord[0].y;\n" /* shift x coordinate from texel edge n.0 to texel center n.5 */ " vec2 coordinate = vec2 (floor (x) + 0.5, y);\n" " uvec4 yuyv = texture2DRect (texture1, coordinate);\n" " if (fract (x) < 0.25) {\n" " write_u8 (yuyv.r);\n" " } else {\n" " write_u8 (yuyv.b);\n" " }\n" "}\n" }, { SCHRO_OPENGL_SHADER_CONVERT_U8_U2_YUYV, "convert_u8_u2_yuyv", SHADER_FLAG_USE_U8, SHADER_HEADER "uniform sampler2DRect texture1;\n" /* YUYV */ "void main (void) {\n" " vec4 yuyv = texture2DRect (texture1, gl_TexCoord[0].xy);\n" " gl_FragColor = vec4 (yuyv.g);\n" "}\n", SHADER_HEADER_INTEGER SHADER_WRITE_U8_INTEGER "uniform usampler2DRect texture1;\n" /* YUYV */ "void main (void) {\n" " uvec4 yuyv = texture2DRect (texture1, gl_TexCoord[0].xy);\n" " write_u8 (yuyv.g);\n" "}\n" }, { SCHRO_OPENGL_SHADER_CONVERT_U8_V2_YUYV, "convert_u8_v2_yuyv", SHADER_FLAG_USE_U8, SHADER_HEADER "uniform sampler2DRect texture1;\n" /* YUYV */ "void main (void) {\n" " vec4 yuyv = texture2DRect (texture1, gl_TexCoord[0].xy);\n" " gl_FragColor = vec4 (yuyv.a);\n" "}\n", SHADER_HEADER_INTEGER SHADER_WRITE_U8_INTEGER "uniform usampler2DRect texture1;\n" /* YUYV */ "void main (void) {\n" " uvec4 yuyv = texture2DRect (texture1, gl_TexCoord[0].xy);\n" " write_u8 (yuyv.a);\n" "}\n" }, { SCHRO_OPENGL_SHADER_CONVERT_U8_Y4_UYVY, "convert_u8_y4_uyvy", SHADER_FLAG_USE_U8, SHADER_HEADER "uniform sampler2DRect texture1;\n" /* UYVY */ "void main (void) {\n" /* round x coordinate down from texel center n.5 to texel edge n.0 */ " float x = floor (gl_TexCoord[0].x) / 2.0;\n" " float y = gl_TexCoord[0].y;\n" /* shift x coordinate from texel edge n.0 to texel center n.5 */ " vec2 coordinate = vec2 (floor (x) + 0.5, y);\n" " vec4 uyvy = texture2DRect (texture1, coordinate);\n" " if (fract (x) < 0.25) {\n" " gl_FragColor = vec4 (uyvy.g);\n" " } else {\n" " gl_FragColor = vec4 (uyvy.a);\n" " }\n" "}\n", SHADER_HEADER_INTEGER SHADER_WRITE_U8_INTEGER "uniform usampler2DRect texture1;\n" /* UYVY */ "void main (void) {\n" /* round x coordinate down from texel center n.5 to texel edge n.0 */ " float x = floor (gl_TexCoord[0].x) / 2.0;\n" " float y = gl_TexCoord[0].y;\n" /* shift x coordinate from texel edge n.0 to texel center n.5 */ " vec2 coordinate = vec2 (floor (x) + 0.5, y);\n" " uvec4 uyvy = texture2DRect (texture1, coordinate);\n" " if (fract (x) < 0.25) {\n" " write_u8 (uyvy.g);\n" " } else {\n" " write_u8 (uyvy.a);\n" " }\n" "}\n" }, { SCHRO_OPENGL_SHADER_CONVERT_U8_U2_UYVY, "convert_u8_u2_uyvy", SHADER_FLAG_USE_U8, SHADER_HEADER "uniform sampler2DRect texture1;\n" /* UYVY */ "void main (void) {\n" " vec4 uyvy = texture2DRect (texture1, gl_TexCoord[0].xy);\n" " gl_FragColor = vec4 (uyvy.r);\n" "}\n", SHADER_HEADER_INTEGER SHADER_WRITE_U8_INTEGER "uniform usampler2DRect texture1;\n" /* UYVY */ "void main (void) {\n" " uvec4 uyvy = texture2DRect (texture1, gl_TexCoord[0].xy);\n" " write_u8 (uyvy.r);\n" "}\n" }, { SCHRO_OPENGL_SHADER_CONVERT_U8_V2_UYVY, "convert_u8_v2_uyvy", SHADER_FLAG_USE_U8, SHADER_HEADER "uniform sampler2DRect texture1;\n" /* UYVY */ "void main (void) {\n" " vec4 uyvy = texture2DRect (texture1, gl_TexCoord[0].xy);\n" " gl_FragColor = vec4 (uyvy.b);\n" "}\n", SHADER_HEADER_INTEGER SHADER_WRITE_U8_INTEGER "uniform usampler2DRect texture1;\n" /* UYVY */ "void main (void) {\n" " uvec4 uyvy = texture2DRect (texture1, gl_TexCoord[0].xy);\n" " write_u8 (uyvy.b);\n" "}\n" }, { SCHRO_OPENGL_SHADER_CONVERT_U8_Y4_AYUV, "convert_u8_y4_ayuv", SHADER_FLAG_USE_U8, SHADER_HEADER "uniform sampler2DRect texture1;\n" /* AYUV */ "void main (void) {\n" " vec4 ayuv = texture2DRect (texture1, gl_TexCoord[0].xy);\n" " gl_FragColor = vec4 (ayuv.g);\n" "}\n", SHADER_HEADER_INTEGER SHADER_WRITE_U8_INTEGER "uniform usampler2DRect texture1;\n" /* AYUV */ "void main (void) {\n" " uvec4 ayuv = texture2DRect (texture1, gl_TexCoord[0].xy);\n" " write_u8 (ayuv.g);\n" "}\n" }, { SCHRO_OPENGL_SHADER_CONVERT_U8_U4_AYUV, "convert_u8_u4_ayuv", SHADER_FLAG_USE_U8, SHADER_HEADER "uniform sampler2DRect texture1;\n" /* AYUV */ "void main (void) {\n" " vec4 ayuv = texture2DRect (texture1, gl_TexCoord[0].xy);\n" " gl_FragColor = vec4 (ayuv.b);\n" "}\n", SHADER_HEADER_INTEGER SHADER_WRITE_U8_INTEGER "uniform usampler2DRect texture1;\n" /* AYUV */ "void main (void) {\n" " uvec4 ayuv = texture2DRect (texture1, gl_TexCoord[0].xy);\n" " write_u8 (ayuv.b);\n" "}\n" }, { SCHRO_OPENGL_SHADER_CONVERT_U8_V4_AYUV, "convert_u8_v4_ayuv", SHADER_FLAG_USE_U8, SHADER_HEADER "uniform sampler2DRect texture1;\n" /* AYUV */ "void main (void) {\n" " vec4 ayuv = texture2DRect (texture1, gl_TexCoord[0].xy);\n" " gl_FragColor = vec4 (ayuv.a);\n" "}\n", SHADER_HEADER_INTEGER SHADER_WRITE_U8_INTEGER "uniform usampler2DRect texture1;\n" /* AYUV */ "void main (void) {\n" " uvec4 ayuv = texture2DRect (texture1, gl_TexCoord[0].xy);\n" " write_u8 (ayuv.a);\n" "}\n" }, { SCHRO_OPENGL_SHADER_CONVERT_YUYV_U8_422, "convert_yuyv_u8_422", SHADER_FLAG_USE_U8, SHADER_HEADER "uniform sampler2DRect texture1;\n" /* Y4 */ "uniform sampler2DRect texture2;\n" /* U2 */ "uniform sampler2DRect texture3;\n" /* V2 */ "void main (void) {\n" " vec4 yuyv;\n" /* round x coordinate down from texel center n.5 to texel edge n.0 */ " float x = floor (gl_TexCoord[0].x) * 2.0;\n" " float y = gl_TexCoord[0].y;\n" /* shift x coordinate from texel edge n.0 to texel center n.5 */ " vec2 coordinate1 = vec2 (x + 0.5, y);\n" " vec2 coordinate2 = vec2 (x + 1.5, y);\n" " yuyv.r = texture2DRect (texture1, coordinate1).r;\n" " yuyv.g = texture2DRect (texture2, gl_TexCoord[0].xy).r;\n" " yuyv.b = texture2DRect (texture1, coordinate2).r;\n" " yuyv.a = texture2DRect (texture3, gl_TexCoord[0].xy).r;\n" " gl_FragColor = yuyv;\n" "}\n", SHADER_HEADER_INTEGER SHADER_WRITE_U8_VEC4_INTEGER "uniform usampler2DRect texture1;\n" /* Y4 */ "uniform usampler2DRect texture2;\n" /* U2 */ "uniform usampler2DRect texture3;\n" /* V2 */ "void main (void) {\n" " uvec4 yuyv;\n" /* round x coordinate down from texel center n.5 to texel edge n.0 */ " float x = floor (gl_TexCoord[0].x) * 2.0;\n" " float y = gl_TexCoord[0].y;\n" /* shift x coordinate from texel edge n.0 to texel center n.5 */ " vec2 coordinate1 = vec2 (x + 0.5, y);\n" " vec2 coordinate2 = vec2 (x + 1.5, y);\n" " yuyv.r = texture2DRect (texture1, coordinate1).a;\n" " yuyv.g = texture2DRect (texture2, gl_TexCoord[0].xy).a;\n" " yuyv.b = texture2DRect (texture1, coordinate2).a;\n" " yuyv.a = texture2DRect (texture3, gl_TexCoord[0].xy).a;\n" " write_u8_vec4 (yuyv);\n" "}\n" }, { SCHRO_OPENGL_SHADER_CONVERT_UYVY_U8_422, "convert_uyvy_u8_422", SHADER_FLAG_USE_U8, SHADER_HEADER "uniform sampler2DRect texture1;\n" /* Y4 */ "uniform sampler2DRect texture2;\n" /* U2 */ "uniform sampler2DRect texture3;\n" /* V2 */ "void main (void) {\n" " vec4 uyvy;\n" /* round x coordinate down from texel center n.5 to n.0 and scale up to double width */ " float x = floor (gl_TexCoord[0].x) * 2.0;\n" " float y = gl_TexCoord[0].y;\n" /* shift x coordinate from texel edge n.0 to texel center n.5 */ " vec2 coordinate1 = vec2 (x + 0.5, y);\n" " vec2 coordinate2 = vec2 (x + 1.5, y);\n" " uyvy.r = texture2DRect (texture2, gl_TexCoord[0].xy).r;\n" " uyvy.g = texture2DRect (texture1, coordinate1).r;\n" " uyvy.b = texture2DRect (texture3, gl_TexCoord[0].xy).r;\n" " uyvy.a = texture2DRect (texture1, coordinate2).r;\n" " gl_FragColor = uyvy;\n" "}\n", SHADER_HEADER_INTEGER SHADER_WRITE_U8_VEC4_INTEGER "uniform usampler2DRect texture1;\n" /* Y4 */ "uniform usampler2DRect texture2;\n" /* U2 */ "uniform usampler2DRect texture3;\n" /* V2 */ "void main (void) {\n" " uvec4 uyvy;\n" /* round x coordinate down from texel center n.5 to n.0 and scale up to double width */ " float x = floor (gl_TexCoord[0].x) * 2.0;\n" " float y = gl_TexCoord[0].y;\n" /* shift x coordinate from texel edge n.0 to texel center n.5 */ " vec2 coordinate1 = vec2 (x + 0.5, y);\n" " vec2 coordinate2 = vec2 (x + 1.5, y);\n" " uyvy.r = texture2DRect (texture2, gl_TexCoord[0].xy).a;\n" " uyvy.g = texture2DRect (texture1, coordinate1).a;\n" " uyvy.b = texture2DRect (texture3, gl_TexCoord[0].xy).a;\n" " uyvy.a = texture2DRect (texture1, coordinate2).a;\n" " write_u8_vec4 (uyvy);\n" "}\n" }, { SCHRO_OPENGL_SHADER_CONVERT_AYUV_U8_444, "convert_ayuv_u8_444", SHADER_FLAG_USE_U8, SHADER_HEADER "uniform sampler2DRect texture1;\n" /* Y4 */ "uniform sampler2DRect texture2;\n" /* U4 */ "uniform sampler2DRect texture3;\n" /* V4 */ "void main (void) {\n" " vec4 ayuv;\n" " ayuv.r = 1.0;\n" " ayuv.g = texture2DRect (texture1, gl_TexCoord[0].xy).r;\n" " ayuv.b = texture2DRect (texture2, gl_TexCoord[0].xy).r;\n" " ayuv.a = texture2DRect (texture3, gl_TexCoord[0].xy).r;\n" " gl_FragColor = ayuv;\n" "}\n", SHADER_HEADER_INTEGER SHADER_WRITE_U8_VEC4_INTEGER "uniform usampler2DRect texture1;\n" /* Y4 */ "uniform usampler2DRect texture2;\n" /* U4 */ "uniform usampler2DRect texture3;\n" /* V4 */ "void main (void) {\n" " uvec4 ayuv;\n" " ayuv.r = 255u;\n" " ayuv.g = texture2DRect (texture1, gl_TexCoord[0].xy).a;\n" " ayuv.b = texture2DRect (texture2, gl_TexCoord[0].xy).a;\n" " ayuv.a = texture2DRect (texture3, gl_TexCoord[0].xy).a;\n" " write_u8_vec4 (ayuv);\n" "}\n" }, /* FIXME: CPU overflows, GPU clamps, is this a problem? */ { SCHRO_OPENGL_SHADER_ADD_S16_U8, "add_s16_u8", SHADER_FLAG_USE_U8 | SHADER_FLAG_USE_S16, SHADER_HEADER "uniform sampler2DRect texture1;\n" /* S16 */ "uniform sampler2DRect texture2;\n" /* U8 */ "const float scale = 255.0 / 65535.0;\n" "const float bias = -32768.0 / 65535.0;\n" "void main (void) {\n" /* bias from [-32768..32767] = [0..1] to [-32768..32767] ~= [-0.5..0.5] so that S16 zero maps to FP zero, otherwise S16 zero maps to FP ~0.5 leading to S16 zero - S16 zero != S16 zero if calculation is done in FP space */ " vec4 a = texture2DRect (texture1, gl_TexCoord[0].xy) + bias;\n" /* scale from U8 [0..255] == [0..1] to S16 [..0..255..] ~= [0..0.004] so that both inputs from S16 and U8 are mapped equivalent to FP and U8 zero == S16 zero == FP zero holds */ " vec4 b = texture2DRect (texture2, gl_TexCoord[0].xy) * scale;\n" /* bias from [-32768..32767] ~= [-0.5..0.5] to [-32768..32767] = [0..1] to undo the initial bias */ " gl_FragColor = (a + b) - bias;\n" "}\n", SHADER_HEADER_INTEGER SHADER_READ_S16_INTEGER ("texture1", "_op1") /* S16 */ SHADER_READ_U8_INTEGER ("texture2", "_op2") /* U8 */ SHADER_WRITE_S16_INTEGER SHADER_CAST_S16_U8_INTEGER "void main (void) {\n" " write_s16 (read_op1_s16 () + cast_s16_u8 (read_op2_u8 ()));\n" \ "}\n" }, /* FIXME: CPU overflows, GPU clamps, is this a problem? */ { SCHRO_OPENGL_SHADER_ADD_S16_S16, "add_s16_s16", SHADER_FLAG_USE_S16, SHADER_HEADER "uniform sampler2DRect texture1;\n" /* S16 */ "uniform sampler2DRect texture2;\n" /* S16 */ "const float bias = -32768.0 / 65535.0;\n" "void main (void) {\n" /* bias from [-32768..32767] = [0..1] to [-32768..32767] ~= [-0.5..0.5] so that S16 zero maps to FP zero, otherwise S16 zero maps to FP ~0.5 leading to S16 zero - S16 zero != S16 zero if calculation is done in FP space */ " vec4 a = texture2DRect (texture1, gl_TexCoord[0].xy) + bias;\n" " vec4 b = texture2DRect (texture2, gl_TexCoord[0].xy) + bias;\n" /* bias from [-32768..32767] ~= [-0.5..0.5] to [-32768..32767] = [0..1] to undo the initial bias */ " gl_FragColor = (a + b) - bias;\n" "}\n", SHADER_HEADER_INTEGER SHADER_READ_S16_INTEGER ("texture1", "_op1") /* S16 */ SHADER_READ_S16_INTEGER ("texture2", "_op2") /* S16 */ SHADER_WRITE_S16_INTEGER "void main (void) {\n" " write_s16 (read_op1_s16 () + read_op2_s16 ());\n" "}\n" }, /* FIXME: CPU overflows, GPU clamps, is this a problem? */ { SCHRO_OPENGL_SHADER_SUBTRACT_S16_U8, "subtract_s16_u8", SHADER_FLAG_USE_U8 | SHADER_FLAG_USE_S16, SHADER_HEADER "uniform sampler2DRect texture1;\n" /* S16 */ "uniform sampler2DRect texture2;\n" /* U8 */ "const float scale = 255.0 / 65535.0;\n" "const float bias = -32768.0 / 65535.0;\n" "void main (void) {\n" /* bias from [-32768..32767] == [0..1] to [-32768..32767] ~= [-0.5..0.5] so that S16 zero maps to FP zero, otherwise S16 zero maps to FP ~0.5 leading to S16 zero - S16 zero != S16 zero if calculation is done in FP space */ " vec4 a = texture2DRect (texture1, gl_TexCoord[0].xy) + bias;\n" /* scale from U8 [0..255] == [0..1] to S16 [..0..255..] ~= [0..0.004] so that both inputs from S16 and U8 are mapped equivalent to FP and U8 zero == S16 zero == FP zero holds */ " vec4 b = texture2DRect (texture2, gl_TexCoord[0].xy) * scale;\n" /* bias from [-32768..32767] ~= [-0.5..0.5] to [-32768..32767] = [0..1] to undo the initial bias */ " gl_FragColor = (a - b) - bias;\n" "}\n", SHADER_HEADER_INTEGER SHADER_READ_S16_INTEGER ("texture1", "_op1") /* S16 */ SHADER_READ_U8_INTEGER ("texture2", "_op2") /* U8 */ SHADER_WRITE_S16_INTEGER SHADER_CAST_S16_U8_INTEGER "void main (void) {\n" " write_s16 (read_op1_s16 () - cast_s16_u8 (read_op2_u8 ()));\n" \ "}\n" }, /* FIXME: CPU overflows, GPU clamps, is this a problem? */ { SCHRO_OPENGL_SHADER_SUBTRACT_S16_S16, "subtract_s16_s16", SHADER_FLAG_USE_S16, SHADER_HEADER "uniform sampler2DRect texture1;\n" /* S16 */ "uniform sampler2DRect texture2;\n" /* S16 */ "const float bias = -32768.0 / 65535.0;\n" "void main (void) {\n" /* bias from [-32768..32767] == [0..1] to [-32768..32767] ~= [-0.5..0.5] so that S16 zero maps to FP zero, otherwise S16 zero maps to FP ~0.5 leading to S16 zero - S16 zero != S16 zero if calculation is done in FP space */ " vec4 a = texture2DRect (texture1, gl_TexCoord[0].xy) + bias;\n" " vec4 b = texture2DRect (texture2, gl_TexCoord[0].xy) + bias;\n" /* bias from [-32768..32767] ~= [-0.5..0.5] to [-32768..32767] == [0..1] to undo the initial bias */ " gl_FragColor = (a - b) - bias;\n" "}\n", SHADER_HEADER_INTEGER SHADER_READ_S16_INTEGER ("texture1", "_op1") /* S16 */ SHADER_READ_S16_INTEGER ("texture2", "_op2") /* S16 */ SHADER_WRITE_S16_INTEGER "void main (void) {\n" " write_s16 (read_op1_s16 () - read_op2_s16 ());\n" \ "}\n" }, /* 1 = Deslauriers-Debuc (9,7) 2 = LeGall (5,3) 3 = Deslauriers-Debuc (13,7) 4 = Haar 0/1 5 = Fidelity 6 = Daubechies (9,7) offset = height / 2 +---------------+ read for... | | | L | L' H' | | | o | A[2 * n - 6] - - - - ? ? - - - - ? ? | o | A[2 * n - 4] - - - - ? ? - - - - ? ? | o | A[2 * n - 2] - - - - ? ? o - o - ? ? | /> X | A[2 * n ] = = = = ? ? X X X X ? ? | / o | A[2 * n + 2] - - - - ? ? o o o - ? ? | | o | A[2 * n + 4] - - - - ? ? o - o - ? ? | | o | A[2 * n + 6] - - - - ? ? - - - - ? ? | offset | o | A[2 * n + 8] - - - - ? ? - - - - ? ? | | | +---------|-----+ 1 2 3 4 5 6 1 2 3 4 5 6 | | | | | o | A[2 * n - 7] - - - - ? ? - - - - ? ? | | o | A[2 * n - 5] - - - - ? ? - - - - ? ? | | o | A[2 * n - 3] - - o - ? ? - - - - ? ? | \ o | A[2 * n - 1] o o o - ? ? - - - - ? ? | \> X | A[2 * n + 1] X X X X ? ? = = = = ? ? | o | A[2 * n + 3] - - o - ? ? - - - - ? ? | o | A[2 * n + 5] - - - - ? ? - - - - ? ? | o | A[2 * n + 7] - - - - ? ? - - - - ? ? | | | H | | | +---------------+ */ { SCHRO_OPENGL_SHADER_IIWT_S16_FILTER_DESLAURIERS_DUBUC_9_7_Lp, "iiwt_s16_filter_deslauriers_dubuc_9_7_lp", SHADER_FLAG_USE_S16, SHADER_HEADER SHADER_READ_S16 ("texture1", "") SHADER_WRITE_S16 SHADER_DIVIDE_S16 /* distance between two corresponding texels from subbands L and H in texels = vec2 (width / 2.0, 0.0) or vec2 (0.0, height / 2.0) */ "uniform vec2 offset;\n" "uniform vec2 one_decrease;\n" "float filter (float h1m, float h0) {\n" " return divide_s16 (h1m + h0 + 2.0, 4.0);\n" "}\n" "void main (void) {\n" " float l0 = read_s16 ();\n" /* A[2 ∗ n] */ " float h1m = read_s16 (offset - one_decrease);\n" /* A[2 ∗ n - 1] */ " float h0 = read_s16 (offset);\n" /* A[2 ∗ n + 1] */ " write_s16 (l0 - filter (h1m, h0));\n" "}\n", SHADER_HEADER_INTEGER SHADER_READ_S16_INTEGER ("texture1", "") SHADER_WRITE_S16_INTEGER SHADER_DIVIDE_S16_INTEGER /* distance between two corresponding texels from subbands L and H in texels = vec2 (width / 2.0, 0.0) or vec2 (0.0, height / 2.0) */ "uniform vec2 offset;\n" "uniform vec2 one_decrease;\n" "int filter (int h1m, int h0) {\n" " return divide_s16 (h1m + h0 + 2, 4);\n" "}\n" "void main (void) {\n" " int l0 = read_s16 ();\n" /* A[2 ∗ n] */ " int h1m = read_s16 (offset - one_decrease);\n" /* A[2 ∗ n - 1] */ " int h0 = read_s16 (offset);\n" /* A[2 ∗ n + 1] */ " write_s16 (l0 - filter (h1m, h0));\n" "}\n" }, { SCHRO_OPENGL_SHADER_IIWT_S16_FILTER_DESLAURIERS_DUBUC_9_7_Hp, "iiwt_s16_filter_deslauriers_dubuc_9_7_hp", SHADER_FLAG_USE_S16, SHADER_HEADER SHADER_READ_S16 ("texture1", "") SHADER_WRITE_S16 SHADER_DIVIDE_S16 /* distance between two corresponding texels from subbands L' and H in texels = vec2 (width / 2.0, 0.0) or vec2 (0.0, height / 2.0) */ "uniform vec2 offset;\n" "uniform vec2 one_decrease;\n" "uniform vec2 one_increase;\n" "uniform vec2 two_increase;\n" "float filter (float l1m, float l0, float l1p, float l2p) {\n" " return divide_s16 (-l1m + 9.0 * (l0 + l1p) - l2p + 8.0, 16.0);\n" "}\n" "void main (void) {\n" " float l1m = read_s16 (-offset - one_decrease);\n" /* A[2 ∗ n - 2] */ " float l0 = read_s16 (-offset);\n" /* A[2 ∗ n] */ " float l1p = read_s16 (-offset + one_increase);\n" /* A[2 ∗ n + 2] */ " float l2p = read_s16 (-offset + two_increase);\n" /* A[2 ∗ n + 4] */ " float h0 = read_s16 ();\n" /* A[2 ∗ n + 1] */ " write_s16 (h0 + filter (l1m, l0, l1p, l2p));\n" "}\n", SHADER_HEADER_INTEGER SHADER_READ_S16_INTEGER ("texture1", "") SHADER_WRITE_S16_INTEGER SHADER_DIVIDE_S16_INTEGER /* distance between two corresponding texels from subbands L' and H in texels = vec2 (width / 2.0, 0.0) or vec2 (0.0, height / 2.0) */ "uniform vec2 offset;\n" "uniform vec2 one_decrease;\n" "uniform vec2 one_increase;\n" "uniform vec2 two_increase;\n" "int filter (int l1m, int l0, int l1p, int l2p) {\n" " return divide_s16 (-l1m + 9 * (l0 + l1p) - l2p + 8, 16);\n" "}\n" "void main (void) {\n" " int l1m = read_s16 (-offset - one_decrease);\n" /* A[2 ∗ n - 2] */ " int l0 = read_s16 (-offset);\n" /* A[2 ∗ n] */ " int l1p = read_s16 (-offset + one_increase);\n" /* A[2 ∗ n + 2] */ " int l2p = read_s16 (-offset + two_increase);\n" /* A[2 ∗ n + 4] */ " int h0 = read_s16 ();\n" /* A[2 ∗ n + 1] */ " write_s16 (h0 + filter (l1m, l0, l1p, l2p));\n" "}\n" }, { SCHRO_OPENGL_SHADER_IIWT_S16_FILTER_LE_GALL_5_3_Lp, "iiwt_s16_filter_le_gall_5_3_lp", SHADER_FLAG_USE_S16, SHADER_HEADER SHADER_READ_S16 ("texture1", "") SHADER_WRITE_S16 SHADER_DIVIDE_S16 /* distance between two corresponding texels from subbands L and H in texels = vec2 (width / 2.0, 0.0) or vec2 (0.0, height / 2.0) */ "uniform vec2 offset;\n" "uniform vec2 one_decrease;\n" "float filter (float h1m, float h0) {\n" " return divide_s16 (h1m + h0 + 2.0, 4.0);\n" "}\n" "void main (void) {\n" " float l0 = read_s16 ();\n" /* A[2 ∗ n] */ " float h1m = read_s16 (offset - one_decrease);\n" /* A[2 ∗ n - 1] */ " float h0 = read_s16 (offset);\n" /* A[2 ∗ n + 1] */ " write_s16 (l0 - filter (h1m, h0));\n" "}\n", SHADER_HEADER_INTEGER SHADER_READ_S16_INTEGER ("texture1", "") SHADER_WRITE_S16_INTEGER SHADER_DIVIDE_S16_INTEGER /* distance between two corresponding texels from subbands L and H in texels = vec2 (width / 2.0, 0.0) or vec2 (0.0, height / 2.0) */ "uniform vec2 offset;\n" "uniform vec2 one_decrease;\n" "int filter (int h1m, int h0) {\n" " return divide_s16 (h1m + h0 + 2, 4);\n" "}\n" "void main (void) {\n" " int l0 = read_s16 ();\n" /* A[2 ∗ n] */ " int h1m = read_s16 (offset - one_decrease);\n" /* A[2 ∗ n - 1] */ " int h0 = read_s16 (offset);\n" /* A[2 ∗ n + 1] */ " write_s16 (l0 - filter (h1m, h0));\n" "}\n" }, { SCHRO_OPENGL_SHADER_IIWT_S16_FILTER_LE_GALL_5_3_Hp, "iiwt_s16_filter_le_gall_5_3_hp", SHADER_FLAG_USE_S16, SHADER_HEADER SHADER_READ_S16 ("texture1", "") SHADER_WRITE_S16 SHADER_DIVIDE_S16 /* distance between two corresponding texels from subbands L' and H in texels = vec2 (width / 2.0, 0.0) or vec2 (0.0, height / 2.0) */ "uniform vec2 offset;\n" "uniform vec2 one_increase;\n" "float filter (float l0, float l1p) {\n" " return divide_s16 (l0 + l1p + 1.0, 2.0);\n" "}\n" "void main (void) {\n" " float l0 = read_s16 (-offset);\n" /* A[2 ∗ n] */ " float l1p = read_s16 (-offset + one_increase);\n" /* A[2 ∗ n + 2] */ " float h0 = read_s16 ();\n" /* A[2 ∗ n + 1] */ " write_s16 (h0 + filter (l0, l1p));\n" "}\n", SHADER_HEADER_INTEGER SHADER_READ_S16_INTEGER ("texture1", "") SHADER_WRITE_S16_INTEGER SHADER_DIVIDE_S16_INTEGER /* distance between two corresponding texels from subbands L' and H in texels = vec2 (width / 2.0, 0.0) or vec2 (0.0, height / 2.0) */ "uniform vec2 offset;\n" "uniform vec2 one_increase;\n" "int filter (int l0, int l1p) {\n" " return divide_s16 (l0 + l1p + 1, 2);\n" "}\n" "void main (void) {\n" " int l0 = read_s16 (-offset);\n" /* A[2 ∗ n] */ " int l1p = read_s16 (-offset + one_increase);\n" /* A[2 ∗ n + 2] */ " int h0 = read_s16 ();\n" /* A[2 ∗ n + 1] */ " write_s16 (h0 + filter (l0, l1p));\n" "}\n" }, /* FIXME: more than 1 level leads to errors */ { SCHRO_OPENGL_SHADER_IIWT_S16_FILTER_DESLAURIERS_DUBUC_13_7_Lp, "iiwt_s16_filter_deslauriers_dubuc_13_7_lp", SHADER_FLAG_USE_S16, SHADER_HEADER SHADER_READ_S16 ("texture1", "") SHADER_WRITE_S16 SHADER_DIVIDE_S16 /* distance between two corresponding texels from subbands L and H in texels = vec2 (width / 2.0, 0.0) or vec2 (0.0, height / 2.0) */ "uniform vec2 offset;\n" "uniform vec2 two_decrease;\n" "uniform vec2 one_decrease;\n" "uniform vec2 one_increase;\n" "float filter (float h2m, float h1m, float h0, float h1p) {\n" " return divide_s16 (-h2m + 9.0 * (h1m + h0) - h1p + 16.0, 32.0);\n" "}\n" "void main (void) {\n" " float l0 = read_s16 ();\n" /* A[2 ∗ n] */ " float h2m = read_s16 (offset - two_decrease);\n" /* A[2 ∗ n - 3] */ " float h1m = read_s16 (offset - one_decrease);\n" /* A[2 ∗ n - 1] */ " float h0 = read_s16 (offset);\n" /* A[2 ∗ n + 1] */ " float h1p = read_s16 (offset + one_increase);\n" /* A[2 ∗ n + 3] */ " write_s16 (l0 - filter (h2m, h1m, h0, h1p));\n" "}\n", SHADER_HEADER_INTEGER SHADER_READ_S16_INTEGER ("texture1", "") SHADER_WRITE_S16_INTEGER SHADER_DIVIDE_S16_INTEGER /* distance between two corresponding texels from subbands L and H in texels = vec2 (width / 2.0, 0.0) or vec2 (0.0, height / 2.0) */ "uniform vec2 offset;\n" "uniform vec2 two_decrease;\n" "uniform vec2 one_decrease;\n" "uniform vec2 one_increase;\n" "int filter (int h2m, int h1m, int h0, int h1p) {\n" " return divide_s16 (-h2m + 9 * (h1m + h0) - h1p + 16, 32);\n" "}\n" "void main (void) {\n" " int l0 = read_s16 ();\n" /* A[2 ∗ n] */ " int h2m = read_s16 (offset - two_decrease);\n" /* A[2 ∗ n - 3] */ " int h1m = read_s16 (offset - one_decrease);\n" /* A[2 ∗ n - 1] */ " int h0 = read_s16 (offset);\n" /* A[2 ∗ n + 1] */ " int h1p = read_s16 (offset + one_increase);\n" /* A[2 ∗ n + 3] */ " write_s16 (l0 - filter (h2m, h1m, h0, h1p));\n" "}\n" }, /* FIXME: more than 1 level leads to errors */ { SCHRO_OPENGL_SHADER_IIWT_S16_FILTER_DESLAURIERS_DUBUC_13_7_Hp, "iiwt_s16_filter_deslauriers_dubuc_13_7_hp", SHADER_FLAG_USE_S16, SHADER_HEADER SHADER_READ_S16 ("texture1", "") SHADER_WRITE_S16 SHADER_DIVIDE_S16 /* distance between two corresponding texels from subbands L' and H in texels = vec2 (width / 2.0, 0.0) or vec2 (0.0, height / 2.0) */ "uniform vec2 offset;\n" "uniform vec2 one_decrease;\n" "uniform vec2 one_increase;\n" "uniform vec2 two_increase;\n" "float filter (float l1m, float l0, float l1p, float l2p) {\n" " return divide_s16 (-l1m + 9.0 * (l0 + l1p) - l2p + 8.0,16.0);\n" "}\n" "void main (void) {\n" " float l1m = read_s16 (-offset - one_decrease);\n" /* A[2 ∗ n - 2] */ " float l0 = read_s16 (-offset);\n" /* A[2 ∗ n] */ " float l1p = read_s16 (-offset + one_increase);\n" /* A[2 ∗ n + 2] */ " float l2p = read_s16 (-offset + two_increase);\n" /* A[2 ∗ n + 4] */ " float h0 = read_s16 ();\n" /* A[2 ∗ n + 1] */ " write_s16 (h0 + filter (l1m, l0, l1p, l2p));\n" "}\n", SHADER_HEADER_INTEGER SHADER_READ_S16_INTEGER ("texture1", "") SHADER_WRITE_S16_INTEGER SHADER_DIVIDE_S16_INTEGER /* distance between two corresponding texels from subbands L' and H in texels = vec2 (width / 2.0, 0.0) or vec2 (0.0, height / 2.0) */ "uniform vec2 offset;\n" "uniform vec2 one_decrease;\n" "uniform vec2 one_increase;\n" "uniform vec2 two_increase;\n" "int filter (int l1m, int l0, int l1p, int l2p) {\n" " return divide_s16 (-l1m + 9 * (l0 + l1p) - l2p + 8, 16);\n" "}\n" "void main (void) {\n" " int l1m = read_s16 (-offset - one_decrease);\n" /* A[2 ∗ n - 2] */ " int l0 = read_s16 (-offset);\n" /* A[2 ∗ n] */ " int l1p = read_s16 (-offset + one_increase);\n" /* A[2 ∗ n + 2] */ " int l2p = read_s16 (-offset + two_increase);\n" /* A[2 ∗ n + 4] */ " int h0 = read_s16 ();\n" /* A[2 ∗ n + 1] */ " write_s16 (h0 + filter (l1m, l0, l1p, l2p));\n" "}\n" }, { SCHRO_OPENGL_SHADER_IIWT_S16_FILTER_HAAR_Lp, "iiwt_s16_filter_haar_lp", SHADER_FLAG_USE_S16, SHADER_HEADER SHADER_READ_S16 ("texture1", "") SHADER_WRITE_S16 SHADER_DIVIDE_S16 /* distance between two corresponding texels from subbands L and H in texels = vec2 (width / 2.0, 0.0) or vec2 (0.0, height / 2.0) */ "uniform vec2 offset;\n" "float filter (float h0) {\n" " return divide_s16 (h0 + 1.0, 2.0);\n" "}\n" "void main (void) {\n" " float l0 = read_s16 ();\n" /* A[2 ∗ n] */ " float h0 = read_s16 (offset);\n" /* A[2 ∗ n + 1] */ " write_s16 (l0 - filter (h0));\n" "}\n", SHADER_HEADER_INTEGER SHADER_READ_S16_INTEGER ("texture1", "") SHADER_WRITE_S16_INTEGER SHADER_DIVIDE_S16_INTEGER /* distance between two corresponding texels from subbands L and H in texels = vec2 (width / 2.0, 0.0) or vec2 (0.0, height / 2.0) */ "uniform vec2 offset;\n" "int filter (int h0) {\n" " return divide_s16 (h0 + 1, 2);\n" "}\n" "void main (void) {\n" " int l0 = read_s16 ();\n" /* A[2 ∗ n] */ " int h0 = read_s16 (offset);\n" /* A[2 ∗ n + 1] */ " write_s16 (l0 - filter (h0));\n" "}\n" }, { SCHRO_OPENGL_SHADER_IIWT_S16_FILTER_HAAR_Hp, "iiwt_s16_filter_haar_hp", SHADER_FLAG_USE_S16, SHADER_HEADER SHADER_READ_S16 ("texture1", "") SHADER_WRITE_S16 /* distance between two corresponding texels from subbands L' and H in texels = vec2 (width / 2.0, 0.0) or vec2 (0.0, height / 2.0) */ "uniform vec2 offset;\n" "void main (void) {\n" " float l0 = read_s16 (-offset);\n" /* A[2 ∗ n] */ " float h0 = read_s16 ();\n" /* A[2 ∗ n + 1] */ " write_s16 (h0 + l0);\n" "}\n", SHADER_HEADER_INTEGER SHADER_READ_S16_INTEGER ("texture1", "") SHADER_WRITE_S16_INTEGER /* distance between two corresponding texels from subbands L' and H in texels = vec2 (width / 2.0, 0.0) or vec2 (0.0, height / 2.0) */ "uniform vec2 offset;\n" "void main (void) {\n" " int l0 = read_s16 (-offset);\n" /* A[2 ∗ n] */ " int h0 = read_s16 ();\n" /* A[2 ∗ n + 1] */ " write_s16 (h0 + l0);\n" "}\n" }, { SCHRO_OPENGL_SHADER_IIWT_S16_VERTICAL_DEINTERLEAVE_L, "iiwt_s16_vertical_deinterleave_l", SHADER_FLAG_USE_S16, SHADER_HEADER "uniform sampler2DRect texture1;\n" "void main (void) {\n" " float x = gl_TexCoord[0].x;\n" /* round y coordinate down from texel center n.5 to texel edge n.0 */ " float y = floor (gl_TexCoord[0].y);\n" /* scale y coordinate to the destination coordinate and shift it from texel edge n.0 to texel center n.5 */ " vec2 coordinate = vec2 (x, y * 2.0 + 0.5);\n" " gl_FragColor = texture2DRect (texture1, coordinate);\n" "}\n", SHADER_HEADER_INTEGER SHADER_WRITE_U16_INTEGER "uniform isampler2DRect texture1;\n" "void main (void) {\n" " float x = gl_TexCoord[0].x;\n" /* round y coordinate down from texel center n.5 to texel edge n.0 */ " float y = floor (gl_TexCoord[0].y);\n" /* scale y coordinate to the destination coordinate and shift it from texel edge n.0 to texel center n.5 */ " vec2 coordinate = vec2 (x, y * 2.0 + 0.5);\n" " write_u16 (texture2DRect (texture1, coordinate).a);\n" "}\n" }, { SCHRO_OPENGL_SHADER_IIWT_S16_VERTICAL_DEINTERLEAVE_H, "iiwt_s16_vertical_deinterleave_h", SHADER_FLAG_USE_S16, SHADER_HEADER "uniform sampler2DRect texture1;\n" /* height of subband XL */ "uniform vec2 offset;\n" /* = vec2 (0.0, height / 2.0) */ "void main (void) {\n" " float x = gl_TexCoord[0].x;\n" /* round y coordinate down from texel center n.5 to texel edge n.0 */ " float y = floor (gl_TexCoord[0].y) - offset.y;\n" /* scale y coordinate to the destination coordinate and shift it from texel edge n.0 to texel center n.5 */ " vec2 coordinate = vec2 (x, y * 2.0 + 1.5);\n" " gl_FragColor = texture2DRect (texture1, coordinate);\n" "}\n", SHADER_HEADER_INTEGER SHADER_WRITE_U16_INTEGER "uniform isampler2DRect texture1;\n" /* height of subband XL */ "uniform vec2 offset;\n" /* = vec2 (0.0, height / 2.0) */ "void main (void) {\n" " float x = gl_TexCoord[0].x;\n" /* round y coordinate down from texel center n.5 to texel edge n.0 */ " float y = floor (gl_TexCoord[0].y) - offset.y;\n" /* scale y coordinate to the destination coordinate and shift it from texel edge n.0 to texel center n.5 */ " vec2 coordinate = vec2 (x, y * 2.0 + 1.5);\n" " write_u16 (texture2DRect (texture1, coordinate).a);\n" "}\n" }, { SCHRO_OPENGL_SHADER_IIWT_S16_VERTICAL_INTERLEAVE, "iiwt_s16_vertical_interleave", SHADER_FLAG_USE_S16, SHADER_HEADER "uniform sampler2DRect texture1;\n" /* vertical distance between two corresponding texels from subband XL and XH in texels */ "uniform vec2 offset;\n" /* = vec2 (0.0, height / 2.0) */ "void main (void) {\n" " float x = gl_TexCoord[0].x;\n" /* round y coordinate down from texel center n.5 to texel edge n.0 */ " float y = floor (gl_TexCoord[0].y);\n" " if (mod (y, 2.0) < 0.5) {\n" " y = floor (y / 2.0);\n" " } else {\n" " y = floor (y / 2.0) + offset.y;\n" " }\n" /* shift y coordinate from texel edge n.0 to texel center n.5 */ " vec2 coordinate = vec2 (x, y + 0.5);\n" " gl_FragColor = texture2DRect (texture1, coordinate);\n" "}\n", SHADER_HEADER_INTEGER SHADER_WRITE_U16_INTEGER "uniform isampler2DRect texture1;\n" /* vertical distance between two corresponding texels from subband XL and XH in texels */ "uniform vec2 offset;\n" /* = vec2 (0.0, height / 2.0) */ "void main (void) {\n" " float x = gl_TexCoord[0].x;\n" /* round y coordinate down from texel center n.5 to texel edge n.0 */ " float y = floor (gl_TexCoord[0].y);\n" " if (mod (y, 2.0) < 0.5) {\n" " y = floor (y / 2.0);\n" " } else {\n" " y = floor (y / 2.0) + offset.y;\n" " }\n" /* shift y coordinate from texel edge n.0 to texel center n.5 */ " vec2 coordinate = vec2 (x, y + 0.5);\n" " write_u16 (texture2DRect (texture1, coordinate).a);\n" "}\n" }, { SCHRO_OPENGL_SHADER_IIWT_S16_HORIZONTAL_INTERLEAVE, "iiwt_s16_horizontal_interleave", SHADER_FLAG_USE_S16, SHADER_HEADER "uniform sampler2DRect texture1;\n" /* horizontal distance between two corresponding texels from subband L' and H' in texels */ "uniform vec2 offset;\n" /* = vec2 (width / 2.0, 0.0) */ "void main (void) {\n" /* round x coordinate down from texel center n.5 to texel edge n.0 */ " float x = floor (gl_TexCoord[0].x);\n" " float y = gl_TexCoord[0].y;\n" " if (mod (x, 2.0) < 0.5) {\n" " x = floor (x / 2.0);\n" " } else {\n" " x = floor (x / 2.0) + offset.x;\n" " }\n" /* shift y coordinate from texel edge n.0 to texel center n.5 */ " vec2 coordinate = vec2 (x + 0.5, y);\n" " gl_FragColor = texture2DRect (texture1, coordinate);\n" "}\n", SHADER_HEADER_INTEGER SHADER_WRITE_U16_INTEGER "uniform isampler2DRect texture1;\n" /* horizontal distance between two corresponding texels from subband L' and H' in texels */ "uniform vec2 offset;\n" /* = vec2 (width / 2.0, 0.0) */ "void main (void) {\n" /* round x coordinate down from texel center n.5 to texel edge n.0 */ " float x = floor (gl_TexCoord[0].x);\n" " float y = gl_TexCoord[0].y;\n" " if (mod (x, 2.0) < 0.5) {\n" " x = floor (x / 2.0);\n" " } else {\n" " x = floor (x / 2.0) + offset.x;\n" " }\n" /* shift y coordinate from texel edge n.0 to texel center n.5 */ " vec2 coordinate = vec2 (x + 0.5, y);\n" " write_u16 (texture2DRect (texture1, coordinate).a);\n" "}\n" }, { SCHRO_OPENGL_SHADER_IIWT_S16_FILTER_SHIFT, "iiwt_s16_filter_shift", SHADER_FLAG_USE_S16, SHADER_HEADER SHADER_READ_S16 ("texture1", "") SHADER_WRITE_S16 SHADER_RSHIFT (1.0, 2.0) "void main (void) {\n" " write_s16 (rshift (read_s16 ()));\n" "}\n", SHADER_HEADER_INTEGER SHADER_READ_S16_INTEGER ("texture1", "") SHADER_WRITE_S16_INTEGER SHADER_RSHIFT_S16_INTEGER (1, 2) "void main (void) {\n" " write_s16 (rshift_s16 (read_s16 ()));\n" "}\n" }, { SCHRO_OPENGL_SHADER_UPSAMPLE_U8, "upsample_u8", SHADER_FLAG_USE_U8, SHADER_HEADER SHADER_READ_U8 ("texture1", "") SHADER_WRITE_U8 SHADER_DIVIDE_S16 "uniform vec2 three_decrease;\n" "uniform vec2 two_decrease;\n" "uniform vec2 one_decrease;\n" "uniform vec2 one_increase;\n" "uniform vec2 two_increase;\n" "uniform vec2 three_increase;\n" "uniform vec2 four_increase;\n" "void main (void) {\n" " float s3m = read_u8 (-three_decrease);\n" /* S[n - 3] */ " float s2m = read_u8 (-two_decrease);\n" /* S[n - 2] */ " float s1m = read_u8 (-one_decrease);\n" /* S[n - 1] */ " float s0 = read_u8 ();\n" /* S[n] */ " float s1p = read_u8 (one_increase);\n" /* S[n + 1] */ " float s2p = read_u8 (two_increase);\n" /* S[n + 2] */ " float s3p = read_u8 (three_increase);\n" /* S[n + 3] */ " float s4p = read_u8 (four_increase);\n" /* S[n + 4] */ " float sum = divide_s16 (-s3m + 3.0 * s2m - 7.0 * s1m + 21.0 * s0\n" " + 21.0 * s1p - 7.0 * s2p + 3.0 * s3p - s4p + 16.0, 32.0);\n" " write_u8 (clamp (sum, 0.0, 255.0));\n" "}\n", SHADER_HEADER_INTEGER SHADER_READ_U8_INTEGER ("texture1", "") SHADER_WRITE_U8_INTEGER SHADER_CAST_U8_S16_INTEGER SHADER_CAST_S16_U8_INTEGER SHADER_DIVIDE_S16_INTEGER "uniform vec2 three_decrease;\n" "uniform vec2 two_decrease;\n" "uniform vec2 one_decrease;\n" "uniform vec2 one_increase;\n" "uniform vec2 two_increase;\n" "uniform vec2 three_increase;\n" "uniform vec2 four_increase;\n" "void main (void) {\n" " int s3m = cast_s16_u8 (read_u8 (-three_decrease));\n" /* S[n - 3] */ " int s2m = cast_s16_u8 (read_u8 (-two_decrease));\n" /* S[n - 2] */ " int s1m = cast_s16_u8 (read_u8 (-one_decrease));\n" /* S[n - 1] */ " int s0 = cast_s16_u8 (read_u8 ());\n" /* S[n] */ " int s1p = cast_s16_u8 (read_u8 (one_increase));\n" /* S[n + 1] */ " int s2p = cast_s16_u8 (read_u8 (two_increase));\n" /* S[n + 2] */ " int s3p = cast_s16_u8 (read_u8 (three_increase));\n" /* S[n + 3] */ " int s4p = cast_s16_u8 (read_u8 (four_increase));\n" /* S[n + 4] */ " int sum = divide_s16 (-s3m + 3 * s2m - 7 * s1m + 21 * s0\n" " + 21 * s1p - 7 * s2p + 3 * s3p - s4p + 16, 32);\n" " write_u8 (cast_u8_s16 (sum));\n" "}\n" }, { SCHRO_OPENGL_SHADER_MC_OBMC_WEIGHT, "mc_obmc_weight", SHADER_FLAG_USE_S16, SHADER_HEADER SHADER_WRITE_S16 SHADER_DIVIDE_S16 "uniform vec2 size;\n" /* block size */ "uniform vec2 offset;\n" /* block offset */ "float ramp (float coordinate, float offset) {\n" " if (offset == 1.0) {\n" " if (coordinate == 0.0) {\n" " return 3.0;\n" " }\n" " return 5.0;\n" " }\n" " return 1.0 + divide_s16 (6.0 * coordinate + offset - 1.0,\n" " 2.0 * offset - 1.0);\n" "}\n" "float obmc_weight (float coordinate, float size, float offset) {\n" " if (offset == 0.0) {\n" " return 8.0;\n" " } else if (coordinate < 2.0 * offset) {\n" " return ramp (coordinate, offset);\n" " } else if (size - 1.0 - coordinate < 2.0 * offset) {\n" " return ramp (size - 1.0 - coordinate, offset);\n" " }\n" " return 8.0;\n" "}\n" "void main (void) {\n" /* round coordinate down from texel center n.5 to texel edge n.0 */ " vec2 coordinate = floor (gl_TexCoord[0].xy);\n" " write_s16 (obmc_weight (coordinate.x, size.x, offset.x)\n" " * obmc_weight (coordinate.y, size.y, offset.y));\n" "}\n", SHADER_HEADER_INTEGER SHADER_WRITE_S16_INTEGER SHADER_DIVIDE_S16_INTEGER "uniform vec2 size;\n" /* block size */ // FIXME: bind as int "uniform vec2 offset;\n" /* block offset */ // FIXME: bind as int "int ramp (int coordinate, int offset) {\n" " if (offset == 1) {\n" " if (coordinate == 0) {\n" " return 3;\n" " }\n" " return 5;\n" " }\n" " return 1 + divide_s16 (6 * coordinate + offset - 1, 2 * offset - 1);\n" "}\n" "int obmc_weight (int coordinate, int size, int offset) {\n" " if (offset == 0) {\n" " return 8;\n" " } else if (coordinate < 2 * offset) {\n" " return ramp (coordinate, offset);\n" " } else if (size - 1 - coordinate < 2 * offset) {\n" " return ramp (size - 1 - coordinate, offset);\n" " }\n" " return 8;\n" "}\n" "void main (void) {\n" /* round coordinate down from texel center n.5 to texel edge n.0 */ " vec2 coordinate = floor (gl_TexCoord[0].xy);\n" " write_s16 (obmc_weight (int (coordinate.x), int (size.x), int (offset.x))\n" " * obmc_weight (int (coordinate.y), int (size.y), int (offset.y)));\n" "}\n" }, { SCHRO_OPENGL_SHADER_MC_CLEAR, "mc_clear", SHADER_FLAG_USE_S16, SHADER_HEADER SHADER_WRITE_S16 "void main (void) {\n" " write_s16 (0.0);\n" "}\n", SHADER_HEADER_INTEGER SHADER_WRITE_S16_INTEGER "void main (void) {\n" " write_s16 (0);\n" "}\n" }, { SCHRO_OPENGL_SHADER_MC_RENDER_DC, "mc_render_dc", SHADER_FLAG_USE_U8 | SHADER_FLAG_USE_S16, SHADER_HEADER SHADER_READ_S16 ("texture1", "_previous") /* previous to blend with */ SHADER_READ_S16 ("texture2", "_obmc_weight") /* obmc weight */ SHADER_WRITE_S16 "uniform vec2 origin;\n" /* block origin */ "uniform float dc;\n" "void main (void) {\n" " float previous = read_previous_s16 ();\n" " float obmc_weight = read_obmc_weight_s16 (-origin);\n" " write_s16 (previous + dc * obmc_weight);\n" "}\n", SHADER_HEADER_INTEGER SHADER_READ_S16_INTEGER ("texture1", "_previous") /* previous to blend with */ SHADER_READ_S16_INTEGER ("texture2", "_obmc_weight") /* obmc weight */ SHADER_WRITE_S16_INTEGER "uniform vec2 origin;\n" /* block origin */ "uniform float dc;\n" // FIXME: bind as int "void main (void) {\n" " int previous = read_previous_s16 ();\n" " int obmc_weight = read_obmc_weight_s16 (-origin);\n" " write_s16 (previous + int (dc) * obmc_weight);\n" "}\n" }, { SCHRO_OPENGL_SHADER_MC_RENDER_REF_PREC_0, "mc_render_ref_prec_0", SHADER_FLAG_USE_U8 | SHADER_FLAG_USE_S16, SHADER_HEADER SHADER_READ_S16 ("texture1", "_previous") /* previous to blend with */ SHADER_READ_S16 ("texture2", "_obmc_weight") /* obmc weight */ SHADER_READ_U8 ("texture3", "_sub0") /* upsampled sub frame 0 */ SHADER_WRITE_S16 "uniform vec2 offset;\n" "uniform vec2 origin;\n" /* block origin */ "void main (void) {\n" " float previous = read_previous_s16 ();\n" " float obmc_weight = read_obmc_weight_s16 (-origin);\n" " float sub0 = read_sub0_u8 (offset);\n" " write_s16 (previous + sub0 * obmc_weight);\n" "}\n", SHADER_HEADER_INTEGER SHADER_READ_S16_INTEGER ("texture1", "_previous") /* previous to blend with */ SHADER_READ_S16_INTEGER ("texture2", "_obmc_weight") /* obmc weight */ SHADER_READ_U8_INTEGER ("texture3", "_sub0") /* upsampled sub frame 0 */ SHADER_WRITE_S16_INTEGER SHADER_CAST_S16_U8_INTEGER "uniform vec2 offset;\n" "uniform vec2 origin;\n" /* block origin */ "void main (void) {\n" " int previous = read_previous_s16 ();\n" " int obmc_weight = read_obmc_weight_s16 (-origin);\n" " int sub0 = cast_s16_u8 (read_sub0_u8 (offset));\n" " write_s16 (previous + sub0 * obmc_weight);\n" "}\n" }, { SCHRO_OPENGL_SHADER_MC_RENDER_REF_PREC_0_WEIGHT, "mc_render_ref_prec_0_weight", SHADER_FLAG_USE_U8 | SHADER_FLAG_USE_S16, SHADER_HEADER SHADER_READ_S16 ("texture1", "_previous") /* previous to blend with */ SHADER_READ_S16 ("texture2", "_obmc_weight") /* obmc weight */ SHADER_READ_U8 ("texture3", "_sub0") /* upsampled sub frame 0 */ SHADER_WRITE_S16 SHADER_DIVIDE_S16 "uniform vec2 offset;\n" "uniform vec2 origin;\n" /* block origin */ "uniform float weight;\n" "uniform float addend;\n" /* 1 << (shift - 1) */ "uniform float divisor;\n" /* 1 << shift */ "void main (void) {\n" " float previous = read_previous_s16 ();\n" " float obmc_weight = read_obmc_weight_s16 (-origin);\n" " float sub0 = read_sub0_u8 (offset);\n" " write_s16 (previous + divide_s16 (sub0 * weight + addend, divisor)\n" " * obmc_weight);\n" "}\n", SHADER_HEADER_INTEGER SHADER_READ_S16_INTEGER ("texture1", "_previous") /* previous to blend with */ SHADER_READ_S16_INTEGER ("texture2", "_obmc_weight") /* obmc weight */ SHADER_READ_U8_INTEGER ("texture3", "_sub0") /* upsampled sub frame 0 */ SHADER_WRITE_S16_INTEGER SHADER_CAST_S16_U8_INTEGER SHADER_DIVIDE_S16_INTEGER "uniform vec2 offset;\n" "uniform vec2 origin;\n" /* block origin */ "uniform float weight;\n" // FIXME: bind as int "uniform float addend;\n" /* 1 << (shift - 1) */ // FIXME: bind as int "uniform float divisor;\n" /* 1 << shift */ // FIXME: bind as int "void main (void) {\n" " int previous = read_previous_s16 ();\n" " int obmc_weight = read_obmc_weight_s16 (-origin);\n" " int sub0 = cast_s16_u8 (read_sub0_u8 (offset));\n" " write_s16 (previous + divide_s16 ((sub0 * int (weight) + int (addend)),\n" " int (divisor)) * obmc_weight);\n" "}\n" }, { SCHRO_OPENGL_SHADER_MC_RENDER_REF_PREC_1, "mc_render_ref_prec_1", SHADER_FLAG_USE_U8 | SHADER_FLAG_USE_S16, SHADER_HEADER SHADER_READ_S16 ("texture1", "_obmc_weight") /* obmc weights */ SHADER_READ_U8 ("texture2", "_subx") /* upsampled sub frame x */ SHADER_WRITE_S16 "uniform vec2 offset;\n" "uniform vec2 origin;\n" /* block origin */ "void main (void) {\n" " float obmc_weight = read_obmc_weight_s16 (-origin);\n" " float subx = read_subx_u8 (offset);\n" " write_s16 (subx * obmc_weight);\n" /* FIXME: ref weighting */ "}\n", "" }, { SCHRO_OPENGL_SHADER_MC_RENDER_REF_PREC_3, "mc_render_ref_prec_3", SHADER_FLAG_USE_U8 | SHADER_FLAG_USE_S16, SHADER_HEADER "void main (void) {\n" "}\n", "" }, { SCHRO_OPENGL_SHADER_MC_RENDER_BIREF, "mc_render_biref", SHADER_FLAG_USE_U8 | SHADER_FLAG_USE_S16, SHADER_HEADER "void main (void) {\n" "}\n", "" }, { SCHRO_OPENGL_SHADER_MC_SHIFT, "mc_shift", SHADER_FLAG_USE_S16, SHADER_HEADER SHADER_READ_S16 ("texture1", "") SHADER_WRITE_S16 SHADER_RSHIFT (-8160.0, 64.0) "void main (void) {\n" " write_s16 (rshift (read_s16 ()));\n" "}\n", SHADER_HEADER_INTEGER SHADER_READ_S16_INTEGER ("texture1", "") SHADER_WRITE_S16_INTEGER SHADER_RSHIFT_S16_INTEGER (-8160, 64) "void main (void) {\n" " write_s16 (rshift_s16 (read_s16 ()));\n" "}\n" }, { -1, NULL } }; struct _SchroOpenGLShaderLibrary { SchroOpenGL *opengl; SchroOpenGLShader *shaders[SCHRO_OPENGL_SHADER_COUNT]; }; SchroOpenGLShaderLibrary * schro_opengl_shader_library_new (SchroOpenGL *opengl) { SchroOpenGLShaderLibrary* library = schro_malloc0 (sizeof (SchroOpenGLShaderLibrary)); library->opengl = opengl; return library; } void schro_opengl_shader_library_free (SchroOpenGLShaderLibrary *library) { int i; SCHRO_ASSERT (library != NULL); schro_opengl_lock (library->opengl); for (i = 0; i < ARRAY_SIZE (library->shaders); ++i) { if (library->shaders[i]) { schro_opengl_shader_free (library->shaders[i]); } } schro_opengl_unlock (library->opengl); schro_free (library); } SchroOpenGLShader * schro_opengl_shader_get (SchroOpenGL *opengl, int index) { SchroOpenGLShaderLibrary* shader_library; SCHRO_ASSERT (index >= 0); SCHRO_ASSERT (index < SCHRO_OPENGL_SHADER_COUNT); shader_library = schro_opengl_get_shader_library (opengl); if (!shader_library->shaders[index]) { schro_opengl_lock (opengl); if ((SCHRO_OPENGL_CANVAS_IS_FLAG_SET (STORE_U8_AS_UI8) && schro_opengl_shader_code_list[index].flags & SHADER_FLAG_USE_U8) || (SCHRO_OPENGL_CANVAS_IS_FLAG_SET (STORE_S16_AS_UI16) && schro_opengl_shader_code_list[index].flags & SHADER_FLAG_USE_S16) || (SCHRO_OPENGL_CANVAS_IS_FLAG_SET (STORE_S16_AS_U16) && schro_opengl_shader_code_list[index].flags & SHADER_FLAG_USE_S16)) { shader_library->shaders[index] = schro_opengl_shader_new (schro_opengl_shader_code_list[index].code_integer, schro_opengl_shader_code_list[index].name); } else { shader_library->shaders[index] = schro_opengl_shader_new (schro_opengl_shader_code_list[index].code, schro_opengl_shader_code_list[index].name); } schro_opengl_unlock (opengl); } return shader_library->shaders[index]; } schroedinger-1.0.11/schroedinger/opengl/schroopengltypes.h0000644000175000017500000000113511320232176020705 00000000000000 #ifndef __SCHRO_OPENGL_TYPES_H__ #define __SCHRO_OPENGL_TYPES_H__ #include SCHRO_BEGIN_DECLS #ifndef SCHRO_OPENGL_TYPEDEF #define SCHRO_OPENGL_TYPEDEF typedef struct _SchroOpenGL SchroOpenGL; #endif typedef struct _SchroOpenGLShader SchroOpenGLShader; typedef struct _SchroOpenGLShaderLibrary SchroOpenGLShaderLibrary; typedef struct _SchroOpenGLTexture SchroOpenGLTexture; typedef struct _SchroOpenGLTransfer SchroOpenGLTransfer; typedef struct _SchroOpenGLCanvas SchroOpenGLCanvas; typedef struct _SchroOpenGLCanvasPool SchroOpenGLCanvasPool; SCHRO_END_DECLS #endif schroedinger-1.0.11/schroedinger/opengl/schroopenglframe.c0000644000175000017500000003067011320232176020634 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include void schro_opengl_frame_setup (SchroOpenGL *opengl, SchroFrame *frame) { int i; int components; int width, height; SchroFrameFormat format; SchroOpenGLCanvasPool *canvas_pool; SchroOpenGLCanvas *canvas; SCHRO_ASSERT (frame != NULL); SCHRO_ASSERT (SCHRO_FRAME_IS_OPENGL (frame)); components = SCHRO_FRAME_IS_PACKED (frame->format) ? 1 : 3; schro_opengl_lock (opengl); canvas_pool = schro_opengl_get_canvas_pool (opengl); for (i = 0; i < components; ++i) { format = frame->components[i].format; width = frame->components[i].width; height = frame->components[i].height; SCHRO_ASSERT (frame->format == format); canvas = schro_opengl_canvas_pool_pull_or_new (canvas_pool, opengl, format, width, height); // FIXME: hack to store custom data per frame component *((SchroOpenGLCanvas **) frame->components[i].data) = canvas; } schro_opengl_unlock (opengl); } void schro_opengl_frame_cleanup (SchroFrame *frame) { int i; int components; SchroOpenGL *opengl; SchroOpenGLCanvasPool *canvas_pool; SchroOpenGLCanvas *canvas; SCHRO_ASSERT (frame != NULL); SCHRO_ASSERT (SCHRO_FRAME_IS_OPENGL (frame)); components = SCHRO_FRAME_IS_PACKED (frame->format) ? 1 : 3; // FIXME: hack to store custom data per frame component canvas = *((SchroOpenGLCanvas **) frame->components[0].data); SCHRO_ASSERT (canvas != NULL); opengl = canvas->opengl; schro_opengl_lock (opengl); canvas_pool = schro_opengl_get_canvas_pool (opengl); for (i = 0; i < components; ++i) { // FIXME: hack to store custom data per frame component canvas = *((SchroOpenGLCanvas **) frame->components[i].data); SCHRO_ASSERT (canvas != NULL); SCHRO_ASSERT (canvas->opengl == opengl); schro_opengl_canvas_pool_push_or_free (canvas_pool, canvas); } schro_opengl_unlock (opengl); } SchroFrame * schro_opengl_frame_new (SchroOpenGL *opengl, SchroMemoryDomain *opengl_domain, SchroFrameFormat format, int width, int height) { SchroFrame *opengl_frame; SCHRO_ASSERT (opengl_domain->flags & SCHRO_MEMORY_DOMAIN_OPENGL); opengl_frame = schro_frame_new_and_alloc (opengl_domain, format, width, height); schro_opengl_frame_setup (opengl, opengl_frame); return opengl_frame; } SchroFrame * schro_opengl_frame_clone (SchroFrame *opengl_frame) { SchroOpenGLCanvas *canvas; SCHRO_ASSERT (opengl_frame != NULL); SCHRO_ASSERT (SCHRO_FRAME_IS_OPENGL (opengl_frame)); // FIXME: hack to store custom data per frame component canvas = *((SchroOpenGLCanvas **) opengl_frame->components[0].data); SCHRO_ASSERT (canvas != NULL); return schro_opengl_frame_new (canvas->opengl, opengl_frame->domain, opengl_frame->format, opengl_frame->width, opengl_frame->height); } SchroFrame * schro_opengl_frame_clone_and_push (SchroOpenGL *opengl, SchroMemoryDomain *opengl_domain, SchroFrame *cpu_frame) { SchroFrame *opengl_frame; SCHRO_ASSERT (opengl_domain->flags & SCHRO_MEMORY_DOMAIN_OPENGL); SCHRO_ASSERT (!SCHRO_FRAME_IS_OPENGL (cpu_frame)); opengl_frame = schro_frame_clone (opengl_domain, cpu_frame); schro_opengl_frame_setup (opengl, opengl_frame); schro_opengl_frame_push (opengl_frame, cpu_frame); return opengl_frame; } void schro_opengl_frame_inverse_iwt_transform (SchroFrame *frame, SchroParams *params) { int i; int width, height; int level; SchroOpenGL *opengl; SchroOpenGLCanvas *canvas; // FIXME: hack to store custom data per frame component canvas = *((SchroOpenGLCanvas **) frame->components[0].data); SCHRO_ASSERT (canvas != NULL); opengl = canvas->opengl; schro_opengl_lock (opengl); for (i = 0; i < 3; ++i) { // FIXME: hack to store custom data per frame component canvas = *((SchroOpenGLCanvas **) frame->components[i].data); SCHRO_ASSERT (canvas != NULL); SCHRO_ASSERT (canvas->opengl == opengl); if (i == 0) { width = params->iwt_luma_width; height = params->iwt_luma_height; } else { width = params->iwt_chroma_width; height = params->iwt_chroma_height; } for (level = params->transform_depth - 1; level >= 0; --level) { SchroFrameData frame_data; frame_data.format = frame->format; frame_data.data = frame->components[i].data; frame_data.width = width >> level; frame_data.height = height >> level; frame_data.stride = frame->components[i].stride << level; schro_opengl_wavelet_inverse_transform (&frame_data, params->wavelet_filter_index); } } schro_opengl_unlock (opengl); } static void schro_opengl_upsampled_frame_render_quad (SchroOpenGLShader *shader, int x, int y, int quad_width, int quad_height, int total_width, int total_height) { int x_inverse, y_inverse; int four_x = 0, four_y = 0, three_x = 0, three_y = 0, two_x = 0, two_y = 0, one_x = 0, one_y = 0; x_inverse = total_width - x - quad_width; y_inverse = total_height - y - quad_height; if (quad_width == total_width && quad_height < total_height) { four_y = 4; three_y = 3; two_y = 2; one_y = 1; } else if (quad_width < total_width && quad_height == total_height) { four_x = 4; three_x = 3; two_x = 2; one_x = 1; } else { SCHRO_ERROR ("invalid quad to total relation"); SCHRO_ASSERT (0); } SCHRO_ASSERT (x_inverse >= 0); SCHRO_ASSERT (y_inverse >= 0); #define UNIFORM(_number, _operation, __x, __y) \ do { \ if (shader->_number##_##_operation != -1) { \ glUniform2fARB (shader->_number##_##_operation, \ __x < _number##_x ? __x : _number##_x, \ __y < _number##_y ? __y : _number##_y); \ } \ } while (0) UNIFORM (four, decrease, x, y); UNIFORM (three, decrease, x, y); UNIFORM (two, decrease, x, y); UNIFORM (one, decrease, x, y); UNIFORM (one, increase, x_inverse, y_inverse); UNIFORM (two, increase, x_inverse, y_inverse); UNIFORM (three, increase, x_inverse, y_inverse); UNIFORM (four, increase, x_inverse, y_inverse); #undef UNIFORM schro_opengl_render_quad (x, y, quad_width, quad_height); } void schro_opengl_upsampled_frame_upsample (SchroUpsampledFrame *upsampled_frame) { int i; int width, height; SchroOpenGLCanvas *canvases[4]; SchroOpenGL *opengl; SchroOpenGLShader *shader = NULL; SCHRO_ASSERT (upsampled_frame->frames[0] != NULL); SCHRO_ASSERT (upsampled_frame->frames[1] == NULL); SCHRO_ASSERT (upsampled_frame->frames[2] == NULL); SCHRO_ASSERT (upsampled_frame->frames[3] == NULL); SCHRO_ASSERT (SCHRO_FRAME_IS_OPENGL (upsampled_frame->frames[0])); SCHRO_ASSERT (!SCHRO_FRAME_IS_PACKED (upsampled_frame->frames[0]->format)); // FIXME: hack to store custom data per frame component canvases[0] = *((SchroOpenGLCanvas **) upsampled_frame->frames[0]->components[0].data); SCHRO_ASSERT (canvases[0] != NULL); opengl = canvases[0]->opengl; schro_opengl_lock (opengl); upsampled_frame->frames[1] = schro_opengl_frame_clone (upsampled_frame->frames[0]); upsampled_frame->frames[2] = schro_opengl_frame_clone (upsampled_frame->frames[0]); upsampled_frame->frames[3] = schro_opengl_frame_clone (upsampled_frame->frames[0]); shader = schro_opengl_shader_get (opengl, SCHRO_OPENGL_SHADER_UPSAMPLE_U8); SCHRO_ASSERT (shader != NULL); glUseProgramObjectARB (shader->program); glUniform1iARB (shader->textures[0], 0); SCHRO_OPENGL_CHECK_ERROR for (i = 0; i < 3; ++i) { // FIXME: hack to store custom data per frame component canvases[0] = *((SchroOpenGLCanvas **) upsampled_frame->frames[0]->components[i].data); canvases[1] = *((SchroOpenGLCanvas **) upsampled_frame->frames[1]->components[i].data); canvases[2] = *((SchroOpenGLCanvas **) upsampled_frame->frames[2]->components[i].data); canvases[3] = *((SchroOpenGLCanvas **) upsampled_frame->frames[3]->components[i].data); SCHRO_ASSERT (canvases[0] != NULL); SCHRO_ASSERT (canvases[1] != NULL); SCHRO_ASSERT (canvases[2] != NULL); SCHRO_ASSERT (canvases[3] != NULL); SCHRO_ASSERT (canvases[0]->opengl == opengl); SCHRO_ASSERT (canvases[1]->opengl == opengl); SCHRO_ASSERT (canvases[2]->opengl == opengl); SCHRO_ASSERT (canvases[3]->opengl == opengl); width = upsampled_frame->frames[0]->components[i].width; height = upsampled_frame->frames[0]->components[i].height; SCHRO_ASSERT (width >= 2); SCHRO_ASSERT (height >= 2); SCHRO_ASSERT (width % 2 == 0); SCHRO_ASSERT (height % 2 == 0); schro_opengl_setup_viewport (width, height); /* horizontal filter 0 -> 1 */ glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, canvases[1]->framebuffers[0]); glBindTexture (GL_TEXTURE_RECTANGLE_ARB, canvases[0]->texture.handles[0]); SCHRO_OPENGL_CHECK_ERROR #define RENDER_QUAD_HORIZONTAL(_x, _quad_width) \ schro_opengl_upsampled_frame_render_quad (shader, _x, 0, _quad_width,\ height, width, height) RENDER_QUAD_HORIZONTAL (0, 1); if (width > 2) { RENDER_QUAD_HORIZONTAL (1, 1); if (width > 4) { RENDER_QUAD_HORIZONTAL (2, 1); if (width > 6) { RENDER_QUAD_HORIZONTAL (3, 1); if (width > 8) { RENDER_QUAD_HORIZONTAL (4, width - 8); } RENDER_QUAD_HORIZONTAL (width - 4, 1); } RENDER_QUAD_HORIZONTAL (width - 3, 1); } RENDER_QUAD_HORIZONTAL (width - 2, 1); } RENDER_QUAD_HORIZONTAL (width - 1, 1); #undef RENDER_QUAD_HORIZONTAL /* vertical filter 0 -> 2 */ glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, canvases[2]->framebuffers[0]); glBindTexture (GL_TEXTURE_RECTANGLE_ARB, canvases[0]->texture.handles[0]); SCHRO_OPENGL_CHECK_ERROR #define RENDER_QUAD_VERTICAL(_y, _quad_height) \ schro_opengl_upsampled_frame_render_quad (shader, 0, _y, width,\ _quad_height, width, height) RENDER_QUAD_VERTICAL (0, 1); if (height > 2) { RENDER_QUAD_VERTICAL (1, 1); if (height > 4) { RENDER_QUAD_VERTICAL (2, 1); if (height > 6) { RENDER_QUAD_VERTICAL (3, 1); if (height > 8) { RENDER_QUAD_VERTICAL (4, height - 8); } RENDER_QUAD_VERTICAL (height - 4, 1); } RENDER_QUAD_VERTICAL (height - 3, 1); } RENDER_QUAD_VERTICAL (height - 2, 1); } RENDER_QUAD_VERTICAL (height - 1, 1); #undef RENDER_QUAD_VERTICAL /* horizontal filter 2 -> 3 */ glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, canvases[3]->framebuffers[0]); glBindTexture (GL_TEXTURE_RECTANGLE_ARB, canvases[2]->texture.handles[0]); SCHRO_OPENGL_CHECK_ERROR #define RENDER_QUAD_HORIZONTAL(_x, _quad_width) \ schro_opengl_upsampled_frame_render_quad (shader, _x, 0, _quad_width,\ height, width, height) RENDER_QUAD_HORIZONTAL (0, 1); if (width > 2) { RENDER_QUAD_HORIZONTAL (1, 1); if (width > 4) { RENDER_QUAD_HORIZONTAL (2, 1); if (width > 6) { RENDER_QUAD_HORIZONTAL (3, 1); if (width > 8) { RENDER_QUAD_HORIZONTAL (4, width - 8); } RENDER_QUAD_HORIZONTAL (width - 4, 1); } RENDER_QUAD_HORIZONTAL (width - 3, 1); } RENDER_QUAD_HORIZONTAL (width - 2, 1); } RENDER_QUAD_HORIZONTAL (width - 1, 1); #undef RENDER_QUAD_HORIZONTAL } glUseProgramObjectARB (0); #if SCHRO_OPENGL_UNBIND_TEXTURES glBindTexture (GL_TEXTURE_RECTANGLE_ARB, 0); #endif glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, 0); schro_opengl_unlock (opengl); } void schro_frame_print (SchroFrame *frame, const char* name) { printf ("schro_frame_print: %s\n", name); switch (SCHRO_FRAME_FORMAT_DEPTH (frame->format)) { case SCHRO_FRAME_FORMAT_DEPTH_U8: printf (" depth: U8\n"); break; case SCHRO_FRAME_FORMAT_DEPTH_S16: printf (" depth: S16\n"); break; case SCHRO_FRAME_FORMAT_DEPTH_S32: printf (" depth: S32\n"); break; default: printf (" depth: unknown\n"); break; } printf (" packed: %s\n", SCHRO_FRAME_IS_PACKED (frame->format) ? "yes": "no"); printf (" width: %i\n", frame->width); printf (" height: %i\n", frame->height); printf (" opengl: %s\n", SCHRO_FRAME_IS_OPENGL (frame) ? "yes": "no"); } schroedinger-1.0.11/schroedinger/opengl/schroopenglframe_convert.c0000644000175000017500000002650111556115124022376 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include /*#include */ #define CONVERT_PROTOTYPE(_func) \ static void schro_opengl_frame_convert_##_func (SchroFrame *dest, \ SchroFrame *src) CONVERT_PROTOTYPE (u8_s16); CONVERT_PROTOTYPE (s16_u8); CONVERT_PROTOTYPE (u8_u8); CONVERT_PROTOTYPE (s16_s16); CONVERT_PROTOTYPE (u8_422_yuyv); CONVERT_PROTOTYPE (u8_422_uyvy); CONVERT_PROTOTYPE (u8_444_ayuv); CONVERT_PROTOTYPE (yuyv_u8_422); CONVERT_PROTOTYPE (uyvy_u8_422); CONVERT_PROTOTYPE (ayuv_u8_444); #undef CONVERT_PROTOTYPE typedef void (*SchroOpenGLFrameBinaryFunc) (SchroFrame *dest, SchroFrame *src); struct FormatToFunction { SchroFrameFormat dest; SchroFrameFormat src; SchroOpenGLFrameBinaryFunc func; }; #define CONVERT_MAPPING(_dest, _src, _func) \ { SCHRO_FRAME_FORMAT_##_dest, SCHRO_FRAME_FORMAT_##_src, \ schro_opengl_frame_convert_##_func } static struct FormatToFunction schro_opengl_frame_convert_func_list[] = { /* S16 -> U8 */ CONVERT_MAPPING (U8_444, S16_444, u8_s16), CONVERT_MAPPING (U8_422, S16_422, u8_s16), CONVERT_MAPPING (U8_420, S16_420, u8_s16), /* U8 -> S16 */ CONVERT_MAPPING (S16_444, U8_444, s16_u8), CONVERT_MAPPING (S16_422, U8_422, s16_u8), CONVERT_MAPPING (S16_420, U8_420, s16_u8), /* U8 -> U8 */ CONVERT_MAPPING (U8_444, U8_444, u8_u8), CONVERT_MAPPING (U8_422, U8_422, u8_u8), CONVERT_MAPPING (U8_420, U8_420, u8_u8), /* S16 -> S16 */ CONVERT_MAPPING (S16_444, S16_444, s16_s16), CONVERT_MAPPING (S16_422, S16_422, s16_s16), CONVERT_MAPPING (S16_420, S16_420, s16_s16), /* packed -> U8 */ CONVERT_MAPPING (U8_422, YUYV, u8_422_yuyv), CONVERT_MAPPING (U8_422, UYVY, u8_422_uyvy), CONVERT_MAPPING (U8_444, AYUV, u8_444_ayuv), /* U8 -> packed */ CONVERT_MAPPING (YUYV, U8_422, yuyv_u8_422), CONVERT_MAPPING (UYVY, U8_422, uyvy_u8_422), CONVERT_MAPPING (AYUV, U8_444, ayuv_u8_444), { 0, 0, NULL } }; #undef CONVERT_MAPPING void schro_opengl_frame_convert (SchroFrame *dest, SchroFrame *src) { int i; SCHRO_ASSERT (dest != NULL); SCHRO_ASSERT (src != NULL); SCHRO_ASSERT (SCHRO_FRAME_IS_OPENGL (dest)); SCHRO_ASSERT (SCHRO_FRAME_IS_OPENGL (src)); for (i = 0; schro_opengl_frame_convert_func_list[i].func; ++i) { if (schro_opengl_frame_convert_func_list[i].dest == dest->format && schro_opengl_frame_convert_func_list[i].src == src->format) { schro_opengl_frame_convert_func_list[i].func (dest, src); return; } } SCHRO_ERROR ("conversion unimplemented (%d -> %d)", src->format, dest->format); SCHRO_ASSERT (0); } static void schro_opengl_frame_convert_with_shader (SchroFrame *dest, SchroFrame *src, int shader_index) { int i; int width, height; SchroOpenGL *opengl = NULL; SchroOpenGLCanvas *dest_canvas = NULL; SchroOpenGLCanvas *src_canvas = NULL; SchroOpenGLShader *shader; // FIXME: hack to store custom data per frame component dest_canvas = *((SchroOpenGLCanvas **) dest->components[0].data); src_canvas = *((SchroOpenGLCanvas **) src->components[0].data); SCHRO_ASSERT (dest_canvas != NULL); SCHRO_ASSERT (src_canvas != NULL); SCHRO_ASSERT (dest_canvas->opengl == src_canvas->opengl); opengl = src_canvas->opengl; schro_opengl_lock (opengl); shader = schro_opengl_shader_get (opengl, shader_index); SCHRO_ASSERT (shader); for (i = 0; i < 3; ++i) { // FIXME: hack to store custom data per frame component dest_canvas = *((SchroOpenGLCanvas **) dest->components[i].data); src_canvas = *((SchroOpenGLCanvas **) src->components[i].data); SCHRO_ASSERT (dest_canvas != NULL); SCHRO_ASSERT (src_canvas != NULL); SCHRO_ASSERT (dest_canvas->opengl == opengl); SCHRO_ASSERT (src_canvas->opengl == opengl); width = MAX (dest->components[i].width, src->components[i].width); height = MAX (dest->components[i].height, src->components[i].height); schro_opengl_setup_viewport (width, height); glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, dest_canvas->framebuffers[0]); glBindTexture (GL_TEXTURE_RECTANGLE_ARB, src_canvas->texture.handles[0]); SCHRO_OPENGL_CHECK_ERROR glUseProgramObjectARB (shader->program); glUniform1iARB (shader->textures[0], 0); schro_opengl_render_quad (0, 0, width, height); glUseProgramObjectARB (0); glFlush (); #if SCHRO_OPENGL_UNBIND_TEXTURES glBindTexture (GL_TEXTURE_RECTANGLE_ARB, 0); #endif glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, 0); } schro_opengl_unlock (opengl); } static void schro_opengl_frame_unpack_with_shader (SchroFrame *dest, SchroFrame *src, int shader_y_index, int shader_u_index, int shader_v_index) { int i; int width, height; SchroOpenGL *opengl = NULL; SchroOpenGLCanvas *dest_canvas = NULL; SchroOpenGLCanvas *src_canvas = NULL; SchroOpenGLShader *shader; int shader_indices[] = { shader_y_index, shader_u_index, shader_v_index }; // FIXME: hack to store custom data per frame component dest_canvas = *((SchroOpenGLCanvas **) dest->components[0].data); src_canvas = *((SchroOpenGLCanvas **) src->components[0].data); SCHRO_ASSERT (dest_canvas != NULL); SCHRO_ASSERT (src_canvas != NULL); SCHRO_ASSERT (dest_canvas->opengl == src_canvas->opengl); opengl = src_canvas->opengl; schro_opengl_lock (opengl); for (i = 0; i < 3; ++i) { // FIXME: hack to store custom data per frame component dest_canvas = *((SchroOpenGLCanvas **) dest->components[i].data); SCHRO_ASSERT (dest_canvas != NULL); SCHRO_ASSERT (dest_canvas->opengl == opengl); shader = schro_opengl_shader_get (opengl, shader_indices[i]); SCHRO_ASSERT (shader); /*width = MAX (dest->components[i].width, src->components[0].width); height = MAX (dest->components[i].height, src->components[0].height);*/ // FIXME: edge extend is unimplemented width = dest->components[i].width; height = dest->components[i].height; schro_opengl_setup_viewport (width, height); glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, dest_canvas->framebuffers[0]); glBindTexture (GL_TEXTURE_RECTANGLE_ARB, src_canvas->texture.handles[0]); SCHRO_OPENGL_CHECK_ERROR glUseProgramObjectARB (shader->program); glUniform1iARB (shader->textures[0], 0); schro_opengl_render_quad (0, 0, width, height); glUseProgramObjectARB (0); glFlush (); #if SCHRO_OPENGL_UNBIND_TEXTURES glBindTexture (GL_TEXTURE_RECTANGLE_ARB, 0); #endif glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, 0); } schro_opengl_unlock (opengl); } static void schro_opengl_frame_pack_with_shader (SchroFrame *dest, SchroFrame *src, int shader_index) { int width, height; SchroOpenGLCanvas *dest_canvas = NULL; SchroOpenGLCanvas *src_y_canvas = NULL; SchroOpenGLCanvas *src_u_canvas = NULL; SchroOpenGLCanvas *src_v_canvas = NULL; SchroOpenGL *opengl = NULL; SchroOpenGLShader *shader; // FIXME: hack to store custom data per frame component dest_canvas = *((SchroOpenGLCanvas **) dest->components[0].data); SCHRO_ASSERT (dest_canvas != NULL); // FIXME: hack to store custom data per frame component src_y_canvas = *((SchroOpenGLCanvas **) src->components[0].data); src_u_canvas = *((SchroOpenGLCanvas **) src->components[1].data); src_v_canvas = *((SchroOpenGLCanvas **) src->components[2].data); SCHRO_ASSERT (src_y_canvas != NULL); SCHRO_ASSERT (src_u_canvas != NULL); SCHRO_ASSERT (src_v_canvas != NULL); opengl = dest_canvas->opengl; SCHRO_ASSERT (src_y_canvas->opengl == opengl); SCHRO_ASSERT (src_u_canvas->opengl == opengl); SCHRO_ASSERT (src_v_canvas->opengl == opengl); schro_opengl_lock (opengl); shader = schro_opengl_shader_get (opengl, shader_index); SCHRO_ASSERT (shader); /*width = MAX (dest->components[i].width, src->components[0].width); height = MAX (dest->components[i].height, src->components[0].height);*/ // FIXME: edge extend is unimplemented width = dest->components[0].width; height = dest->components[0].height; schro_opengl_setup_viewport (width, height); glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, dest_canvas->framebuffers[0]); glUseProgramObjectARB (shader->program); //glActiveTextureARB (GL_TEXTURE0_ARB); glBindTexture (GL_TEXTURE_RECTANGLE_ARB, src_y_canvas->texture.handles[0]); glUniform1iARB (shader->textures[0], 0); glActiveTextureARB (GL_TEXTURE1_ARB); glBindTexture (GL_TEXTURE_RECTANGLE_ARB, src_u_canvas->texture.handles[0]); glUniform1iARB (shader->textures[1], 1); glActiveTextureARB (GL_TEXTURE2_ARB); glBindTexture (GL_TEXTURE_RECTANGLE_ARB, src_v_canvas->texture.handles[0]); glUniform1iARB (shader->textures[2], 2); glActiveTextureARB (GL_TEXTURE0_ARB); SCHRO_OPENGL_CHECK_ERROR schro_opengl_render_quad (0, 0, width, height); glFlush (); glUseProgramObjectARB (0); #if SCHRO_OPENGL_UNBIND_TEXTURES glBindTexture (GL_TEXTURE_RECTANGLE_ARB, 0); glActiveTextureARB (GL_TEXTURE1_ARB); glBindTexture (GL_TEXTURE_RECTANGLE_ARB, 0); glActiveTextureARB (GL_TEXTURE2_ARB); glBindTexture (GL_TEXTURE_RECTANGLE_ARB, 0); glActiveTextureARB (GL_TEXTURE0_ARB); #endif glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, 0); schro_opengl_unlock (opengl); } static void schro_opengl_frame_convert_u8_s16 (SchroFrame *dest, SchroFrame *src) { schro_opengl_frame_convert_with_shader (dest, src, SCHRO_OPENGL_SHADER_CONVERT_U8_S16); } static void schro_opengl_frame_convert_s16_u8 (SchroFrame *dest, SchroFrame *src) { schro_opengl_frame_convert_with_shader (dest, src, SCHRO_OPENGL_SHADER_CONVERT_S16_U8); } static void schro_opengl_frame_convert_u8_u8 (SchroFrame *dest, SchroFrame *src) { schro_opengl_frame_convert_with_shader (dest, src, SCHRO_OPENGL_SHADER_CONVERT_U8_U8); } static void schro_opengl_frame_convert_s16_s16 (SchroFrame *dest, SchroFrame *src) { schro_opengl_frame_convert_with_shader (dest, src, SCHRO_OPENGL_SHADER_CONVERT_S16_S16); } static void schro_opengl_frame_convert_u8_422_yuyv (SchroFrame *dest, SchroFrame *src) { schro_opengl_frame_unpack_with_shader (dest, src, SCHRO_OPENGL_SHADER_CONVERT_U8_Y4_YUYV, SCHRO_OPENGL_SHADER_CONVERT_U8_U2_YUYV, SCHRO_OPENGL_SHADER_CONVERT_U8_V2_YUYV); } static void schro_opengl_frame_convert_u8_422_uyvy (SchroFrame *dest, SchroFrame *src) { schro_opengl_frame_unpack_with_shader (dest, src, SCHRO_OPENGL_SHADER_CONVERT_U8_Y4_UYVY, SCHRO_OPENGL_SHADER_CONVERT_U8_U2_UYVY, SCHRO_OPENGL_SHADER_CONVERT_U8_V2_UYVY); } static void schro_opengl_frame_convert_u8_444_ayuv (SchroFrame *dest, SchroFrame *src) { schro_opengl_frame_unpack_with_shader (dest, src, SCHRO_OPENGL_SHADER_CONVERT_U8_Y4_AYUV, SCHRO_OPENGL_SHADER_CONVERT_U8_U4_AYUV, SCHRO_OPENGL_SHADER_CONVERT_U8_V4_AYUV); } static void schro_opengl_frame_convert_yuyv_u8_422 (SchroFrame *dest, SchroFrame *src) { schro_opengl_frame_pack_with_shader (dest, src, SCHRO_OPENGL_SHADER_CONVERT_YUYV_U8_422); } static void schro_opengl_frame_convert_uyvy_u8_422 (SchroFrame *dest, SchroFrame *src) { schro_opengl_frame_pack_with_shader (dest, src, SCHRO_OPENGL_SHADER_CONVERT_UYVY_U8_422); } static void schro_opengl_frame_convert_ayuv_u8_444 (SchroFrame *dest, SchroFrame *src) { schro_opengl_frame_pack_with_shader (dest, src, SCHRO_OPENGL_SHADER_CONVERT_AYUV_U8_444); } schroedinger-1.0.11/schroedinger/opengl/schroopenglmotion.h0000644000175000017500000000034311320232176021046 00000000000000 #ifndef __SCHRO_OPENGL_MOTION_H__ #define __SCHRO_OPENGL_MOTION_H__ #include SCHRO_BEGIN_DECLS void schro_opengl_motion_render (SchroMotion *motion, SchroFrame *dest); SCHRO_END_DECLS #endif schroedinger-1.0.11/schroedinger/opengl/schroopengl.h0000644000175000017500000000264211320232176017624 00000000000000 #ifndef __SCHRO_OPENGL_H__ #define __SCHRO_OPENGL_H__ #include #include #include SCHRO_BEGIN_DECLS #define SCHRO_OPENGL_CHECK_ERROR \ schro_opengl_check_error (__FILE__, __LINE__, __FUNCTION__); #define SCHRO_OPENGL_CHECK_FRAMEBUFFER \ schro_opengl_check_framebuffer (__FILE__, __LINE__, __FUNCTION__); void schro_opengl_init (void); SchroOpenGL *schro_opengl_new (void); void schro_opengl_free (SchroOpenGL *opengl); int schro_opengl_is_usable (SchroOpenGL *opengl); void schro_opengl_lock (SchroOpenGL *opengl); void schro_opengl_unlock (SchroOpenGL *opengl); void schro_opengl_check_error (const char *file, int line, const char *func); void schro_opengl_check_framebuffer (const char *file, int line, const char *func); void schro_opengl_set_visible (SchroOpenGL *opengl, int visible); void schro_opengl_setup_viewport (int width, int height); void schro_opengl_render_quad (int x, int y, int width, int height); void *schro_opengl_get_tmp (SchroOpenGL *opengl, int size); SchroOpenGLShaderLibrary *schro_opengl_get_shader_library (SchroOpenGL *opengl); SchroOpenGLCanvasPool *schro_opengl_get_canvas_pool (SchroOpenGL *opengl); SchroOpenGLCanvas *schro_opengl_get_obmc_weight_canvas (SchroOpenGL *opengl, int width, int height); SchroMemoryDomain *schro_memory_domain_new_opengl (void); SCHRO_END_DECLS #endif schroedinger-1.0.11/schroedinger/opengl/schroopenglframe_combine.c0000644000175000017500000001713711556115124022337 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include /*#include */ typedef void (*SchroOpenGLFrameBinaryFunc) (SchroFrame *dest, SchroFrame *src); struct FormatToFunction { SchroFrameFormat dest; SchroFrameFormat src; SchroOpenGLFrameBinaryFunc func; }; static void schro_opengl_frame_add_s16_u8 (SchroFrame *dest, SchroFrame *src); static void schro_opengl_frame_add_s16_s16 (SchroFrame *dest, SchroFrame *src); static struct FormatToFunction schro_opengl_frame_add_func_list[] = { /* U8 -> S16 */ { SCHRO_FRAME_FORMAT_S16_444, SCHRO_FRAME_FORMAT_U8_444, schro_opengl_frame_add_s16_u8 }, { SCHRO_FRAME_FORMAT_S16_422, SCHRO_FRAME_FORMAT_U8_422, schro_opengl_frame_add_s16_u8 }, { SCHRO_FRAME_FORMAT_S16_420, SCHRO_FRAME_FORMAT_U8_420, schro_opengl_frame_add_s16_u8 }, /* S16 -> S16 */ { SCHRO_FRAME_FORMAT_S16_444, SCHRO_FRAME_FORMAT_S16_444, schro_opengl_frame_add_s16_s16 }, { SCHRO_FRAME_FORMAT_S16_422, SCHRO_FRAME_FORMAT_S16_422, schro_opengl_frame_add_s16_s16 }, { SCHRO_FRAME_FORMAT_S16_420, SCHRO_FRAME_FORMAT_S16_420, schro_opengl_frame_add_s16_s16 }, { 0, 0, NULL } }; void schro_opengl_frame_add (SchroFrame *dest, SchroFrame *src) { int i; SCHRO_ASSERT (dest != NULL); SCHRO_ASSERT (src != NULL); SCHRO_ASSERT (SCHRO_FRAME_IS_OPENGL (dest)); SCHRO_ASSERT (SCHRO_FRAME_IS_OPENGL (src)); for (i = 0; schro_opengl_frame_add_func_list[i].func; ++i) { if (schro_opengl_frame_add_func_list[i].dest == dest->format && schro_opengl_frame_add_func_list[i].src == src->format) { schro_opengl_frame_add_func_list[i].func (dest, src); return; } } SCHRO_ERROR ("addition unimplemented (%d -> %d)", src->format, dest->format); SCHRO_ASSERT (0); } static void schro_opengl_frame_subtract_s16_u8 (SchroFrame *dest, SchroFrame *src); static void schro_opengl_frame_subtract_s16_s16 (SchroFrame *dest, SchroFrame *src); static struct FormatToFunction schro_opengl_frame_subtract_func_list[] = { /* U8 -> S16 */ { SCHRO_FRAME_FORMAT_S16_444, SCHRO_FRAME_FORMAT_U8_444, schro_opengl_frame_subtract_s16_u8 }, { SCHRO_FRAME_FORMAT_S16_422, SCHRO_FRAME_FORMAT_U8_422, schro_opengl_frame_subtract_s16_u8 }, { SCHRO_FRAME_FORMAT_S16_420, SCHRO_FRAME_FORMAT_U8_420, schro_opengl_frame_subtract_s16_u8 }, /* S16 -> S16 */ { SCHRO_FRAME_FORMAT_S16_444, SCHRO_FRAME_FORMAT_S16_444, schro_opengl_frame_subtract_s16_s16 }, { SCHRO_FRAME_FORMAT_S16_422, SCHRO_FRAME_FORMAT_S16_422, schro_opengl_frame_subtract_s16_s16 }, { SCHRO_FRAME_FORMAT_S16_420, SCHRO_FRAME_FORMAT_S16_420, schro_opengl_frame_subtract_s16_s16 }, { 0, 0, NULL } }; void schro_opengl_frame_subtract (SchroFrame *dest, SchroFrame *src) { int i; SCHRO_ASSERT (dest != NULL); SCHRO_ASSERT (src != NULL); SCHRO_ASSERT (SCHRO_FRAME_IS_OPENGL (dest)); SCHRO_ASSERT (SCHRO_FRAME_IS_OPENGL (src)); for (i = 0; schro_opengl_frame_subtract_func_list[i].func; ++i) { if (schro_opengl_frame_subtract_func_list[i].dest == dest->format && schro_opengl_frame_subtract_func_list[i].src == src->format) { schro_opengl_frame_subtract_func_list[i].func (dest, src); return; } } SCHRO_ERROR ("subtraction unimplemented (%d -> %d)", src->format, dest->format); SCHRO_ASSERT (0); } static void schro_opengl_frame_combine_with_shader (SchroFrame *dest, SchroFrame *src, int shader_index) { int i; int width, height; SchroOpenGLCanvas *dest_canvas = NULL; SchroOpenGLCanvas *src_canvas = NULL; SchroOpenGL *opengl = NULL; SchroOpenGLShader *shader_copy_u8; SchroOpenGLShader *shader_copy_s16; SchroOpenGLShader *shader_combine; SCHRO_ASSERT (dest != NULL); SCHRO_ASSERT (src != NULL); SCHRO_ASSERT (SCHRO_FRAME_IS_OPENGL (dest)); SCHRO_ASSERT (SCHRO_FRAME_IS_OPENGL (src)); // FIXME: hack to store custom data per frame component dest_canvas = *((SchroOpenGLCanvas **) dest->components[0].data); src_canvas = *((SchroOpenGLCanvas **) src->components[0].data); SCHRO_ASSERT (dest_canvas != NULL); SCHRO_ASSERT (src_canvas != NULL); SCHRO_ASSERT (dest_canvas->opengl == src_canvas->opengl); opengl = src_canvas->opengl; schro_opengl_lock (opengl); shader_copy_u8 = schro_opengl_shader_get (opengl, SCHRO_OPENGL_SHADER_COPY_U8); shader_copy_s16 = schro_opengl_shader_get (opengl, SCHRO_OPENGL_SHADER_COPY_S16); shader_combine = schro_opengl_shader_get (opengl, shader_index); SCHRO_ASSERT (shader_copy_u8); SCHRO_ASSERT (shader_copy_s16); SCHRO_ASSERT (shader_combine); for (i = 0; i < 3; ++i) { // FIXME: hack to store custom data per frame component dest_canvas = *((SchroOpenGLCanvas **) dest->components[i].data); src_canvas = *((SchroOpenGLCanvas **) src->components[i].data); SCHRO_ASSERT (dest_canvas != NULL); SCHRO_ASSERT (src_canvas != NULL); width = MIN (dest->components[i].width, src->components[i].width); height = MIN (dest->components[i].height, src->components[i].height); schro_opengl_setup_viewport (width, height); glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, dest_canvas->framebuffers[1]); glBindTexture (GL_TEXTURE_RECTANGLE_ARB, dest_canvas->texture.handles[0]); switch (SCHRO_FRAME_FORMAT_DEPTH (dest_canvas->format)) { case SCHRO_FRAME_FORMAT_DEPTH_U8: glUseProgramObjectARB (shader_copy_u8->program); glUniform1iARB (shader_copy_u8->textures[0], 0); break; case SCHRO_FRAME_FORMAT_DEPTH_S16: glUseProgramObjectARB (shader_copy_s16->program); glUniform1iARB (shader_copy_s16->textures[0], 0); break; default: SCHRO_ASSERT (0); break; } schro_opengl_render_quad (0, 0, width, height); SCHRO_OPENGL_CHECK_ERROR glFlush (); glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, dest_canvas->framebuffers[0]); glUseProgramObjectARB (shader_combine->program); //glActiveTextureARB (GL_TEXTURE0_ARB); glBindTexture (GL_TEXTURE_RECTANGLE_ARB, dest_canvas->texture.handles[1]); glUniform1iARB (shader_combine->textures[0], 0); glActiveTextureARB (GL_TEXTURE1_ARB); glBindTexture (GL_TEXTURE_RECTANGLE_ARB, src_canvas->texture.handles[0]); glUniform1iARB (shader_combine->textures[1], 1); glActiveTextureARB (GL_TEXTURE0_ARB); schro_opengl_render_quad (0, 0, width, height); glUseProgramObjectARB (0); SCHRO_OPENGL_CHECK_ERROR glFlush (); } #if SCHRO_OPENGL_UNBIND_TEXTURES glBindTexture (GL_TEXTURE_RECTANGLE_ARB, 0); glActiveTextureARB (GL_TEXTURE1_ARB); glBindTexture (GL_TEXTURE_RECTANGLE_ARB, 0); glActiveTextureARB (GL_TEXTURE0_ARB); #endif glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, 0); schro_opengl_unlock (opengl); } static void schro_opengl_frame_add_s16_u8 (SchroFrame *dest, SchroFrame *src) { schro_opengl_frame_combine_with_shader (dest, src, SCHRO_OPENGL_SHADER_ADD_S16_U8); } static void schro_opengl_frame_add_s16_s16 (SchroFrame *dest, SchroFrame *src) { schro_opengl_frame_combine_with_shader (dest, src, SCHRO_OPENGL_SHADER_ADD_S16_S16); } static void schro_opengl_frame_subtract_s16_u8 (SchroFrame *dest, SchroFrame *src) { schro_opengl_frame_combine_with_shader (dest, src, SCHRO_OPENGL_SHADER_SUBTRACT_S16_U8); } static void schro_opengl_frame_subtract_s16_s16 (SchroFrame *dest, SchroFrame *src) { schro_opengl_frame_combine_with_shader (dest, src, SCHRO_OPENGL_SHADER_SUBTRACT_S16_S16); } schroedinger-1.0.11/schroedinger/opengl/schroopenglframe.h0000644000175000017500000000263411426074213020643 00000000000000 #ifndef __SCHRO_OPENGL_FRAME_H__ #define __SCHRO_OPENGL_FRAME_H__ #include #include #include SCHRO_BEGIN_DECLS #define SCHRO_FRAME_IS_OPENGL(_frame) \ ((_frame)->domain && ((_frame)->domain->flags & SCHRO_MEMORY_DOMAIN_OPENGL)) void schro_opengl_frame_setup (SchroOpenGL *opengl, SchroFrame *frame); void schro_opengl_frame_cleanup (SchroFrame *frame); SchroFrame *schro_opengl_frame_new (SchroOpenGL *opengl, SchroMemoryDomain *opengl_domain, SchroFrameFormat format, int width, int height); SchroFrame *schro_opengl_frame_clone (SchroFrame *opengl_frame); SchroFrame *schro_opengl_frame_clone_and_push (SchroOpenGL *opengl, SchroMemoryDomain *opengl_domain, SchroFrame *cpu_frame); void schro_opengl_frame_push (SchroFrame *dest, SchroFrame *src); // CPU -> GPU void schro_opengl_frame_pull (SchroFrame *dest, SchroFrame *src); // CPU <- GPU void schro_opengl_frame_convert (SchroFrame *dest, SchroFrame *src); void schro_opengl_frame_add (SchroFrame *dest, SchroFrame *src); void schro_opengl_frame_subtract (SchroFrame *dest, SchroFrame *src); void schro_opengl_frame_inverse_iwt_transform (SchroFrame *frame, SchroParams *params); void schro_opengl_upsampled_frame_upsample (SchroUpsampledFrame *upsampled_frame); void schro_frame_print (SchroFrame *frame, const char* name); SCHRO_END_DECLS #endif schroedinger-1.0.11/schroedinger/opengl/schroopenglwavelet.c0000644000175000017500000003623711320232176021216 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include void schro_opengl_wavelet_transform (SchroFrameData *frame_data, int filter) { SCHRO_ERROR ("unimplemented"); SCHRO_ASSERT (0); } void schro_opengl_wavelet_vertical_deinterleave (SchroFrameData *frame_data) { int width, height; int framebuffer_index, texture_index; SchroOpenGLCanvas *canvas = NULL; SchroOpenGL *opengl = NULL; SchroOpenGLShader *shader_copy = NULL; SchroOpenGLShader *shader_vertical_deinterleave_l = NULL; SchroOpenGLShader *shader_vertical_deinterleave_h = NULL; SCHRO_ASSERT (SCHRO_FRAME_FORMAT_DEPTH (frame_data->format) == SCHRO_FRAME_FORMAT_DEPTH_S16); SCHRO_ASSERT (frame_data->width % 2 == 0); SCHRO_ASSERT (frame_data->height % 2 == 0); width = frame_data->width; height = frame_data->height; // FIXME: hack to store custom data per frame component canvas = *((SchroOpenGLCanvas **) frame_data->data); SCHRO_ASSERT (canvas != NULL); opengl = canvas->opengl; schro_opengl_lock (opengl); shader_copy = schro_opengl_shader_get (opengl, SCHRO_OPENGL_SHADER_COPY_S16); shader_vertical_deinterleave_l = schro_opengl_shader_get (opengl, SCHRO_OPENGL_SHADER_IIWT_S16_VERTICAL_DEINTERLEAVE_L); shader_vertical_deinterleave_h = schro_opengl_shader_get (opengl, SCHRO_OPENGL_SHADER_IIWT_S16_VERTICAL_DEINTERLEAVE_H); SCHRO_ASSERT (shader_copy != NULL); SCHRO_ASSERT (shader_vertical_deinterleave_l != NULL); SCHRO_ASSERT (shader_vertical_deinterleave_h != NULL); schro_opengl_setup_viewport (width, height); SCHRO_OPENGL_CHECK_ERROR #define SWITCH_FRAMEBUFFER_AND_TEXTURE_INDICES \ framebuffer_index = 1 - framebuffer_index; \ texture_index = 1 - texture_index; \ SCHRO_ASSERT (framebuffer_index != texture_index); #define BIND_FRAMEBUFFER_AND_TEXTURE \ glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, \ canvas->framebuffers[framebuffer_index]); \ glBindTexture (GL_TEXTURE_RECTANGLE_ARB, \ canvas->texture.handles[texture_index]); \ SCHRO_OPENGL_CHECK_ERROR framebuffer_index = 1; texture_index = 0; /* pass 1: vertical deinterleave */ BIND_FRAMEBUFFER_AND_TEXTURE glUseProgramObjectARB (shader_vertical_deinterleave_l->program); glUniform1iARB (shader_vertical_deinterleave_l->textures[0], 0); schro_opengl_render_quad (0, 0, width, height / 2); glUseProgramObjectARB (shader_vertical_deinterleave_h->program); glUniform1iARB (shader_vertical_deinterleave_h->textures[0], 0); glUniform2fARB (shader_vertical_deinterleave_h->offset, 0, height / 2); schro_opengl_render_quad (0, height / 2, width, height / 2); SCHRO_OPENGL_CHECK_ERROR glFlush (); /* pass 2: transfer data from secondary to primary framebuffer */ SWITCH_FRAMEBUFFER_AND_TEXTURE_INDICES BIND_FRAMEBUFFER_AND_TEXTURE glUseProgramObjectARB (shader_copy->program); glUniform1iARB (shader_copy->textures[0], 0); schro_opengl_render_quad (0, 0, width, height); SCHRO_OPENGL_CHECK_ERROR glFlush (); #undef SWITCH_FRAMEBUFFER_AND_TEXTURE_INDICES #undef BIND_FRAMEBUFFER_AND_TEXTURE #if SCHRO_OPENGL_UNBIND_TEXTURES glBindTexture (GL_TEXTURE_RECTANGLE_ARB, 0); #endif glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, 0); schro_opengl_unlock (opengl); } static void schro_opengl_wavelet_render_quad (SchroOpenGLShader *shader, int x, int y, int quad_width, int quad_height, int total_width, int total_height) { int x_inverse, y_inverse; int two_x = 0, two_y = 0, one_x = 0, one_y = 0; x_inverse = total_width - x - quad_width; y_inverse = total_height - y - quad_height; if (quad_width == total_width && quad_height < total_height) { two_y = 2; one_y = 1; } else if (quad_width < total_width && quad_height == total_height) { two_x = 2; one_x = 1; } else { SCHRO_ERROR ("invalid quad to total relation"); SCHRO_ASSERT (0); } SCHRO_ASSERT (x_inverse >= 0); SCHRO_ASSERT (y_inverse >= 0); #define UNIFORM(_number, _operation, __x, __y) \ do { \ if (shader->_number##_##_operation != -1) { \ glUniform2fARB (shader->_number##_##_operation, \ __x < _number##_x ? __x : _number##_x, \ __y < _number##_y ? __y : _number##_y); \ } \ } while (0) UNIFORM (two, decrease, x, y); UNIFORM (one, decrease, x, y); UNIFORM (one, increase, x_inverse, y_inverse); UNIFORM (two, increase, x_inverse, y_inverse); #undef UNIFORM schro_opengl_render_quad (x, y, quad_width, quad_height); } void schro_opengl_wavelet_inverse_transform (SchroFrameData *frame_data, int filter) { int width, height, subband_width, subband_height; int framebuffer_index, texture_index; int filter_shift = FALSE; SchroOpenGLCanvas *canvas = NULL; SchroOpenGL *opengl = NULL; SchroOpenGLShader *shader_copy = NULL; SchroOpenGLShader *shader_filter_lp = NULL; SchroOpenGLShader *shader_filter_hp = NULL; SchroOpenGLShader *shader_vertical_interleave = NULL; SchroOpenGLShader *shader_horizontal_interleave = NULL; SchroOpenGLShader *shader_filter_shift = NULL; SCHRO_ASSERT (SCHRO_FRAME_FORMAT_DEPTH (frame_data->format) == SCHRO_FRAME_FORMAT_DEPTH_S16); SCHRO_ASSERT (frame_data->width >= 2); SCHRO_ASSERT (frame_data->height >= 2); SCHRO_ASSERT (frame_data->width % 2 == 0); SCHRO_ASSERT (frame_data->height % 2 == 0); width = frame_data->width; height = frame_data->height; subband_width = width / 2; subband_height = height / 2; // FIXME: hack to store custom data per frame component canvas = *((SchroOpenGLCanvas **) frame_data->data); SCHRO_ASSERT (canvas != NULL); opengl = canvas->opengl; schro_opengl_lock (opengl); shader_copy = schro_opengl_shader_get (opengl, SCHRO_OPENGL_SHADER_COPY_S16); SCHRO_ASSERT (shader_copy != NULL); switch (filter) { case SCHRO_WAVELET_DESLAURIES_DUBUC_9_7: shader_filter_lp = schro_opengl_shader_get (opengl, SCHRO_OPENGL_SHADER_IIWT_S16_FILTER_DESLAURIERS_DUBUC_9_7_Lp); shader_filter_hp = schro_opengl_shader_get (opengl, SCHRO_OPENGL_SHADER_IIWT_S16_FILTER_DESLAURIERS_DUBUC_9_7_Hp); filter_shift = TRUE; break; case SCHRO_WAVELET_LE_GALL_5_3: shader_filter_lp = schro_opengl_shader_get (opengl, SCHRO_OPENGL_SHADER_IIWT_S16_FILTER_LE_GALL_5_3_Lp); shader_filter_hp = schro_opengl_shader_get (opengl, SCHRO_OPENGL_SHADER_IIWT_S16_FILTER_LE_GALL_5_3_Hp); filter_shift = TRUE; break; case SCHRO_WAVELET_DESLAURIES_DUBUC_13_7: shader_filter_lp = schro_opengl_shader_get (opengl, SCHRO_OPENGL_SHADER_IIWT_S16_FILTER_DESLAURIERS_DUBUC_13_7_Lp); shader_filter_hp = schro_opengl_shader_get (opengl, SCHRO_OPENGL_SHADER_IIWT_S16_FILTER_DESLAURIERS_DUBUC_13_7_Hp); filter_shift = TRUE; break; case SCHRO_WAVELET_HAAR_0: shader_filter_lp = schro_opengl_shader_get (opengl, SCHRO_OPENGL_SHADER_IIWT_S16_FILTER_HAAR_Lp); shader_filter_hp = schro_opengl_shader_get (opengl, SCHRO_OPENGL_SHADER_IIWT_S16_FILTER_HAAR_Hp); filter_shift = FALSE; break; case SCHRO_WAVELET_HAAR_1: shader_filter_lp = schro_opengl_shader_get (opengl, SCHRO_OPENGL_SHADER_IIWT_S16_FILTER_HAAR_Lp); shader_filter_hp = schro_opengl_shader_get (opengl, SCHRO_OPENGL_SHADER_IIWT_S16_FILTER_HAAR_Hp); filter_shift = TRUE; break; case SCHRO_WAVELET_FIDELITY: SCHRO_ERROR ("fidelity filter is not implemented yet"); SCHRO_ASSERT (0); filter_shift = FALSE; break; case SCHRO_WAVELET_DAUBECHIES_9_7: SCHRO_ERROR ("daubechies 9,7 filter is not implemented yet"); SCHRO_ASSERT (0); filter_shift = TRUE; break; default: SCHRO_ERROR ("unknown filter %i", filter); SCHRO_ASSERT (0); break; } SCHRO_ASSERT (shader_filter_lp != NULL); SCHRO_ASSERT (shader_filter_hp != NULL); shader_vertical_interleave = schro_opengl_shader_get (opengl, SCHRO_OPENGL_SHADER_IIWT_S16_VERTICAL_INTERLEAVE); shader_horizontal_interleave = schro_opengl_shader_get (opengl, SCHRO_OPENGL_SHADER_IIWT_S16_HORIZONTAL_INTERLEAVE); SCHRO_ASSERT (shader_vertical_interleave != NULL); SCHRO_ASSERT (shader_horizontal_interleave != NULL); if (filter_shift) { shader_filter_shift = schro_opengl_shader_get (opengl, SCHRO_OPENGL_SHADER_IIWT_S16_FILTER_SHIFT); SCHRO_ASSERT (shader_filter_shift); } else { shader_filter_shift = NULL; } schro_opengl_setup_viewport (width, height); SCHRO_OPENGL_CHECK_ERROR #define SWITCH_FRAMEBUFFER_AND_TEXTURE_INDICES \ framebuffer_index = 1 - framebuffer_index; \ texture_index = 1 - texture_index; \ SCHRO_ASSERT (framebuffer_index != texture_index); #define BIND_FRAMEBUFFER_AND_TEXTURE \ glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, \ canvas->framebuffers[framebuffer_index]); \ glBindTexture (GL_TEXTURE_RECTANGLE_ARB, \ canvas->texture.handles[texture_index]); \ SCHRO_OPENGL_CHECK_ERROR framebuffer_index = 1; texture_index = 0; /* pass 1: vertical filtering => XL + f(XH) = XL' */ BIND_FRAMEBUFFER_AND_TEXTURE glUseProgramObjectARB (shader_filter_lp->program); glUniform1iARB (shader_filter_lp->textures[0], 0); glUniform2fARB (shader_filter_lp->offset, 0, subband_height); #define RENDER_QUAD_VERTICAL_Lp(_y, _quad_height) \ schro_opengl_wavelet_render_quad (shader_filter_lp, 0, _y, width, \ _quad_height, width, height) RENDER_QUAD_VERTICAL_Lp (0, 1); if (subband_height > 2) { RENDER_QUAD_VERTICAL_Lp (1, 1); if (subband_height > 4) { RENDER_QUAD_VERTICAL_Lp (2, subband_height - 4); } RENDER_QUAD_VERTICAL_Lp (subband_height - 2, 1); } RENDER_QUAD_VERTICAL_Lp (subband_height - 1, 1); #undef RENDER_QUAD_VERTICAL_Lp /* copy XH */ glUseProgramObjectARB (shader_copy->program); glUniform1iARB (shader_copy->textures[0], 0); schro_opengl_render_quad (0, subband_height, width, subband_height); SCHRO_OPENGL_CHECK_ERROR glFlush (); /* pass 2: vertical filtering => f(XL') + XH = XH' */ SWITCH_FRAMEBUFFER_AND_TEXTURE_INDICES BIND_FRAMEBUFFER_AND_TEXTURE glUseProgramObjectARB (shader_filter_hp->program); glUniform1iARB (shader_filter_hp->textures[0], 0); glUniform2fARB (shader_filter_hp->offset, 0, subband_height); #define RENDER_QUAD_VERTICAL_Hp(_y_offset, _quad_height) \ schro_opengl_wavelet_render_quad (shader_filter_hp, 0, \ subband_height + (_y_offset), width, _quad_height, width, height) RENDER_QUAD_VERTICAL_Hp (0, 1); if (subband_height > 2) { RENDER_QUAD_VERTICAL_Hp (1, 1); if (subband_height > 4) { RENDER_QUAD_VERTICAL_Hp (2, subband_height - 4); } RENDER_QUAD_VERTICAL_Hp (subband_height - 2, 1); } RENDER_QUAD_VERTICAL_Hp (subband_height - 1, 1); #undef RENDER_QUAD_VERTICAL_Hp /* copy XL' */ glUseProgramObjectARB (shader_copy->program); glUniform1iARB (shader_copy->textures[0], 0); schro_opengl_render_quad (0, 0, width, subband_height); SCHRO_OPENGL_CHECK_ERROR glFlush (); /* pass 3: vertical interleave => i(LL', LH') = L, i(HL', HH') = H */ SWITCH_FRAMEBUFFER_AND_TEXTURE_INDICES BIND_FRAMEBUFFER_AND_TEXTURE glUseProgramObjectARB (shader_vertical_interleave->program); glUniform1iARB (shader_vertical_interleave->textures[0], 0); glUniform2fARB (shader_vertical_interleave->offset, 0, subband_height); schro_opengl_render_quad (0, 0, width, height); SCHRO_OPENGL_CHECK_ERROR glFlush (); /* pass 4: horizontal filtering => L + f(H) = L' */ SWITCH_FRAMEBUFFER_AND_TEXTURE_INDICES BIND_FRAMEBUFFER_AND_TEXTURE glUseProgramObjectARB (shader_filter_lp->program); glUniform1iARB (shader_filter_lp->textures[0], 0); glUniform2fARB (shader_filter_lp->offset, subband_width, 0); #define RENDER_QUAD_HORIZONTAL_Lp(_x, _quad_width) \ schro_opengl_wavelet_render_quad (shader_filter_lp, _x, 0, _quad_width, \ height, width, height) RENDER_QUAD_HORIZONTAL_Lp (0, 1); if (subband_width > 2) { RENDER_QUAD_HORIZONTAL_Lp (1, 1); if (subband_width > 4) { RENDER_QUAD_HORIZONTAL_Lp (2, subband_width - 4); } RENDER_QUAD_HORIZONTAL_Lp (subband_width - 2, 1); } RENDER_QUAD_HORIZONTAL_Lp (subband_width - 1, 1); #undef RENDER_QUAD_HORIZONTAL_Lp /* copy H */ glUseProgramObjectARB (shader_copy->program); glUniform1iARB (shader_copy->textures[0], 0); schro_opengl_render_quad (subband_width, 0, subband_width, height); SCHRO_OPENGL_CHECK_ERROR glFlush (); /* pass 5: horizontal filtering => f(L') + H = H' */ SWITCH_FRAMEBUFFER_AND_TEXTURE_INDICES BIND_FRAMEBUFFER_AND_TEXTURE glUseProgramObjectARB (shader_filter_hp->program); glUniform1iARB (shader_filter_hp->textures[0], 0); glUniform2fARB (shader_filter_hp->offset, subband_width, 0); #define RENDER_QUAD_HORIZONTAL_Hp(_x_offset, _quad_width) \ schro_opengl_wavelet_render_quad (shader_filter_hp, \ subband_width + (_x_offset), 0, _quad_width, height, width, height); RENDER_QUAD_HORIZONTAL_Hp (0, 1); if (subband_width > 2) { RENDER_QUAD_HORIZONTAL_Hp (1, 1); if (subband_width > 4) { RENDER_QUAD_HORIZONTAL_Hp (2, subband_width - 4); } RENDER_QUAD_HORIZONTAL_Hp (subband_width - 2, 1); } RENDER_QUAD_HORIZONTAL_Hp (subband_width - 1, 1); #undef RENDER_QUAD_HORIZONTAL_Hp /* copy L' */ glUseProgramObjectARB (shader_copy->program); glUniform1iARB (shader_copy->textures[0], 0); schro_opengl_render_quad (0, 0, subband_width, height); SCHRO_OPENGL_CHECK_ERROR glFlush (); /* pass 6: horizontal interleave => i(L', H') = LL */ SWITCH_FRAMEBUFFER_AND_TEXTURE_INDICES BIND_FRAMEBUFFER_AND_TEXTURE glUseProgramObjectARB (shader_horizontal_interleave->program); glUniform1iARB (shader_horizontal_interleave->textures[0], 0); glUniform2fARB (shader_horizontal_interleave->offset, width / 2, 0); schro_opengl_render_quad (0, 0, width, height); SCHRO_OPENGL_CHECK_ERROR glFlush (); /* pass 7: filter shift */ if (filter_shift) { SWITCH_FRAMEBUFFER_AND_TEXTURE_INDICES BIND_FRAMEBUFFER_AND_TEXTURE glUseProgramObjectARB (shader_filter_shift->program); glUniform1iARB (shader_filter_shift->textures[0], 0); schro_opengl_render_quad (0, 0, width, height); SCHRO_OPENGL_CHECK_ERROR glFlush (); } /* pass 8: transfer data from secondary to primary framebuffer if previous pass result wasn't rendered into the primary framebuffer */ if (framebuffer_index != 0) { SWITCH_FRAMEBUFFER_AND_TEXTURE_INDICES BIND_FRAMEBUFFER_AND_TEXTURE glUseProgramObjectARB (shader_copy->program); glUniform1iARB (shader_copy->textures[0], 0); schro_opengl_render_quad (0, 0, width, height); SCHRO_OPENGL_CHECK_ERROR glFlush (); } #undef SWITCH_FRAMEBUFFER_AND_TEXTURE_INDICES #undef BIND_FRAMEBUFFER_AND_TEXTURE glUseProgramObjectARB (0); #if SCHRO_OPENGL_UNBIND_TEXTURES glBindTexture (GL_TEXTURE_RECTANGLE_ARB, 0); #endif glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, 0); schro_opengl_unlock (opengl); } schroedinger-1.0.11/schroedinger/opengl/schroopenglframe_pull.c0000644000175000017500000001732511556115124021676 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include static void schro_opengl_canvas_pull_convert (SchroFrameData *dest, SchroOpenGLCanvas *src, void *texture_data, int y_offset, int height) { int x, y; int width; int frame_stride, texture_stride, texture_channels; uint8_t *texture_data_u8 = NULL; uint16_t *texture_data_u16 = NULL; int16_t *texture_data_s16 = NULL; float *texture_data_f32 = NULL; uint8_t *frame_data_u8 = NULL; int16_t *frame_data_s16 = NULL; SCHRO_ASSERT (dest != NULL); SCHRO_ASSERT (src != NULL); SCHRO_ASSERT (dest->format == src->format); SCHRO_ASSERT (dest->width == src->width); SCHRO_ASSERT (dest->height == src->height); SCHRO_ASSERT (texture_data != NULL); width = dest->width; frame_stride = dest->stride; texture_stride = src->pull.stride; texture_channels = SCHRO_FRAME_IS_PACKED (dest->format) ? 1 : src->texture.channels; switch (SCHRO_FRAME_FORMAT_DEPTH (dest->format)) { case SCHRO_FRAME_FORMAT_DEPTH_U8: frame_data_u8 = SCHRO_FRAME_DATA_GET_LINE (dest, y_offset); if (SCHRO_OPENGL_CANVAS_IS_FLAG_SET (PULL_U8_AS_F32)) { texture_data_f32 = (float *) texture_data; for (y = 0; y < height; ++y) { for (x = 0; x < width; ++x) { frame_data_u8[x] = (uint8_t) (texture_data_f32[x * texture_channels] * 255.0); } frame_data_u8 = OFFSET (frame_data_u8, frame_stride); texture_data_f32 = OFFSET (texture_data_f32, texture_stride); } } else { texture_data_u8 = (uint8_t *) texture_data; if (texture_channels > 1) { for (y = 0; y < height; ++y) { for (x = 0; x < width; ++x) { frame_data_u8[x] = texture_data_u8[x * texture_channels]; } frame_data_u8 = OFFSET (frame_data_u8, frame_stride); texture_data_u8 = OFFSET (texture_data_u8, texture_stride); } } else { for (y = 0; y < height; ++y) { orc_memcpy (frame_data_u8, texture_data_u8, width); frame_data_u8 = OFFSET (frame_data_u8, frame_stride); texture_data_u8 = OFFSET (texture_data_u8, texture_stride); } } } break; case SCHRO_FRAME_FORMAT_DEPTH_S16: frame_data_s16 = SCHRO_FRAME_DATA_GET_LINE (dest, y_offset); if (SCHRO_OPENGL_CANVAS_IS_FLAG_SET (PULL_S16_AS_F32)) { texture_data_f32 = (float *) texture_data; for (y = 0; y < height; ++y) { for (x = 0; x < width; ++x) { // FIXME: for some unknown reason I need to scale with 65536.0 // instead of 65535.0 to get correct S16 value back. I also get // correct S16 values with rounding: round (x) := floor (x + 0.5) // but thats way to expensive frame_data_s16[x] = (int16_t) ((int32_t) (texture_data_f32[x * texture_channels] * 65536.0) - 32768); } frame_data_s16 = OFFSET (frame_data_s16, frame_stride); texture_data_f32 = OFFSET (texture_data_f32, texture_stride); } } else if (SCHRO_OPENGL_CANVAS_IS_FLAG_SET (PULL_S16_AS_U16)) { texture_data_u16 = (uint16_t *) texture_data; for (y = 0; y < height; ++y) { for (x = 0; x < width; ++x) { frame_data_s16[x] = (int16_t) ((int32_t) texture_data_u16[x * texture_channels] - 32768); } frame_data_s16 = OFFSET (frame_data_s16, frame_stride); texture_data_u16 = OFFSET (texture_data_u16, texture_stride); } } else { texture_data_s16 = (int16_t *) texture_data; if (texture_channels > 1) { for (y = 0; y < height; ++y) { for (x = 0; x < width; ++x) { frame_data_s16[x] = texture_data_s16[x * texture_channels]; } frame_data_s16 = OFFSET (frame_data_s16, frame_stride); texture_data_s16 = OFFSET (texture_data_s16, texture_stride); } } else { for (y = 0; y < height; ++y) { orc_memcpy (frame_data_s16, texture_data_s16, width * sizeof (int16_t)); frame_data_s16 = OFFSET (frame_data_s16, frame_stride); texture_data_s16 = OFFSET (texture_data_s16, texture_stride); } } } break; default: SCHRO_ASSERT (0); break; } } void schro_opengl_frame_pull (SchroFrame *dest, SchroFrame *src) { int i; int components; SchroOpenGLCanvas *src_canvas; SchroOpenGL *opengl; SCHRO_ASSERT (dest != NULL); SCHRO_ASSERT (src != NULL); SCHRO_ASSERT (!SCHRO_FRAME_IS_OPENGL (dest)); SCHRO_ASSERT (SCHRO_FRAME_IS_OPENGL (src)); SCHRO_ASSERT (dest->format == src->format); components = SCHRO_FRAME_IS_PACKED (src->format) ? 1 : 3; // FIXME: hack to store custom data per frame component src_canvas = *((SchroOpenGLCanvas **) src->components[0].data); SCHRO_ASSERT (src_canvas != NULL); opengl = src_canvas->opengl; schro_opengl_lock (opengl); for (i = 0; i < components; ++i) { // FIXME: hack to store custom data per frame component src_canvas = *((SchroOpenGLCanvas **) src->components[i].data); SCHRO_ASSERT (src_canvas != NULL); SCHRO_ASSERT (src_canvas->opengl == opengl); schro_opengl_canvas_pull (dest->components + i, src_canvas); } schro_opengl_unlock (opengl); } void schro_opengl_canvas_pull (SchroFrameData *dest, SchroOpenGLCanvas *src) { int i; int width, height; int pixelbuffer_y_offset, pixelbuffer_height; void *mapped_data = NULL; void *tmp_data = NULL; SCHRO_ASSERT (dest->format == src->format); SCHRO_ASSERT (dest->width == src->width); SCHRO_ASSERT (dest->height == src->height); SCHRO_ASSERT (src->texture.handles[0] != 0); SCHRO_ASSERT (src->texture.handles[1] != 0); SCHRO_ASSERT (src->framebuffers[0] != 0); SCHRO_ASSERT (src->framebuffers[1] != 0); width = dest->width; height = dest->height; schro_opengl_lock (src->opengl); if (SCHRO_OPENGL_CANVAS_IS_FLAG_SET (PULL_PIXELBUFFER)) { glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, src->framebuffers[0]); pixelbuffer_y_offset = 0; for (i = 0; i < SCHRO_OPENGL_TRANSFER_PIXELBUFFERS; ++i) { pixelbuffer_height = src->pull.heights[i]; glBindBufferARB (GL_PIXEL_PACK_BUFFER_ARB, src->pull.pixelbuffers[i]); glReadPixels (0, pixelbuffer_y_offset, width, pixelbuffer_height, src->texture.pixel_format, src->pull.type, NULL); pixelbuffer_y_offset += pixelbuffer_height; SCHRO_OPENGL_CHECK_ERROR } pixelbuffer_y_offset = 0; for (i = 0; i < SCHRO_OPENGL_TRANSFER_PIXELBUFFERS; ++i) { pixelbuffer_height = src->pull.heights[i]; glBindBufferARB (GL_PIXEL_PACK_BUFFER_ARB, src->pull.pixelbuffers[i]); mapped_data = glMapBufferARB (GL_PIXEL_PACK_BUFFER_ARB, GL_READ_ONLY_ARB); schro_opengl_canvas_pull_convert (dest, src, mapped_data, pixelbuffer_y_offset, pixelbuffer_height); glUnmapBufferARB (GL_PIXEL_PACK_BUFFER_ARB); pixelbuffer_y_offset += pixelbuffer_height; SCHRO_OPENGL_CHECK_ERROR } glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, 0); } else { tmp_data = schro_opengl_get_tmp (src->opengl, src->pull.stride * height); glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, src->framebuffers[0]); glReadPixels (0, 0, width, height, src->texture.pixel_format, src->pull.type, tmp_data); glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, 0); schro_opengl_canvas_pull_convert (dest, src, tmp_data, 0, height); } schro_opengl_unlock (src->opengl); } schroedinger-1.0.11/schroedinger/opengl/schroopenglmotion.c0000644000175000017500000004132711556115124021054 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include typedef struct _SchroOpenGLMotion SchroOpenGLMotion; struct _SchroOpenGLMotion { SchroMotion *motion; SchroOpenGLCanvas *src_canvases[2][4]; SchroOpenGLShader *shader_dc; SchroOpenGLShader *shader_ref_prec0; SchroOpenGLShader *shader_ref_prec0_weight; SchroOpenGLShader *shader_ref_prec1; SchroOpenGLCanvas *obmc_weight_canvas; }; /* static*/ void schro_opengl_motion_render_dc_block (SchroOpenGLMotion *opengl_motion, int i, int x, int y, int u, int v) { int xblen, yblen; SchroMotion *motion; SchroMotionVector *motion_vector_dc; uint8_t dc; motion = opengl_motion->motion; motion_vector_dc = (SchroMotionVector *) &motion->motion_vectors[v * motion->params->x_num_blocks + u]; dc = (int) motion_vector_dc->u.dc.dc[i] + 128; glUseProgramObjectARB (opengl_motion->shader_dc->program); glUniform1iARB (opengl_motion->shader_dc->textures[0], 0); /* input */ glUniform1iARB (opengl_motion->shader_dc->textures[1], 1); /* obmc_weight */ glUniform2fARB (opengl_motion->shader_dc->origin, x, y); glUniform1fARB (opengl_motion->shader_dc->dc, dc); if (x < 0) { xblen = motion->xblen + x; x = 0; } else { xblen = motion->xblen; } if (y < 0) { yblen = motion->yblen + y; y = 0; } else { yblen = motion->yblen; } schro_opengl_render_quad (x, y, xblen, yblen); } /* static*/ void schro_opengl_motion_render_ref_block (SchroOpenGLMotion *opengl_motion, int i, int x, int y, int u, int v, int ref) { int s, dx, dy, px, py, hx, hy, rx, ry; int weight, shift, addend, divisor; SchroMotion *motion; SchroMotionVector *motion_vector; SchroChromaFormat chroma_format; motion = opengl_motion->motion; motion_vector = &motion->motion_vectors[v * motion->params->x_num_blocks + u]; chroma_format = motion->params->video_format->chroma_format; SCHRO_ASSERT (motion_vector->using_global == FALSE); dx = motion_vector->u.vec.dx[ref]; dy = motion_vector->u.vec.dy[ref]; if (i > 0) { dx >>= SCHRO_CHROMA_FORMAT_H_SHIFT (chroma_format); dy >>= SCHRO_CHROMA_FORMAT_V_SHIFT (chroma_format); } px = (x << motion->mv_precision) + dx; py = (y << motion->mv_precision) + dy; switch (motion->mv_precision) { case 0: weight = motion->ref1_weight + motion->ref2_weight; shift = motion->ref_weight_precision; addend = 1 << (shift - 1); divisor = 1 << shift; if (weight != divisor) { glUseProgramObjectARB (opengl_motion->shader_ref_prec0_weight->program); } else { glUseProgramObjectARB (opengl_motion->shader_ref_prec0->program); } glUniform1iARB (opengl_motion->shader_ref_prec0->textures[0], 0); /* input */ glUniform1iARB (opengl_motion->shader_ref_prec0->textures[1], 1); /* obmc_weight */ glActiveTextureARB (GL_TEXTURE2_ARB); glBindTexture (GL_TEXTURE_RECTANGLE_ARB, opengl_motion->src_canvases[ref][0]->texture.handles[0]); glUniform1iARB (opengl_motion->shader_ref_prec0->textures[2], 2); glActiveTextureARB (GL_TEXTURE0_ARB); glUniform2fARB (opengl_motion->shader_ref_prec0->offset, px - x, py - y); glUniform2fARB (opengl_motion->shader_ref_prec0->origin, x, y); if (weight != divisor) { glUniform1fARB (opengl_motion->shader_ref_prec0->weight, weight); glUniform1fARB (opengl_motion->shader_ref_prec0->addend, addend); glUniform1fARB (opengl_motion->shader_ref_prec0->divisor, divisor); } schro_opengl_render_quad (x, y, motion->xblen, motion->yblen); break; case 1: s = ((py & 1) << 1) | (px & 1); SCHRO_ERROR ("1"); glUseProgramObjectARB (opengl_motion->shader_ref_prec1->program); glUniform1iARB (opengl_motion->shader_ref_prec1->textures[0], 0); glUniform1iARB (opengl_motion->shader_ref_prec1->textures[1], 1); glUniform2fARB (opengl_motion->shader_ref_prec1->offset, (px >> 1) - x, (py >> 1) - y); glUniform2fARB (opengl_motion->shader_ref_prec1->origin, x, y); schro_opengl_render_quad (x, y, motion->xblen, motion->yblen); break; case 2: px <<= 1; py <<= 1; /* fall through */ case 3: hx = px >> 2; hy = py >> 2; rx = px & 0x3; ry = py & 0x3; SCHRO_ERROR ("2/3"); switch ((ry << 2) | rx) { case 0: s = ((hy & 1) << 1) | (hx & 1); glBindTexture (GL_TEXTURE_RECTANGLE_ARB, opengl_motion->src_canvases[ref][s]->texture.handles[0]); glUseProgramObjectARB (opengl_motion->shader_ref_prec1->program); glUniform1iARB (opengl_motion->shader_ref_prec1->textures[0], 0); glUniform2fARB (opengl_motion->shader_ref_prec1->offset, (hx >> 1) - x, (hy >> 1) - y); break; case 2: case 8: /* __schro_upsampled_frame_get_subdata_prec1 (upframe, k, hx, hy, &fd00); if (rx == 0) { __schro_upsampled_frame_get_subdata_prec1 (upframe, k, hx, hy + 1, &fd10); } else { __schro_upsampled_frame_get_subdata_prec1 (upframe, k, hx + 1, hy, &fd10); } switch (fd->width) { case 8: orc_avg2_8xn_u8 (fd->data, fd->stride, fd00.data, fd00.stride, fd10.data, fd10.stride, fd->height); break; case 12: orc_avg2_12xn_u8 (fd->data, fd->stride, fd00.data, fd00.stride, fd10.data, fd10.stride, fd->height); break; case 16: orc_avg2_16xn_u8 (fd->data, fd->stride, fd00.data, fd00.stride, fd10.data, fd10.stride, fd->height); break; default: for(j=0;jheight;j++) { uint8_t *data = SCHRO_FRAME_DATA_GET_LINE (fd, j); uint8_t *d00 = SCHRO_FRAME_DATA_GET_LINE (&fd00, j); uint8_t *d10 = SCHRO_FRAME_DATA_GET_LINE (&fd10, j); for(i=0;iwidth;i++) { data[i] = (1 + d00[i] + d10[i]) >> 1; } } break; } break; */ break; } //schro_upsampled_frame_get_block_fast_prec3 (motion->src1, i, px, py, fd); break; default: SCHRO_ASSERT (0); break; } /*int weight = motion->ref1_weight + motion->ref2_weight; int shift = motion->ref_weight_precision; if (weight == (1<yblen;jj++) { uint8_t *d = SCHRO_FRAME_DATA_GET_LINE (&motion->block, jj); uint8_t *s = SCHRO_FRAME_DATA_GET_LINE (&motion->tmp_block_ref[0], jj); memcpy(d,s,motion->xblen); } } else { for(jj=0;jjyblen;jj++) { uint8_t *d = SCHRO_FRAME_DATA_GET_LINE (&motion->block, jj); uint8_t *s = SCHRO_FRAME_DATA_GET_LINE (&motion->tmp_block_ref[0], jj); for(ii=0;iixblen;ii++) { d[ii] = ROUND_SHIFT(s[ii] * weight, shift); } } }*/ } /* static*/ void schro_opengl_motion_render_block (SchroOpenGLMotion *opengl_motion, int i, int x, int y, int u, int v) { SchroMotion *motion; SchroMotionVector *motion_vector; motion = opengl_motion->motion; motion_vector = &motion->motion_vectors[v * motion->params->x_num_blocks + u]; switch (motion_vector->pred_mode) { case 0: schro_opengl_motion_render_dc_block (opengl_motion, i, x, y, u, v); break; case 1: schro_opengl_motion_render_ref_block (opengl_motion, i, x, y, u, v, 0); break; case 2: //schro_opengl_motion_render_ref_block (opengl_motion, i, x, y, u, v, 1); break; case 3: //schro_opengl_motion_render_biref_block (opengl_motion, i, x, y, u, v); break; default: SCHRO_ASSERT (0); break; } } void schro_opengl_motion_render (SchroMotion *motion, SchroFrame *dest) { int i, k, u, v; int x, y; SchroParams *params = motion->params; SchroOpenGLCanvas *dest_canvas; SchroOpenGL *opengl; SchroChromaFormat chroma_format; SchroOpenGLShader *shader_copy; SchroOpenGLShader *shader_obmc_weight; SchroOpenGLShader *shader_clear; SchroOpenGLShader *shader_shift; SchroOpenGLMotion opengl_motion; SCHRO_ASSERT (SCHRO_FRAME_IS_OPENGL (dest)); SCHRO_ASSERT (SCHRO_FRAME_FORMAT_DEPTH (dest->format) == SCHRO_FRAME_FORMAT_DEPTH_S16); if (params->num_refs == 1) { SCHRO_ASSERT(params->picture_weight_2 == 1); } // FIXME: hack to store custom data per frame component dest_canvas = *((SchroOpenGLCanvas **) dest->components[0].data); SCHRO_ASSERT (dest_canvas != NULL); opengl = dest_canvas->opengl; schro_opengl_lock (opengl); shader_copy = schro_opengl_shader_get (opengl, SCHRO_OPENGL_SHADER_COPY_S16); shader_obmc_weight = schro_opengl_shader_get (opengl, SCHRO_OPENGL_SHADER_MC_OBMC_WEIGHT); shader_clear = schro_opengl_shader_get (opengl, SCHRO_OPENGL_SHADER_MC_CLEAR); shader_shift = schro_opengl_shader_get (opengl, SCHRO_OPENGL_SHADER_MC_SHIFT); SCHRO_ASSERT (shader_copy != NULL); SCHRO_ASSERT (shader_obmc_weight != NULL); SCHRO_ASSERT (shader_clear != NULL); SCHRO_ASSERT (shader_shift != NULL); opengl_motion.motion = motion; opengl_motion.shader_dc = schro_opengl_shader_get (opengl, SCHRO_OPENGL_SHADER_MC_RENDER_DC); opengl_motion.shader_ref_prec0 = schro_opengl_shader_get (opengl, SCHRO_OPENGL_SHADER_MC_RENDER_REF_PREC_0); opengl_motion.shader_ref_prec0_weight = schro_opengl_shader_get (opengl, SCHRO_OPENGL_SHADER_MC_RENDER_REF_PREC_0_WEIGHT);/* opengl_motion.shader_ref_prec1 = schro_opengl_shader_get (opengl, SCHRO_OPENGL_SHADER_MC_RENDER_REF_PREC_1);*/ SCHRO_ASSERT (opengl_motion.shader_dc != NULL); SCHRO_ASSERT (opengl_motion.shader_ref_prec0 != NULL); SCHRO_ASSERT (opengl_motion.shader_ref_prec0_weight != NULL); //SCHRO_ASSERT (opengl_motion.shader_ref_prec1 != NULL); motion->ref_weight_precision = params->picture_weight_bits; motion->ref1_weight = params->picture_weight_1; motion->ref2_weight = params->picture_weight_2; motion->mv_precision = params->mv_precision; chroma_format = params->video_format->chroma_format; for (i = 0; i < 3; ++i) { // FIXME: hack to store custom data per frame component dest_canvas = *((SchroOpenGLCanvas **) dest->components[i].data); SCHRO_ASSERT (dest_canvas != NULL); SCHRO_ASSERT (dest_canvas->opengl == opengl); for (k = 0; k < 4; ++k) { if (motion->src1->frames[k]) { SCHRO_ASSERT (SCHRO_FRAME_IS_OPENGL (motion->src1->frames[k])); // FIXME: hack to store custom data per frame component opengl_motion.src_canvases[0][k] = *((SchroOpenGLCanvas **) motion->src1->frames[k]->components[i].data); SCHRO_ASSERT (opengl_motion.src_canvases[0][k] != NULL); SCHRO_ASSERT (opengl_motion.src_canvases[0][k]->opengl == opengl); } else { opengl_motion.src_canvases[0][k] = NULL; } } if (params->num_refs > 1) { for (k = 0; k < 4; ++k) { if (motion->src2->frames[k]) { SCHRO_ASSERT (SCHRO_FRAME_IS_OPENGL (motion->src2->frames[k])); // FIXME: hack to store custom data per frame component opengl_motion.src_canvases[1][k] = *((SchroOpenGLCanvas **) motion->src2->frames[k]->components[i].data); SCHRO_ASSERT (opengl_motion.src_canvases[1][k] != NULL); SCHRO_ASSERT (opengl_motion.src_canvases[1][k]->opengl == opengl); } else { opengl_motion.src_canvases[1][k] = NULL; } } } if (i == 0) { motion->xbsep = params->xbsep_luma; motion->ybsep = params->ybsep_luma; motion->xblen = params->xblen_luma; motion->yblen = params->yblen_luma; } else { motion->xbsep = params->xbsep_luma >> SCHRO_CHROMA_FORMAT_H_SHIFT (chroma_format); motion->ybsep = params->ybsep_luma >> SCHRO_CHROMA_FORMAT_V_SHIFT (chroma_format); motion->xblen = params->xblen_luma >> SCHRO_CHROMA_FORMAT_H_SHIFT (chroma_format); motion->yblen = params->yblen_luma >> SCHRO_CHROMA_FORMAT_V_SHIFT (chroma_format); } motion->width = dest->components[i].width; motion->height = dest->components[i].height; motion->xoffset = (motion->xblen - motion->xbsep) / 2; motion->yoffset = (motion->yblen - motion->ybsep) / 2; motion->max_fast_x = (motion->width - motion->xblen) << motion->mv_precision; motion->max_fast_y = (motion->height - motion->yblen) << motion->mv_precision; /* push obmc weight to texture */ opengl_motion.obmc_weight_canvas = schro_opengl_get_obmc_weight_canvas (opengl, motion->xblen, motion->yblen); #if 0 motion->obmc_weight.format = SCHRO_FRAME_FORMAT_S16_444; motion->obmc_weight.width = opengl_motion.obmc_weight_canvas->width; motion->obmc_weight.height = opengl_motion.obmc_weight_canvas->height; motion->obmc_weight.stride = motion->obmc_weight.width * sizeof (int16_t); motion->obmc_weight.data = schro_malloc (motion->obmc_weight.stride * motion->obmc_weight.height); schro_motion_init_obmc_weight (motion); schro_opengl_canvas_push (opengl_motion.obmc_weight_canvas, &motion->obmc_weight); #else schro_opengl_setup_viewport (motion->xblen, motion->yblen); glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, opengl_motion.obmc_weight_canvas->framebuffers[0]); glUseProgramObjectARB (shader_obmc_weight->program); glUniform2fARB (shader_obmc_weight->size, motion->xblen, motion->yblen); glUniform2fARB (shader_obmc_weight->offset, motion->xoffset, motion->yoffset); schro_opengl_render_quad (0, 0, motion->xblen, motion->yblen); SCHRO_OPENGL_CHECK_ERROR glFlush(); #endif /* clear */ schro_opengl_setup_viewport (motion->width, motion->height); glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, dest_canvas->framebuffers[1]); glUseProgramObjectARB (shader_clear->program); schro_opengl_render_quad (0, 0, motion->width, motion->height); SCHRO_OPENGL_CHECK_ERROR glFlush(); /* render blocks */ int passes[4][2] = { { 0, 0 }, { 0, 1 }, { 1, 0 }, { 1, 1 } }; for (k = 0; k < 4; ++k) { /* copy */ /*if (GLEW_EXT_framebuffer_blit) { glBindFramebufferEXT (GL_READ_FRAMEBUFFER_EXT, dest_canvas->framebuffers[1]); glBindFramebufferEXT (GL_DRAW_FRAMEBUFFER_EXT, dest_canvas->framebuffers[0]); glBlitFramebufferEXT (0, 0, motion->width, motion->height, 0, 0, motion->width, motion->height, GL_COLOR_BUFFER_BIT, GL_NEAREST); SCHRO_OPENGL_CHECK_ERROR glFlush(); } else*/ { glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, dest_canvas->framebuffers[0]); glBindTexture (GL_TEXTURE_RECTANGLE_ARB, dest_canvas->texture.handles[1]); glUseProgramObjectARB (shader_copy->program); schro_opengl_render_quad (0, 0, motion->width, motion->height); SCHRO_OPENGL_CHECK_ERROR glFlush(); } /* render */ glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, dest_canvas->framebuffers[1]); //glActiveTextureARB (GL_TEXTURE0_ARB); glBindTexture (GL_TEXTURE_RECTANGLE_ARB, dest_canvas->texture.handles[0]); glActiveTextureARB (GL_TEXTURE1_ARB); glBindTexture (GL_TEXTURE_RECTANGLE_ARB, opengl_motion.obmc_weight_canvas->texture.handles[0]); glActiveTextureARB (GL_TEXTURE0_ARB); SCHRO_OPENGL_CHECK_ERROR for (v = passes[k][0]; v < params->y_num_blocks; v += 2) { y = motion->ybsep * v - motion->yoffset; for (u = passes[k][1]; u < params->x_num_blocks; u += 2) { x = motion->xbsep * u - motion->xoffset; schro_opengl_motion_render_block (&opengl_motion, i, x, y, u, v); } } SCHRO_OPENGL_CHECK_ERROR glFlush(); } /* shift */ glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, dest_canvas->framebuffers[0]); glBindTexture (GL_TEXTURE_RECTANGLE_ARB, dest_canvas->texture.handles[1]); glUseProgramObjectARB (shader_shift->program); glUniform1iARB (shader_shift->textures[0], 0); schro_opengl_render_quad (0, 0, motion->width, motion->height); SCHRO_OPENGL_CHECK_ERROR glFlush(); schro_free (motion->obmc_weight.data); } glUseProgramObjectARB (0); #if SCHRO_OPENGL_UNBIND_TEXTURES glBindTexture (GL_TEXTURE_RECTANGLE_ARB, 0); glActiveTextureARB (GL_TEXTURE1_ARB); glBindTexture (GL_TEXTURE_RECTANGLE_ARB, 0); glActiveTextureARB (GL_TEXTURE2_ARB); glBindTexture (GL_TEXTURE_RECTANGLE_ARB, 0); glActiveTextureARB (GL_TEXTURE0_ARB); #endif glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, 0); /*if (GLEW_EXT_framebuffer_blit) { glBindFramebufferEXT (GL_READ_FRAMEBUFFER_EXT, 0); glBindFramebufferEXT (GL_DRAW_FRAMEBUFFER_EXT, 0); }*/ schro_opengl_unlock (opengl); } schroedinger-1.0.11/schroedinger/opengl/Makefile.am0000644000175000017500000000112111556115124017157 00000000000000 noinst_LTLIBRARIES = libopengl.la libopengl_la_SOURCES = \ schroopengl.c \ schroopengl.h \ schroopenglcanvas.c \ schroopenglframe.c \ schroopenglframe.h \ schroopenglframe_combine.c \ schroopenglframe_convert.c \ schroopenglframe_pull.c \ schroopenglframe_push.c \ schroopenglmotion.c \ schroopenglmotion.h \ schroopenglshader.c \ schroopengltypes.h \ schroopenglwavelet.c libopengl_la_CFLAGS = $(SCHRO_CFLAGS) $(ORC_CFLAGS) $(OPENGL_CFLAGS) $(ERROR_CFLAGS) \ -DSCHRO_ENABLE_UNSTABLE_API -D_GNU_SOURCE -DSCHRO_OPENGL_UNBIND_TEXTURES=1 libopengl_la_LIBADD = $(OPENGL_LIBS) schroedinger-1.0.11/schroedinger/opengl/Makefile.in0000664000175000017500000007047011707140261017205 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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@ subdir = schroedinger/opengl DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-auto-alt.m4 \ $(top_srcdir)/m4/as-compiler-flag.m4 \ $(top_srcdir)/m4/as-host-defines.m4 \ $(top_srcdir)/m4/as-version.m4 $(top_srcdir)/m4/gst-args.m4 \ $(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)/m4/pkg.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) am__DEPENDENCIES_1 = libopengl_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_libopengl_la_OBJECTS = libopengl_la-schroopengl.lo \ libopengl_la-schroopenglcanvas.lo \ libopengl_la-schroopenglframe.lo \ libopengl_la-schroopenglframe_combine.lo \ libopengl_la-schroopenglframe_convert.lo \ libopengl_la-schroopenglframe_pull.lo \ libopengl_la-schroopenglframe_push.lo \ libopengl_la-schroopenglmotion.lo \ libopengl_la-schroopenglshader.lo \ libopengl_la-schroopenglwavelet.lo libopengl_la_OBJECTS = $(am_libopengl_la_OBJECTS) libopengl_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libopengl_la_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libopengl_la_SOURCES) DIST_SOURCES = $(libopengl_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUDA_CFLAGS = @CUDA_CFLAGS@ CUDA_LIBS = @CUDA_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ GCOV = @GCOV@ GCOV_CFLAGS = @GCOV_CFLAGS@ GCOV_LIBS = @GCOV_LIBS@ GREP = @GREP@ GTHREAD_CFLAGS = @GTHREAD_CFLAGS@ GTHREAD_LIBS = @GTHREAD_LIBS@ GTKDOC_CHECK = @GTKDOC_CHECK@ 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@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ NVCC = @NVCC@ NVCCFLAGS = @NVCCFLAGS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENGL_CFLAGS = @OPENGL_CFLAGS@ OPENGL_LIBS = @OPENGL_LIBS@ ORCC = @ORCC@ ORC_CFLAGS = @ORC_CFLAGS@ ORC_LIBS = @ORC_LIBS@ 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@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SCHRO_CFLAGS = @SCHRO_CFLAGS@ SCHRO_LIBS = @SCHRO_LIBS@ SCHRO_LIBVERSION = @SCHRO_LIBVERSION@ SCHRO_MAJORMINOR = @SCHRO_MAJORMINOR@ SCHRO_PKG_DEPS = @SCHRO_PKG_DEPS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ THREAD_IMPL = @THREAD_IMPL@ VERSION = @VERSION@ 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_CXX = @ac_ct_CXX@ 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@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libopengl.la libopengl_la_SOURCES = \ schroopengl.c \ schroopengl.h \ schroopenglcanvas.c \ schroopenglframe.c \ schroopenglframe.h \ schroopenglframe_combine.c \ schroopenglframe_convert.c \ schroopenglframe_pull.c \ schroopenglframe_push.c \ schroopenglmotion.c \ schroopenglmotion.h \ schroopenglshader.c \ schroopengltypes.h \ schroopenglwavelet.c libopengl_la_CFLAGS = $(SCHRO_CFLAGS) $(ORC_CFLAGS) $(OPENGL_CFLAGS) $(ERROR_CFLAGS) \ -DSCHRO_ENABLE_UNSTABLE_API -D_GNU_SOURCE -DSCHRO_OPENGL_UNBIND_TEXTURES=1 libopengl_la_LIBADD = $(OPENGL_LIBS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(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) --foreign schroedinger/opengl/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign schroedinger/opengl/Makefile .PRECIOUS: 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)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libopengl.la: $(libopengl_la_OBJECTS) $(libopengl_la_DEPENDENCIES) $(libopengl_la_LINK) $(libopengl_la_OBJECTS) $(libopengl_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libopengl_la-schroopengl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libopengl_la-schroopenglcanvas.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libopengl_la-schroopenglframe.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libopengl_la-schroopenglframe_combine.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libopengl_la-schroopenglframe_convert.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libopengl_la-schroopenglframe_pull.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libopengl_la-schroopenglframe_push.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libopengl_la-schroopenglmotion.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libopengl_la-schroopenglshader.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libopengl_la-schroopenglwavelet.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< libopengl_la-schroopengl.lo: schroopengl.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libopengl_la_CFLAGS) $(CFLAGS) -MT libopengl_la-schroopengl.lo -MD -MP -MF $(DEPDIR)/libopengl_la-schroopengl.Tpo -c -o libopengl_la-schroopengl.lo `test -f 'schroopengl.c' || echo '$(srcdir)/'`schroopengl.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libopengl_la-schroopengl.Tpo $(DEPDIR)/libopengl_la-schroopengl.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='schroopengl.c' object='libopengl_la-schroopengl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libopengl_la_CFLAGS) $(CFLAGS) -c -o libopengl_la-schroopengl.lo `test -f 'schroopengl.c' || echo '$(srcdir)/'`schroopengl.c libopengl_la-schroopenglcanvas.lo: schroopenglcanvas.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libopengl_la_CFLAGS) $(CFLAGS) -MT libopengl_la-schroopenglcanvas.lo -MD -MP -MF $(DEPDIR)/libopengl_la-schroopenglcanvas.Tpo -c -o libopengl_la-schroopenglcanvas.lo `test -f 'schroopenglcanvas.c' || echo '$(srcdir)/'`schroopenglcanvas.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libopengl_la-schroopenglcanvas.Tpo $(DEPDIR)/libopengl_la-schroopenglcanvas.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='schroopenglcanvas.c' object='libopengl_la-schroopenglcanvas.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libopengl_la_CFLAGS) $(CFLAGS) -c -o libopengl_la-schroopenglcanvas.lo `test -f 'schroopenglcanvas.c' || echo '$(srcdir)/'`schroopenglcanvas.c libopengl_la-schroopenglframe.lo: schroopenglframe.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libopengl_la_CFLAGS) $(CFLAGS) -MT libopengl_la-schroopenglframe.lo -MD -MP -MF $(DEPDIR)/libopengl_la-schroopenglframe.Tpo -c -o libopengl_la-schroopenglframe.lo `test -f 'schroopenglframe.c' || echo '$(srcdir)/'`schroopenglframe.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libopengl_la-schroopenglframe.Tpo $(DEPDIR)/libopengl_la-schroopenglframe.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='schroopenglframe.c' object='libopengl_la-schroopenglframe.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libopengl_la_CFLAGS) $(CFLAGS) -c -o libopengl_la-schroopenglframe.lo `test -f 'schroopenglframe.c' || echo '$(srcdir)/'`schroopenglframe.c libopengl_la-schroopenglframe_combine.lo: schroopenglframe_combine.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libopengl_la_CFLAGS) $(CFLAGS) -MT libopengl_la-schroopenglframe_combine.lo -MD -MP -MF $(DEPDIR)/libopengl_la-schroopenglframe_combine.Tpo -c -o libopengl_la-schroopenglframe_combine.lo `test -f 'schroopenglframe_combine.c' || echo '$(srcdir)/'`schroopenglframe_combine.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libopengl_la-schroopenglframe_combine.Tpo $(DEPDIR)/libopengl_la-schroopenglframe_combine.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='schroopenglframe_combine.c' object='libopengl_la-schroopenglframe_combine.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libopengl_la_CFLAGS) $(CFLAGS) -c -o libopengl_la-schroopenglframe_combine.lo `test -f 'schroopenglframe_combine.c' || echo '$(srcdir)/'`schroopenglframe_combine.c libopengl_la-schroopenglframe_convert.lo: schroopenglframe_convert.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libopengl_la_CFLAGS) $(CFLAGS) -MT libopengl_la-schroopenglframe_convert.lo -MD -MP -MF $(DEPDIR)/libopengl_la-schroopenglframe_convert.Tpo -c -o libopengl_la-schroopenglframe_convert.lo `test -f 'schroopenglframe_convert.c' || echo '$(srcdir)/'`schroopenglframe_convert.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libopengl_la-schroopenglframe_convert.Tpo $(DEPDIR)/libopengl_la-schroopenglframe_convert.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='schroopenglframe_convert.c' object='libopengl_la-schroopenglframe_convert.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libopengl_la_CFLAGS) $(CFLAGS) -c -o libopengl_la-schroopenglframe_convert.lo `test -f 'schroopenglframe_convert.c' || echo '$(srcdir)/'`schroopenglframe_convert.c libopengl_la-schroopenglframe_pull.lo: schroopenglframe_pull.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libopengl_la_CFLAGS) $(CFLAGS) -MT libopengl_la-schroopenglframe_pull.lo -MD -MP -MF $(DEPDIR)/libopengl_la-schroopenglframe_pull.Tpo -c -o libopengl_la-schroopenglframe_pull.lo `test -f 'schroopenglframe_pull.c' || echo '$(srcdir)/'`schroopenglframe_pull.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libopengl_la-schroopenglframe_pull.Tpo $(DEPDIR)/libopengl_la-schroopenglframe_pull.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='schroopenglframe_pull.c' object='libopengl_la-schroopenglframe_pull.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libopengl_la_CFLAGS) $(CFLAGS) -c -o libopengl_la-schroopenglframe_pull.lo `test -f 'schroopenglframe_pull.c' || echo '$(srcdir)/'`schroopenglframe_pull.c libopengl_la-schroopenglframe_push.lo: schroopenglframe_push.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libopengl_la_CFLAGS) $(CFLAGS) -MT libopengl_la-schroopenglframe_push.lo -MD -MP -MF $(DEPDIR)/libopengl_la-schroopenglframe_push.Tpo -c -o libopengl_la-schroopenglframe_push.lo `test -f 'schroopenglframe_push.c' || echo '$(srcdir)/'`schroopenglframe_push.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libopengl_la-schroopenglframe_push.Tpo $(DEPDIR)/libopengl_la-schroopenglframe_push.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='schroopenglframe_push.c' object='libopengl_la-schroopenglframe_push.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libopengl_la_CFLAGS) $(CFLAGS) -c -o libopengl_la-schroopenglframe_push.lo `test -f 'schroopenglframe_push.c' || echo '$(srcdir)/'`schroopenglframe_push.c libopengl_la-schroopenglmotion.lo: schroopenglmotion.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libopengl_la_CFLAGS) $(CFLAGS) -MT libopengl_la-schroopenglmotion.lo -MD -MP -MF $(DEPDIR)/libopengl_la-schroopenglmotion.Tpo -c -o libopengl_la-schroopenglmotion.lo `test -f 'schroopenglmotion.c' || echo '$(srcdir)/'`schroopenglmotion.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libopengl_la-schroopenglmotion.Tpo $(DEPDIR)/libopengl_la-schroopenglmotion.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='schroopenglmotion.c' object='libopengl_la-schroopenglmotion.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libopengl_la_CFLAGS) $(CFLAGS) -c -o libopengl_la-schroopenglmotion.lo `test -f 'schroopenglmotion.c' || echo '$(srcdir)/'`schroopenglmotion.c libopengl_la-schroopenglshader.lo: schroopenglshader.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libopengl_la_CFLAGS) $(CFLAGS) -MT libopengl_la-schroopenglshader.lo -MD -MP -MF $(DEPDIR)/libopengl_la-schroopenglshader.Tpo -c -o libopengl_la-schroopenglshader.lo `test -f 'schroopenglshader.c' || echo '$(srcdir)/'`schroopenglshader.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libopengl_la-schroopenglshader.Tpo $(DEPDIR)/libopengl_la-schroopenglshader.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='schroopenglshader.c' object='libopengl_la-schroopenglshader.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libopengl_la_CFLAGS) $(CFLAGS) -c -o libopengl_la-schroopenglshader.lo `test -f 'schroopenglshader.c' || echo '$(srcdir)/'`schroopenglshader.c libopengl_la-schroopenglwavelet.lo: schroopenglwavelet.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libopengl_la_CFLAGS) $(CFLAGS) -MT libopengl_la-schroopenglwavelet.lo -MD -MP -MF $(DEPDIR)/libopengl_la-schroopenglwavelet.Tpo -c -o libopengl_la-schroopenglwavelet.lo `test -f 'schroopenglwavelet.c' || echo '$(srcdir)/'`schroopenglwavelet.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libopengl_la-schroopenglwavelet.Tpo $(DEPDIR)/libopengl_la-schroopenglwavelet.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='schroopenglwavelet.c' object='libopengl_la-schroopenglwavelet.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libopengl_la_CFLAGS) $(CFLAGS) -c -o libopengl_la-schroopenglwavelet.lo `test -f 'schroopenglwavelet.c' || echo '$(srcdir)/'`schroopenglwavelet.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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) 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 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 all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags 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 uninstall uninstall-am # 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: schroedinger-1.0.11/schroedinger/opengl/schroopenglframe_push.c0000644000175000017500000003066611556115124021704 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include static void schro_opengl_canvas_push_convert (SchroOpenGLCanvas *dest, SchroFrameData *src, void *texture_data, int y_offset, int height) { int x, y; int width; int frame_stride, texture_stride, texture_channels; uint8_t *frame_data_u8 = NULL; int16_t *frame_data_s16 = NULL; uint8_t *texture_data_u8 = NULL; uint16_t *texture_data_u16 = NULL; int16_t *texture_data_s16 = NULL; float *texture_data_f32 = NULL; SCHRO_ASSERT (dest != NULL); SCHRO_ASSERT (src != NULL); SCHRO_ASSERT (dest->format == src->format); SCHRO_ASSERT (dest->width == src->width); SCHRO_ASSERT (dest->height == src->height); SCHRO_ASSERT (texture_data != NULL); width = src->width; frame_stride = src->stride; texture_stride = dest->push.stride; texture_channels = SCHRO_FRAME_IS_PACKED (src->format) ? 1 : dest->texture.channels; switch (SCHRO_FRAME_FORMAT_DEPTH (src->format)) { case SCHRO_FRAME_FORMAT_DEPTH_U8: frame_data_u8 = SCHRO_FRAME_DATA_GET_LINE (src, y_offset); if (SCHRO_OPENGL_CANVAS_IS_FLAG_SET (PUSH_U8_AS_F32)) { texture_data_f32 = (float *) texture_data; for (y = 0; y < height; ++y) { for (x = 0; x < width; ++x) { texture_data_f32[x * texture_channels] = (float) frame_data_u8[x] / 255.0; } texture_data_f32 = OFFSET (texture_data_f32, texture_stride); frame_data_u8 = OFFSET (frame_data_u8, frame_stride); } } else { texture_data_u8 = (uint8_t *) texture_data; if (texture_channels > 1) { for (y = 0; y < height; ++y) { for (x = 0; x < width; ++x) { texture_data_u8[x * texture_channels] = frame_data_u8[x]; } texture_data_u8 = OFFSET (texture_data_u8, texture_stride); frame_data_u8 = OFFSET (frame_data_u8, frame_stride); } } else { for (y = 0; y < height; ++y) { orc_memcpy (texture_data_u8, frame_data_u8, width); texture_data_u8 = OFFSET (texture_data_u8, texture_stride); frame_data_u8 = OFFSET (frame_data_u8, frame_stride); } } } break; case SCHRO_FRAME_FORMAT_DEPTH_S16: frame_data_s16 = SCHRO_FRAME_DATA_GET_LINE (src, y_offset); if (SCHRO_OPENGL_CANVAS_IS_FLAG_SET (PUSH_S16_AS_U16)) { texture_data_u16 = (uint16_t *) texture_data; for (y = 0; y < height; ++y) { for (x = 0; x < width; ++x) { texture_data_u16[x * texture_channels] = (uint16_t) ((int32_t) frame_data_s16[x] + 32768); } texture_data_u16 = OFFSET (texture_data_u16, texture_stride); frame_data_s16 = OFFSET (frame_data_s16, frame_stride); } } else if (SCHRO_OPENGL_CANVAS_IS_FLAG_SET (PUSH_S16_AS_F32)) { texture_data_f32 = (float *) texture_data; for (y = 0; y < height; ++y) { for (x = 0; x < width; ++x) { texture_data_f32[x * texture_channels] = (float) ((int32_t) frame_data_s16[x] + 32768) / 65535.0; } texture_data_f32 = OFFSET (texture_data_f32, texture_stride); frame_data_s16 = OFFSET (frame_data_s16, frame_stride); } } else { texture_data_s16 = (int16_t *) texture_data; if (texture_channels > 1) { for (y = 0; y < height; ++y) { for (x = 0; x < width; ++x) { texture_data_s16[x * texture_channels] = frame_data_s16[x]; } texture_data_s16 = OFFSET (texture_data_s16, texture_stride); frame_data_s16 = OFFSET (frame_data_s16, frame_stride); } } else { for (y = 0; y < height; ++y) { orc_memcpy (texture_data_s16, frame_data_s16, width * sizeof (int16_t)); texture_data_s16 = OFFSET (texture_data_s16, texture_stride); frame_data_s16 = OFFSET (frame_data_s16, frame_stride); } } } break; default: SCHRO_ASSERT (0); break; } } void schro_opengl_frame_push (SchroFrame *dest, SchroFrame *src) { int i; int components; SchroOpenGLCanvas *dest_canvas = NULL; SchroOpenGL *opengl = NULL; SCHRO_ASSERT (dest != NULL); SCHRO_ASSERT (src != NULL); SCHRO_ASSERT (SCHRO_FRAME_IS_OPENGL (dest)); SCHRO_ASSERT (!SCHRO_FRAME_IS_OPENGL (src)); SCHRO_ASSERT (dest->format == src->format); components = SCHRO_FRAME_IS_PACKED (src->format) ? 1 : 3; // FIXME: hack to store custom data per frame component dest_canvas = *((SchroOpenGLCanvas **) dest->components[0].data); SCHRO_ASSERT (dest_canvas != NULL); opengl = dest_canvas->opengl; schro_opengl_lock (opengl); for (i = 0; i < components; ++i) { // FIXME: hack to store custom data per frame component dest_canvas = *((SchroOpenGLCanvas **) dest->components[i].data); schro_opengl_canvas_push (dest_canvas, src->components + i); } schro_opengl_unlock (opengl); } void schro_opengl_canvas_push (SchroOpenGLCanvas *dest, SchroFrameData *src) { int i; int width, height, depth; int pixelbuffer_y_offset, pixelbuffer_height; GLuint src_texture = 0; // FIXME: don't create a new locale texture here // but use a single global texture for such temporary // purpose void *mapped_data = NULL; void *tmp_data = NULL; SchroOpenGLShader *shader; SCHRO_ASSERT (dest->format == src->format); SCHRO_ASSERT (dest->width == src->width); SCHRO_ASSERT (dest->height == src->height); SCHRO_ASSERT (dest->texture.handles[0] != 0); SCHRO_ASSERT (dest->texture.handles[1] != 0); SCHRO_ASSERT (dest->framebuffers[0] != 0); SCHRO_ASSERT (dest->framebuffers[1] != 0); width = src->width; height = src->height; depth = SCHRO_FRAME_FORMAT_DEPTH (src->format); schro_opengl_lock (dest->opengl); if (SCHRO_OPENGL_CANVAS_IS_FLAG_SET (PUSH_RENDER_QUAD)) { glGenTextures (1, &src_texture); glBindTexture (GL_TEXTURE_RECTANGLE_ARB, src_texture); glTexImage2D (GL_TEXTURE_RECTANGLE_ARB, 0, dest->texture.internal_format, width, height, 0, dest->texture.pixel_format, dest->texture.type, NULL); glTexParameteri (GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameteri (GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri (GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_WRAP_S, GL_CLAMP); glTexParameteri (GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_WRAP_T, GL_CLAMP); glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); SCHRO_OPENGL_CHECK_ERROR } if ((SCHRO_OPENGL_CANVAS_IS_FLAG_SET (PUSH_U8_PIXELBUFFER) && depth == SCHRO_FRAME_FORMAT_DEPTH_U8) || (SCHRO_OPENGL_CANVAS_IS_FLAG_SET (PUSH_S16_PIXELBUFFER) && depth == SCHRO_FRAME_FORMAT_DEPTH_S16)) { pixelbuffer_y_offset = 0; for (i = 0; i < SCHRO_OPENGL_TRANSFER_PIXELBUFFERS; ++i) { pixelbuffer_height = dest->push.heights[i]; glBindBufferARB (GL_PIXEL_UNPACK_BUFFER_EXT, dest->push.pixelbuffers[i]); glBufferDataARB (GL_PIXEL_UNPACK_BUFFER_ARB, dest->push.stride * pixelbuffer_height, NULL, GL_STREAM_DRAW_ARB); mapped_data = glMapBufferARB (GL_PIXEL_UNPACK_BUFFER_EXT, GL_WRITE_ONLY_ARB); schro_opengl_canvas_push_convert (dest, src, mapped_data, pixelbuffer_y_offset, pixelbuffer_height); glUnmapBufferARB (GL_PIXEL_UNPACK_BUFFER_EXT); pixelbuffer_y_offset += pixelbuffer_height; SCHRO_OPENGL_CHECK_ERROR } if (!SCHRO_OPENGL_CANVAS_IS_FLAG_SET (PUSH_RENDER_QUAD)) { glBindTexture (GL_TEXTURE_RECTANGLE_ARB, dest->texture.handles[0]); } pixelbuffer_y_offset = 0; if (dest->push.type == GL_SHORT) { /* OpenGL maps signed values different to float values than unsigned values. for S16 -32768 is mapped to -1.0 and 32767 to 1.0, for U16 0 is mapped to 0.0 and 65535 to 1.0. after this mapping scale and bias are applied and the resulting value is clamped to [0..1]. with default scale = 1 and default bias = 0 all negative values from S16 are clamped to 0.0, changing scale and bias to 0.5 gives a unclamped mapping that doesn't discard all negative values for S16 */ glPixelTransferf (GL_RED_SCALE, 0.5); glPixelTransferf (GL_RED_BIAS, 0.5); } for (i = 0; i < SCHRO_OPENGL_TRANSFER_PIXELBUFFERS; ++i) { pixelbuffer_height = dest->push.heights[i]; glBindBufferARB (GL_PIXEL_UNPACK_BUFFER_EXT, dest->push.pixelbuffers[i]); SCHRO_OPENGL_CHECK_ERROR if (SCHRO_OPENGL_CANVAS_IS_FLAG_SET (PUSH_DRAWPIXELS)) { glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, dest->framebuffers[0]); glWindowPos2iARB (0, pixelbuffer_y_offset); glDrawPixels (width, pixelbuffer_height, dest->texture.pixel_format, dest->push.type, NULL); glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, 0); } else { glTexSubImage2D (GL_TEXTURE_RECTANGLE_ARB, 0, 0, pixelbuffer_y_offset, width, pixelbuffer_height, dest->texture.pixel_format, dest->push.type, NULL); } SCHRO_OPENGL_CHECK_ERROR pixelbuffer_y_offset += pixelbuffer_height; } if (dest->push.type == GL_SHORT) { glPixelTransferf (GL_RED_SCALE, 1); glPixelTransferf (GL_RED_BIAS, 0); } glBindBufferARB (GL_PIXEL_UNPACK_BUFFER_EXT, 0); } else { tmp_data = schro_opengl_get_tmp (dest->opengl, dest->push.stride * height); schro_opengl_canvas_push_convert (dest, src, tmp_data, 0, height); if (!SCHRO_OPENGL_CANVAS_IS_FLAG_SET (PUSH_RENDER_QUAD)) { glBindTexture (GL_TEXTURE_RECTANGLE_ARB, dest->texture.handles[0]); } if (dest->push.type == GL_SHORT) { /* OpenGL maps signed values different to float values than unsigned values. for S16 -32768 is mapped to -1.0 and 32767 to 1.0, for U16 0 is mapped to 0.0 and 65535 to 1.0. after this mapping scale and bias are applied and the resulting value is clamped to [0..1]. with default scale = 1 and default bias = 0 all negative values from S16 are clamped to 0.0, changing scale and bias to 0.5 gives a unclamped mapping that doesn't discard all negative values for S16 */ glPixelTransferf (GL_RED_SCALE, 0.5); glPixelTransferf (GL_RED_BIAS, 0.5); } if (SCHRO_OPENGL_CANVAS_IS_FLAG_SET (PUSH_DRAWPIXELS)) { glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, dest->framebuffers[0]); glWindowPos2iARB (0, 0); glDrawPixels (width, height, dest->texture.pixel_format, dest->push.type, tmp_data); glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, 0); } else { glTexSubImage2D (GL_TEXTURE_RECTANGLE_ARB, 0, 0, 0, width, height, dest->texture.pixel_format, dest->push.type, tmp_data); } if (dest->push.type == GL_SHORT) { glPixelTransferf (GL_RED_SCALE, 1); glPixelTransferf (GL_RED_BIAS, 0); } } SCHRO_OPENGL_CHECK_ERROR if (SCHRO_OPENGL_CANVAS_IS_FLAG_SET (PUSH_RENDER_QUAD)) { schro_opengl_setup_viewport (width, height); glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, dest->framebuffers[0]); SCHRO_OPENGL_CHECK_ERROR if (SCHRO_OPENGL_CANVAS_IS_FLAG_SET (PUSH_SHADER)) { switch (SCHRO_FRAME_FORMAT_DEPTH (src->format)) { case SCHRO_FRAME_FORMAT_DEPTH_U8: shader = schro_opengl_shader_get (dest->opengl, SCHRO_OPENGL_SHADER_COPY_U8); break; case SCHRO_FRAME_FORMAT_DEPTH_S16: shader = schro_opengl_shader_get (dest->opengl, SCHRO_OPENGL_SHADER_COPY_S16); break; default: SCHRO_ASSERT (0); break; } glUseProgramObjectARB (shader->program); glUniform1iARB (shader->textures[0], 0); } schro_opengl_render_quad (0, 0, width, height); if (SCHRO_OPENGL_CANVAS_IS_FLAG_SET (PUSH_SHADER)) { glUseProgramObjectARB (0); } glFlush (); glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, 0); SCHRO_OPENGL_CHECK_ERROR } #if SCHRO_OPENGL_UNBIND_TEXTURES glBindTexture (GL_TEXTURE_RECTANGLE_ARB, 0); #endif if (SCHRO_OPENGL_CANVAS_IS_FLAG_SET (PUSH_RENDER_QUAD)) { glDeleteTextures (1, &src_texture); } schro_opengl_unlock (dest->opengl); } schroedinger-1.0.11/schroedinger/opengl/schroopenglcanvas.c0000644000175000017500000006402111320232176021012 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include unsigned int _schro_opengl_canvas_flags = 0 //| SCHRO_OPENGL_CANVAS_STORE_BGRA /* FIXME: currently broken with packed formats in convert */ | SCHRO_OPENGL_CANVAS_STORE_U8_AS_UI8 //| SCHRO_OPENGL_CANVAS_STORE_U8_AS_F16 //| SCHRO_OPENGL_CANVAS_STORE_U8_AS_F32 | SCHRO_OPENGL_CANVAS_STORE_S16_AS_UI16 //| SCHRO_OPENGL_CANVAS_STORE_S16_AS_I16 /* FIXME: doesn't yield a useable mapping in shader */ //| SCHRO_OPENGL_CANVAS_STORE_S16_AS_U16 //| SCHRO_OPENGL_CANVAS_STORE_S16_AS_F16 /* FIXME: currently broken in shader */ //| SCHRO_OPENGL_CANVAS_STORE_S16_AS_F32 /* FIXME: currently broken in shader */ //| SCHRO_OPENGL_CANVAS_PUSH_RENDER_QUAD //| SCHRO_OPENGL_CANVAS_PUSH_SHADER //| SCHRO_OPENGL_CANVAS_PUSH_DRAWPIXELS /* FIXME: currently broken */ | SCHRO_OPENGL_CANVAS_PUSH_U8_PIXELBUFFER //| SCHRO_OPENGL_CANVAS_PUSH_U8_AS_F32 //| SCHRO_OPENGL_CANVAS_PUSH_S16_PIXELBUFFER | SCHRO_OPENGL_CANVAS_PUSH_S16_AS_U16 //| SCHRO_OPENGL_CANVAS_PUSH_S16_AS_F32 //| SCHRO_OPENGL_CANVAS_PULL_PIXELBUFFER //| SCHRO_OPENGL_CANVAS_PULL_U8_AS_F32 | SCHRO_OPENGL_CANVAS_PULL_S16_AS_U16 //| SCHRO_OPENGL_CANVAS_PULL_S16_AS_F32 ; /* results on a NVIDIA 8800 GT with nvidia-glx-new drivers on Ubuntu Hardy */ /* U8: 259.028421/502.960679 mbyte/sec *//* unsigned int _schro_opengl_canvas_flags = 0;*/ /* U8: 382.692291/447.573619 mbyte/sec *//* unsigned int _schro_opengl_canvas_flags = SCHRO_OPENGL_CANVAS_PUSH_RENDER_QUAD | SCHRO_OPENGL_CANVAS_PUSH_U8_PIXELBUFFER;*/ /* U8: 972.809028/962.217704 mbyte/sec *//* unsigned int _schro_opengl_canvas_flags = SCHRO_OPENGL_CANVAS_STORE_U8_AS_UI8;*/ /* U8: 1890.699986/848.954058 mbyte/sec *//* unsigned int _schro_opengl_canvas_flags = SCHRO_OPENGL_CANVAS_STORE_U8_AS_UI8 | SCHRO_OPENGL_CANVAS_PUSH_U8_PIXELBUFFER;*/ /* U8: 2003.478261/462.976159 mbyte/sec *//* unsigned int _schro_opengl_canvas_flags = SCHRO_OPENGL_CANVAS_PUSH_U8_PIXELBUFFER;*/ /* S16: 22.265474/492.245509 mbyte/sec *//* unsigned int _schro_opengl_canvas_flags = SCHRO_OPENGL_CANVAS_PUSH_S16_AS_U16 | SCHRO_OPENGL_CANVAS_PUSH_S16_PIXELBUFFER | SCHRO_OPENGL_CANVAS_PULL_S16_AS_U16;*/ /* S16: 85.136173/499.591624 mbyte/sec *//* unsigned int _schro_opengl_canvas_flags = SCHRO_OPENGL_CANVAS_PULL_S16_AS_U16;*/ /* S16: 266.568537/490.034023 mbyte/sec *//* unsigned int _schro_opengl_canvas_flags = SCHRO_OPENGL_CANVAS_PUSH_S16_AS_U16 | SCHRO_OPENGL_CANVAS_PULL_S16_AS_U16;*/ /* S16: 601.249413/914.319981 mbyte/sec *//* unsigned int _schro_opengl_canvas_flags = SCHRO_OPENGL_CANVAS_STORE_S16_AS_UI16 | SCHRO_OPENGL_CANVAS_PUSH_S16_AS_U16 | SCHRO_OPENGL_CANVAS_PULL_S16_AS_U16;*/ void schro_opengl_canvas_check_flags (void) { int count; /* store */ if (SCHRO_OPENGL_CANVAS_IS_FLAG_SET (STORE_BGRA) && !GLEW_EXT_bgra) { SCHRO_ERROR ("missing extension GL_EXT_bgra, disabling BGRA storing"); SCHRO_OPENGL_CANVAS_CLEAR_FLAG (STORE_BGRA); } count = 0; count += SCHRO_OPENGL_CANVAS_IS_FLAG_SET (STORE_U8_AS_UI8) ? 1 : 0; count += SCHRO_OPENGL_CANVAS_IS_FLAG_SET (STORE_S16_AS_UI16) ? 1 : 0; count += SCHRO_OPENGL_CANVAS_IS_FLAG_SET (STORE_S16_AS_I16) ? 1 : 0; if (count > 0 && (!GLEW_EXT_texture_integer || !GLEW_EXT_gpu_shader4)) { SCHRO_ERROR ("missing extension GL_EXT_texture_integer or " "GLEW_EXT_gpu_shader4, can't store U8/S16 as UI8/UI16/I16, disabling " "U8/S16 as UI8/UI16/I16 storing"); SCHRO_OPENGL_CANVAS_CLEAR_FLAG (STORE_U8_AS_UI8); SCHRO_OPENGL_CANVAS_CLEAR_FLAG (STORE_S16_AS_UI16); SCHRO_OPENGL_CANVAS_CLEAR_FLAG (STORE_S16_AS_I16); } count = 0; count += SCHRO_OPENGL_CANVAS_IS_FLAG_SET (STORE_U8_AS_F16) ? 1 : 0; count += SCHRO_OPENGL_CANVAS_IS_FLAG_SET (STORE_U8_AS_F32) ? 1 : 0; count += SCHRO_OPENGL_CANVAS_IS_FLAG_SET (STORE_S16_AS_F16) ? 1 : 0; count += SCHRO_OPENGL_CANVAS_IS_FLAG_SET (STORE_S16_AS_F32) ? 1 : 0; if (count > 0 && !GLEW_ARB_texture_float && !GLEW_ATI_texture_float) { SCHRO_ERROR ("missing extension GL_{ARB|ATI}_texture_float, can't store " "U8/S16 as F16/F32, disabling U8/S16 as F16/F32 storing"); SCHRO_OPENGL_CANVAS_CLEAR_FLAG (STORE_U8_AS_F16); SCHRO_OPENGL_CANVAS_CLEAR_FLAG (STORE_U8_AS_F32); SCHRO_OPENGL_CANVAS_CLEAR_FLAG (STORE_S16_AS_F16); SCHRO_OPENGL_CANVAS_CLEAR_FLAG (STORE_S16_AS_F32); } /* store U8 */ count = 0; count += SCHRO_OPENGL_CANVAS_IS_FLAG_SET (STORE_U8_AS_UI8) ? 1 : 0; count += SCHRO_OPENGL_CANVAS_IS_FLAG_SET (STORE_U8_AS_F16) ? 1 : 0; count += SCHRO_OPENGL_CANVAS_IS_FLAG_SET (STORE_U8_AS_F32) ? 1 : 0; if (count > 1) { SCHRO_ERROR ("multiple flags for U8 storage type are set, disabling all"); SCHRO_OPENGL_CANVAS_CLEAR_FLAG (STORE_U8_AS_UI8); SCHRO_OPENGL_CANVAS_CLEAR_FLAG (STORE_U8_AS_F16); SCHRO_OPENGL_CANVAS_CLEAR_FLAG (STORE_U8_AS_F32); } /* store S16 */ count = 0; count += SCHRO_OPENGL_CANVAS_IS_FLAG_SET (STORE_S16_AS_UI16) ? 1 : 0; count += SCHRO_OPENGL_CANVAS_IS_FLAG_SET (STORE_S16_AS_I16) ? 1 : 0; count += SCHRO_OPENGL_CANVAS_IS_FLAG_SET (STORE_S16_AS_U16) ? 1 : 0; count += SCHRO_OPENGL_CANVAS_IS_FLAG_SET (STORE_S16_AS_F16) ? 1 : 0; count += SCHRO_OPENGL_CANVAS_IS_FLAG_SET (STORE_S16_AS_F32) ? 1 : 0; if (count > 1) { SCHRO_ERROR ("multiple flags for S16 storage type are set, disabling all"); SCHRO_OPENGL_CANVAS_CLEAR_FLAG (STORE_S16_AS_UI16); SCHRO_OPENGL_CANVAS_CLEAR_FLAG (STORE_S16_AS_I16); SCHRO_OPENGL_CANVAS_CLEAR_FLAG (STORE_S16_AS_U16); SCHRO_OPENGL_CANVAS_CLEAR_FLAG (STORE_S16_AS_F16); SCHRO_OPENGL_CANVAS_CLEAR_FLAG (STORE_S16_AS_F32); } /* push */ if (!SCHRO_OPENGL_CANVAS_IS_FLAG_SET (PUSH_RENDER_QUAD) && SCHRO_OPENGL_CANVAS_IS_FLAG_SET (PUSH_SHADER)) { SCHRO_ERROR ("can't use shader to push without render quad, disabling " "shader"); SCHRO_OPENGL_CANVAS_CLEAR_FLAG (PUSH_SHADER); } count = 0; count += SCHRO_OPENGL_CANVAS_IS_FLAG_SET (STORE_U8_AS_UI8) ? 1 : 0; count += SCHRO_OPENGL_CANVAS_IS_FLAG_SET (STORE_S16_AS_UI16) ? 1 : 0; count += SCHRO_OPENGL_CANVAS_IS_FLAG_SET (STORE_S16_AS_I16) ? 1 : 0; if (count > 0 && SCHRO_OPENGL_CANVAS_IS_FLAG_SET (PUSH_RENDER_QUAD) && !SCHRO_OPENGL_CANVAS_IS_FLAG_SET (PUSH_SHADER)) { SCHRO_ERROR ("can't push U8/S16 as UI8/UI16/I16 shader, disabling " "pushing U8/S16 as UI8/UI16/I16"); SCHRO_OPENGL_CANVAS_CLEAR_FLAG (STORE_U8_AS_UI8); SCHRO_OPENGL_CANVAS_CLEAR_FLAG (STORE_S16_AS_UI16); SCHRO_OPENGL_CANVAS_CLEAR_FLAG (STORE_S16_AS_I16); } if (SCHRO_OPENGL_CANVAS_IS_FLAG_SET (PUSH_RENDER_QUAD) && SCHRO_OPENGL_CANVAS_IS_FLAG_SET (PUSH_DRAWPIXELS)) { SCHRO_ERROR ("can't render quad and drawpixels to push, disabling " "drawpixels push"); SCHRO_OPENGL_CANVAS_CLEAR_FLAG (PUSH_DRAWPIXELS); } if (SCHRO_OPENGL_CANVAS_IS_FLAG_SET (PUSH_DRAWPIXELS) && !GLEW_ARB_window_pos) { SCHRO_ERROR ("missing extension GL_ARB_window_pos, disabling drawpixels " "push"); SCHRO_OPENGL_CANVAS_CLEAR_FLAG (PUSH_DRAWPIXELS); } if (SCHRO_OPENGL_CANVAS_IS_FLAG_SET (PUSH_U8_PIXELBUFFER) && (!GLEW_ARB_vertex_buffer_object || !GLEW_ARB_pixel_buffer_object)) { SCHRO_ERROR ("missing extensions GL_ARB_vertex_buffer_object and/or " "GL_ARB_pixel_buffer_object, disabling U8 pixelbuffer push"); SCHRO_OPENGL_CANVAS_CLEAR_FLAG (PUSH_U8_PIXELBUFFER); } if (SCHRO_OPENGL_CANVAS_IS_FLAG_SET (PUSH_S16_PIXELBUFFER) && (!GLEW_ARB_vertex_buffer_object || !GLEW_ARB_pixel_buffer_object)) { SCHRO_ERROR ("missing extensions GL_ARB_vertex_buffer_object and/or " "GL_ARB_pixel_buffer_object, disabling S16 pixelbuffer push"); SCHRO_OPENGL_CANVAS_CLEAR_FLAG (PUSH_S16_PIXELBUFFER); } if (SCHRO_OPENGL_CANVAS_IS_FLAG_SET (PUSH_S16_AS_U16) && SCHRO_OPENGL_CANVAS_IS_FLAG_SET (PUSH_S16_AS_F32)) { SCHRO_ERROR ("can't push S16 as U16 and F32, disabling U16 push"); SCHRO_OPENGL_CANVAS_CLEAR_FLAG (PUSH_S16_AS_U16); } /* pull */ if (SCHRO_OPENGL_CANVAS_IS_FLAG_SET (PULL_PIXELBUFFER) && (!GLEW_ARB_vertex_buffer_object || !GLEW_ARB_pixel_buffer_object)) { SCHRO_ERROR ("missing extensions GL_ARB_vertex_buffer_object and/or " "GL_ARB_pixel_buffer_object, disabling S16 pixelbuffer pull"); SCHRO_OPENGL_CANVAS_CLEAR_FLAG (PULL_PIXELBUFFER); } if (SCHRO_OPENGL_CANVAS_IS_FLAG_SET (PULL_S16_AS_U16) && SCHRO_OPENGL_CANVAS_IS_FLAG_SET (PULL_S16_AS_F32)) { SCHRO_ERROR ("can't pull S16 as U16 and F32, disabling U16 pull"); SCHRO_OPENGL_CANVAS_CLEAR_FLAG (PULL_S16_AS_U16); } } void schro_opengl_canvas_print_flags (const char* indent) { schro_opengl_canvas_check_flags (); #define PRINT_FLAG(_text, _flag) \ printf ("%s "_text"%s\n", indent, \ SCHRO_OPENGL_CANVAS_IS_FLAG_SET (_flag) ? "on" : "off") printf ("%sstore flags\n", indent); PRINT_FLAG ("BGRA: ", STORE_BGRA); PRINT_FLAG ("U8 as UI8: ", STORE_U8_AS_UI8); PRINT_FLAG ("U8 as F16: ", STORE_U8_AS_F16); PRINT_FLAG ("U8 as F32: ", STORE_U8_AS_F32); PRINT_FLAG ("S16 as UI16: ", STORE_S16_AS_UI16); PRINT_FLAG ("S16 as I16: ", STORE_S16_AS_I16); PRINT_FLAG ("S16 as U16: ", STORE_S16_AS_U16); PRINT_FLAG ("S16 as F16: ", STORE_S16_AS_F16); PRINT_FLAG ("S16 as F32: ", STORE_S16_AS_F32); printf ("%spush flags\n", indent); PRINT_FLAG ("render quad: ", PUSH_RENDER_QUAD); PRINT_FLAG ("shader: ", PUSH_SHADER); PRINT_FLAG ("drawpixels: ", PUSH_DRAWPIXELS); PRINT_FLAG ("U8 pixelbuffer: ", PUSH_U8_PIXELBUFFER); PRINT_FLAG ("U8 as F32: ", PUSH_U8_AS_F32); PRINT_FLAG ("S16 pixelbuffer: ", PUSH_S16_PIXELBUFFER); PRINT_FLAG ("S16 as U16: ", PUSH_S16_AS_U16); PRINT_FLAG ("S16 as F32: ", PUSH_S16_AS_F32); printf ("%spull flags\n", indent); PRINT_FLAG ("pixelbuffer: ", PULL_PIXELBUFFER); PRINT_FLAG ("U8 as F32: ", PULL_U8_AS_F32); PRINT_FLAG ("S16 as U16: ", PULL_S16_AS_U16); PRINT_FLAG ("S16 as F32: ", PULL_S16_AS_F32); #undef PRINT_FLAG } SchroOpenGLCanvas * schro_opengl_canvas_new (SchroOpenGL *opengl, SchroFrameFormat format, int width, int height) { int i; int create_push_pixelbuffers = FALSE; SchroOpenGLCanvas *canvas = schro_malloc0 (sizeof (SchroOpenGLCanvas)); schro_opengl_canvas_check_flags (); // FIXME schro_opengl_lock (opengl); canvas->opengl = opengl; canvas->format = format; canvas->width = width; canvas->height = height; switch (SCHRO_FRAME_FORMAT_DEPTH (format)) { case SCHRO_FRAME_FORMAT_DEPTH_U8: if (SCHRO_OPENGL_CANVAS_IS_FLAG_SET (STORE_U8_AS_F16)) { if (!SCHRO_FRAME_IS_PACKED (format) && GLEW_NV_float_buffer) { canvas->texture.internal_format = GL_FLOAT_R16_NV; } else { canvas->texture.internal_format = GL_RGBA16F_ARB; } canvas->texture.type = GL_FLOAT; } else if (SCHRO_OPENGL_CANVAS_IS_FLAG_SET (STORE_U8_AS_F32)) { if (!SCHRO_FRAME_IS_PACKED (format) && GLEW_NV_float_buffer) { canvas->texture.internal_format = GL_FLOAT_R32_NV; } else { canvas->texture.internal_format = GL_RGBA32F_ARB; } canvas->texture.type = GL_FLOAT; } else if (SCHRO_OPENGL_CANVAS_IS_FLAG_SET (STORE_U8_AS_UI8)) { if (SCHRO_FRAME_IS_PACKED (format)) { canvas->texture.internal_format = GL_RGBA8UI_EXT; } else { canvas->texture.internal_format = GL_ALPHA8UI_EXT; } canvas->texture.type = GL_UNSIGNED_BYTE; } else { /* must use RGBA format here, because other formats are in general not supported by framebuffers */ canvas->texture.internal_format = GL_RGBA8; canvas->texture.type = GL_UNSIGNED_BYTE; } if (SCHRO_FRAME_IS_PACKED (format)) { if (SCHRO_OPENGL_CANVAS_IS_FLAG_SET (STORE_BGRA)) { if (SCHRO_OPENGL_CANVAS_IS_FLAG_SET (STORE_U8_AS_UI8)) { canvas->texture.pixel_format = GL_BGRA_INTEGER_EXT; } else { canvas->texture.pixel_format = GL_BGRA; } canvas->texture.channels = 4; } else { if (SCHRO_OPENGL_CANVAS_IS_FLAG_SET (STORE_U8_AS_UI8)) { canvas->texture.pixel_format = GL_RGBA_INTEGER_EXT; } else { canvas->texture.pixel_format = GL_RGBA; } canvas->texture.channels = 4; } } else { if (SCHRO_OPENGL_CANVAS_IS_FLAG_SET (STORE_U8_AS_UI8)) { canvas->texture.pixel_format = GL_ALPHA_INTEGER_EXT; } else { canvas->texture.pixel_format = GL_RED; } canvas->texture.channels = 1; } if (SCHRO_OPENGL_CANVAS_IS_FLAG_SET (PUSH_U8_PIXELBUFFER)) { create_push_pixelbuffers = TRUE; } if (SCHRO_OPENGL_CANVAS_IS_FLAG_SET (PUSH_U8_AS_F32)) { canvas->push.type = GL_FLOAT; canvas->push.stride = ROUND_UP_4 (width * canvas->texture.channels * sizeof (float)); } else { canvas->push.type = GL_UNSIGNED_BYTE; canvas->push.stride = ROUND_UP_4 (width * canvas->texture.channels * sizeof (uint8_t)); } if (SCHRO_OPENGL_CANVAS_IS_FLAG_SET (PULL_U8_AS_F32)) { canvas->pull.type = GL_FLOAT; canvas->pull.stride = ROUND_UP_4 (width * canvas->texture.channels * sizeof (float)); } else { canvas->pull.type = GL_UNSIGNED_BYTE; canvas->pull.stride = ROUND_UP_4 (width * canvas->texture.channels * sizeof (uint8_t)); } break; case SCHRO_FRAME_FORMAT_DEPTH_S16: if (SCHRO_OPENGL_CANVAS_IS_FLAG_SET (STORE_S16_AS_F16)) { if (!SCHRO_FRAME_IS_PACKED (format) && GLEW_NV_float_buffer) { canvas->texture.internal_format = GL_FLOAT_R16_NV; } else { canvas->texture.internal_format = GL_RGBA16F_ARB; } canvas->texture.type = GL_FLOAT; } else if (SCHRO_OPENGL_CANVAS_IS_FLAG_SET (STORE_S16_AS_F32)) { if (!SCHRO_FRAME_IS_PACKED (format) && GLEW_NV_float_buffer) { canvas->texture.internal_format = GL_FLOAT_R32_NV; } else { canvas->texture.internal_format = GL_RGBA32F_ARB; } canvas->texture.type = GL_FLOAT; } else if (SCHRO_OPENGL_CANVAS_IS_FLAG_SET (STORE_S16_AS_UI16)) { if (SCHRO_FRAME_IS_PACKED (format)) { canvas->texture.internal_format = GL_RGBA16UI_EXT; } else { canvas->texture.internal_format = GL_ALPHA16UI_EXT; } canvas->texture.type = GL_UNSIGNED_SHORT; } else if (SCHRO_OPENGL_CANVAS_IS_FLAG_SET (STORE_S16_AS_I16)) { if (SCHRO_FRAME_IS_PACKED (format)) { canvas->texture.internal_format = GL_RGBA16I_EXT; } else { canvas->texture.internal_format = GL_ALPHA16I_EXT; } canvas->texture.type = GL_SHORT; } else if (SCHRO_OPENGL_CANVAS_IS_FLAG_SET (STORE_S16_AS_U16)) { /* must use RGBA format here, because other formats are in general not supported by framebuffers */ canvas->texture.internal_format = GL_RGBA16; canvas->texture.type = GL_UNSIGNED_SHORT; } else { /* must use RGBA format here, because other formats are in general not supported by framebuffers */ canvas->texture.internal_format = GL_RGBA16; canvas->texture.type = GL_SHORT; } if (SCHRO_FRAME_IS_PACKED (format)) { if (SCHRO_OPENGL_CANVAS_IS_FLAG_SET (STORE_BGRA)) { if (SCHRO_OPENGL_CANVAS_IS_FLAG_SET (STORE_S16_AS_UI16) || SCHRO_OPENGL_CANVAS_IS_FLAG_SET (STORE_S16_AS_I16)) { canvas->texture.pixel_format = GL_BGRA_INTEGER_EXT; } else { canvas->texture.pixel_format = GL_BGRA; } canvas->texture.channels = 4; } else { if (SCHRO_OPENGL_CANVAS_IS_FLAG_SET (STORE_S16_AS_UI16) || SCHRO_OPENGL_CANVAS_IS_FLAG_SET (STORE_S16_AS_I16)) { canvas->texture.pixel_format = GL_RGBA_INTEGER_EXT; } else { canvas->texture.pixel_format = GL_RGBA; } canvas->texture.channels = 4; } } else { if (SCHRO_OPENGL_CANVAS_IS_FLAG_SET (STORE_S16_AS_UI16) || SCHRO_OPENGL_CANVAS_IS_FLAG_SET (STORE_S16_AS_I16)) { canvas->texture.pixel_format = GL_ALPHA_INTEGER_EXT; } else { canvas->texture.pixel_format = GL_RED; } canvas->texture.channels = 1; } if (SCHRO_OPENGL_CANVAS_IS_FLAG_SET (PUSH_S16_AS_U16)) { canvas->push.type = GL_UNSIGNED_SHORT; canvas->push.stride = ROUND_UP_4 (width * canvas->texture.channels * sizeof (uint16_t)); } else if (SCHRO_OPENGL_CANVAS_IS_FLAG_SET (PUSH_S16_AS_F32)) { canvas->push.type = GL_FLOAT; canvas->push.stride = ROUND_UP_4 (width * canvas->texture.channels * sizeof (float)); } else { canvas->push.type = GL_SHORT; canvas->push.stride = ROUND_UP_4 (width * canvas->texture.channels * sizeof (int16_t)); } if (SCHRO_OPENGL_CANVAS_IS_FLAG_SET (PUSH_S16_PIXELBUFFER)) { create_push_pixelbuffers = TRUE; } if (SCHRO_OPENGL_CANVAS_IS_FLAG_SET (PULL_S16_AS_U16)) { /* must pull S16 as GL_UNSIGNED_SHORT instead of GL_SHORT because the OpenGL mapping form internal float represenation into S16 values with GL_SHORT maps 0.0 to 0 and 1.0 to 32767 clamping all negative values to 0, see glReadPixel documentation. so the pull is done with GL_UNSIGNED_SHORT and the resulting U16 values are manually shifted to S16 */ canvas->pull.type = GL_UNSIGNED_SHORT; canvas->pull.stride = ROUND_UP_4 (width * canvas->texture.channels * sizeof (uint16_t)); } else if (SCHRO_OPENGL_CANVAS_IS_FLAG_SET (PULL_S16_AS_F32)) { canvas->pull.type = GL_FLOAT; canvas->pull.stride = ROUND_UP_4 (width * canvas->texture.channels * sizeof (float)); } else { // FIXME: pulling S16 as GL_SHORT doesn't work in general, maybe // it's the right mode if the internal format is an integer format // but for some reason storing as I16 doesn't work either and only // gives garbage pull results canvas->pull.type = GL_SHORT; canvas->pull.stride = ROUND_UP_4 (width * canvas->texture.channels * sizeof (int16_t)); } break; default: SCHRO_ASSERT (0); break; } /* textures */ for (i = 0; i < 2; ++i) { glGenTextures (1, &canvas->texture.handles[i]); glBindTexture (GL_TEXTURE_RECTANGLE_ARB, canvas->texture.handles[i]); glTexImage2D (GL_TEXTURE_RECTANGLE_ARB, 0, canvas->texture.internal_format, width, height, 0, canvas->texture.pixel_format, canvas->texture.type, NULL); glTexParameteri (GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameteri (GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri (GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_WRAP_S, GL_CLAMP); glTexParameteri (GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_WRAP_T, GL_CLAMP); glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); SCHRO_OPENGL_CHECK_ERROR } #if SCHRO_OPENGL_UNBIND_TEXTURES glBindTexture (GL_TEXTURE_RECTANGLE_ARB, 0); #endif /* framebuffers */ for (i = 0; i < 2; ++i) { glGenFramebuffersEXT (1, &canvas->framebuffers[i]); glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, canvas->framebuffers[i]); glFramebufferTexture2DEXT (GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_RECTANGLE_ARB, canvas->texture.handles[i], 0); glDrawBuffer (GL_COLOR_ATTACHMENT0_EXT); glReadBuffer (GL_COLOR_ATTACHMENT0_EXT); SCHRO_OPENGL_CHECK_ERROR // FIXME: checking framebuffer status is an expensive operation SCHRO_OPENGL_CHECK_FRAMEBUFFER } glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, 0); SCHRO_ASSERT (height >= SCHRO_OPENGL_TRANSFER_PIXELBUFFERS); /* push pixelbuffers */ if (create_push_pixelbuffers) { for (i = 0; i < SCHRO_OPENGL_TRANSFER_PIXELBUFFERS; ++i) { SCHRO_ASSERT (canvas->push.pixelbuffers[i] == 0); if (i == SCHRO_OPENGL_TRANSFER_PIXELBUFFERS - 1) { canvas->push.heights[i] = height - (height / SCHRO_OPENGL_TRANSFER_PIXELBUFFERS) * i; } else { canvas->push.heights[i] = height / SCHRO_OPENGL_TRANSFER_PIXELBUFFERS; } glGenBuffersARB (1, &canvas->push.pixelbuffers[i]); glBindBufferARB (GL_PIXEL_UNPACK_BUFFER_ARB, canvas->push.pixelbuffers[i]); glBufferDataARB (GL_PIXEL_UNPACK_BUFFER_ARB, canvas->push.stride * canvas->push.heights[i], NULL, GL_STREAM_DRAW_ARB); SCHRO_OPENGL_CHECK_ERROR } glBindBufferARB (GL_PIXEL_UNPACK_BUFFER_ARB, 0); } /* pull pixelbuffers */ if (SCHRO_OPENGL_CANVAS_IS_FLAG_SET (PULL_PIXELBUFFER)) { for (i = 0; i < SCHRO_OPENGL_TRANSFER_PIXELBUFFERS; ++i) { SCHRO_ASSERT (canvas->pull.pixelbuffers[i] == 0); if (i == SCHRO_OPENGL_TRANSFER_PIXELBUFFERS - 1) { canvas->pull.heights[i] = height - (height / SCHRO_OPENGL_TRANSFER_PIXELBUFFERS) * i; } else { canvas->pull.heights[i] = height / SCHRO_OPENGL_TRANSFER_PIXELBUFFERS; } glGenBuffersARB (1, &canvas->pull.pixelbuffers[i]); glBindBufferARB (GL_PIXEL_PACK_BUFFER_ARB, canvas->pull.pixelbuffers[i]); glBufferDataARB (GL_PIXEL_PACK_BUFFER_ARB, canvas->pull.stride * canvas->pull.heights[i], NULL, GL_STATIC_READ_ARB); SCHRO_OPENGL_CHECK_ERROR } glBindBufferARB (GL_PIXEL_PACK_BUFFER_ARB, 0); } schro_opengl_unlock (opengl); return canvas; } void schro_opengl_canvas_free (SchroOpenGLCanvas *canvas) { int i; SchroOpenGL *opengl; SCHRO_ASSERT (canvas != NULL); opengl = canvas->opengl; canvas->opengl = NULL; schro_opengl_lock (opengl); /* textures */ for (i = 0; i < 2; ++i) { if (glIsTexture (canvas->texture.handles[i])) { glDeleteTextures (1, &canvas->texture.handles[i]); canvas->texture.handles[i] = 0; SCHRO_OPENGL_CHECK_ERROR } } /* framebuffers */ for (i = 0; i < 2; ++i) { if (glIsFramebufferEXT (canvas->framebuffers[i])) { glDeleteFramebuffersEXT (1, &canvas->framebuffers[i]); canvas->framebuffers[i] = 0; SCHRO_OPENGL_CHECK_ERROR } } /* pixelbuffers */ for (i = 0; i < SCHRO_OPENGL_TRANSFER_PIXELBUFFERS; ++i) { if (glIsBufferARB (canvas->push.pixelbuffers[i])) { glDeleteBuffersARB (1, &canvas->push.pixelbuffers[i]); canvas->push.pixelbuffers[i] = 0; SCHRO_OPENGL_CHECK_ERROR } if (glIsBufferARB (canvas->pull.pixelbuffers[i])) { glDeleteBuffersARB (1, &canvas->pull.pixelbuffers[i]); canvas->pull.pixelbuffers[i] = 0; SCHRO_OPENGL_CHECK_ERROR } } schro_opengl_unlock (opengl); schro_free (canvas); } SchroOpenGLCanvasPool *schro_opengl_canvas_pool_new (SchroOpenGL *opengl) { SchroOpenGLCanvasPool *canvas_pool; canvas_pool = schro_malloc0 (sizeof (SchroOpenGLCanvasPool)); canvas_pool->opengl = opengl; canvas_pool->size = 0; return canvas_pool; } void schro_opengl_canvas_pool_free (SchroOpenGLCanvasPool* canvas_pool) { int i; SCHRO_ASSERT (canvas_pool->size >= 0); SCHRO_ASSERT (canvas_pool->size <= SCHRO_OPENGL_CANVAS_POOL_SIZE); schro_opengl_lock (canvas_pool->opengl); for (i = 0; i < canvas_pool->size; ++i) { schro_opengl_canvas_free (canvas_pool->canvases[i]); } schro_opengl_unlock (canvas_pool->opengl); schro_free (canvas_pool); } static int schro_opengl_canvas_pool_is_empty (SchroOpenGLCanvasPool* canvas_pool) { SCHRO_ASSERT (canvas_pool->size >= 0); SCHRO_ASSERT (canvas_pool->size <= SCHRO_OPENGL_CANVAS_POOL_SIZE); return canvas_pool->size == 0; } static int schro_opengl_canvas_pool_is_full (SchroOpenGLCanvasPool* canvas_pool) { SCHRO_ASSERT (canvas_pool->size >= 0); SCHRO_ASSERT (canvas_pool->size <= SCHRO_OPENGL_CANVAS_POOL_SIZE); return canvas_pool->size == SCHRO_OPENGL_CANVAS_POOL_SIZE; } static SchroOpenGLCanvas * schro_opengl_canvas_pool_pull (SchroOpenGLCanvasPool* canvas_pool, SchroFrameFormat format, int width, int height) { int i; SchroOpenGLCanvas *canvas; SCHRO_ASSERT (canvas_pool->size >= 1); SCHRO_ASSERT (canvas_pool->size <= SCHRO_OPENGL_CANVAS_POOL_SIZE); for (i = 0; i < canvas_pool->size; ++i) { canvas = canvas_pool->canvases[i]; if (canvas->format == format && canvas->width == width && canvas->height == height) { --canvas_pool->size; /* move the last canvas in the pool to the slot of the pulled one to maintain the pool continuous in memory */ canvas_pool->canvases[i] = canvas_pool->canvases[canvas_pool->size]; return canvas; } } return NULL; } static void schro_opengl_canvas_pool_push (SchroOpenGLCanvasPool* canvas_pool, SchroOpenGLCanvas *canvas) { SCHRO_ASSERT (canvas_pool->size >= 0); SCHRO_ASSERT (canvas_pool->size <= SCHRO_OPENGL_CANVAS_POOL_SIZE - 1); canvas_pool->canvases[canvas_pool->size] = canvas; ++canvas_pool->size; } SchroOpenGLCanvas * schro_opengl_canvas_pool_pull_or_new (SchroOpenGLCanvasPool* canvas_pool, SchroOpenGL *opengl, SchroFrameFormat format, int width, int height) { SchroOpenGLCanvas *canvas = NULL; schro_opengl_lock (canvas_pool->opengl); if (!schro_opengl_canvas_pool_is_empty (canvas_pool)) { canvas = schro_opengl_canvas_pool_pull (canvas_pool, format, width, height); } if (!canvas) { canvas = schro_opengl_canvas_new (opengl, format, width, height); } schro_opengl_unlock (canvas_pool->opengl); return canvas; } void schro_opengl_canvas_pool_push_or_free (SchroOpenGLCanvasPool* canvas_pool, SchroOpenGLCanvas *canvas) { schro_opengl_lock (canvas_pool->opengl); if (!schro_opengl_canvas_pool_is_full (canvas_pool)) { schro_opengl_canvas_pool_push (canvas_pool, canvas); } else { schro_opengl_canvas_free (canvas); } schro_opengl_unlock (canvas_pool->opengl); } schroedinger-1.0.11/schroedinger/opengl/schroopengl.c0000644000175000017500000003416111556115124017624 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #include #define REQUIRED_TEXTURE_UNITS 9 struct _SchroOpenGL { int is_usable; int is_visible; int lock_count; SchroMutex *mutex; Display *display; Window root; int screen; XVisualInfo *visual_info; GLXContext context; Window window; void *tmp; int tmp_size; SchroOpenGLShaderLibrary *shader_library; SchroOpenGLCanvasPool* canvas_pool; SchroOpenGLCanvas *obmc_weight_canvas; }; static int schro_opengl_x_error_handler (Display *display, XErrorEvent *event) { char errormsg[512]; XGetErrorText (display, event->error_code, errormsg, sizeof (errormsg)); SCHRO_ERROR ("Xlib error: %s", errormsg); return 0; } static int schro_opengl_open_display (SchroOpenGL *opengl, const char *display_name) { SCHRO_ASSERT (opengl->display == NULL); opengl->display = XOpenDisplay (display_name); if (opengl->display == NULL) { SCHRO_ERROR ("failed to open display %s", display_name); return FALSE; } XSynchronize (opengl->display, False); XSetErrorHandler (schro_opengl_x_error_handler); opengl->root = DefaultRootWindow (opengl->display); opengl->screen = DefaultScreen (opengl->display); return TRUE; } static void schro_opengl_close_display (SchroOpenGL *opengl) { if (opengl->display) { XCloseDisplay (opengl->display); opengl->display = NULL; } } static int schro_opengl_create_window (SchroOpenGL *opengl) { int error_base; int event_base; int result; int visual_attr[] = { GLX_RGBA, GLX_DOUBLEBUFFER, GLX_RED_SIZE, 8, GLX_GREEN_SIZE, 8, GLX_BLUE_SIZE, 8, None }; int mask; XSetWindowAttributes window_attr; SCHRO_ASSERT (opengl->display != NULL); SCHRO_ASSERT (opengl->root != None); result = glXQueryExtension (opengl->display, &error_base, &event_base); if (!result) { SCHRO_ERROR ("missing GLX extension"); return FALSE; } opengl->visual_info = glXChooseVisual (opengl->display, opengl->screen, visual_attr); if (opengl->visual_info == NULL) { SCHRO_ERROR ("no usable visual"); return FALSE; } opengl->context = glXCreateContext (opengl->display, opengl->visual_info, NULL, True); if (opengl->context == NULL) { SCHRO_ERROR ("failed to create direct GLX context"); XFree (opengl->visual_info); opengl->visual_info = NULL; return FALSE; } mask = CWBackPixel | CWBorderPixel | CWColormap | CWOverrideRedirect; window_attr.background_pixel = 0; window_attr.border_pixel = 0; window_attr.colormap = XCreateColormap (opengl->display, opengl->root, opengl->visual_info->visual, AllocNone); window_attr.override_redirect = False; opengl->window = XCreateWindow (opengl->display, opengl->root, 0, 0, 100, 100, 0, opengl->visual_info->depth, InputOutput, opengl->visual_info->visual, mask, &window_attr); if (opengl->window == None) { SCHRO_ERROR ("failed to create window with visual %ld", opengl->visual_info->visualid); glXDestroyContext (opengl->display, opengl->context); opengl->context = NULL; XFree (opengl->visual_info); opengl->visual_info = NULL; return FALSE; } XSync (opengl->display, FALSE); return TRUE; } static void schro_opengl_destroy_window (SchroOpenGL *opengl) { if (opengl->window != None) { XDestroyWindow (opengl->display, opengl->window); opengl->window = None; } if (opengl->context) { glXDestroyContext (opengl->display, opengl->context); opengl->context = NULL; } if (opengl->visual_info) { XFree (opengl->visual_info); opengl->visual_info = NULL; } } static int schro_opengl_init_glew (SchroOpenGL *opengl) { int ok = TRUE; int major, minor, micro; GLenum error; schro_opengl_lock (opengl); error = glewInit (); if (error != GLEW_OK) { SCHRO_ERROR ("GLEW error: %s", glewGetErrorString (error)); ok = FALSE; } major = atoi ((const char*) glewGetString (GLEW_VERSION_MAJOR)); minor = atoi ((const char*) glewGetString (GLEW_VERSION_MINOR)); micro = atoi ((const char*) glewGetString (GLEW_VERSION_MICRO)); if (major < 1) { SCHRO_ERROR ("missing GLEW >= 1.5.0"); ok = FALSE; } else if (major == 1 && minor < 5) { SCHRO_ERROR ("missing GLEW >= 1.5.0"); ok = FALSE; } else if (major == 1 && minor == 5 && micro < 0) { SCHRO_ERROR ("missing GLEW >= 1.5.0"); ok = FALSE; } schro_opengl_unlock (opengl); return ok; } static int schro_opengl_check_essential_extensions (SchroOpenGL *opengl) { int ok = TRUE; //GLint texture_units; schro_opengl_lock (opengl); #define CHECK_EXTENSION(_name) \ if (!GLEW_##_name) { \ SCHRO_ERROR ("missing essential extension GL_" #_name); \ ok = FALSE; \ } #define CHECK_EXTENSION_GROUPS(_group1, _group2, _name) \ if (!GLEW_##_group1##_##_name && !GLEW_##_group2##_##_name) { \ SCHRO_ERROR ("missing essential extension GL_{" #_group1 "|" #_group2 "}_" #_name); \ ok = FALSE; \ } CHECK_EXTENSION (EXT_framebuffer_object) CHECK_EXTENSION_GROUPS (ARB, NV, texture_rectangle) CHECK_EXTENSION (ARB_multitexture) CHECK_EXTENSION (ARB_shader_objects) CHECK_EXTENSION (ARB_shading_language_100) CHECK_EXTENSION (ARB_fragment_shader) #undef CHECK_EXTENSION #undef CHECK_EXTENSION_GROUPS if (ok) { /*glGetIntegerv (GL_MAX_TEXTURE_UNITS_ARB, &texture_units); if (texture_units < REQUIRED_TEXTURE_UNITS) { SCHRO_ERROR ("GL_MAX_TEXTURE_UNITS_ARB >= %i required, have %i", REQUIRED_TEXTURE_UNITS, texture_units); ok = FALSE; }*/ } schro_opengl_unlock (opengl); return ok; } void schro_opengl_init (void) { XInitThreads (); } SchroOpenGL * schro_opengl_new (void) { SchroOpenGL *opengl = schro_malloc0 (sizeof (SchroOpenGL)); opengl->is_usable = TRUE; opengl->is_visible = FALSE; opengl->lock_count = 0; opengl->display = NULL; opengl->root = None; opengl->screen = 0; opengl->visual_info = NULL; opengl->context = NULL; opengl->window = None; opengl->tmp = NULL; opengl->tmp_size = 0; opengl->shader_library = NULL; opengl->canvas_pool = NULL; opengl->obmc_weight_canvas = NULL; opengl->mutex = schro_mutex_new (); if (!schro_opengl_open_display (opengl, NULL)) { opengl->is_usable = FALSE; return opengl; } if (!schro_opengl_create_window (opengl)) { opengl->is_usable = FALSE; return opengl; } if (!schro_opengl_init_glew (opengl)) { opengl->is_usable = FALSE; return opengl; } if (!schro_opengl_check_essential_extensions (opengl)) { opengl->is_usable = FALSE; return opengl; } opengl->shader_library = schro_opengl_shader_library_new (opengl); opengl->canvas_pool = schro_opengl_canvas_pool_new (opengl); schro_opengl_canvas_check_flags (); opengl->obmc_weight_canvas = schro_opengl_canvas_new (opengl, SCHRO_FRAME_FORMAT_S16_444, 32, 32); schro_opengl_lock (opengl); glMatrixMode (GL_MODELVIEW); glLoadIdentity (); glMatrixMode (GL_PROJECTION); glLoadIdentity (); glEnable (GL_TEXTURE_RECTANGLE_ARB); schro_opengl_unlock (opengl); //schro_opengl_set_visible (opengl, TRUE); return opengl; } void schro_opengl_free (SchroOpenGL *opengl) { SCHRO_ASSERT (opengl->lock_count == 0); if (opengl->shader_library) { schro_opengl_shader_library_free (opengl->shader_library); opengl->shader_library = NULL; } if (opengl->obmc_weight_canvas) { schro_opengl_canvas_free (opengl->obmc_weight_canvas); opengl->obmc_weight_canvas = NULL; } SCHRO_ASSERT (opengl->lock_count == 0); if (opengl->canvas_pool) { schro_opengl_canvas_pool_free (opengl->canvas_pool); opengl->canvas_pool = NULL; } schro_opengl_destroy_window (opengl); schro_opengl_close_display (opengl); if (opengl->tmp) { schro_free (opengl->tmp); opengl->tmp = NULL; } schro_mutex_free (opengl->mutex); schro_free (opengl); } int schro_opengl_is_usable (SchroOpenGL *opengl) { return opengl->is_usable; } void schro_opengl_lock (SchroOpenGL *opengl) { SCHRO_ASSERT (opengl->display != NULL); SCHRO_ASSERT (opengl->window != None); SCHRO_ASSERT (opengl->context != NULL); SCHRO_ASSERT (opengl->lock_count < (INT_MAX - 1)); schro_mutex_lock (opengl->mutex); if (opengl->lock_count == 0) { XLockDisplay (opengl->display); if (!glXMakeCurrent (opengl->display, opengl->window, opengl->context)) { SCHRO_ERROR ("glXMakeCurrent failed"); } XUnlockDisplay (opengl->display); } ++opengl->lock_count; SCHRO_OPENGL_CHECK_ERROR } void schro_opengl_unlock (SchroOpenGL *opengl) { #if SCHRO_OPENGL_UNBIND_TEXTURES int i; GLint texture; #endif GLint framebuffer; SCHRO_ASSERT (opengl->display != NULL); SCHRO_ASSERT (opengl->lock_count > 0); SCHRO_OPENGL_CHECK_ERROR --opengl->lock_count; if (opengl->lock_count == 0) { #if SCHRO_OPENGL_UNBIND_TEXTURES for (i = 0; i < REQUIRED_TEXTURE_UNITS; ++i) { glActiveTextureARB (GL_TEXTURE0_ARB + i); glGetIntegerv (GL_TEXTURE_BINDING_RECTANGLE_ARB, &texture); SCHRO_ASSERT (!glIsTexture (texture)); SCHRO_ASSERT (texture == 0); } glActiveTextureARB (GL_TEXTURE0_ARB); #endif glGetIntegerv (GL_FRAMEBUFFER_BINDING_EXT, &framebuffer); SCHRO_ASSERT (!glIsFramebufferEXT (framebuffer)); SCHRO_ASSERT (framebuffer == 0); if (GLEW_EXT_framebuffer_blit) { glGetIntegerv (GL_READ_FRAMEBUFFER_BINDING_EXT, &framebuffer); SCHRO_ASSERT (!glIsFramebufferEXT (framebuffer)); SCHRO_ASSERT (framebuffer == 0); glGetIntegerv (GL_DRAW_FRAMEBUFFER_BINDING_EXT, &framebuffer); SCHRO_ASSERT (!glIsFramebufferEXT (framebuffer)); SCHRO_ASSERT (framebuffer == 0); } XLockDisplay (opengl->display); if (!glXMakeCurrent (opengl->display, None, NULL)) { SCHRO_ERROR ("glXMakeCurrent failed"); } XUnlockDisplay (opengl->display); } schro_mutex_unlock (opengl->mutex); } void schro_opengl_check_error (const char* file, int line, const char* func) { GLenum error = glGetError (); if (error) { SCHRO_ERROR ("GL Error 0x%04x in %s(%d) %s", (int) error, file, line, func); //SCHRO_ASSERT (0); } } void schro_opengl_check_framebuffer (const char *file, int line, const char *func) { switch (glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT)) { case GL_FRAMEBUFFER_COMPLETE_EXT: break; case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT: SCHRO_ERROR ("GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT in %s(%d) %s", file, line, func); break; case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT: SCHRO_ERROR ("GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT in " "%s(%d) %s", file, line, func); break; case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT: SCHRO_ERROR ("GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT in %s(%d) %s", file, line, func); break; case GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT: SCHRO_ERROR ("GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT in %s(%d) %s", file, line, func); break; case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT: SCHRO_ERROR ("GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT in %s(%d) %s", file, line, func); break; case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT: SCHRO_ERROR ("GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT in %s(%d) %s", file, line, func); break; case GL_FRAMEBUFFER_UNSUPPORTED_EXT: SCHRO_ERROR ("GL_FRAMEBUFFER_UNSUPPORTED_EXT in %s(%d)", file, line, func); break; default: SCHRO_ERROR ("unknown error from glCheckFramebufferStatusEXT in " "%s(%d) %s", file, line, func); break; } } void schro_opengl_set_visible (SchroOpenGL *opengl, int visible) { if (opengl->is_visible == visible) { return; } opengl->is_visible = visible; if (opengl->is_visible) { XMapWindow (opengl->display, opengl->window); } else { XUnmapWindow (opengl->display, opengl->window); } XSync (opengl->display, FALSE); } void schro_opengl_setup_viewport (int width, int height) { glViewport (0, 0, width, height); glLoadIdentity (); glOrtho (0, width, 0, height, -1, 1); } void schro_opengl_render_quad (int x, int y, int width, int height) { glBegin (GL_QUADS); glTexCoord2f (x, y); glVertex3f (x, y, 0); glTexCoord2f (x + width, y); glVertex3f (x + width, y, 0); glTexCoord2f (x + width, y + height); glVertex3f (x + width, y + height, 0); glTexCoord2f (x, y + height); glVertex3f (x, y + height, 0); glEnd (); } SchroOpenGLShaderLibrary * schro_opengl_get_shader_library (SchroOpenGL *opengl) { return opengl->shader_library; } void * schro_opengl_get_tmp (SchroOpenGL *opengl, int size) { SCHRO_ASSERT (size > 0); if (opengl->tmp_size < size || !opengl->tmp) { opengl->tmp_size = size; if (!opengl->tmp) { opengl->tmp = schro_malloc (opengl->tmp_size); } else { opengl->tmp = schro_realloc (opengl->tmp, opengl->tmp_size); } } return opengl->tmp; } SchroOpenGLCanvas * schro_opengl_get_obmc_weight_canvas (SchroOpenGL *opengl, int width, int height) { if (width > opengl->obmc_weight_canvas->width || height > opengl->obmc_weight_canvas->height) { schro_opengl_canvas_free (opengl->obmc_weight_canvas); opengl->obmc_weight_canvas = schro_opengl_canvas_new (opengl, SCHRO_FRAME_FORMAT_S16_444, MAX (width, 64), MAX (height, 64)); } return opengl->obmc_weight_canvas; } SchroOpenGLCanvasPool * schro_opengl_get_canvas_pool (SchroOpenGL *opengl) { return opengl->canvas_pool; } static void * schro_opengl_domain_alloc (int size) { return schro_malloc0 (size); } static void schro_opengl_domain_free (void *ptr, int size) { schro_free (ptr); } SchroMemoryDomain * schro_memory_domain_new_opengl (void) { SchroMemoryDomain *domain; domain = schro_memory_domain_new (); domain->flags = SCHRO_MEMORY_DOMAIN_OPENGL; domain->alloc = schro_opengl_domain_alloc; domain->free = schro_opengl_domain_free; return domain; } schroedinger-1.0.11/schroedinger/schrodomain.h0000644000175000017500000000243611320232176016324 00000000000000 #ifndef _SCHRO_DOMAIN_H_ #define _SCHRO_DOMAIN_H_ #include typedef struct _SchroMemoryDomain SchroMemoryDomain; #ifdef SCHRO_ENABLE_UNSTABLE_API #define SCHRO_MEMORY_DOMAIN_SLOTS 1000 struct _SchroMemoryDomain { SchroMutex * mutex; unsigned int flags; void *(*alloc) (int size); void *(*alloc_2d) (int depth, int width, int height); void (*free) (void *ptr, int size); struct { unsigned int flags; void *ptr; int size; void *priv; } slots[SCHRO_MEMORY_DOMAIN_SLOTS]; }; #define SCHRO_EXEC_DOMAIN_CPU 0x0001 #define SCHRO_EXEC_DOMAIN_CUDA 0x0002 #define SCHRO_EXEC_DOMAIN_OPENGL 0x0003 #define SCHRO_MEMORY_DOMAIN_CPU 0x0001 #define SCHRO_MEMORY_DOMAIN_CUDA 0x0002 #define SCHRO_MEMORY_DOMAIN_OPENGL 0x0004 #define SCHRO_MEMORY_DOMAIN_SLOT_ALLOCATED 0x0001 #define SCHRO_MEMORY_DOMAIN_SLOT_IN_USE 0x0002 SchroMemoryDomain * schro_memory_domain_new (void); SchroMemoryDomain * schro_memory_domain_new_local (void); void schro_memory_domain_free (SchroMemoryDomain *domain); void * schro_memory_domain_alloc (SchroMemoryDomain *domain, int size); void * schro_memory_domain_alloc_2d (SchroMemoryDomain *domain, int depth, int width, int height); void schro_memory_domain_memfree (SchroMemoryDomain *domain, void *ptr); #endif #endif schroedinger-1.0.11/schroedinger/schroasync-gthread.c0000644000175000017500000002051011541755167017611 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #include #include #ifdef __APPLE__ #include #endif struct _SchroAsync { int n_threads; int n_threads_running; int n_idle; enum { RUNNING = 0, STOP, DIE } stop; volatile int n_completed; GMutex *mutex; GCond *app_cond; GCond *thread_cond; SchroThread *threads; SchroAsyncTask task; SchroAsyncScheduleFunc schedule; void *schedule_closure; SchroAsyncCompleteFunc complete; }; struct _SchroThread { GThread *thread; SchroExecDomain exec_domain; SchroAsync *async; int busy; int index; }; static int domain_key_inited; static GPrivate *domain_key; static void *schro_thread_main (void *ptr); void schro_async_init (void) { if (!g_thread_supported ()) g_thread_init (NULL); } SchroAsync * schro_async_new (int n_threads, SchroAsyncScheduleFunc schedule, SchroAsyncCompleteFunc complete, void *closure) { SchroAsync *async; int i; if (n_threads == 0) { char *s; s = getenv ("SCHRO_THREADS"); if (s && s[0]) { char *end; int n; n = strtoul (s, &end, 0); if (end[0] == 0) { n_threads = n; } } if (n_threads == 0) { #if defined(_WIN32) const char *s = getenv ("NUMBER_OF_PROCESSORS"); if (s) { n_threads = atoi (s); } #elif defined(__APPLE__) { int mib[] = { CTL_HW, HW_NCPU }; size_t dataSize = sizeof (int); if (sysctl (mib, 2, &n_threads, &dataSize, NULL, 0)) { n_threads = 0; } } #else n_threads = sysconf (_SC_NPROCESSORS_CONF); #endif } if (n_threads == 0) { n_threads = 1; } } async = schro_malloc0 (sizeof (SchroAsync)); SCHRO_DEBUG ("%d", n_threads); async->n_threads = n_threads; async->threads = schro_malloc0 (sizeof (SchroThread) * (n_threads + 1)); async->stop = RUNNING; async->schedule = schedule; async->schedule_closure = closure; async->complete = complete; async->mutex = g_mutex_new (); async->app_cond = g_cond_new (); async->thread_cond = g_cond_new (); if (!domain_key_inited) { domain_key = g_private_new (NULL); domain_key_inited = TRUE; } g_mutex_lock (async->mutex); for (i = 0; i < n_threads; i++) { SchroThread *thread = async->threads + i; GError *error = NULL; thread->async = async; thread->index = i; thread->exec_domain = SCHRO_EXEC_DOMAIN_CPU; async->threads[i].thread = g_thread_create (schro_thread_main, async->threads + i, TRUE, &error); g_mutex_lock (async->mutex); } g_mutex_unlock (async->mutex); return async; } void schro_async_free (SchroAsync * async) { int i; g_mutex_lock (async->mutex); async->stop = DIE; while (async->n_threads_running > 0) { g_cond_signal (async->thread_cond); g_cond_wait (async->app_cond, async->mutex); } g_mutex_unlock (async->mutex); for (i = 0; i < async->n_threads; i++) { g_thread_join (async->threads[i].thread); } g_mutex_free (async->mutex); g_cond_free (async->app_cond); g_cond_free (async->thread_cond); schro_free (async->threads); schro_free (async); } void schro_async_start (SchroAsync * async) { async->stop = RUNNING; g_cond_broadcast (async->thread_cond); } void schro_async_stop (SchroAsync * async) { async->stop = STOP; g_mutex_lock (async->mutex); while (async->n_idle < async->n_threads_running) { g_cond_wait (async->app_cond, async->mutex); } g_mutex_unlock (async->mutex); } void schro_async_run_stage_locked (SchroAsync * async, SchroAsyncStage * stage) { SCHRO_ASSERT (async->task.task_func == NULL); async->task.task_func = stage->task_func; async->task.priv = stage; g_cond_signal (async->thread_cond); } static void schro_async_dump (SchroAsync * async) { int i; SCHRO_WARNING ("stop = %d", async->stop); for (i = 0; i < async->n_threads; i++) { SchroThread *thread = async->threads + i; SCHRO_WARNING ("thread %d: busy=%d", i, thread->busy); } } int schro_async_wait_locked (SchroAsync * async) { GTimeVal ts; int ret; g_get_current_time (&ts); g_time_val_add (&ts, 1000000); ret = g_cond_timed_wait (async->app_cond, async->mutex, &ts); if (!ret) { int i; for (i = 0; i < async->n_threads; i++) { if (async->threads[i].busy != 0) break; } if (i == async->n_threads) { SCHRO_WARNING ("timeout. deadlock?"); schro_async_dump (async); return FALSE; } } return TRUE; } static void * schro_thread_main (void *ptr) { void (*func) (void *); void *priv; SchroThread *thread = ptr; SchroAsync *async = thread->async; int ret; /* thread starts with async->mutex locked */ g_private_set (domain_key, (void *) (unsigned long) thread->exec_domain); async->n_threads_running++; thread->busy = FALSE; while (1) { /* check for deaths each time */ if (async->stop != RUNNING) { async->n_idle++; thread->busy = FALSE; g_cond_signal (async->app_cond); if (async->stop == DIE) { async->n_threads_running--; g_mutex_unlock (async->mutex); SCHRO_DEBUG ("thread %d: dying", thread->index); return NULL; } SCHRO_DEBUG ("thread %d: stopping (until restarted)", thread->index); g_cond_wait (async->thread_cond, async->mutex); SCHRO_DEBUG ("thread %d: resuming", thread->index); async->n_idle--; continue; } if (thread->busy == 0) { async->n_idle++; SCHRO_DEBUG ("thread %d: idle", thread->index); g_cond_wait (async->thread_cond, async->mutex); SCHRO_DEBUG ("thread %d: got signal", thread->index); async->n_idle--; thread->busy = TRUE; /* check for stop requests before doing work */ continue; } if (1) { /* avoiding indent change */ ret = async->schedule (async->schedule_closure, thread->exec_domain); /* FIXME ignoring ret */ if (!async->task.task_func) { thread->busy = FALSE; continue; } thread->busy = TRUE; func = async->task.task_func; priv = async->task.priv; async->task.task_func = NULL; if (async->n_idle > 0) { g_cond_signal (async->thread_cond); } g_mutex_unlock (async->mutex); SCHRO_DEBUG ("thread %d: running", thread->index); func (priv); SCHRO_DEBUG ("thread %d: done", thread->index); g_mutex_lock (async->mutex); async->complete (priv); g_cond_signal (async->app_cond); #if defined HAVE_CUDA || defined HAVE_OPENGL /* FIXME */ /* This is required because we don't have a better mechanism * for indicating to threads in other exec domains that it is * their turn to run. It's mostly harmless, although causes * a lot of unnecessary wakeups in some cases. */ g_cond_broadcast (async->thread_cond); #endif } } } void schro_async_lock (SchroAsync * async) { g_mutex_lock (async->mutex); } void schro_async_unlock (SchroAsync * async) { g_mutex_unlock (async->mutex); } void schro_async_signal_scheduler (SchroAsync * async) { g_cond_broadcast (async->thread_cond); } void schro_async_add_exec_domain (SchroAsync * async, SchroExecDomain exec_domain) { SchroThread *thread; int i; GError *error = NULL; g_mutex_lock (async->mutex); /* We allocated a spare thread structure just for this case. */ async->n_threads++; i = async->n_threads - 1; thread = async->threads + i; memset (thread, 0, sizeof (SchroThread)); thread->async = async; thread->index = i; thread->exec_domain = exec_domain; async->threads[i].thread = g_thread_create (schro_thread_main, async->threads + i, TRUE, &error); g_mutex_lock (async->mutex); g_mutex_unlock (async->mutex); } SchroExecDomain schro_async_get_exec_domain (void) { void *domain; domain = g_private_get (domain_key); return (int) (unsigned long) domain; } SchroMutex * schro_mutex_new (void) { return (SchroMutex *) g_mutex_new (); } void schro_mutex_lock (SchroMutex * mutex) { g_mutex_lock ((GMutex *) mutex); } void schro_mutex_unlock (SchroMutex * mutex) { g_mutex_unlock ((GMutex *) mutex); } void schro_mutex_free (SchroMutex * mutex) { g_mutex_free ((GMutex *) mutex); } schroedinger-1.0.11/schroedinger/schroasync-pthread.c0000644000175000017500000002247211702127232017614 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif /* required for recursive mutex (ugh) */ #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #ifdef __APPLE__ #include #endif struct _SchroAsync { int n_threads; int n_threads_running; int n_idle; enum { RUNNING = 0, STOP, DIE } stop; volatile int n_completed; pthread_mutex_t mutex; pthread_cond_t app_cond; pthread_cond_t thread_cond; SchroThread *threads; SchroAsyncTask task; SchroAsyncScheduleFunc schedule; void *schedule_closure; SchroAsyncCompleteFunc complete; }; struct _SchroThread { pthread_t pthread; SchroExecDomain exec_domain; SchroAsync *async; int busy; int index; }; struct _SchroMutex { pthread_mutex_t mutex; }; static int domain_key_inited; static pthread_key_t domain_key; static void *schro_thread_main (void *ptr); void schro_async_init (void) { } SchroAsync * schro_async_new (int n_threads, SchroAsyncScheduleFunc schedule, SchroAsyncCompleteFunc complete, void *closure) { SchroAsync *async; pthread_attr_t attr; pthread_mutexattr_t mutexattr; pthread_condattr_t condattr; int i; if (n_threads == 0) { char *s; s = getenv ("SCHRO_THREADS"); if (s && s[0]) { char *end; int n; n = strtoul (s, &end, 0); if (end[0] == 0) { n_threads = n; } } if (n_threads == 0) { #if defined(_WIN32) const char *s = getenv ("NUMBER_OF_PROCESSORS"); if (s) { n_threads = atoi (s); } #elif defined(__APPLE__) { int mib[] = { CTL_HW, HW_NCPU }; size_t dataSize = sizeof (int); if (sysctl (mib, 2, &n_threads, &dataSize, NULL, 0)) { n_threads = 0; } } #else n_threads = sysconf (_SC_NPROCESSORS_CONF); #endif } if (n_threads == 0) { n_threads = 1; } } async = schro_malloc0 (sizeof (SchroAsync)); SCHRO_DEBUG ("%d", n_threads); async->n_threads = n_threads; async->threads = schro_malloc0 (sizeof (SchroThread) * (n_threads + 1)); async->stop = RUNNING; async->schedule = schedule; async->schedule_closure = closure; async->complete = complete; pthread_mutexattr_init (&mutexattr); pthread_mutex_init (&async->mutex, &mutexattr); pthread_condattr_init (&condattr); pthread_cond_init (&async->app_cond, &condattr); pthread_cond_init (&async->thread_cond, &condattr); if (!domain_key_inited) { pthread_key_create (&domain_key, NULL); domain_key_inited = TRUE; } pthread_attr_init (&attr); pthread_mutex_lock (&async->mutex); for (i = 0; i < n_threads; i++) { SchroThread *thread = async->threads + i; thread->async = async; thread->index = i; thread->exec_domain = SCHRO_EXEC_DOMAIN_CPU; pthread_create (&async->threads[i].pthread, &attr, schro_thread_main, async->threads + i); pthread_mutex_lock (&async->mutex); } pthread_mutex_unlock (&async->mutex); pthread_attr_destroy (&attr); pthread_mutexattr_destroy (&mutexattr); pthread_condattr_destroy (&condattr); return async; } void schro_async_free (SchroAsync * async) { int i; pthread_mutex_lock (&async->mutex); async->stop = DIE; while (async->n_threads_running > 0) { pthread_cond_signal (&async->thread_cond); pthread_cond_wait (&async->app_cond, &async->mutex); } pthread_mutex_unlock (&async->mutex); for (i = 0; i < async->n_threads; i++) { void *ignore; pthread_join (async->threads[i].pthread, &ignore); } schro_free (async->threads); schro_free (async); } void schro_async_start (SchroAsync * async) { async->stop = RUNNING; pthread_cond_broadcast (&async->thread_cond); } void schro_async_stop (SchroAsync * async) { async->stop = STOP; pthread_mutex_lock (&async->mutex); while (async->n_idle < async->n_threads_running) { pthread_cond_wait (&async->app_cond, &async->mutex); } pthread_mutex_unlock (&async->mutex); } void schro_async_run_stage_locked (SchroAsync * async, SchroAsyncStage * stage) { SCHRO_ASSERT (async->task.task_func == NULL); async->task.task_func = stage->task_func; async->task.priv = stage; schro_async_signal_scheduler (async); } static void schro_async_dump (SchroAsync * async) { int i; SCHRO_WARNING ("stop = %d", async->stop); for (i = 0; i < async->n_threads; i++) { SchroThread *thread = async->threads + i; SCHRO_WARNING ("thread %d: busy=%d", i, thread->busy); } } int schro_async_wait_locked (SchroAsync * async) { struct timespec ts; int ret; #ifdef HAVE_CLOCK_GETTIME clock_gettime (CLOCK_REALTIME, &ts); #else { struct timeval tv; gettimeofday (&tv, NULL); ts.tv_sec = tv.tv_sec; ts.tv_nsec = tv.tv_usec * 1000; } #endif ts.tv_sec += 1; ret = pthread_cond_timedwait (&async->app_cond, &async->mutex, &ts); if (ret != 0) { int i; for (i = 0; i < async->n_threads; i++) { if (async->threads[i].busy != 0) break; } if (i == async->n_threads) { SCHRO_WARNING ("timeout. deadlock?"); schro_async_dump (async); return FALSE; } } return TRUE; } static void * schro_thread_main (void *ptr) { void (*func) (void *); void *priv; SchroThread *thread = ptr; SchroAsync *async = thread->async; /* thread starts with async->mutex locked */ pthread_setspecific (domain_key, (void *) (unsigned long) thread->exec_domain); async->n_threads_running++; thread->busy = FALSE; while (1) { /* check for deaths each time */ if (async->stop != RUNNING) { async->n_idle++; thread->busy = FALSE; pthread_cond_signal (&async->app_cond); if (async->stop == DIE) { async->n_threads_running--; pthread_mutex_unlock (&async->mutex); SCHRO_DEBUG ("thread %d: dying", thread->index); return NULL; } SCHRO_DEBUG ("thread %d: stopping (until restarted)", thread->index); pthread_cond_wait (&async->thread_cond, &async->mutex); SCHRO_DEBUG ("thread %d: resuming", thread->index); async->n_idle--; continue; } if (thread->busy == 0) { async->n_idle++; SCHRO_DEBUG ("thread %d: idle", thread->index); pthread_cond_wait (&async->thread_cond, &async->mutex); SCHRO_DEBUG ("thread %d: got signal", thread->index); async->n_idle--; thread->busy = TRUE; /* check for stop requests before doing work */ continue; } if (1) { /* avoiding indent change */ async->schedule (async->schedule_closure, thread->exec_domain); /* FIXME ignoring ret */ if (!async->task.task_func) { thread->busy = FALSE; continue; } thread->busy = TRUE; func = async->task.task_func; priv = async->task.priv; async->task.task_func = NULL; if (async->n_idle > 0) { pthread_cond_signal (&async->thread_cond); } pthread_mutex_unlock (&async->mutex); SCHRO_DEBUG ("thread %d: running", thread->index); func (priv); SCHRO_DEBUG ("thread %d: done", thread->index); pthread_mutex_lock (&async->mutex); async->complete (priv); pthread_cond_signal (&async->app_cond); #if defined HAVE_CUDA || defined HAVE_OPENGL /* FIXME */ /* This is required because we don't have a better mechanism * for indicating to threads in other exec domains that it is * their turn to run. It's mostly harmless, although causes * a lot of unnecessary wakeups in some cases. */ pthread_cond_broadcast (&async->thread_cond); #endif } } } void schro_async_lock (SchroAsync * async) { pthread_mutex_lock (&async->mutex); } void schro_async_unlock (SchroAsync * async) { pthread_mutex_unlock (&async->mutex); } void schro_async_signal_scheduler (SchroAsync * async) { pthread_cond_broadcast (&async->thread_cond); } void schro_async_add_exec_domain (SchroAsync * async, SchroExecDomain exec_domain) { SchroThread *thread; int i; pthread_attr_t attr; pthread_mutex_lock (&async->mutex); /* We allocated a spare thread structure just for this case. */ async->n_threads++; i = async->n_threads - 1; thread = async->threads + i; memset (thread, 0, sizeof (SchroThread)); pthread_attr_init (&attr); thread->async = async; thread->index = i; thread->exec_domain = exec_domain; pthread_create (&async->threads[i].pthread, &attr, schro_thread_main, async->threads + i); pthread_mutex_lock (&async->mutex); pthread_mutex_unlock (&async->mutex); pthread_attr_destroy (&attr); } SchroExecDomain schro_async_get_exec_domain (void) { void *domain; domain = pthread_getspecific (domain_key); return (int) (unsigned long) domain; } SchroMutex * schro_mutex_new (void) { SchroMutex *mutex; pthread_mutexattr_t mutexattr; mutex = schro_malloc (sizeof (SchroMutex)); pthread_mutexattr_init (&mutexattr); pthread_mutex_init (&mutex->mutex, &mutexattr); pthread_mutexattr_destroy (&mutexattr); return mutex; } void schro_mutex_lock (SchroMutex * mutex) { pthread_mutex_lock (&mutex->mutex); } void schro_mutex_unlock (SchroMutex * mutex) { pthread_mutex_unlock (&mutex->mutex); } void schro_mutex_free (SchroMutex * mutex) { pthread_mutex_destroy (&mutex->mutex); schro_free (mutex); } schroedinger-1.0.11/schroedinger/schroparse.c0000644000175000017500000002652611541755167016207 00000000000000 #include "config.h" #include #include #include #include int schro_parse_decode_sequence_header (uint8_t * data, int length, SchroVideoFormat * format) { int bit; int index; SchroUnpack u; SchroUnpack *unpack = &u; int major_version, minor_version; int profile, level; SCHRO_DEBUG ("decoding sequence header"); schro_unpack_init_with_data (unpack, data, length, 1); /* parse parameters */ major_version = schro_unpack_decode_uint (unpack); SCHRO_DEBUG ("major_version = %d", major_version); minor_version = schro_unpack_decode_uint (unpack); SCHRO_DEBUG ("minor_version = %d", minor_version); profile = schro_unpack_decode_uint (unpack); SCHRO_DEBUG ("profile = %d", profile); level = schro_unpack_decode_uint (unpack); SCHRO_DEBUG ("level = %d", level); #if 0 if (!schro_decoder_check_version (major_version, minor_version)) { SCHRO_WARNING ("Stream version number %d:%d not handled, expecting 0:20071203, 1:0, 2:0, or 2:1", major_version, minor_version); } #endif if (profile != 0 || level != 0) { SCHRO_WARNING ("Expecting profile/level 0:0, got %d:%d", profile, level); } /* base video format */ index = schro_unpack_decode_uint (unpack); schro_video_format_set_std_video_format (format, index); /* source parameters */ /* frame dimensions */ bit = schro_unpack_decode_bit (unpack); if (bit) { format->width = schro_unpack_decode_uint (unpack); format->height = schro_unpack_decode_uint (unpack); } SCHRO_DEBUG ("size = %d x %d", format->width, format->height); /* chroma format */ bit = schro_unpack_decode_bit (unpack); if (bit) { format->chroma_format = schro_unpack_decode_uint (unpack); } SCHRO_DEBUG ("chroma_format %d", format->chroma_format); /* scan format */ bit = schro_unpack_decode_bit (unpack); if (bit) { format->interlaced = schro_unpack_decode_uint (unpack); } SCHRO_DEBUG ("interlaced %d top_field_first %d", format->interlaced, format->top_field_first); /* frame rate */ bit = schro_unpack_decode_bit (unpack); if (bit) { index = schro_unpack_decode_uint (unpack); if (index == 0) { format->frame_rate_numerator = schro_unpack_decode_uint (unpack); format->frame_rate_denominator = schro_unpack_decode_uint (unpack); } else { schro_video_format_set_std_frame_rate (format, index); } } SCHRO_DEBUG ("frame rate %d/%d", format->frame_rate_numerator, format->frame_rate_denominator); /* aspect ratio */ bit = schro_unpack_decode_bit (unpack); if (bit) { index = schro_unpack_decode_uint (unpack); if (index == 0) { format->aspect_ratio_numerator = schro_unpack_decode_uint (unpack); format->aspect_ratio_denominator = schro_unpack_decode_uint (unpack); } else { schro_video_format_set_std_aspect_ratio (format, index); } } SCHRO_DEBUG ("aspect ratio %d/%d", format->aspect_ratio_numerator, format->aspect_ratio_denominator); /* clean area */ bit = schro_unpack_decode_bit (unpack); if (bit) { format->clean_width = schro_unpack_decode_uint (unpack); format->clean_height = schro_unpack_decode_uint (unpack); format->left_offset = schro_unpack_decode_uint (unpack); format->top_offset = schro_unpack_decode_uint (unpack); } SCHRO_DEBUG ("clean offset %d %d", format->left_offset, format->top_offset); SCHRO_DEBUG ("clean size %d %d", format->clean_width, format->clean_height); /* signal range */ bit = schro_unpack_decode_bit (unpack); if (bit) { index = schro_unpack_decode_uint (unpack); if (index == 0) { format->luma_offset = schro_unpack_decode_uint (unpack); format->luma_excursion = schro_unpack_decode_uint (unpack); format->chroma_offset = schro_unpack_decode_uint (unpack); format->chroma_excursion = schro_unpack_decode_uint (unpack); } else { if (index <= SCHRO_SIGNAL_RANGE_12BIT_VIDEO) { schro_video_format_set_std_signal_range (format, index); } else { SCHRO_DEBUG ("signal range index %d out of range", index); return FALSE; } } } SCHRO_DEBUG ("luma offset %d excursion %d", format->luma_offset, format->luma_excursion); SCHRO_DEBUG ("chroma offset %d excursion %d", format->chroma_offset, format->chroma_excursion); /* colour spec */ bit = schro_unpack_decode_bit (unpack); if (bit) { index = schro_unpack_decode_uint (unpack); if (index <= SCHRO_COLOUR_SPEC_CINEMA) { schro_video_format_set_std_colour_spec (format, index); } else { SCHRO_DEBUG ("colour spec index %d out of range", index); return FALSE; } if (index == 0) { /* colour primaries */ bit = schro_unpack_decode_bit (unpack); if (bit) { format->colour_primaries = schro_unpack_decode_uint (unpack); } /* colour matrix */ bit = schro_unpack_decode_bit (unpack); if (bit) { format->colour_matrix = schro_unpack_decode_uint (unpack); } /* transfer function */ bit = schro_unpack_decode_bit (unpack); if (bit) { format->transfer_function = schro_unpack_decode_uint (unpack); } } } format->interlaced_coding = schro_unpack_decode_uint (unpack); schro_video_format_validate (format); return TRUE; } typedef struct parse_info { uint32_t next_parse_offset; uint32_t prev_parse_offset; uint_least8_t parse_code; } parse_info_t; /** * schro_parse_decode_parseinfo: * * decodes a parse info structure aligned at the start of *@data@, * of maximal length @length@, storing the results in *@pi@. * * Returns 0 if decoding is unsuccessful; 1 on success */ static int schro_parse_decode_parseinfo (uint8_t * data, unsigned length, parse_info_t * pi) { if (length < 13) { return 0; } if (data[0] != 'B' || data[1] != 'B' || data[2] != 'C' || data[3] != 'D') { return 0; } pi->parse_code = data[4]; pi->next_parse_offset = data[5] << 24 | data[6] << 16 | data[7] << 8 | data[8]; pi->prev_parse_offset = data[9] << 24 | data[10] << 16 | data[11] << 8 | data[12]; return 1; } struct _SchroParseSyncState { /* */ int sync_state; unsigned offset; uint32_t last_npo; int done_special_startup; }; enum { NOT_SYNCED = 0, TRY_SYNC, SYNCED, SYNCED_INCOMPLETEDU, }; /** * schro_parse_sync_new: * * returns: NULL or pointer to allocated SchroParseSyncState */ SchroParseSyncState * schro_parse_sync_new (void) { return schro_malloc0 (sizeof (SchroParseSyncState)); } /** * schro_parse_sync_free: * * release storage for an allocated SchroParseSyncState */ void schro_parse_sync_free (SchroParseSyncState * sps) { schro_free (sps); } /** * schro_parse_sync: * * Synchronises to and extracts single data units from @buflist@. * Synchronisation state is updated through @sps@. * * Returns: NULL if no data unit may be extracted; or pointer to * SchroBuffer containing a single data unit. */ SchroBuffer * schro_parse_sync (SchroParseSyncState * sps, SchroBufferList * buflist) { uint8_t tmp[13]; const uint8_t *parse_code_prefix = (const uint8_t *) "BBCD"; parse_info_t pu = { 0 }; SchroBuffer *du; do { switch (sps->sync_state) { case NOT_SYNCED:{ /* -> TRY_SYNC | NOT_SYNCED */ /* find start code (offset), stop so as to include a whole PI */ int found = schro_buflist_findbytes (buflist, &sps->offset, parse_code_prefix, 4); /* xxx, worth flushing upto this point, although that is * quite complicated. */ if (!found) { return NULL; } /* protect the case where there isn't a whole parse_info avaliable. * eagerly read parse_info into tmp, it'll be required shortly */ if (!schro_buflist_peekbytes (tmp, 13, buflist, sps->offset)) { return NULL; } while (!sps->done_special_startup && !sps->offset) { uint8_t c; sps->done_special_startup = TRUE; /* special startup case: the very first buffer may consist of a * single data unit, (usually a seqhdr), to aleviate waiting for * two parse_infos to arrive, assume that we are synced IFF the * next_parse_offset <= length(buflist) */ if (!schro_parse_decode_parseinfo (tmp, 13, &pu)) { break; } if (!schro_buflist_peekbytes (&c, 1, buflist, sps->offset + pu.next_parse_offset - 1)) { break; } sps->last_npo = pu.next_parse_offset; sps->sync_state = SYNCED; goto extract; } /* found, fall through */ } case TRY_SYNC:{ /* -> SYNCED | NOT_SYNCED */ parse_info_t pu1; /* tmp is still valid from NOT_SYNCED case */ if (!schro_parse_decode_parseinfo (tmp, 13, &pu1)) { goto try_sync_fail; } /* Check that prev_parse_offset doesn't reference something not yet seen */ if (sps->offset < pu1.prev_parse_offset) { goto try_sync_fail; } /* NB, guaranteed that there are 13 bytes avaliable */ schro_buflist_peekbytes (tmp, 13, buflist, sps->offset - pu1.prev_parse_offset); if (!schro_parse_decode_parseinfo (tmp, 13, &pu)) { goto try_sync_fail; } if (pu1.prev_parse_offset != pu.next_parse_offset) { try_sync_fail: sps->sync_state = NOT_SYNCED; sps->offset++; /* find somewhere else to try again */ break; } sps->last_npo = pu.next_parse_offset; /* offset was pointing at pu1, rewind to point at pu */ sps->offset -= pu.next_parse_offset; sps->sync_state = SYNCED; break; } case SYNCED:{ /* -> SYNCED | SYNCED_INCOMPLETEDU | NOT_SYNCED */ int a; if (schro_buflist_peekbytes (tmp, 13, buflist, sps->offset) < 13) return NULL; a = schro_parse_decode_parseinfo (tmp, 13, &pu); if (!a || (sps->last_npo != pu.prev_parse_offset)) { sps->sync_state = NOT_SYNCED; break; } sps->last_npo = pu.next_parse_offset; sps->sync_state = SYNCED; break; } case SYNCED_INCOMPLETEDU:{ /* -> SYNCED */ /* NB, this is safe -- to get here we must've already read pu * previously, so no need to check that it is ok again */ schro_buflist_peekbytes (tmp, 13, buflist, sps->offset); schro_parse_decode_parseinfo (tmp, 13, &pu); sps->sync_state = SYNCED; /* assume that the DU is complete this time */ break; default: SCHRO_ASSERT (0); } } } while (NOT_SYNCED == sps->sync_state); extract: /* * synced, attempt to extract a data unit */ /* fixup for case where pu.next_parse_offset = 0 (eg, EOS) */ if (!pu.next_parse_offset) { pu.next_parse_offset = 13; } /* flush everything upto the DU */ schro_buflist_flush (buflist, sps->offset); sps->offset = 0; /* try to extract the complete DU */ du = schro_buflist_extract (buflist, 0, pu.next_parse_offset); if (!du) { /* the whole DU isn't in the buffer, try again */ sps->sync_state = SYNCED_INCOMPLETEDU; return NULL; } /* flush everything upto the end of DU */ schro_buflist_flush (buflist, pu.next_parse_offset); return du; } schroedinger-1.0.11/schroedinger/schrovideoformat.c0000644000175000017500000005647511541755167017422 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include /* * schro_video_format_validate: * @format: pointer to a SchroVideoFormat structure * * Checks the video format structure pointed to by @format for * inconsistencies. * * Returns: TRUE if the contents of @format is valid */ int schro_video_format_validate (SchroVideoFormat * format) { int fix_clean_area = 0; if (format->aspect_ratio_numerator == 0) { SCHRO_ERROR ("aspect_ratio_numerator is 0"); format->aspect_ratio_numerator = 1; } if (format->aspect_ratio_denominator == 0) { SCHRO_ERROR ("aspect_ratio_denominator is 0"); format->aspect_ratio_denominator = 1; } if (format->clean_width + format->left_offset > format->width) { SCHRO_ERROR ("10.3.7: horizontal clean area is not legal (clean_width + left_offset > width)"); fix_clean_area = 1; } if (format->clean_height + format->top_offset > format->height) { SCHRO_ERROR ("10.3.7: vertical clean area is not legal (clean_height + top_offset > height)"); fix_clean_area = 1; } if (fix_clean_area) { SCHRO_ERROR ("resetting clean area to frame size"); format->clean_width = format->width; format->clean_height = format->height; format->left_offset = format->top_offset = 0; } if (schro_video_format_get_bit_depth (format) != 8) { SCHRO_WARNING ("video bit depth != 8"); return 0; } return 1; } #ifdef unused int schro_video_format_compare_new_sequence (SchroVideoFormat * a, SchroVideoFormat * b) { if (a->index != b->index || a->width != b->width || a->height != b->height || a->chroma_format != b->chroma_format || a->interlaced != b->interlaced || a->top_field_first != b->top_field_first || a->frame_rate_numerator != b->frame_rate_numerator || a->frame_rate_denominator != b->frame_rate_denominator || a->aspect_ratio_numerator != b->aspect_ratio_numerator || a->aspect_ratio_denominator != b->aspect_ratio_denominator || a->clean_width != b->clean_width || a->clean_height != b->clean_height || a->left_offset != b->left_offset || a->top_offset != b->top_offset || a->luma_offset != b->luma_offset || a->luma_excursion != b->luma_excursion || a->chroma_offset != b->chroma_offset || a->chroma_excursion != b->chroma_excursion || a->colour_primaries != b->colour_primaries || a->colour_matrix != b->colour_matrix || a->transfer_function != b->transfer_function) { return FALSE; } return TRUE; } #endif #ifdef unused int schro_video_format_compare (SchroVideoFormat * a, SchroVideoFormat * b) { if (!schro_video_format_compare_new_sequence (a, b) || a->interlaced_coding != b->interlaced_coding) { return FALSE; } return TRUE; } #endif int schro_video_format_get_bit_depth (SchroVideoFormat * format) { int max; int i; max = MAX (format->chroma_excursion, format->luma_excursion); for (i = 0; i < 32; i++) { if (max < (1 << i)) return i; } return 0; } static SchroVideoFormat schro_video_formats[] = { {0, /* custom */ 640, 480, SCHRO_CHROMA_420, FALSE, FALSE, 24000, 1001, 1, 1, 640, 480, 0, 0, 0, 255, 128, 255, 0, 0, 0}, {1, /* QSIF525 */ 176, 120, SCHRO_CHROMA_420, FALSE, FALSE, 15000, 1001, 10, 11, 176, 120, 0, 0, 0, 255, 128, 255, 1, 1, 0}, {2, /* QCIF */ 176, 144, SCHRO_CHROMA_420, FALSE, TRUE, 25, 2, 12, 11, 176, 144, 0, 0, 0, 255, 128, 255, 2, 1, 0}, {3, /* SIF525 */ 352, 240, SCHRO_CHROMA_420, FALSE, FALSE, 15000, 1001, 10, 11, 352, 240, 0, 0, 0, 255, 128, 255, 1, 1, 0}, {4, /* CIF */ 352, 288, SCHRO_CHROMA_420, FALSE, TRUE, 25, 2, 12, 11, 352, 288, 0, 0, 0, 255, 128, 255, 2, 1, 0}, {5, /* 4SIF525 */ 704, 480, SCHRO_CHROMA_420, FALSE, FALSE, 15000, 1001, 10, 11, 704, 480, 0, 0, 0, 255, 128, 255, 1, 1, 0}, {6, /* 4CIF */ 704, 576, SCHRO_CHROMA_420, FALSE, TRUE, 25, 2, 12, 11, 704, 576, 0, 0, 0, 255, 128, 255, 2, 1, 0}, {7, /* SD480I-60 */ 720, 480, SCHRO_CHROMA_422, TRUE, FALSE, 30000, 1001, 10, 11, 704, 480, 8, 0, 64, 876, 512, 896, 1, 1, 0}, {8, /* SD576I-50 */ 720, 576, SCHRO_CHROMA_422, TRUE, TRUE, 25, 1, 12, 11, 704, 576, 8, 0, 64, 876, 512, 896, 2, 1, 0}, {9, /* HD720P-60 */ 1280, 720, SCHRO_CHROMA_422, FALSE, TRUE, 60000, 1001, 1, 1, 1280, 720, 0, 0, 64, 876, 512, 896, 0, 0, 0}, {10, /* HD720P-50 */ 1280, 720, SCHRO_CHROMA_422, FALSE, TRUE, 50, 1, 1, 1, 1280, 720, 0, 0, 64, 876, 512, 896, 0, 0, 0}, {11, /* HD1080I-60 */ 1920, 1080, SCHRO_CHROMA_422, TRUE, TRUE, 30000, 1001, 1, 1, 1920, 1080, 0, 0, 64, 876, 512, 896, 0, 0, 0}, {12, /* HD1080I-50 */ 1920, 1080, SCHRO_CHROMA_422, TRUE, TRUE, 25, 1, 1, 1, 1920, 1080, 0, 0, 64, 876, 512, 896, 0, 0, 0}, {13, /* HD1080P-60 */ 1920, 1080, SCHRO_CHROMA_422, FALSE, TRUE, 60000, 1001, 1, 1, 1920, 1080, 0, 0, 64, 876, 512, 896, 0, 0, 0}, {14, /* HD1080P-50 */ 1920, 1080, SCHRO_CHROMA_422, FALSE, TRUE, 50, 1, 1, 1, 1920, 1080, 0, 0, 64, 876, 512, 896, 0, 0, 0}, {15, /* DC2K */ 2048, 1080, SCHRO_CHROMA_444, FALSE, TRUE, 24, 1, 1, 1, 2048, 1080, 0, 0, 256, 3504, 2048, 3584, 3, 0, 0}, {16, /* DC4K */ 4096, 2160, SCHRO_CHROMA_444, FALSE, TRUE, 24, 1, 1, 1, 2048, 1536, 0, 0, 256, 3504, 2048, 3584, 3, 0, 0}, {17, /* UHDTV 4K-60 */ 3840, 2160, SCHRO_CHROMA_422, FALSE, TRUE, 60000, 1001, 1, 1, 3840, 2160, 0, 0, 64, 876, 512, 896, 0, 0, 0}, {18, /* UHDTV 4K-50 */ 3840, 2160, SCHRO_CHROMA_422, FALSE, TRUE, 50, 1, 1, 1, 3840, 2160, 0, 0, 64, 876, 512, 896, 0, 0, 0}, {19, /* UHDTV 8K-60 */ 7680, 4320, SCHRO_CHROMA_422, FALSE, TRUE, 60000, 1001, 1, 1, 7680, 4320, 0, 0, 64, 876, 512, 896, 0, 0, 0}, {20, /* UHDTV 8K-50 */ 7680, 4320, SCHRO_CHROMA_422, FALSE, TRUE, 50, 1, 1, 1, 7680, 4320, 0, 0, 64, 876, 512, 896, 0, 0, 0}, }; /** * schro_video_format_set_std_video_format: * @format: * @index: * * Initializes the video format structure pointed to by @format to * the standard Dirac video formats specified by @index. */ void schro_video_format_set_std_video_format (SchroVideoFormat * format, SchroVideoFormatEnum index) { if (index < 0 || index >= ARRAY_SIZE (schro_video_formats)) { SCHRO_ERROR ("illegal video format index"); return; } memcpy (format, schro_video_formats + index, sizeof (SchroVideoFormat)); } static int schro_video_format_get_video_format_metric (SchroVideoFormat * format, int i) { SchroVideoFormat *std_format; int metric = 0; std_format = schro_video_formats + i; /* this is really important because it can't be overrided */ if (format->interlaced && format->top_field_first == std_format->top_field_first) { metric |= 0x8000; } metric += schro_pack_estimate_uint (i); if (std_format->width == format->width && std_format->height == format->height) { metric++; } else { metric++; metric += schro_pack_estimate_uint (format->width); metric += schro_pack_estimate_uint (format->height); } if (std_format->chroma_format == format->chroma_format) { metric++; } else { metric++; metric += schro_pack_estimate_uint (format->chroma_format); } /* scan format */ if (std_format->interlaced == format->interlaced) { metric++; } else { metric++; metric += schro_pack_estimate_uint (format->interlaced); } /* frame rate */ if (std_format->frame_rate_numerator == format->frame_rate_numerator && std_format->frame_rate_denominator == format->frame_rate_denominator) { metric++; } else { metric++; i = schro_video_format_get_std_frame_rate (format); metric += schro_pack_estimate_uint (i); if (i == 0) { metric += schro_pack_estimate_uint (format->frame_rate_numerator); metric += schro_pack_estimate_uint (format->frame_rate_denominator); } } /* pixel aspect ratio */ if (std_format->aspect_ratio_numerator == format->aspect_ratio_numerator && std_format->aspect_ratio_denominator == format->aspect_ratio_denominator) { metric++; } else { metric++; i = schro_video_format_get_std_aspect_ratio (format); metric += schro_pack_estimate_uint (i); if (i == 0) { metric += schro_pack_estimate_uint (format->aspect_ratio_numerator); metric += schro_pack_estimate_uint (format->aspect_ratio_denominator); } } /* clean area */ if (std_format->clean_width == format->clean_width && std_format->clean_height == format->clean_height && std_format->left_offset == format->left_offset && std_format->top_offset == format->top_offset) { metric++; } else { metric++; metric += schro_pack_estimate_uint (format->clean_width); metric += schro_pack_estimate_uint (format->clean_height); metric += schro_pack_estimate_uint (format->left_offset); metric += schro_pack_estimate_uint (format->top_offset); } #if 0 if (format->left_offset == std_format->left_offset && format->top_offset == std_format->top_offset && format->clean_width == std_format->clean_width && format->clean_height == std_format->clean_height) { metric |= 0x40; } #endif return metric; } /** * schro_video_format_get_std_video_format: * @format: pointer to SchroVideoFormat structure * * In Dirac streams, video formats are encoded by specifying a standard * format, and then modifying that to get the desired video format. This * function guesses a standard format to use as a starting point for * encoding the video format pointed to by @format. * * Returns: an index to the optimal standard format */ SchroVideoFormatEnum schro_video_format_get_std_video_format (SchroVideoFormat * format) { int metric; int max_index; int max_metric; int i; max_index = 0; max_metric = schro_video_format_get_video_format_metric (format, 1); for (i = 1; i < ARRAY_SIZE (schro_video_formats); i++) { metric = schro_video_format_get_video_format_metric (format, i); if (metric > max_metric) { max_index = i; max_metric = metric; } } return max_index; } typedef struct _SchroFrameRate SchroFrameRate; struct _SchroFrameRate { int numerator; int denominator; }; static SchroFrameRate schro_frame_rates[] = { {0, 0}, {24000, 1001}, {24, 1}, {25, 1}, {30000, 1001}, {30, 1}, {50, 1}, {60000, 1001}, {60, 1}, {15000, 1001}, {25, 2} }; /** * schro_video_format_set_std_frame_rate: * @format: * @index: * * Sets the frame rate of the video format structure pointed to by * @format to the Dirac standard frame specified by @index. */ void schro_video_format_set_std_frame_rate (SchroVideoFormat * format, int index) { if (index < 1 || index >= ARRAY_SIZE (schro_frame_rates)) { SCHRO_ERROR ("illegal frame rate index"); return; } format->frame_rate_numerator = schro_frame_rates[index].numerator; format->frame_rate_denominator = schro_frame_rates[index].denominator; } /** * schro_video_format_get_std_frame_rate: * @format: * * In Dirac bitstreams, frame rates can be one of several standard * frame rates, encoded as an index, or the numerator and denominator * of the framerate can be encoded directly. This function looks up * the frame rate contained in the video format structure @format in * the list of standard frame rates. If the frame rate is a standard * frame rate, the corresponding index is returned, otherwise 0 is * returned. * * Returns: index to a standard Dirac frame rate, or 0 if the frame rate * is custom. */ int schro_video_format_get_std_frame_rate (SchroVideoFormat * format) { int i; for (i = 1; i < ARRAY_SIZE (schro_frame_rates); i++) { if (format->frame_rate_numerator == schro_frame_rates[i].numerator && format->frame_rate_denominator == schro_frame_rates[i].denominator) { return i; } } return 0; } typedef struct _SchroPixelAspectRatio SchroPixelAspectRatio; struct _SchroPixelAspectRatio { int numerator; int denominator; }; static const SchroPixelAspectRatio schro_aspect_ratios[] = { {0, 0}, {1, 1}, {10, 11}, {12, 11}, {40, 33}, {16, 11}, {4, 3} }; /* * schro_video_format_set_std_aspect_ratio: * @format: pointer to a SchroVideoFormat structure * @index: index to a standard aspect ratio * * Sets the pixel aspect ratio of the video format structure pointed to * by @format to the standard pixel aspect ratio indicated by @index. */ void schro_video_format_set_std_aspect_ratio (SchroVideoFormat * format, int index) { if (index < 1 || index >= ARRAY_SIZE (schro_aspect_ratios)) { SCHRO_ERROR ("illegal pixel aspect ratio index"); return; } format->aspect_ratio_numerator = schro_aspect_ratios[index].numerator; format->aspect_ratio_denominator = schro_aspect_ratios[index].denominator; } /* * schro_video_format_get_std_aspect_ratio: * @format: pointer to a SchroVideoFormat structure * * In Dirac bitstreams, pixel aspect ratios can be one of several standard * pixel aspect ratios, encoded as an index, or the numerator and denominator * of the pixel aspect ratio can be encoded directly. This function looks up * the pixel aspect ratio contained in the video format structure @format in * the list of standard pixel aspect ratios. If the pixel aspect ratio is * a standard pixel aspect ratio, the corresponding index is returned, * otherwise 0 is returned. * * Returns: index to standard pixel aspect ratio, or 0 if there is no * corresponding standard pixel aspect ratio. */ int schro_video_format_get_std_aspect_ratio (SchroVideoFormat * format) { int i; for (i = 1; i < ARRAY_SIZE (schro_aspect_ratios); i++) { if (format->aspect_ratio_numerator == schro_aspect_ratios[i].numerator && format->aspect_ratio_denominator == schro_aspect_ratios[i].denominator) { return i; } } return 0; } typedef struct _SchroSignalRangeStruct SchroSignalRangeStruct; struct _SchroSignalRangeStruct { int luma_offset; int luma_excursion; int chroma_offset; int chroma_excursion; }; static const SchroSignalRangeStruct schro_signal_ranges[] = { {0, 0, 0, 0}, {0, 255, 128, 255}, {16, 219, 128, 224}, {64, 876, 512, 896}, {256, 3504, 2048, 3584} }; /** * schro_video_format_set_std_signal_range: * @format: * @index: * * Sets the signal range of the video format structure to one of the * standard values indicated by @index. */ void schro_video_format_set_std_signal_range (SchroVideoFormat * format, SchroSignalRange i) { if (i < 1 || i >= ARRAY_SIZE (schro_signal_ranges)) { SCHRO_ERROR ("illegal signal range index"); return; } format->luma_offset = schro_signal_ranges[i].luma_offset; format->luma_excursion = schro_signal_ranges[i].luma_excursion; format->chroma_offset = schro_signal_ranges[i].chroma_offset; format->chroma_excursion = schro_signal_ranges[i].chroma_excursion; } /** * schro_video_format_get_std_signal_range: * @format: pointer to SchroVideoFormat structure * * In Dirac bitstreams, signal ranges can be one of several standard * signal ranges, encoded as an index, or the extents of the signal * range can be encoded directly. This function looks up * the signal range contained in the video format structure @format in * the list of standard signal ranges. If the signal range is * a standard signal range, the corresponding index is returned, * otherwise 0 is returned. * * Returns: index to standard signal range, or 0 if there is no * corresponding standard signal range. */ SchroSignalRange schro_video_format_get_std_signal_range (SchroVideoFormat * format) { int i; for (i = 1; i < ARRAY_SIZE (schro_signal_ranges); i++) { if (format->luma_offset == schro_signal_ranges[i].luma_offset && format->luma_excursion == schro_signal_ranges[i].luma_excursion && format->chroma_offset == schro_signal_ranges[i].chroma_offset && format->chroma_excursion == schro_signal_ranges[i].chroma_excursion) { return i; } } return 0; } typedef struct _SchroColourSpecStruct SchroColourSpecStruct; struct _SchroColourSpecStruct { int colour_primaries; int colour_matrix; int transfer_function; }; static const SchroColourSpecStruct schro_colour_specs[] = { { /* Custom */ SCHRO_COLOUR_PRIMARY_HDTV, SCHRO_COLOUR_MATRIX_HDTV, SCHRO_TRANSFER_CHAR_TV_GAMMA}, { /* SDTV 525 */ SCHRO_COLOUR_PRIMARY_SDTV_525, SCHRO_COLOUR_MATRIX_SDTV, SCHRO_TRANSFER_CHAR_TV_GAMMA}, { /* SDTV 625 */ SCHRO_COLOUR_PRIMARY_SDTV_625, SCHRO_COLOUR_MATRIX_SDTV, SCHRO_TRANSFER_CHAR_TV_GAMMA}, { /* HDTV */ SCHRO_COLOUR_PRIMARY_HDTV, SCHRO_COLOUR_MATRIX_HDTV, SCHRO_TRANSFER_CHAR_TV_GAMMA}, { /* Cinema */ SCHRO_COLOUR_PRIMARY_CINEMA, SCHRO_COLOUR_MATRIX_HDTV, SCHRO_TRANSFER_CHAR_TV_GAMMA} }; /** * schro_video_format_set_std_colour_spec: * @format: pointer to SchroVideoFormat structure * @index: index to standard colour specification * * Sets the colour specification of the video format structure to one of the * standard values indicated by @index. */ void schro_video_format_set_std_colour_spec (SchroVideoFormat * format, SchroColourSpec i) { if (i < 0 || i >= ARRAY_SIZE (schro_colour_specs)) { SCHRO_ERROR ("illegal signal range index"); return; } format->colour_primaries = schro_colour_specs[i].colour_primaries; format->colour_matrix = schro_colour_specs[i].colour_matrix; format->transfer_function = schro_colour_specs[i].transfer_function; } /** * schro_video_format_get_std_colour_spec: * @format: pointer to SchroVideoFormat structure * * In Dirac bitstreams, colour specifications can be one of several standard * colour specifications, encoded as an index, or the individual parts of * the colour specication can be encoded. This function looks up * the colour specification contained in the video format structure @format in * the list of standard colour specifications. If the colour specification is * a standard colour specification, the corresponding index is returned, * otherwise 0 is returned. * * Returns: index to standard colour specification, or 0 if there is no * corresponding standard colour specification. */ SchroColourSpec schro_video_format_get_std_colour_spec (SchroVideoFormat * format) { int i; for (i = 1; i < ARRAY_SIZE (schro_colour_specs); i++) { if (format->colour_primaries == schro_colour_specs[i].colour_primaries && format->colour_matrix == schro_colour_specs[i].colour_matrix && format->transfer_function == schro_colour_specs[i].transfer_function) { return i; } } return 0; } /** * schro_video_format_get_picture_height: * @format: pointer to SchroVideoFormat structure * * Returns the height of coded pictures in the Dirac stream. For * streams encoded with interlaced_coding enabled, this will be the * field height, or half of the video height. */ int schro_video_format_get_picture_height (SchroVideoFormat * format) { if (format->interlaced_coding) { return ROUND_UP_SHIFT (format->height, 1); } return format->height; } #ifdef unused int schro_video_format_get_chroma_width (SchroVideoFormat * format) { return ROUND_UP_SHIFT (format->width, SCHRO_CHROMA_FORMAT_H_SHIFT (format->chroma_format)); } #endif #ifdef unused int schro_video_format_get_chroma_height (SchroVideoFormat * format) { return ROUND_UP_SHIFT (format->height, SCHRO_CHROMA_FORMAT_V_SHIFT (format->chroma_format)); } #endif void schro_video_format_get_picture_luma_size (SchroVideoFormat * format, int *width, int *height) { *width = format->width; *height = ROUND_UP_SHIFT (format->height, format->interlaced_coding); } void schro_video_format_get_picture_chroma_size (SchroVideoFormat * format, int *width, int *height) { *width = ROUND_UP_SHIFT (format->width, SCHRO_CHROMA_FORMAT_H_SHIFT (format->chroma_format)); *height = ROUND_UP_SHIFT (format->height, SCHRO_CHROMA_FORMAT_V_SHIFT (format->chroma_format) + format->interlaced_coding); } void schro_video_format_get_iwt_alloc_size (SchroVideoFormat * format, int *width, int *height, int transform_depth) { int picture_chroma_width; int picture_chroma_height; schro_video_format_get_picture_chroma_size (format, &picture_chroma_width, &picture_chroma_height); picture_chroma_width = ROUND_UP_POW2 (picture_chroma_width, transform_depth); picture_chroma_height = ROUND_UP_POW2 (picture_chroma_height, transform_depth); *width = picture_chroma_width << SCHRO_CHROMA_FORMAT_H_SHIFT (format->chroma_format); *height = picture_chroma_height << SCHRO_CHROMA_FORMAT_V_SHIFT (format->chroma_format); } schro_bool schro_video_format_check_MP_DL (SchroVideoFormat * format) { SchroVideoFormat base_format; if (format->index < 1 || format->index > 20) { return FALSE; } schro_video_format_set_std_video_format (&base_format, format->index); if (format->width > base_format.width || format->height > base_format.height) { return FALSE; } if (format->frame_rate_numerator != base_format.frame_rate_numerator || format->frame_rate_denominator != base_format.frame_rate_denominator) { return FALSE; } if (format->clean_width != base_format.clean_width || format->clean_height != base_format.clean_height || format->left_offset != base_format.left_offset || format->top_offset != base_format.top_offset) { return FALSE; } if (schro_video_format_get_std_signal_range (format) != 2) { return FALSE; } if (format->colour_primaries != base_format.colour_primaries || format->colour_matrix != base_format.colour_matrix || format->transfer_function != base_format.transfer_function) { return FALSE; } return TRUE; } schro_bool schro_video_format_check_VC2_DL (SchroVideoFormat * format) { SchroVideoFormat base_format; if (format->index < 1 || format->index > 20) { return FALSE; } schro_video_format_set_std_video_format (&base_format, format->index); if (memcmp (&base_format, format, sizeof (SchroVideoFormat)) != 0) { return FALSE; } return TRUE; } schroedinger-1.0.11/schroedinger/schrofilter.h0000644000175000017500000000175711541755167016366 00000000000000 #ifndef __SCHRO_FILTER_H__ #define __SCHRO_FILTER_H__ #include SCHRO_BEGIN_DECLS #ifdef SCHRO_ENABLE_UNSTABLE_API void schro_frame_filter_lowpass (SchroFrame * frame, int tap); void schro_frame_filter_lowpass2 (SchroFrame *frame, double sigma); void schro_frame_filter_lowpass_16 (SchroFrame *frame); void schro_frame_filter_cwm7 (SchroFrame *frame); void schro_frame_filter_cwmN (SchroFrame *frame, int weight); void schro_frame_filter_cwmN_ref (SchroFrame *frame, int weight); void schro_frame_filter_wavelet (SchroFrame *frame); void schro_frame_filter_addnoise (SchroFrame *frame, double sigma); void schro_frame_filter_adaptive_lowpass (SchroFrame *frame); void schro_filter_cwmN (uint8_t *d, uint8_t *s1, uint8_t *s2, uint8_t *s3, int n, int weight); void schro_filter_cwmN_ref (uint8_t *d, uint8_t *s1, uint8_t *s2, uint8_t *s3, int n, int weight); void schro_filter_cwm7 (uint8_t *d, uint8_t *s1, uint8_t *s2, uint8_t *s3, int n); #endif SCHRO_END_DECLS #endif schroedinger-1.0.11/schroedinger/schroengine.c0000644000175000017500000007177311704740110016325 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include int schro_engine_get_scene_change_score (SchroEncoder * encoder, int i); void schro_encoder_calculate_allocation (SchroEncoderFrame * frame); /** * schro_engine_check_new_sequence_header: * @encoder: encoder * @frame: encoder frame * * Checks if the current picture should be the start of a new access * unit. */ static void schro_engine_check_new_sequence_header (SchroEncoder * encoder, SchroEncoderFrame * frame) { if (encoder->force_sequence_header || frame->frame_number >= encoder->au_frame + encoder->au_distance) { frame->start_sequence_header = TRUE; encoder->au_frame = frame->frame_number; encoder->force_sequence_header = FALSE; } } /** * schro_engine_code_picture: * @frame: encoder frame * @is_ref: * @retire: * @num_refs: * @ref0: * @ref1: * * Used to set coding order and coding parameters for a picture. */ static void schro_engine_code_picture (SchroEncoderFrame * frame, int is_ref, int retire, int num_refs, int ref0, int ref1) { SchroEncoder *encoder = frame->encoder; SCHRO_DEBUG ("preparing %d as is_ref=%d retire=%d num_refs=%d ref0=%d ref1=%d", frame->frame_number, is_ref, retire, num_refs, ref0, ref1); frame->is_ref = is_ref; frame->retired_picture_number = retire; frame->num_refs = num_refs; frame->picture_number_ref[0] = ref0; frame->picture_number_ref[1] = ref1; frame->stages[SCHRO_ENCODER_FRAME_STAGE_HAVE_GOP].is_done = TRUE; frame->slot = encoder->next_slot++; if (num_refs > 0) { SCHRO_ASSERT (ref0 >= encoder->au_frame); frame->ref_frame[0] = schro_encoder_reference_get (encoder, ref0); SCHRO_ASSERT (frame->ref_frame[0]); schro_encoder_frame_ref (frame->ref_frame[0]); } if (num_refs > 1) { SCHRO_ASSERT (ref0 >= encoder->au_frame); frame->ref_frame[1] = schro_encoder_reference_get (encoder, ref1); SCHRO_ASSERT (frame->ref_frame[1]); schro_encoder_frame_ref (frame->ref_frame[1]); } if (is_ref) { int i; for (i = 0; i < SCHRO_LIMIT_REFERENCE_FRAMES; i++) { if (encoder->reference_pictures[i] == NULL) break; if (encoder->reference_pictures[i]->frame_number == retire) { schro_encoder_frame_unref (encoder->reference_pictures[i]); encoder->reference_pictures[i] = NULL; break; } } SCHRO_ASSERT (i < SCHRO_LIMIT_REFERENCE_FRAMES); encoder->reference_pictures[i] = frame; schro_encoder_frame_ref (frame); } } static int subgroup_ready (SchroQueue * queue, int index, int subgroup_length, SchroEncoderFrameStateEnum gop_state) { size_t i = index; SchroEncoderFrame *f; for (; index + subgroup_length > i; ++i) { f = queue->elements[i].data; SCHRO_ASSERT (!f->stages[gop_state].is_done); if (!f->stages[gop_state - 1].is_done) { return 0; } } return 1; } /** * schro_engine_code_intra_bailout_picture: * @frame: * * Sets up coding parameters for encoding as a completely independent * non-ref intra picture. */ #if 0 static void schro_engine_code_intra (SchroEncoderFrame * frame, double weight) { schro_engine_code_picture (frame, FALSE, -1, 0, -1, -1); frame->presentation_frame = frame->frame_number; frame->picture_weight = weight; frame->gop_length = 1; } #endif static void schro_encoder_pick_refs (SchroEncoderFrame * frame, SchroPictureNumber * ptr_ref0, SchroPictureNumber * ptr_ref1) { SchroEncoder *encoder = frame->encoder; SchroPictureNumber ref0; SchroPictureNumber ref1; int i; ref0 = SCHRO_PICTURE_NUMBER_INVALID; /* pick the most recent back ref */ for (i = 0; i < SCHRO_LIMIT_REFERENCE_FRAMES; i++) { if (encoder->reference_pictures[i] == NULL) continue; if (encoder->reference_pictures[i]->frame_number < frame->frame_number && (ref0 == SCHRO_PICTURE_NUMBER_INVALID || encoder->reference_pictures[i]->frame_number > ref0)) { ref0 = encoder->reference_pictures[i]->frame_number; } } SCHRO_ASSERT (ref0 != SCHRO_PICTURE_NUMBER_INVALID); /* pick the earliest forward ref */ ref1 = SCHRO_PICTURE_NUMBER_INVALID; for (i = 0; i < SCHRO_LIMIT_REFERENCE_FRAMES; i++) { if (encoder->reference_pictures[i] == NULL) continue; if (!encoder->reference_pictures[i]->expired_reference && encoder->reference_pictures[i]->frame_number > frame->frame_number && (ref1 == SCHRO_PICTURE_NUMBER_INVALID || encoder->reference_pictures[i]->frame_number < ref1)) { ref1 = encoder->reference_pictures[i]->frame_number; } } if (ref1 == SCHRO_PICTURE_NUMBER_INVALID) { /* if there's no fwd ref, pick an older back ref */ for (i = 0; i < SCHRO_LIMIT_REFERENCE_FRAMES; i++) { if (encoder->reference_pictures[i] == NULL) continue; if (!encoder->reference_pictures[i]->expired_reference && encoder->reference_pictures[i]->frame_number < ref0 && (ref1 == SCHRO_PICTURE_NUMBER_INVALID || encoder->reference_pictures[i]->frame_number > ref1)) { ref1 = encoder->reference_pictures[i]->frame_number; } } } *ptr_ref0 = ref0; *ptr_ref1 = ref1; } static void schro_encoder_pick_retire (SchroEncoderFrame * frame, SchroPictureNumber * ptr_retire) { SchroEncoder *encoder = frame->encoder; SchroPictureNumber retire; int n_refs = 0; int i; retire = SCHRO_PICTURE_NUMBER_INVALID; /* pick the oldest expired ref */ for (i = 0; i < SCHRO_LIMIT_REFERENCE_FRAMES; i++) { if (encoder->reference_pictures[i] == NULL) continue; n_refs++; if (encoder->reference_pictures[i]->expired_reference && (retire == SCHRO_PICTURE_NUMBER_INVALID || encoder->reference_pictures[i]->frame_number < retire)) { retire = encoder->reference_pictures[i]->frame_number; } } if (retire == SCHRO_PICTURE_NUMBER_INVALID && n_refs == 3) { /* if we have a full queue, forceably retire something */ for (i = 0; i < SCHRO_LIMIT_REFERENCE_FRAMES; i++) { if (encoder->reference_pictures[i] == NULL) continue; if (retire == SCHRO_PICTURE_NUMBER_INVALID || encoder->reference_pictures[i]->frame_number < retire) { retire = encoder->reference_pictures[i]->frame_number; } } SCHRO_ASSERT (retire != SCHRO_PICTURE_NUMBER_INVALID); } *ptr_retire = retire; } static void schro_encoder_expire_reference (SchroEncoder * encoder, SchroPictureNumber ref) { int i; for (i = 0; i < SCHRO_LIMIT_REFERENCE_FRAMES; i++) { if (encoder->reference_pictures[i] == NULL) continue; if (encoder->reference_pictures[i]->frame_number == ref) { encoder->reference_pictures[i]->expired_reference = TRUE; } } } static void schro_encoder_expire_refs_before (SchroEncoder * encoder, SchroPictureNumber ref) { int i; for (i = 0; i < SCHRO_LIMIT_REFERENCE_FRAMES; i++) { if (encoder->reference_pictures[i] == NULL) continue; if (encoder->reference_pictures[i]->frame_number < ref) { encoder->reference_pictures[i]->expired_reference = TRUE; } } } static void schro_engine_code_BBBP (SchroEncoder * encoder, int i, int gop_length) { SchroEncoderFrame *frame; SchroEncoderFrame *f; int j; SchroPictureNumber ref0; SchroPictureNumber ref1; SchroPictureNumber retire; frame = encoder->frame_queue->elements[i].data; /* BBBP */ frame->gop_length = gop_length; f = encoder->frame_queue->elements[i + gop_length - 1].data; if (f->start_sequence_header) { schro_encoder_pick_retire (f, &retire); schro_engine_code_picture (f, TRUE, retire, 0, -1, -1); f->picture_weight = encoder->magic_keyframe_weight; } else { schro_encoder_pick_retire (f, &retire); schro_encoder_pick_refs (f, &ref0, &ref1); schro_engine_code_picture (f, TRUE, retire, (ref1 == SCHRO_PICTURE_NUMBER_INVALID) ? 1 : 2, ref0, ref1); f->picture_weight = encoder->magic_inter_p_weight; schro_encoder_expire_reference (encoder, encoder->last_ref); encoder->last_ref = f->frame_number; } for (j = 0; j < gop_length - 1; j++) { f = encoder->frame_queue->elements[i + j].data; schro_encoder_pick_refs (f, &ref0, &ref1); schro_engine_code_picture (f, FALSE, -1, 2, ref0, ref1); f->presentation_frame = f->frame_number; if (j == gop_length - 2) { f->presentation_frame++; } f->picture_weight = encoder->magic_inter_b_weight; } f = encoder->frame_queue->elements[i + gop_length - 1].data; if (f->start_sequence_header) { schro_encoder_expire_refs_before (encoder, f->frame_number); } } /** * schro_engine_get_scene_change_score: * @frame: encoder frame * @i: index * * Calculates scene change score for two pictures. */ int schro_engine_get_scene_change_score (SchroEncoder * encoder, int i) { SchroEncoderFrame *frame1; SchroEncoderFrame *frame2; double luma; frame1 = encoder->frame_queue->elements[i].data; if (frame1->have_scene_change_score) return TRUE; frame2 = frame1->previous_frame; if (frame2 == NULL) { frame1->scene_change_score = 1.0; frame1->have_scene_change_score = TRUE; return TRUE; } if (!(frame2->stages[SCHRO_ENCODER_FRAME_STAGE_ANALYSE].is_done)) { return FALSE; } SCHRO_DEBUG ("%g %g", frame1->average_luma, frame2->average_luma); luma = frame1->average_luma - 16.0; if (luma > 0.01) { double mse[3]; schro_frame_mean_squared_error (frame1-> downsampled_frames[encoder->downsample_levels - 1], frame2->downsampled_frames[encoder->downsample_levels - 1], mse); frame1->scene_change_score = mse[0] / (luma * luma); } else { frame1->scene_change_score = 1.0; } SCHRO_DEBUG ("scene change score %g", frame1->scene_change_score); schro_encoder_frame_unref (frame1->previous_frame); frame1->previous_frame = NULL; frame1->have_scene_change_score = TRUE; return TRUE; } /** * schro_engine_pick_output_buffer_size: * @encoder: encoder * @frame: encoder frame * * Calculates allocated size of output buffer for a picture. Horribly * inefficient and outdated. */ static int schro_engine_pick_output_buffer_size (SchroEncoder * encoder, SchroEncoderFrame * frame) { int size; size = encoder->video_format.width * encoder->video_format.height; switch (encoder->video_format.chroma_format) { case SCHRO_CHROMA_444: size *= 3; break; case SCHRO_CHROMA_422: size *= 2; break; case SCHRO_CHROMA_420: size += size / 2; break; default: SCHRO_ASSERT (0); } /* random scale factor of 2 in order to be safe */ size *= 2; return size; } /** * init_params: * @frame: encoder frame * * Initializes params structure for picture based on encoder parameters * and some heuristics. */ void init_params (SchroEncoderFrame * frame) { SchroParams *params = &frame->params; SchroEncoder *encoder = frame->encoder; SchroVideoFormat *video_format = params->video_format; int shift; int i; int size; int overlap; params->video_format = &encoder->video_format; schro_params_init (params, params->video_format->index); if ((encoder->enable_noarith && frame->num_refs == 0) || params->is_lowdelay) { params->is_noarith = TRUE; } params->transform_depth = encoder->transform_depth; size = encoder->motion_block_size; if (size == 0) { if (video_format->width * video_format->height >= 1920 * 1080) { size = 3; } else if (video_format->width * video_format->height >= 960 * 540) { size = 2; } else { size = 1; } } switch (size) { default: case 1: params->xbsep_luma = 8; params->ybsep_luma = 8; break; case 2: params->xbsep_luma = 12; params->ybsep_luma = 12; break; case 3: params->xbsep_luma = 16; params->ybsep_luma = 16; break; } overlap = encoder->motion_block_overlap; if (overlap == 0) { overlap = 3; } switch (overlap) { case 1: params->xblen_luma = params->xbsep_luma; params->yblen_luma = params->ybsep_luma; break; default: case 2: params->xblen_luma = (params->xbsep_luma * 3 / 2) & (~3); params->yblen_luma = (params->ybsep_luma * 3 / 2) & (~3); break; case 3: params->xblen_luma = 2 * params->xbsep_luma; params->yblen_luma = 2 * params->ybsep_luma; break; } schro_params_calculate_mc_sizes (params); schro_params_calculate_iwt_sizes (params); switch (encoder->codeblock_size) { case 1: /* small (blocks of size 5x5) */ shift = params->transform_depth; params->horiz_codeblocks[0] = MAX (1, (params->iwt_luma_width >> shift) / 5); params->vert_codeblocks[0] = MAX (1, (params->iwt_luma_height >> shift) / 5); for (i = 1; i < params->transform_depth + 1; i++) { shift = params->transform_depth + 1 - i; /* These values are empirically derived from fewer than 2 test results */ params->horiz_codeblocks[i] = MAX (1, (params->iwt_luma_width >> shift) / 5); params->vert_codeblocks[i] = MAX (1, (params->iwt_luma_height >> shift) / 5); SCHRO_DEBUG ("codeblocks %d %d %d", i, params->horiz_codeblocks[i], params->vert_codeblocks[i]); } break; case 0: default: case 2: /* medium (blocks of size 8x8) */ shift = params->transform_depth; params->horiz_codeblocks[0] = MAX (1, (params->iwt_luma_width >> shift) / 8); params->vert_codeblocks[0] = MAX (1, (params->iwt_luma_height >> shift) / 8); for (i = 1; i < params->transform_depth + 1; i++) { shift = params->transform_depth + 1 - i; params->horiz_codeblocks[i] = MAX (1, (params->iwt_luma_width >> shift) / 8); params->vert_codeblocks[i] = MAX (1, (params->iwt_luma_height >> shift) / 8); SCHRO_DEBUG ("codeblocks %d %d %d", i, params->horiz_codeblocks[i], params->vert_codeblocks[i]); } break; case 3: /* large (uses spec defaults) */ break; case 4: /* full (codeblocks are entire subband) */ params->horiz_codeblocks[0] = 1; params->vert_codeblocks[0] = 1; for (i = 1; i < params->transform_depth + 1; i++) { params->horiz_codeblocks[i] = 1; params->vert_codeblocks[i] = 1; } break; } if (!encoder->enable_dc_multiquant) { /* This is to work around a bug in the decoder that was fixed 8/2008. */ params->horiz_codeblocks[0] = 1; params->vert_codeblocks[0] = 1; } params->mv_precision = encoder->mv_precision; if (encoder->enable_global_motion) { params->have_global_motion = TRUE; } if (encoder->enable_multiquant) { params->codeblock_mode_index = 1; } else { params->codeblock_mode_index = 0; } } void schro_frame_set_wavelet_params (SchroEncoderFrame * frame) { SchroParams *params = &frame->params; SchroEncoder *encoder = frame->encoder; if (params->num_refs > 0) { params->wavelet_filter_index = encoder->inter_wavelet; } else { params->wavelet_filter_index = encoder->intra_wavelet; } /* overrides for near-lossless */ if (encoder->rate_control == 0) { double offset = 6.0 * (encoder->bit_depth - 8); if (encoder->noise_threshold < 40.0 + offset) { /* do nothing */ } else if (encoder->noise_threshold < 47.0 + offset) { params->wavelet_filter_index = 1; } else { params->wavelet_filter_index = 3; } } else if (encoder->rate_control == SCHRO_ENCODER_RATE_CONTROL_LOSSLESS) { params->wavelet_filter_index = 3; } } static double get_alloc (SchroEncoder * encoder, double requested_bits) { double x; double y; int must_use_bits; double alloc; must_use_bits = MAX (0, encoder->buffer_level + encoder->bits_per_picture - encoder->buffer_size); x = MAX (0, requested_bits - must_use_bits) / MAX (0, encoder->buffer_size - encoder->bits_per_picture); y = 1 - exp (-x); alloc = must_use_bits + (encoder->buffer_level - must_use_bits) * y; SCHRO_DEBUG ("request %g, level %d/%d, must use %d -> x %g y %g alloc %g", requested_bits, encoder->buffer_level, encoder->buffer_size, must_use_bits, x, y, alloc); return alloc; } /** * schro_encoder_calculate_allocation: * @frame: * * Calculates the number of bits to allocate to a picture. */ void schro_encoder_calculate_allocation (SchroEncoderFrame * frame) { SchroEncoder *encoder = frame->encoder; if (encoder->rate_control != SCHRO_ENCODER_RATE_CONTROL_CONSTANT_BITRATE) { /* FIXME this function shouldn't be called for CBR */ frame->hard_limit_bits = frame->output_buffer_size * 8; frame->allocated_mc_bits = frame->hard_limit_bits; frame->allocated_residual_bits = frame->hard_limit_bits; return; } /* FIXME should be fixed elsewhere */ if (frame->picture_weight == 0.0) frame->picture_weight = 1.0; if (frame->num_refs == 0) { frame->allocated_mc_bits = 0; frame->allocated_residual_bits = get_alloc (encoder, encoder->bits_per_picture * frame->picture_weight * encoder->magic_allocation_scale); frame->hard_limit_bits = encoder->buffer_level; } else { double weight; frame->allocated_mc_bits = frame->estimated_mc_bits; weight = frame->picture_weight; if (frame->is_ref) { weight += frame->badblock_ratio * encoder->magic_badblock_multiplier_ref; } else { weight += frame->badblock_ratio * encoder->magic_badblock_multiplier_nonref; } frame->allocated_residual_bits = get_alloc (encoder, encoder->bits_per_picture * weight * encoder->magic_allocation_scale); frame->allocated_residual_bits -= frame->estimated_mc_bits; if (frame->allocated_residual_bits < 0) { SCHRO_DEBUG ("allocated residual bits less than 0"); frame->allocated_residual_bits = 0; } frame->hard_limit_bits = encoder->buffer_level; } } /** * init_frame: * @frame: * * Initializes a frame prior to any analysis. */ void schro_encoder_init_frame (SchroEncoderFrame * frame) { SchroEncoder *encoder = frame->encoder; frame->params.video_format = &encoder->video_format; frame->need_filtering = (encoder->filtering != 0); switch (encoder->gop_structure) { case SCHRO_ENCODER_GOP_INTRA_ONLY: frame->need_downsampling = FALSE; frame->need_upsampling = FALSE; frame->need_average_luma = FALSE; frame->need_mad = FALSE; break; case SCHRO_ENCODER_GOP_ADAPTIVE: case SCHRO_ENCODER_GOP_BACKREF: case SCHRO_ENCODER_GOP_CHAINED_BACKREF: frame->need_downsampling = TRUE; frame->need_upsampling = (encoder->mv_precision > 0); frame->need_average_luma = TRUE; frame->need_extension = TRUE; frame->need_mad = encoder->enable_scene_change_detection; break; case SCHRO_ENCODER_GOP_BIREF: case SCHRO_ENCODER_GOP_CHAINED_BIREF: frame->need_downsampling = TRUE; frame->need_upsampling = (encoder->mv_precision > 0); frame->need_average_luma = TRUE; frame->need_extension = TRUE; frame->need_mad = encoder->enable_scene_change_detection; break; default: SCHRO_ASSERT (0); } } /***** tworef *****/ /** * handle_gop_tworef: * @encoder: * @i: * * Sets up a minor group of pictures for the tworef engine. */ void schro_encoder_handle_gop_tworef (SchroEncoder * encoder, int i) { SchroEncoderFrame *frame; SchroEncoderFrame *f; int j; int gop_length; //double scs_sum; frame = encoder->frame_queue->elements[i].data; SCHRO_ASSERT (frame->stages[SCHRO_ENCODER_FRAME_STAGE_HAVE_GOP].is_done == FALSE); if (frame->busy || !frame->stages[SCHRO_ENCODER_FRAME_STAGE_ANALYSE].is_done) return; schro_engine_check_new_sequence_header (encoder, frame); gop_length = encoder->magic_subgroup_length; SCHRO_DEBUG ("handling gop from %d to %d (index %d)", encoder->gop_picture, encoder->gop_picture + gop_length - 1, i); if (encoder->end_of_stream) { gop_length = MIN (gop_length, encoder->frame_queue->n - i); } //intra_start = frame->start_sequence_header; //scs_sum = 0; for (j = 0; j < gop_length; j++) { if (i + j >= encoder->frame_queue->n) { SCHRO_DEBUG ("not enough pictures in queue"); return; } f = encoder->frame_queue->elements[i + j].data; SCHRO_ASSERT (f->stages[SCHRO_ENCODER_FRAME_STAGE_HAVE_GOP].is_done == FALSE); if (f->busy || !f->stages[SCHRO_ENCODER_FRAME_STAGE_ANALYSE].is_done) { SCHRO_DEBUG ("picture %d not ready", i + j); return; } if (f->start_sequence_header || f->frame_number >= encoder->au_frame + encoder->au_distance) { f->start_sequence_header = TRUE; if (encoder->open_gop || j == 0) { gop_length = j + 1; } else { gop_length = j; } break; } if (encoder->enable_scene_change_detection) { if (!subgroup_ready (encoder->frame_queue, i, gop_length, SCHRO_ENCODER_FRAME_STAGE_HAVE_GOP)) return; /*not all frames in subgroup have scene change score calculated */ } else { schro_engine_get_scene_change_score (encoder, i + j); } schro_dump (SCHRO_DUMP_SCENE_CHANGE, "%d %g %g\n", f->frame_number, f->scene_change_score, f->average_luma); SCHRO_DEBUG ("scene change score %g", f->scene_change_score); if (f->scene_change_score > encoder->magic_scene_change_threshold) { SCHRO_DEBUG ("Scene change detected: score %g for picture %d", f->scene_change_score, f->frame_number); if (j == 0) { /* If the first picture of the proposed subgroup is first * picture of a new shot, we want to encode a sequence header * and an I frame. */ f->start_sequence_header = TRUE; gop_length = 1; break; } else { /* If there's a shot change in the middle of the proposed * subgroup, terminate the subgroup early. Also flag that * picture as a new sequence header (not really necessary). */ f->start_sequence_header = TRUE; gop_length = j; } } #if 0 scs_sum += f->scene_change_score; if (scs_sum > encoder->magic_scene_change_threshold) { /* matching is getting bad. terminate gop */ gop_length = j; } #endif } SCHRO_DEBUG ("gop length %d", gop_length); for (j = 0; j < gop_length - 1; j++) { f = encoder->frame_queue->elements[i + j].data; SCHRO_ASSERT (f->start_sequence_header == FALSE); } if (gop_length == 1) { schro_engine_code_BBBP (encoder, i, gop_length); } else { schro_engine_code_BBBP (encoder, i, gop_length); } f = encoder->frame_queue->elements[i + gop_length - 1].data; if (f->start_sequence_header) { encoder->au_frame = f->frame_number; } encoder->gop_picture += gop_length; } int schro_encoder_setup_frame_tworef (SchroEncoderFrame * frame) { SchroEncoder *encoder = frame->encoder; frame->output_buffer_size = schro_engine_pick_output_buffer_size (encoder, frame); SCHRO_ASSERT (frame->output_buffer_size != 0); /* set up params - num_refs only */ frame->params.num_refs = frame->num_refs; return TRUE; } int schro_encoder_handle_quants (SchroEncoder * encoder, int i) { SchroEncoderFrame *frame; frame = encoder->frame_queue->elements[i].data; if (frame->busy || !frame->stages[SCHRO_ENCODER_FRAME_STAGE_MODE_DECISION].is_done) return FALSE; schro_encoder_calculate_allocation (frame); schro_encoder_choose_quantisers (frame); schro_encoder_estimate_entropy (frame); frame->stages[SCHRO_ENCODER_FRAME_STAGE_HAVE_QUANTS].is_done = TRUE; return TRUE; } /**** backref ****/ /** * handle_gop_backref: * @encoder: * @i: * * Sets up a minor group of pictures for the backref engine. */ void schro_encoder_handle_gop_backref (SchroEncoder * encoder, int i) { SchroEncoderFrame *frame; SchroPictureNumber retire; SchroPictureNumber ref0; SchroPictureNumber ref1; frame = encoder->frame_queue->elements[i].data; if (frame->busy || !frame->stages[SCHRO_ENCODER_FRAME_STAGE_ANALYSE].is_done) return; schro_engine_check_new_sequence_header (encoder, frame); //schro_engine_code_BBBP (encoder, i, 1); if (frame->start_sequence_header) { schro_encoder_pick_retire (frame, &retire); schro_engine_code_picture (frame, TRUE, retire, 0, -1, -1); frame->picture_weight = encoder->magic_keyframe_weight; } else { schro_encoder_pick_retire (frame, &retire); schro_encoder_pick_refs (frame, &ref0, &ref1); schro_engine_code_picture (frame, TRUE, retire, (ref1 == SCHRO_PICTURE_NUMBER_INVALID) ? 1 : 2, ref0, ref1); frame->picture_weight = encoder->magic_inter_p_weight; } schro_encoder_expire_reference (encoder, frame->frame_number - 2); frame->presentation_frame = frame->frame_number; frame->picture_weight = 1; encoder->last_ref = frame->frame_number; encoder->gop_picture += 1; if (frame->start_sequence_header) { schro_encoder_expire_refs_before (encoder, frame->frame_number); } } int schro_encoder_setup_frame_backref (SchroEncoderFrame * frame) { SchroEncoder *encoder = frame->encoder; frame->output_buffer_size = schro_engine_pick_output_buffer_size (encoder, frame); /* set up params */ frame->params.num_refs = frame->num_refs; return TRUE; } /*** intra-only ***/ /** * handle_gop_intra_only: * @encoder: * @i: * * Sets up GOP structure for an intra picture. */ void schro_encoder_handle_gop_intra_only (SchroEncoder * encoder, int i) { SchroEncoderFrame *frame; frame = encoder->frame_queue->elements[i].data; if (frame->busy || !frame->stages[SCHRO_ENCODER_FRAME_STAGE_ANALYSE].is_done) return; schro_engine_check_new_sequence_header (encoder, frame); SCHRO_DEBUG ("handling gop from %d to %d (index %d)", encoder->gop_picture, encoder->gop_picture, i); if (frame->busy || !frame->stages[SCHRO_ENCODER_FRAME_STAGE_ANALYSE].is_done) { SCHRO_DEBUG ("picture %d not ready", i); return; } schro_engine_code_picture (frame, FALSE, -1, 0, -1, -1); frame->presentation_frame = frame->frame_number; frame->picture_weight = 1.0; encoder->gop_picture++; } /** * setup_params_intra_only: * @frame: * * sets up parameters for a picture for intra-only encoding. */ int schro_encoder_setup_frame_intra_only (SchroEncoderFrame * frame) { SchroEncoder *encoder = frame->encoder; frame->output_buffer_size = schro_engine_pick_output_buffer_size (encoder, frame); frame->params.num_refs = frame->num_refs; /* set up params */ return TRUE; } /*** lossless ***/ /** * setup_params_lossless: * @frame: * * sets up parameters for a picture for intra-only encoding. */ int schro_encoder_setup_frame_lossless (SchroEncoderFrame * frame) { SchroEncoder *encoder = frame->encoder; SchroParams *params; frame->output_buffer_size = schro_engine_pick_output_buffer_size (encoder, frame); frame->params.num_refs = frame->num_refs; /* set up params */ params = &frame->params; params->wavelet_filter_index = SCHRO_WAVELET_HAAR_0; params->transform_depth = 3; params->num_refs = frame->num_refs; params->video_format = &encoder->video_format; init_params (frame); params->xbsep_luma = 8; params->xblen_luma = 8; params->ybsep_luma = 8; params->yblen_luma = 8; schro_params_calculate_mc_sizes (params); return TRUE; } void schro_encoder_handle_gop_lossless (SchroEncoder * encoder, int i) { schro_encoder_handle_gop_backref (encoder, i); } /*** low delay ***/ void schro_encoder_handle_gop_lowdelay (SchroEncoder * encoder, int i) { SchroEncoderFrame *frame; frame = encoder->frame_queue->elements[i].data; if (frame->busy || !frame->stages[SCHRO_ENCODER_FRAME_STAGE_ANALYSE].is_done) return; schro_engine_check_new_sequence_header (encoder, frame); SCHRO_DEBUG ("handling gop from %d to %d (index %d)", encoder->gop_picture, encoder->gop_picture, i); schro_engine_code_picture (frame, FALSE, -1, 0, -1, -1); frame->presentation_frame = frame->frame_number; frame->picture_weight = 1.0; encoder->gop_picture++; } int schro_encoder_setup_frame_lowdelay (SchroEncoderFrame * frame) { SchroEncoder *encoder = frame->encoder; SchroParams *params = &frame->params; int num; int denom; frame->output_buffer_size = schro_engine_pick_output_buffer_size (encoder, frame); /* set up params */ params->num_refs = frame->num_refs; params->is_lowdelay = TRUE; if (encoder->horiz_slices != 0 && encoder->vert_slices != 0) { params->n_horiz_slices = encoder->horiz_slices; params->n_vert_slices = encoder->vert_slices; } else { params->n_horiz_slices = params->iwt_chroma_width >> params->transform_depth; params->n_vert_slices = params->iwt_chroma_height >> params->transform_depth; } schro_params_set_default_quant_matrix (params); num = muldiv64 (encoder->bitrate, encoder->video_format.frame_rate_denominator, encoder->video_format.frame_rate_numerator * 8); denom = params->n_horiz_slices * params->n_vert_slices; if (encoder->video_format.interlaced_coding) { denom *= 2; } SCHRO_ASSERT (denom != 0); schro_utils_reduce_fraction (&num, &denom); params->slice_bytes_num = num; params->slice_bytes_denom = denom; return TRUE; } schroedinger-1.0.11/schroedinger/schroparse.h0000644000175000017500000000110411320237456016164 00000000000000 #ifndef __SCHRO_PARSE_H__ #define __SCHRO_PARSE_H__ #include #include SCHRO_BEGIN_DECLS int schro_parse_decode_sequence_header (uint8_t *data, int length, SchroVideoFormat *video_format); #ifdef SCHRO_ENABLE_UNSTABLE_API typedef struct _SchroParseSyncState SchroParseSyncState; SchroParseSyncState *schro_parse_sync_new (void); void schro_parse_sync_free (SchroParseSyncState *); SchroBuffer *schro_parse_sync (SchroParseSyncState *sps, SchroBufferList *input_bufer); #endif SCHRO_END_DECLS #endif schroedinger-1.0.11/schroedinger/schroutils.c0000644000175000017500000001560311703744120016212 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #ifndef _WIN32 #include #include #endif #include #ifndef SCHRO_MALLOC_USE_MMAP /* enable this for mmap based buffer overrun checks */ //# define SCHRO_MALLOC_USE_MMAP /* enable this if there are alignment issues */ //# define ALIGN_16 #endif #ifdef _WIN32 #include #undef SCHRO_MALLOC_USE_MMAP #endif #ifdef SCHRO_MALLOC_USE_MMAP #include #endif #ifndef SCHRO_MALLOC_USE_MMAP void * schro_malloc (int size) { void *ptr; ptr = malloc (size); SCHRO_DEBUG ("alloc %p %d", ptr, size); return ptr; } void * schro_malloc0 (int size) { void *ptr; ptr = malloc (size); memset (ptr, 0, size); SCHRO_DEBUG ("alloc %p %d", ptr, size); return ptr; } void * schro_realloc (void *ptr, int size) { ptr = realloc (ptr, size); SCHRO_DEBUG ("realloc %p %d", ptr, size); return ptr; } void schro_free (void *ptr) { SCHRO_DEBUG ("free %p", ptr); free (ptr); } #else /* SCHRO_MALLOC_USE_MMAP */ static const char sentinel[] = "This came from schro"; void * schro_malloc (int size) { void *ptr; int rsize; #ifdef ALIGN_16 size = ROUND_UP_POW2 (size, 4); #endif rsize = ROUND_UP_POW2 (size + sizeof (int) + sizeof (sentinel), 12); ptr = mmap (NULL, rsize + 8192, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); SCHRO_ASSERT (ptr != MAP_FAILED); mprotect (ptr, 4096, PROT_NONE); mprotect (OFFSET (ptr, 4096 + rsize), 4096, PROT_NONE); SCHRO_DEBUG ("alloc %p %d", ptr, size); *(int *) OFFSET (ptr, 4096) = rsize; memcpy (OFFSET (ptr, 4096 + sizeof (int)), sentinel, sizeof (sentinel)); return OFFSET (ptr, 4096 + rsize - size); } void * schro_malloc0 (int size) { return schro_malloc (size); } void * schro_realloc (void *ptr, int size) { unsigned long page = ((unsigned long) ptr) & ~(4095); int rsize, old_size; if (!ptr) return schro_malloc (size); /* find original size */ if ((unsigned long) ptr - page <= sizeof (int) + sizeof (sentinel)) { /* if ptr is too close to start of page, then the base pointer is * the previous page */ page -= 4096; } rsize = *(int *) page; old_size = page + rsize - (unsigned long) ptr;; void *new = schro_malloc (size); if (size < old_size) memcpy (new, ptr, size); else memcpy (new, ptr, old_size); schro_free (ptr); return new; } void schro_free (void *ptr) { unsigned long page = ((unsigned long) ptr) & ~(4095); int rsize; if ((unsigned long) ptr - page <= sizeof (int) + sizeof (sentinel)) { /* if ptr is too close to start of page, then the base pointer is * the previous page */ page -= 4096; } rsize = *(int *) page; SCHRO_ASSERT (!memcmp ((void *) page + sizeof (int), sentinel, sizeof (sentinel))); munmap ((void *) (page - 4096), rsize + 8192); } #endif /* SCHRO_MALLOC_USE_MMAP */ int muldiv64 (int a, int b, int c) { orc_int64 x; x = a; x *= b; x /= c; return (int) x; } int schro_utils_multiplier_to_quant_index (double x) { return CLAMP (rint (log (x) / log (2) * 4.0), 0, 60); } static int __schro_dequantise (int q, int quant_factor, int quant_offset) { if (q == 0) return 0; if (q < 0) { return -((-q * quant_factor + quant_offset + 2) >> 2); } else { return (q * quant_factor + quant_offset + 2) >> 2; } } int schro_dequantise (int q, int quant_factor, int quant_offset) { return __schro_dequantise (q, quant_factor, quant_offset); } static int __schro_quantise (int value, int quant_factor, int quant_offset) { int x; int dead_zone = quant_offset; int offset = quant_offset - quant_factor / 2; /* * offset = quant_offset always undershoots * offset = quant_offset - quant_factor always overshoots * offset = quant_offset - quant_factor/2 gives an error that averages 0 */ if (value == 0) return 0; if (value < 0) { x = (-value) << 2; if (x < dead_zone) { x = 0; } else { x = (x - offset) / quant_factor; } value = -x; } else { x = value << 2; if (x < dead_zone) { x = 0; } else { x = (x - offset) / quant_factor; } value = x; } return value; } int schro_quantise (int value, int quant_factor, int quant_offset) { return __schro_quantise (value, quant_factor, quant_offset); } void schro_quantise_s16 (int16_t * dest, int16_t * src, int quant_factor, int quant_offset, int n) { int i; for (i = 0; i < n; i++) { dest[i] = __schro_quantise (src[i], quant_factor, quant_offset); src[i] = __schro_dequantise (dest[i], quant_factor, quant_offset); } } void schro_quantise_s32 (int32_t * dest, int32_t * src, int quant_factor, int quant_offset, int n) { int i; for (i = 0; i < n; i++) { dest[i] = __schro_quantise (src[i], quant_factor, quant_offset); src[i] = __schro_dequantise (dest[i], quant_factor, quant_offset); } } #ifdef unused void schro_quantise_s16_table (int16_t * dest, int16_t * src, int quant_index, schro_bool is_intra, int n) { int i; int16_t *table; table = schro_tables_get_quantise_table (quant_index, is_intra); table += 32768; for (i = 0; i < n; i++) { dest[i] = table[src[i]]; } } void schro_dequantise_s16_table (int16_t * dest, int16_t * src, int quant_index, schro_bool is_intra, int n) { int i; int16_t *table; table = schro_tables_get_dequantise_table (quant_index, is_intra); table += 32768; for (i = 0; i < n; i++) { dest[i] = table[src[i]]; } } #endif void schro_dequantise_s16 (int16_t * dest, int16_t * src, int quant_factor, int quant_offset, int n) { int i; for (i = 0; i < n; i++) { dest[i] = __schro_dequantise (src[i], quant_factor, quant_offset); } } /* log(2.0) */ #define LOG_2 0.69314718055994528623 /* 1.0/log(2.0) */ #define INV_LOG_2 1.44269504088896338700 double schro_utils_probability_to_entropy (double x) { if (x <= 0 || x >= 1.0) return 0; return -(x * log (x) + (1 - x) * log (1 - x)) * INV_LOG_2; } double schro_utils_entropy (double a, double total) { double x; if (total == 0) return 0; x = a / total; return schro_utils_probability_to_entropy (x) * total; } void schro_utils_reduce_fraction (int *n, int *d) { static const int primes[] = { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 91 }; int i; int p; SCHRO_DEBUG ("reduce %d/%d", *n, *d); for (i = 0; i < sizeof (primes) / sizeof (primes[0]); i++) { p = primes[i]; while (*n % p == 0 && *d % p == 0) { *n /= p; *d /= p; } if (*d == 1) break; } SCHRO_DEBUG ("to %d/%d", *n, *d); } double schro_utils_get_time (void) { #ifndef _WIN32 struct timeval tv; gettimeofday (&tv, NULL); return tv.tv_sec + 1e-6 * tv.tv_usec; #else return (double) GetTickCount () / 1000.; #endif } schroedinger-1.0.11/Makefile.am0000644000175000017500000000143511541755167013242 00000000000000AUTOMAKE_OPTIONS = foreign SUBDIRS = schroedinger doc tools testsuite DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc DIST_SUBDIRS = schroedinger doc tools testsuite EXTRA_DIST = COPYING COPYING.GPL COPYING.LGPL COPYING.MIT COPYING.MPL \ autogen.sh schroedinger.spec TODO NEWS orc.mak pkgconfig_DATA = schroedinger-$(SCHRO_MAJORMINOR).pc schroedinger-$(SCHRO_MAJORMINOR).pc: schroedinger.pc cp schroedinger.pc schroedinger-$(SCHRO_MAJORMINOR).pc schroedinger-$(SCHRO_MAJORMINOR)-uninstalled.pc: schroedinger-uninstalled.pc cp schroedinger-uninstalled.pc schroedinger-$(SCHRO_MAJORMINOR)-uninstalled.pc BUILT_SOURCES=schroedinger-$(SCHRO_MAJORMINOR)-uninstalled.pc CLEANFILES = schroedinger-$(SCHRO_MAJORMINOR).pc schroedinger-$(SCHRO_MAJORMINOR)-uninstalled.pc ACLOCAL_FLAGS = -I m4 schroedinger-1.0.11/Makefile.in0000664000175000017500000006550011707140262013244 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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@ subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(srcdir)/schroedinger-uninstalled.pc.in \ $(srcdir)/schroedinger.pc.in $(srcdir)/schroedinger.spec.in \ $(top_srcdir)/configure AUTHORS COPYING NEWS TODO compile \ config.guess config.sub depcomp install-sh ltmain.sh missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-auto-alt.m4 \ $(top_srcdir)/m4/as-compiler-flag.m4 \ $(top_srcdir)/m4/as-host-defines.m4 \ $(top_srcdir)/m4/as-version.m4 $(top_srcdir)/m4/gst-args.m4 \ $(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)/m4/pkg.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = schroedinger-uninstalled.pc schroedinger.pc \ schroedinger.spec CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-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 uninstall-recursive 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__installdirs = "$(DESTDIR)$(pkgconfigdir)" DATA = $(pkgconfig_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir dist dist-all distcheck ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d "$(distdir)" \ || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr "$(distdir)"; }; } 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" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUDA_CFLAGS = @CUDA_CFLAGS@ CUDA_LIBS = @CUDA_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ GCOV = @GCOV@ GCOV_CFLAGS = @GCOV_CFLAGS@ GCOV_LIBS = @GCOV_LIBS@ GREP = @GREP@ GTHREAD_CFLAGS = @GTHREAD_CFLAGS@ GTHREAD_LIBS = @GTHREAD_LIBS@ GTKDOC_CHECK = @GTKDOC_CHECK@ 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@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ NVCC = @NVCC@ NVCCFLAGS = @NVCCFLAGS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENGL_CFLAGS = @OPENGL_CFLAGS@ OPENGL_LIBS = @OPENGL_LIBS@ ORCC = @ORCC@ ORC_CFLAGS = @ORC_CFLAGS@ ORC_LIBS = @ORC_LIBS@ 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@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SCHRO_CFLAGS = @SCHRO_CFLAGS@ SCHRO_LIBS = @SCHRO_LIBS@ SCHRO_LIBVERSION = @SCHRO_LIBVERSION@ SCHRO_MAJORMINOR = @SCHRO_MAJORMINOR@ SCHRO_PKG_DEPS = @SCHRO_PKG_DEPS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ THREAD_IMPL = @THREAD_IMPL@ VERSION = @VERSION@ 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_CXX = @ac_ct_CXX@ 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@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = foreign SUBDIRS = schroedinger doc tools testsuite DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc DIST_SUBDIRS = schroedinger doc tools testsuite EXTRA_DIST = COPYING COPYING.GPL COPYING.LGPL COPYING.MIT COPYING.MPL \ autogen.sh schroedinger.spec TODO NEWS orc.mak pkgconfig_DATA = schroedinger-$(SCHRO_MAJORMINOR).pc BUILT_SOURCES = schroedinger-$(SCHRO_MAJORMINOR)-uninstalled.pc CLEANFILES = schroedinger-$(SCHRO_MAJORMINOR).pc schroedinger-$(SCHRO_MAJORMINOR)-uninstalled.pc ACLOCAL_FLAGS = -I m4 all: $(BUILT_SOURCES) config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: @: $(srcdir)/Makefile.in: $(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 \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ else :; fi 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) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 schroedinger-uninstalled.pc: $(top_builddir)/config.status $(srcdir)/schroedinger-uninstalled.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ schroedinger.pc: $(top_builddir)/config.status $(srcdir)/schroedinger.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ schroedinger.spec: $(top_builddir)/config.status $(srcdir)/schroedinger.spec.in cd $(top_builddir) && $(SHELL) ./config.status $@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ 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|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(pkgconfigdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(pkgconfigdir)" && rm -f $$files # 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. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; 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" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @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 \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ 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 -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @$(am__cd) '$(distuninstallcheck_dir)' \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-recursive all-am: Makefile $(DATA) config.h installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(pkgconfigdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr \ distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-pkgconfigDATA 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 $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -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-pkgconfigDATA .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check \ ctags-recursive install install-am install-strip \ tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ dist-gzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \ distcheck distclean distclean-generic distclean-hdr \ distclean-libtool distclean-tags distcleancheck distdir \ distuninstallcheck 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 installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am uninstall-pkgconfigDATA schroedinger-$(SCHRO_MAJORMINOR).pc: schroedinger.pc cp schroedinger.pc schroedinger-$(SCHRO_MAJORMINOR).pc schroedinger-$(SCHRO_MAJORMINOR)-uninstalled.pc: schroedinger-uninstalled.pc cp schroedinger-uninstalled.pc schroedinger-$(SCHRO_MAJORMINOR)-uninstalled.pc # 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: schroedinger-1.0.11/schroedinger.pc.in0000644000175000017500000000057711541755167014621 00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@/schroedinger-@SCHRO_MAJORMINOR@ toolsdir=${exec_prefix}/bin Name: schroedinger-@SCHRO_MAJORMINOR@ Description: Dirac codec library Requires.private: @SCHRO_PKG_DEPS@ Version: @VERSION@ Libs: -L${libdir} -lschroedinger-@SCHRO_MAJORMINOR@ Libs.private: @PTHREAD_LIBS@ @LIBM@ Cflags: -I${includedir} schroedinger-1.0.11/README0000644000175000017500000000337411541755167012072 00000000000000 Schroedinger ============ Schroedinger (or "schro" for short) is an implementation of the Dirac and SMPTE VC-2 video compression specification. Dirac was developed by BBC Research & Development (http://www.bbc.co.uk/rd/) as an open technology with open licensing. Schroedinger is the C library implementing video encoding and decoding. Most end users will want to use an application that uses the Schroedinger library for encoding and decoding Dirac streams. A few such applications are Totem, VLC, and Mplayer. In addition, media frameworks such as GStreamer and decoding libraries such as ffmpeg can be configured to use Schroedinger either internally or via plugins. Schroedinger requires Orc (the Oil Runtime Compiler) in order to processing. Orc is a library that generates SIMD code at runtime based on simple rules and configurable parameters. Information about Orc can be found here: http://code.entropywave.com/projects/orc/ Schroedinger uses pkg-config both for finding Orc, and for allowing other build systems to find it. If you are having trouble with configure scripts not finding Orc or Schroedinger, you probably need to set the PKG_CONFIG_PATH environment variable (substitute /usr/local as necessary): export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig Schroedinger has a mailing list: https://lists.sourceforge.net/lists/listinfo/schrodinger-devel (Note that this is spelled with just an "o" instead of "oe" or o-umlaut "ö".) Web site: http://diracvideo.org/ Download: http://diracvideo.org/download/schroedinger/ Git repository: http://diracvideo.org/git?p=schroedinger.git;a=summary IRC Channel: #dirac at freenode.net Bug tracking: send mail. bugzilla is down and not missed. Maintainer: David Schleef schroedinger-1.0.11/schroedinger.spec0000664000175000017500000001054211707140271014523 00000000000000Name: libschroedinger Version: 1.0.11 Release: gst.1 Summary: Library for decoding and encoding video in the Dirac format Group: Applications/Multimedia License: LGPL/MIT/MPL URL: http://schrodinger.sourceforge.net/ Source: http://schrodinger.sourceforge.net/schroedinger-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: gtk-doc BuildRequires: liboil-devel >= 0.3.13 BuildRequires: gstreamer-devel BuildRequires: gstreamer-plugins-base-devel %description Library for decoding and encoding video in the Dirac format. It is implemented in ANSI C and optimized through the us of liboil. libschro is written as a collaboration between the BBC Research and Development, David Schleef and Fluendo. %package devel Summary: Development files and static libraries for libschroedinger Group: Development/Libraries Requires: %{name} = %{version}-%{release} %description devel libschroedinger-devel contains the files needed to build packages that depend on libschroedinger. %prep %setup -q -n schroedinger-%{version} %build %configure # parallel build does not work # make %{?_smp_mflags} make %install rm -rf $RPM_BUILD_ROOT %makeinstall # Clean out files that should not be part of the rpm. rm -f $RPM_BUILD_ROOT%{_libdir}/*.{a,la} rm -f $RPM_BUILD_ROOT%{_libdir}/gstreamer-0.10/*.{a,la} %clean rm -rf $RPM_BUILD_ROOT %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %files %defattr(-,root,root) %doc COPYING COPYING.MIT COPYING.GPL COPYING.LGPL COPYING.MPL %{_libdir}/libschroedinger-1.0.so.* %{_libdir}/gstreamer-0.10/libgstschro.so %files devel %defattr(-,root,root) %{_libdir}/pkgconfig/schroedinger-1.0.pc %{_libdir}/libschroedinger-1.0.so %{_includedir}/schroedinger-1.0/schroedinger/schroanalysis.h %{_includedir}/schroedinger-1.0/schroedinger/schroarith.h %{_includedir}/schroedinger-1.0/schroedinger/schroasync.h %{_includedir}/schroedinger-1.0/schroedinger/schrobitstream.h %{_includedir}/schroedinger-1.0/schroedinger/schrobuffer.h %{_includedir}/schroedinger-1.0/schroedinger/schrodebug.h %{_includedir}/schroedinger-1.0/schroedinger/schrodecoder.h %{_includedir}/schroedinger-1.0/schroedinger/schroencoder.h %{_includedir}/schroedinger-1.0/schroedinger/schroengine.h %{_includedir}/schroedinger-1.0/schroedinger/schrofft.h %{_includedir}/schroedinger-1.0/schroedinger/schrofilter.h %{_includedir}/schroedinger-1.0/schroedinger/schroframe.h %{_includedir}/schroedinger-1.0/schroedinger/schro.h %{_includedir}/schroedinger-1.0/schroedinger/schrohistogram.h %{_includedir}/schroedinger-1.0/schroedinger/schrometric.h %{_includedir}/schroedinger-1.0/schroedinger/schromotion.h %{_includedir}/schroedinger-1.0/schroedinger/schroparams.h %{_includedir}/schroedinger-1.0/schroedinger/schrophasecorrelation.h %{_includedir}/schroedinger-1.0/schroedinger/schroqueue.h %{_includedir}/schroedinger-1.0/schroedinger/schrossim.h %{_includedir}/schroedinger-1.0/schroedinger/schro-stdint.h %{_includedir}/schroedinger-1.0/schroedinger/schrotables.h %{_includedir}/schroedinger-1.0/schroedinger/schrounpack.h %{_includedir}/schroedinger-1.0/schroedinger/schroutils.h %{_includedir}/schroedinger-1.0/schroedinger/schrowavelet.h %{_includedir}/schroedinger-1.0/schroedinger/schrocog.h %{_includedir}/schroedinger-1.0/schroedinger/schrodomain.h %{_includedir}/schroedinger-1.0/schroedinger/schromotionest.h %{_includedir}/schroedinger-1.0/schroedinger/schrolimits.h %{_includedir}/schroedinger-1.0/schroedinger/schrolist.h %{_includedir}/schroedinger-1.0/schroedinger/schropack.h %{_includedir}/schroedinger-1.0/schroedinger/schrovideoformat.h %{_includedir}/schroedinger-1.0/schroedinger/schrovirtframe.h %{_includedir}/schroedinger-1.0/schroedinger/schroparse.h %{_datadir}/gtk-doc/html/schroedinger %changelog * Wed May 7 2008 Christian Schaller - Added Schrovirtframe.h * Fri Feb 22 2008 David Schleef - Update for 1.0 * Fri Feb 1 2008 Christian F.K. Schaller - add schromotionest.h - remove schropredict.h * Tue Jan 22 2008 Christian F.K. Schaller - Update for latest changes * Thu Apr 05 2007 Thomas Vander Stichele - Further updates. * Thu Apr 27 2006 Christian F.K. Schaller - Updates for carid -> schroedinger change schroedinger-1.0.11/autogen.sh0000755000175000017500000000042711541755167013207 00000000000000#!/bin/sh if [ $(whoami) = wladimir ]; then confflags="--prefix=/home/wladimir --with-cuda --disable-gtk-doc" elif [ $(whoami) = ds ]; then confflags="--enable-gtk-doc" else confflags="--enable-gtk-doc" fi autoreconf -i -f && ./configure --disable-static $confflags $@ schroedinger-1.0.11/COPYING.MIT0000644000175000017500000000230410735025462012655 00000000000000Copyright (c) 2006 BBC and Fluendo Unless otherwise indicated, Source Code is licensed under MIT license. See further explanation attached in License Statement (distributed in the file LICENSE). Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. schroedinger-1.0.11/NEWS0000644000175000017500000000653111541755167011707 00000000000000 1.0.10 ====== - Build fixes on various platforms - Speed increases for low-delay syntax - Fix unaligned access in orc code, which was uncovered by a recent Orc bug fix. Bump orc requirement to 0.4.10, which makes sure everyone works right. - No encoder changes 1.0.9 ===== - Orc: Complete conversion to Orc and removal of liboil dependency. - Added a lot of orc code to make things faster. A lot faster. - New motion vector generation, enabled by default. - New CBR rate control, enabled by default. - New scene change detection, enabled by default. - Encoder went through several rounds of tuning, improving quality greatly. - New encoder setting "force-profile". Allows easy access to one of three VC-2 profiles (vc2_low_delay, vc2_simple, vc2_main) for intermediate coding. Default is same as before: long-GOP Dirac. - Improved lossless encoding. Works in concert with force-profile. 1.0.8 ===== - encoder: various performance enhancements - Orc: More Orc conversion. The next release will likely require Orc to build. - Add a fast path for 8x8 non-obmc motion blocks. - encoder: Fix the queue-depth setting so that it actually works. - Fix a bitstream conformance bug. Shows up as a psychadelic color pattern. Broken bitstreams should be uncommon, however, if the decoder detects a broken bitstream, it will be played correctly. - Move GStreamer plugin to gst-plugins-bad - encoder: Strictly enforce bit rate. Encoded pictures are cut off if they are larger than the available buffer. - encoder: Change the backref engine to use an IPPPP... structure, using the last two pictures as references. 1.0.7 ===== - Somebody forgot to write release notes for 1.0.7 1.0.6 ===== - Requires liboil-0.3.16 - New configure flag '--disable-encoder' useful for embedded systems that don't require the encoder. - New constant-quality encoding mode, enabled by setting the encoder setting 'rate-control' to 6, and adjusting 'quality' from 0 to 10. (Interesting range is 3-7). - Various encoder improvements - Speed improvements in decoder - API additions for parsing streams in the decoder - API improvements handling interlaced video - Rewrite of the GStreamer elements, including new base classes for video encoding and decoding - Moved extra GStreamer elements to Cog - Experimental code that uses Orc instead of liboil (--enable-orc) 1.0.5-1.0.2 =========== - ... 1.0.1 ===== - Add API reference documentation for SchroDecoder. - Restructure API reference documentation, although coverage is very low. - Default GOP structure now uses 3 reference frames. This gives a very slight improvement in quality. - Fix encode/decode mismatch for low-delay syntax. - Fix brokenness in CBR intra-only encoding - Additional testing and code cleanups - Eliminate artificial width limitation in encoder and decoder. - Fix encoding/decoding of video offset and excursion. - Fix granulepos calculation in GStreamer encoder element - Set DELTA_UNIT correctly in GStreamer encoder element - Update code path used when pthread is disabled. 1.0.0 ===== - Major release 0.2.1 ===== - Encoder and decoder nearly complete. The bitstream is nearly compatible with Dirac, except in a few cases for predicted frames. Note that the Dirac bitstream isn't frozen, so that's kind of irrelevant. - Requires liboil-0.3.10. schroedinger-1.0.11/doc/0000775000175000017500000000000011707140273012020 500000000000000schroedinger-1.0.11/doc/xml/0000775000175000017500000000000011707140273012620 500000000000000schroedinger-1.0.11/doc/xml/schrodomain.xml0000664000175000017500000002712411707140273015576 00000000000000 schrodomain 3 SCHROEDINGER Library schrodomain Synopsis typedef SchroExecDomain; struct SchroMemoryDomain; #define SCHRO_EXEC_DOMAIN_CPU #define SCHRO_EXEC_DOMAIN_CUDA #define SCHRO_EXEC_DOMAIN_OPENGL #define SCHRO_MEMORY_DOMAIN_CPU #define SCHRO_MEMORY_DOMAIN_CUDA #define SCHRO_MEMORY_DOMAIN_OPENGL #define SCHRO_MEMORY_DOMAIN_SLOTS #define SCHRO_MEMORY_DOMAIN_SLOT_ALLOCATED #define SCHRO_MEMORY_DOMAIN_SLOT_IN_USE void * schro_memory_domain_alloc (SchroMemoryDomain *domain, int size); void * schro_memory_domain_alloc_2d (SchroMemoryDomain *domain, int depth, int width, int height); void schro_memory_domain_free (SchroMemoryDomain *domain); void schro_memory_domain_memfree (SchroMemoryDomain *domain, void *ptr); SchroMemoryDomain * schro_memory_domain_new (void); SchroMemoryDomain * schro_memory_domain_new_cuda (void); SchroMemoryDomain * schro_memory_domain_new_local (void); Description Details SchroExecDomain SchroExecDomain typedef int SchroExecDomain; struct SchroMemoryDomain SchroMemoryDomain struct SchroMemoryDomain { SchroMutex * mutex; unsigned int flags; void *(*alloc) (int size); void *(*alloc_2d) (int depth, int width, int height); void (*free) (void *ptr, int size); struct { unsigned int flags; void *ptr; int size; void *priv; } slots[SCHRO_MEMORY_DOMAIN_SLOTS]; }; SCHRO_EXEC_DOMAIN_CPU SCHRO_EXEC_DOMAIN_CPU #define SCHRO_EXEC_DOMAIN_CPU 0x0001 SCHRO_EXEC_DOMAIN_CUDA SCHRO_EXEC_DOMAIN_CUDA #define SCHRO_EXEC_DOMAIN_CUDA 0x0002 SCHRO_EXEC_DOMAIN_OPENGL SCHRO_EXEC_DOMAIN_OPENGL #define SCHRO_EXEC_DOMAIN_OPENGL 0x0003 SCHRO_MEMORY_DOMAIN_CPU SCHRO_MEMORY_DOMAIN_CPU #define SCHRO_MEMORY_DOMAIN_CPU 0x0001 SCHRO_MEMORY_DOMAIN_CUDA SCHRO_MEMORY_DOMAIN_CUDA #define SCHRO_MEMORY_DOMAIN_CUDA 0x0002 SCHRO_MEMORY_DOMAIN_OPENGL SCHRO_MEMORY_DOMAIN_OPENGL #define SCHRO_MEMORY_DOMAIN_OPENGL 0x0004 SCHRO_MEMORY_DOMAIN_SLOTS SCHRO_MEMORY_DOMAIN_SLOTS #define SCHRO_MEMORY_DOMAIN_SLOTS 1000 SCHRO_MEMORY_DOMAIN_SLOT_ALLOCATED SCHRO_MEMORY_DOMAIN_SLOT_ALLOCATED #define SCHRO_MEMORY_DOMAIN_SLOT_ALLOCATED 0x0001 SCHRO_MEMORY_DOMAIN_SLOT_IN_USE SCHRO_MEMORY_DOMAIN_SLOT_IN_USE #define SCHRO_MEMORY_DOMAIN_SLOT_IN_USE 0x0002 schro_memory_domain_alloc () schro_memory_domain_alloc void * schro_memory_domain_alloc (SchroMemoryDomain *domain, int size); schro_memory_domain_alloc_2d () schro_memory_domain_alloc_2d void * schro_memory_domain_alloc_2d (SchroMemoryDomain *domain, int depth, int width, int height); schro_memory_domain_free () schro_memory_domain_free void schro_memory_domain_free (SchroMemoryDomain *domain); schro_memory_domain_memfree () schro_memory_domain_memfree void schro_memory_domain_memfree (SchroMemoryDomain *domain, void *ptr); schro_memory_domain_new () schro_memory_domain_new SchroMemoryDomain * schro_memory_domain_new (void); schro_memory_domain_new_cuda () schro_memory_domain_new_cuda SchroMemoryDomain * schro_memory_domain_new_cuda (void); schro_memory_domain_new_local () schro_memory_domain_new_local SchroMemoryDomain * schro_memory_domain_new_local (void); schroedinger-1.0.11/doc/xml/schrohistogram.xml0000664000175000017500000001161311707140273016320 00000000000000 schrohistogram 3 SCHROEDINGER Library schrohistogram Synopsis void schro_histogram_table_generate (SchroHistogramTable *table, double (*func) (int value, void *priv), void *priv); Description Details schro_histogram_table_generate () schro_histogram_table_generate void schro_histogram_table_generate (SchroHistogramTable *table, double (*func) (int value, void *priv), void *priv); table : int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: schroedinger-1.0.11/doc/xml/schrovideoformat.xml0000664000175000017500000004015711707140273016647 00000000000000 schrovideoformat 3 SCHROEDINGER Library schrovideoformat Synopsis int schro_video_format_validate (SchroVideoFormat *format); void schro_video_format_set_std_video_format (SchroVideoFormat *format, SchroVideoFormatEnum index); SchroVideoFormatEnum schro_video_format_get_std_video_format (SchroVideoFormat *format); void schro_video_format_set_std_frame_rate (SchroVideoFormat *format, int index); int schro_video_format_get_std_frame_rate (SchroVideoFormat *format); void schro_video_format_set_std_aspect_ratio (SchroVideoFormat *format, int index); int schro_video_format_get_std_aspect_ratio (SchroVideoFormat *format); void schro_video_format_set_std_signal_range (SchroVideoFormat *format, SchroSignalRange index); SchroSignalRange schro_video_format_get_std_signal_range (SchroVideoFormat *format); void schro_video_format_set_std_colour_spec (SchroVideoFormat *format, SchroColourSpec index); SchroColourSpec schro_video_format_get_std_colour_spec (SchroVideoFormat *format); Description Details schro_video_format_validate () schro_video_format_validate int schro_video_format_validate (SchroVideoFormat *format); schro_video_format_set_std_video_format () schro_video_format_set_std_video_format void schro_video_format_set_std_video_format (SchroVideoFormat *format, SchroVideoFormatEnum index); Initializes the video format structure pointed to by format to the standard Dirac video formats specified by index. schro_video_format_get_std_video_format () schro_video_format_get_std_video_format SchroVideoFormatEnum schro_video_format_get_std_video_format (SchroVideoFormat *format); In Dirac streams, video formats are encoded by specifying a standard format, and then modifying that to get the desired video format. This function guesses a standard format to use as a starting point for encoding the video format pointed to by format. format : pointer to SchroVideoFormat structure Returns :an index to the optimal standard format schro_video_format_set_std_frame_rate () schro_video_format_set_std_frame_rate void schro_video_format_set_std_frame_rate (SchroVideoFormat *format, int index); Sets the frame rate of the video format structure pointed to by format to the Dirac standard frame specified by index. schro_video_format_get_std_frame_rate () schro_video_format_get_std_frame_rate int schro_video_format_get_std_frame_rate (SchroVideoFormat *format); In Dirac bitstreams, frame rates can be one of several standard frame rates, encoded as an index, or the numerator and denominator of the framerate can be encoded directly. This function looks up the frame rate contained in the video format structure format in the list of standard frame rates. If the frame rate is a standard frame rate, the corresponding index is returned, otherwise 0 is returned. Returns :index to a standard Dirac frame rate, or 0 if the frame rate is custom. schro_video_format_set_std_aspect_ratio () schro_video_format_set_std_aspect_ratio void schro_video_format_set_std_aspect_ratio (SchroVideoFormat *format, int index); schro_video_format_get_std_aspect_ratio () schro_video_format_get_std_aspect_ratio int schro_video_format_get_std_aspect_ratio (SchroVideoFormat *format); schro_video_format_set_std_signal_range () schro_video_format_set_std_signal_range void schro_video_format_set_std_signal_range (SchroVideoFormat *format, SchroSignalRange index); Sets the signal range of the video format structure to one of the standard values indicated by index. schro_video_format_get_std_signal_range () schro_video_format_get_std_signal_range SchroSignalRange schro_video_format_get_std_signal_range (SchroVideoFormat *format); In Dirac bitstreams, signal ranges can be one of several standard signal ranges, encoded as an index, or the extents of the signal range can be encoded directly. This function looks up the signal range contained in the video format structure format in the list of standard signal ranges. If the signal range is a standard signal range, the corresponding index is returned, otherwise 0 is returned. format : pointer to SchroVideoFormat structure Returns :index to standard signal range, or 0 if there is no corresponding standard signal range. schro_video_format_set_std_colour_spec () schro_video_format_set_std_colour_spec void schro_video_format_set_std_colour_spec (SchroVideoFormat *format, SchroColourSpec index); Sets the colour specification of the video format structure to one of the standard values indicated by index. format : pointer to SchroVideoFormat structure index : index to standard colour specification schro_video_format_get_std_colour_spec () schro_video_format_get_std_colour_spec SchroColourSpec schro_video_format_get_std_colour_spec (SchroVideoFormat *format); In Dirac bitstreams, colour specifications can be one of several standard colour specifications, encoded as an index, or the individual parts of the colour specication can be encoded. This function looks up the colour specification contained in the video format structure format in the list of standard colour specifications. If the colour specification is a standard colour specification, the corresponding index is returned, otherwise 0 is returned. format : pointer to SchroVideoFormat structure Returns :index to standard colour specification, or 0 if there is no corresponding standard colour specification. schroedinger-1.0.11/doc/xml/schrolist.xml0000664000175000017500000002753211707140273015305 00000000000000 schrolist 3 SCHROEDINGER Library schrolist Synopsis struct SchroList; void (*SchroListFreeFunc) (void *member, void *priv); void schro_list_append (SchroList *list, void *value); void schro_list_delete (SchroList *list, int i); void schro_list_free (SchroList *list); void * schro_list_get (SchroList *list, int i); int schro_list_get_size (SchroList *list); void schro_list_insert (SchroList *list, int i, void *value); SchroList * schro_list_new (void); SchroList * schro_list_new_full (SchroListFreeFunc freefunc, void *priv); void schro_list_prepend (SchroList *list, void *value); void * schro_list_remove (SchroList *list, int i); void * schro_list_replace (SchroList *list, int i, void *value); Description Details struct SchroList SchroList struct SchroList { void **members; int n; int n_alloc; SchroListFreeFunc free; void *priv; }; SchroListFreeFunc () SchroListFreeFunc void (*SchroListFreeFunc) (void *member, void *priv); schro_list_append () schro_list_append void schro_list_append (SchroList *list, void *value); schro_list_delete () schro_list_delete void schro_list_delete (SchroList *list, int i); schro_list_free () schro_list_free void schro_list_free (SchroList *list); schro_list_get () schro_list_get void * schro_list_get (SchroList *list, int i); schro_list_get_size () schro_list_get_size int schro_list_get_size (SchroList *list); schro_list_insert () schro_list_insert void schro_list_insert (SchroList *list, int i, void *value); schro_list_new () schro_list_new SchroList * schro_list_new (void); schro_list_new_full () schro_list_new_full SchroList * schro_list_new_full (SchroListFreeFunc freefunc, void *priv); schro_list_prepend () schro_list_prepend void schro_list_prepend (SchroList *list, void *value); schro_list_remove () schro_list_remove void * schro_list_remove (SchroList *list, int i); schro_list_replace () schro_list_replace void * schro_list_replace (SchroList *list, int i, void *value); schroedinger-1.0.11/doc/xml/schroarith.xml0000664000175000017500000004511411707140273015435 00000000000000 schroarith 3 SCHROEDINGER Library schroarith Synopsis struct SchroArith; struct SchroArithContext; SchroArith * schro_arith_new (void); void schro_arith_free (SchroArith *arith); void schro_arith_decode_init (SchroArith *arith, SchroBuffer *buffer); void schro_arith_encode_init (SchroArith *arith, SchroBuffer *buffer); void schro_arith_flush (SchroArith *arith); int schro_arith_decode_bit (SchroArith *arith, unsigned int context); void schro_arith_decode_flush (SchroArith *arith); int schro_arith_decode_sint (SchroArith *arith, unsigned int cont_context, unsigned int value_context, unsigned int sign_context); int schro_arith_decode_uint (SchroArith *arith, unsigned int cont_context, unsigned int value_context); void schro_arith_encode_bit (SchroArith *arith, int context, int value); void schro_arith_encode_sint (SchroArith *arith, int cont_context, int value_context, int sign_context, int value); void schro_arith_encode_uint (SchroArith *arith, int cont_context, int value_context, int value); void schro_arith_estimate_init (SchroArith *arith); void schro_arith_estimate_sint (SchroArith *arith, int cont_context, int value_context, int sign_context, int value); void schro_arith_estimate_uint (SchroArith *arith, int cont_context, int value_context, int value); Description Details struct SchroArith SchroArith struct SchroArith { SchroBuffer *buffer; uint8_t *dataptr; uintptr_t offset; uint32_t range[2]; uint32_t code; uint32_t range_size; int cntr; int carry; uint16_t probabilities[SCHRO_CTX_LAST]; uint16_t lut[512]; SchroArithContext contexts[SCHRO_CTX_LAST]; }; struct SchroArithContext SchroArithContext struct SchroArithContext { unsigned int next; #ifdef unused int stat_range; int n_bits; int n_symbols; int ones; #endif }; schro_arith_new () schro_arith_new SchroArith * schro_arith_new (void); schro_arith_free () schro_arith_free void schro_arith_free (SchroArith *arith); schro_arith_decode_init () schro_arith_decode_init void schro_arith_decode_init (SchroArith *arith, SchroBuffer *buffer); schro_arith_encode_init () schro_arith_encode_init void schro_arith_encode_init (SchroArith *arith, SchroBuffer *buffer); schro_arith_flush () schro_arith_flush void schro_arith_flush (SchroArith *arith); schro_arith_decode_bit () schro_arith_decode_bit int schro_arith_decode_bit (SchroArith *arith, unsigned int context); schro_arith_decode_flush () schro_arith_decode_flush void schro_arith_decode_flush (SchroArith *arith); schro_arith_decode_sint () schro_arith_decode_sint int schro_arith_decode_sint (SchroArith *arith, unsigned int cont_context, unsigned int value_context, unsigned int sign_context); schro_arith_decode_uint () schro_arith_decode_uint int schro_arith_decode_uint (SchroArith *arith, unsigned int cont_context, unsigned int value_context); schro_arith_encode_bit () schro_arith_encode_bit void schro_arith_encode_bit (SchroArith *arith, int context, int value); schro_arith_encode_sint () schro_arith_encode_sint void schro_arith_encode_sint (SchroArith *arith, int cont_context, int value_context, int sign_context, int value); schro_arith_encode_uint () schro_arith_encode_uint void schro_arith_encode_uint (SchroArith *arith, int cont_context, int value_context, int value); schro_arith_estimate_init () schro_arith_estimate_init void schro_arith_estimate_init (SchroArith *arith); schro_arith_estimate_sint () schro_arith_estimate_sint void schro_arith_estimate_sint (SchroArith *arith, int cont_context, int value_context, int sign_context, int value); schro_arith_estimate_uint () schro_arith_estimate_uint void schro_arith_estimate_uint (SchroArith *arith, int cont_context, int value_context, int value); schroedinger-1.0.11/doc/xml/schrodecoder.xml0000664000175000017500000012117511707140273015735 00000000000000 schrodecoder 3 SCHROEDINGER Library schrodecoder Synopsis struct SchroDecoder; SchroDecoder * schro_decoder_new (void); void schro_decoder_free (SchroDecoder *decoder); void schro_decoder_reset (SchroDecoder *decoder); SchroVideoFormat * schro_decoder_get_video_format (SchroDecoder *decoder); void schro_decoder_add_output_picture (SchroDecoder *decoder, SchroFrame *frame); int schro_decoder_push_ready (SchroDecoder *decoder); int schro_decoder_push (SchroDecoder *decoder, SchroBuffer *buffer); int schro_decoder_push_end_of_stream (SchroDecoder *decoder); SchroFrame * schro_decoder_pull (SchroDecoder *decoder); int schro_decoder_wait (SchroDecoder *decoder); void schro_decoder_set_earliest_frame (SchroDecoder *decoder, SchroPictureNumber earliest_frame); void schro_decoder_set_skip_ratio (SchroDecoder *decoder, double ratio); SchroPictureNumber schro_decoder_get_picture_number (SchroDecoder *decoder); int schro_decoder_decode_parse_header (SchroUnpack *unpack); void schro_decoder_decode_transform_data (SchroPicture *picture); void schro_decoder_decode_lowdelay_transform_data (SchroPicture *picture); void schro_decoder_subband_dc_predict (SchroFrameData *fd); void schro_decoder_decode_block_data (SchroPicture *picture); void schro_decoder_decode_macroblock (SchroPicture *picture, SchroArith **arith, SchroUnpack *unpack, int i, int j); void schro_decoder_decode_prediction_unit (SchroPicture *picture, SchroArith **arith, SchroUnpack *unpack, SchroMotionVector *motion_vectors, int x, int y); void schro_decoder_init_subband_frame_data_interleaved (SchroPicture *picture); int schro_decoder_iterate_picture (SchroDecoderInstance *instance, SchroBuffer *buffer, SchroUnpack *unpack, int parse_code); void schro_decoder_parse_block_data (SchroPicture *picture, SchroUnpack *unpack); void schro_decoder_parse_lowdelay_transform_data (SchroPicture *picture, SchroUnpack *unpack); void schro_decoder_parse_picture (SchroPicture *picture, SchroUnpack *unpack); void schro_decoder_parse_picture_header (SchroPicture *picture, SchroUnpack *unpack); void schro_decoder_parse_picture_prediction_parameters (SchroPicture *picture, SchroUnpack *unpack); void schro_decoder_parse_transform_data (SchroPicture *picture, SchroUnpack *unpack); void schro_decoder_parse_transform_parameters (SchroPicture *picture, SchroUnpack *unpack); struct SchroPicture; SchroPicture * schro_picture_new (SchroDecoderInstance *instance); SchroPicture * schro_picture_ref (SchroPicture *picture); void schro_picture_unref (SchroPicture *picture); Description Details struct SchroDecoder SchroDecoder struct SchroDecoder { }; schro_decoder_new () schro_decoder_new SchroDecoder * schro_decoder_new (void); Creates a new decoder object. The decoder object should be freed using schro_decoder_free() when it is no longer needed. Returns :a new decoder object schro_decoder_free () schro_decoder_free void schro_decoder_free (SchroDecoder *decoder); Frees a decoder object. decoder : decoder object schro_decoder_reset () schro_decoder_reset void schro_decoder_reset (SchroDecoder *decoder); Resets the internal state of the decoder. This function should be called after a discontinuity of the stream, for example, as the result of a seek. decoder : a decoder object schro_decoder_get_video_format () schro_decoder_get_video_format SchroVideoFormat * schro_decoder_get_video_format (SchroDecoder *decoder); Returns a structure containing information on the video format being decoded by the decoder. This structure should be freed using free() when it is no longer needed. decoder : a decoder object Returns :a video format structure schro_decoder_add_output_picture () schro_decoder_add_output_picture void schro_decoder_add_output_picture (SchroDecoder *decoder, SchroFrame *frame); Adds a frame provided by the application to the picture queue. Frames in the picture queue will be used for decoding images, and are eventually returned to the application by schro_decoder_pull(). The caller loses its reference to frame after calling this function. decoder : a decoder object frame : the frame to add to the picture queue schro_decoder_push_ready () schro_decoder_push_ready int schro_decoder_push_ready (SchroDecoder *decoder); This function is used by the application to determine if it should push more data to the decoder. decoder : a decoder object Returns :TRUE if the decoder is ready for more data schro_decoder_push () schro_decoder_push int schro_decoder_push (SchroDecoder *decoder, SchroBuffer *buffer); schro_decoder_push_end_of_stream () schro_decoder_push_end_of_stream int schro_decoder_push_end_of_stream (SchroDecoder *decoder); schro_decoder_pull () schro_decoder_pull SchroFrame * schro_decoder_pull (SchroDecoder *decoder); Removes the next picture from the picture queue and returns a frame containing the image. The application provides the frames that pictures are decoded into, and the same frames are returned from this function. However, the order of frames returned may be different than the order that the application provides the frames to the decoder. An exception to this is that skipped frames are indicated by a frame having a height and width equal to 0. This frame is created using schro_frame_new(), and is not one of the frames provided by the application. Frames should be freed using schro_frame_unref() when no longer needed. The frame must not be reused by the application, since it may contain a reference frame still in use by the decoder. decoder : a decoder object Returns :the next picture schro_decoder_wait () schro_decoder_wait int schro_decoder_wait (SchroDecoder *decoder); Waits until the decoder requires the application to do something, e.g., push more data or remove a frame from the picture queue, and then returns the decoder status. decoder : a decoder object Returns :decoder status schro_decoder_set_earliest_frame () schro_decoder_set_earliest_frame void schro_decoder_set_earliest_frame (SchroDecoder *decoder, SchroPictureNumber earliest_frame); The application can tell the decoder the earliest frame it is interested in by calling this function. Subsequent calls to schro_decoder_pull() will only return pictures with picture numbers greater than or equal to this number. The decoder will avoid decoding pictures that will not be displayed or used as reference pictures. This feature can be used for frame-accurate seeking. This function can be called at any time during decoding. Calling this function with a picture number less than the current earliest frame setting is invalid. decoder : a decoder object earliest_frame : the earliest frame that the application is interested in schro_decoder_set_skip_ratio () schro_decoder_set_skip_ratio void schro_decoder_set_skip_ratio (SchroDecoder *decoder, double ratio); Sets the skip ratio of the decoder. The skip ratio is used by the decoder to skip decoding of some pictures. Reference pictures are always decoded. A picture is skipped when the running average of the proportion of pictures skipped is less than the skip ratio. Reference frames are always decoded and contribute to the running average. Thus, the actual ratio of skipped pictures may be larger than the requested skip ratio. The decoder indicates a skipped picture in the pictures returned by schro_decoder_pull() by a frame that has a width and height of 0. The default skip ratio is 1.0, indicating that all pictures should be decoded. A skip ratio of 0.0 indicates that no pictures should be decoded, although as mentioned above, some pictures will be decoded anyway. Values outside the range of 0.0 to 1.0 are quietly clamped to that range. This function may be called at any time during decoding. decoder : a decoder object ratio : skip ratio. schro_decoder_get_picture_number () schro_decoder_get_picture_number SchroPictureNumber schro_decoder_get_picture_number (SchroDecoder *decoder); Returns the picture number of the next picture that will be returned by schro_decoder_pull(). decoder : a decoder object Returns :a picture number schro_decoder_decode_parse_header () schro_decoder_decode_parse_header int schro_decoder_decode_parse_header (SchroUnpack *unpack); schro_decoder_decode_transform_data () schro_decoder_decode_transform_data void schro_decoder_decode_transform_data (SchroPicture *picture); schro_decoder_decode_lowdelay_transform_data () schro_decoder_decode_lowdelay_transform_data void schro_decoder_decode_lowdelay_transform_data (SchroPicture *picture); schro_decoder_subband_dc_predict () schro_decoder_subband_dc_predict void schro_decoder_subband_dc_predict (SchroFrameData *fd); schro_decoder_decode_block_data () schro_decoder_decode_block_data void schro_decoder_decode_block_data (SchroPicture *picture); schro_decoder_decode_macroblock () schro_decoder_decode_macroblock void schro_decoder_decode_macroblock (SchroPicture *picture, SchroArith **arith, SchroUnpack *unpack, int i, int j); schro_decoder_decode_prediction_unit () schro_decoder_decode_prediction_unit void schro_decoder_decode_prediction_unit (SchroPicture *picture, SchroArith **arith, SchroUnpack *unpack, SchroMotionVector *motion_vectors, int x, int y); schro_decoder_init_subband_frame_data_interleaved () schro_decoder_init_subband_frame_data_interleaved void schro_decoder_init_subband_frame_data_interleaved (SchroPicture *picture); schro_decoder_iterate_picture () schro_decoder_iterate_picture int schro_decoder_iterate_picture (SchroDecoderInstance *instance, SchroBuffer *buffer, SchroUnpack *unpack, int parse_code); schro_decoder_parse_block_data () schro_decoder_parse_block_data void schro_decoder_parse_block_data (SchroPicture *picture, SchroUnpack *unpack); schro_decoder_parse_lowdelay_transform_data () schro_decoder_parse_lowdelay_transform_data void schro_decoder_parse_lowdelay_transform_data (SchroPicture *picture, SchroUnpack *unpack); schro_decoder_parse_picture () schro_decoder_parse_picture void schro_decoder_parse_picture (SchroPicture *picture, SchroUnpack *unpack); schro_decoder_parse_picture_header () schro_decoder_parse_picture_header void schro_decoder_parse_picture_header (SchroPicture *picture, SchroUnpack *unpack); schro_decoder_parse_picture_prediction_parameters () schro_decoder_parse_picture_prediction_parameters void schro_decoder_parse_picture_prediction_parameters (SchroPicture *picture, SchroUnpack *unpack); schro_decoder_parse_transform_data () schro_decoder_parse_transform_data void schro_decoder_parse_transform_data (SchroPicture *picture, SchroUnpack *unpack); schro_decoder_parse_transform_parameters () schro_decoder_parse_transform_parameters void schro_decoder_parse_transform_parameters (SchroPicture *picture, SchroUnpack *unpack); struct SchroPicture SchroPicture struct SchroPicture { int refcount; SchroDecoderInstance *decoder_instance; int busy; int skip; int error; SchroBuffer *input_buffer; SchroParams params; SchroPictureNumber picture_number; SchroPictureNumber reference1; SchroPictureNumber reference2; SchroPictureNumber retired_picture_number; SchroPicture *ref0; SchroPicture *ref1; SchroFrame *planar_output_frame; SchroFrame *ref_output_frame; SchroAsyncStage stages[9]; int is_ref; int zero_residual; SchroFrame *transform_frame; SchroFrame *frame; SchroFrame *mc_tmp_frame; SchroMotion *motion; SchroFrame *output_picture; SchroUpsampledFrame *upsampled_frame; int subband_length[3][SCHRO_LIMIT_SUBBANDS]; int subband_quant_index[3][SCHRO_LIMIT_SUBBANDS]; SchroBuffer *subband_buffer[3][SCHRO_LIMIT_SUBBANDS]; SchroFrameData subband_data[3][SCHRO_LIMIT_SUBBANDS]; SchroBuffer *motion_buffers[9]; SchroBuffer *lowdelay_buffer; int has_md5; uint8_t md5_checksum[32]; /* private data that is associated with this picture */ SchroTag *tag; }; schro_picture_new () schro_picture_new SchroPicture * schro_picture_new (SchroDecoderInstance *instance); Creates a new picture for decoder. Internal API. Returns :a new picture schro_picture_ref () schro_picture_ref SchroPicture * schro_picture_ref (SchroPicture *picture); schro_picture_unref () schro_picture_unref void schro_picture_unref (SchroPicture *picture); schroedinger-1.0.11/doc/xml/schrosubband.xml0000664000175000017500000001155711707140273015750 00000000000000 schrosubband 3 SCHROEDINGER Library schrosubband Synopsis #define SCHRO_SUBBAND_IS_HORIZONTALLY_ORIENTED(position) #define SCHRO_SUBBAND_IS_VERTICALLY_ORIENTED(position) #define SCHRO_SUBBAND_SHIFT (position) void schro_subband_get_frame_data (SchroFrameData *dest, SchroFrame *frame, int component, int position, SchroParams *params); int schro_subband_get_position (int index); Description Details SCHRO_SUBBAND_IS_HORIZONTALLY_ORIENTED() SCHRO_SUBBAND_IS_HORIZONTALLY_ORIENTED #define SCHRO_SUBBAND_IS_HORIZONTALLY_ORIENTED(position) (((position)&3) == 2) SCHRO_SUBBAND_IS_VERTICALLY_ORIENTED() SCHRO_SUBBAND_IS_VERTICALLY_ORIENTED #define SCHRO_SUBBAND_IS_VERTICALLY_ORIENTED(position) (((position)&3) == 1) SCHRO_SUBBAND_SHIFT() SCHRO_SUBBAND_SHIFT #define SCHRO_SUBBAND_SHIFT(position) ((position)>>2) schro_subband_get_frame_data () schro_subband_get_frame_data void schro_subband_get_frame_data (SchroFrameData *dest, SchroFrame *frame, int component, int position, SchroParams *params); schro_subband_get_position () schro_subband_get_position int schro_subband_get_position (int index); schroedinger-1.0.11/doc/xml/schroencoder.xml0000664000175000017500000017315211707140273015751 00000000000000 schroencoder 3 SCHROEDINGER Library schroencoder Synopsis struct SchroEncoder; struct SchroEncoderFrame; enum SchroEncoderFrameStateEnum; enum SchroEncoderPerceptualEnum; enum SchroQuantiserEngineEnum; enum SchroStateEnum; enum SchroEncoderGOPEnum; enum SchroEncoderRateControlEnum; struct SchroEncoderSetting; enum SchroEncoderSettingTypeEnum; int (*SchroEngineIterateFunc) (SchroEncoder *encoder); SchroEncoder * schro_encoder_new (void); void schro_encoder_free (SchroEncoder *encoder); SchroVideoFormat * schro_encoder_get_video_format (SchroEncoder *encoder); void schro_encoder_set_video_format (SchroEncoder *encoder, SchroVideoFormat *video_format); void schro_encoder_end_of_stream (SchroEncoder *encoder); void schro_encoder_push_frame (SchroEncoder *encoder, SchroFrame *frame); void schro_encoder_encode_parse_info (SchroPack *bits, int parse_code); SchroBuffer * schro_encoder_pull (SchroEncoder *encoder, int *n_decodable_frames); void schro_encoder_analyse_picture (SchroAsyncStage *stage); void schro_encoder_calculate_subband_weights (SchroEncoder *encoder, double (*perceptual_weight) (double)); void schro_encoder_calculate_test_info (SchroEncoderFrame *frame); void schro_encoder_choose_quantisers (SchroEncoderFrame *frame); void schro_encoder_clean_up_transform (SchroEncoderFrame *frame); SchroBuffer * schro_encoder_encode_auxiliary_data (SchroEncoder *encoder, SchroAuxiliaryDataID id, const void *data, int size); SchroBuffer * schro_encoder_encode_end_of_stream (SchroEncoder *encoder); void schro_encoder_encode_lowdelay_transform_data (SchroEncoderFrame *frame); void schro_encoder_encode_picture (SchroAsyncStage *stage); void schro_encoder_encode_picture_header (SchroEncoderFrame *frame); void schro_encoder_encode_subband (SchroEncoderFrame *frame, int component, int index); void schro_encoder_encode_subband_noarith (SchroEncoderFrame *frame, int component, int index); int schro_encoder_engine_backref (SchroEncoder *encoder); int schro_encoder_engine_backtest (SchroEncoder *encoder); int schro_encoder_engine_intra_only (SchroEncoder *encoder); int schro_encoder_engine_lossless (SchroEncoder *encoder); int schro_encoder_engine_lowdelay (SchroEncoder *encoder); int schro_encoder_engine_test_intra (SchroEncoder *encoder); void schro_encoder_estimate_entropy (SchroEncoderFrame *frame); void schro_encoder_frame_analyse (SchroEncoderFrame *frame); void schro_encoder_frame_downsample (SchroEncoderFrame *frame); void schro_encoder_frame_insert_buffer (SchroEncoderFrame *frame, SchroBuffer *buffer); SchroEncoderFrame * schro_encoder_frame_new (SchroEncoder *encoder); SchroFrame * schro_encoder_frame_queue_get (SchroEncoder *encoder, SchroPictureNumber frame_number); void schro_encoder_frame_queue_remove (SchroEncoder *encoder, SchroPictureNumber frame_number); void schro_encoder_frame_ref (SchroEncoderFrame *frame); void schro_encoder_frame_unref (SchroEncoderFrame *frame); void schro_encoder_init_subbands (SchroEncoderFrame *frame); void schro_encoder_insert_buffer (SchroEncoder *encoder, SchroBuffer *buffer); void schro_encoder_output_push (SchroEncoder *encoder, SchroBuffer *buffer, int slot, int presentation_frame); double schro_encoder_perceptual_weight_ccir959 (double cpd); double schro_encoder_perceptual_weight_constant (double cpd); double schro_encoder_perceptual_weight_moo (double cpd); void schro_encoder_postanalyse_picture (SchroAsyncStage *stage); int schro_encoder_push_ready (SchroEncoder *encoder); void schro_encoder_recalculate_allocations (SchroEncoder *encoder); void schro_encoder_reconstruct_picture (SchroAsyncStage *stage); SchroEncoderFrame * schro_encoder_reference_get (SchroEncoder *encoder, SchroPictureNumber frame_number); void schro_encoder_set_default_subband_weights (SchroEncoder *encoder); void schro_encoder_start (SchroEncoder *encoder); SchroStateEnum schro_encoder_wait (SchroEncoder *encoder); int schro_encoder_get_n_settings (void); const SchroEncoderSetting * schro_encoder_get_setting_info (int i); void schro_encoder_global_estimation (SchroEncoderFrame *frame); void schro_encoder_init_error_tables (SchroEncoder *encoder); void schro_encoder_phasecorr_estimation (SchroPhaseCorr *pc); double schro_encoder_setting_get_double (SchroEncoder *encoder, const char *name); void schro_encoder_setting_set_double (SchroEncoder *encoder, const char *name, double d); Description Details struct SchroEncoder SchroEncoder struct SchroEncoder { }; struct SchroEncoderFrame SchroEncoderFrame struct SchroEncoderFrame { }; enum SchroEncoderFrameStateEnum SchroEncoderFrameStateEnum typedef enum { SCHRO_ENCODER_FRAME_STAGE_NEW = 0, SCHRO_ENCODER_FRAME_STAGE_ANALYSE, SCHRO_ENCODER_FRAME_STAGE_SC_DETECT_1, SCHRO_ENCODER_FRAME_STAGE_SC_DETECT_2, SCHRO_ENCODER_FRAME_STAGE_HAVE_GOP, SCHRO_ENCODER_FRAME_STAGE_HAVE_PARAMS, SCHRO_ENCODER_FRAME_STAGE_PREDICT_ROUGH, SCHRO_ENCODER_FRAME_STAGE_PREDICT_PEL, SCHRO_ENCODER_FRAME_STAGE_PREDICT_SUBPEL, SCHRO_ENCODER_FRAME_STAGE_MODE_DECISION, SCHRO_ENCODER_FRAME_STAGE_HAVE_REFS, SCHRO_ENCODER_FRAME_STAGE_HAVE_QUANTS, SCHRO_ENCODER_FRAME_STAGE_ENCODING, SCHRO_ENCODER_FRAME_STAGE_RECONSTRUCT, SCHRO_ENCODER_FRAME_STAGE_POSTANALYSE, SCHRO_ENCODER_FRAME_STAGE_DONE, SCHRO_ENCODER_FRAME_STAGE_FREE, SCHRO_ENCODER_FRAME_STAGE_LAST /* this should be last */ } SchroEncoderFrameStateEnum; enum SchroEncoderPerceptualEnum SchroEncoderPerceptualEnum typedef enum { SCHRO_ENCODER_PERCEPTUAL_CONSTANT, SCHRO_ENCODER_PERCEPTUAL_CCIR959, SCHRO_ENCODER_PERCEPTUAL_MOO, SCHRO_ENCODER_PERCEPTUAL_MANOS_SAKRISON } SchroEncoderPerceptualEnum; enum SchroQuantiserEngineEnum SchroQuantiserEngineEnum typedef enum { SCHRO_QUANTISER_ENGINE_SIMPLE, SCHRO_QUANTISER_ENGINE_RDO_BIT_ALLOCATION, SCHRO_QUANTISER_ENGINE_CBR, SCHRO_QUANTISER_ENGINE_LOSSLESS, SCHRO_QUANTISER_ENGINE_LOWDELAY, SCHRO_QUANTISER_ENGINE_RDO_LAMBDA, SCHRO_QUANTISER_ENGINE_CONSTANT_ERROR } SchroQuantiserEngineEnum; enum SchroStateEnum SchroStateEnum typedef enum { SCHRO_STATE_NEED_FRAME, SCHRO_STATE_HAVE_BUFFER, SCHRO_STATE_AGAIN, SCHRO_STATE_END_OF_STREAM } SchroStateEnum; enum SchroEncoderGOPEnum SchroEncoderGOPEnum typedef enum { SCHRO_ENCODER_GOP_ADAPTIVE, SCHRO_ENCODER_GOP_INTRA_ONLY, SCHRO_ENCODER_GOP_BACKREF, SCHRO_ENCODER_GOP_CHAINED_BACKREF, SCHRO_ENCODER_GOP_BIREF, SCHRO_ENCODER_GOP_CHAINED_BIREF, } SchroEncoderGOPEnum; enum SchroEncoderRateControlEnum SchroEncoderRateControlEnum typedef enum { SCHRO_ENCODER_RATE_CONTROL_CONSTANT_NOISE_THRESHOLD, SCHRO_ENCODER_RATE_CONTROL_CONSTANT_BITRATE, SCHRO_ENCODER_RATE_CONTROL_LOW_DELAY, SCHRO_ENCODER_RATE_CONTROL_LOSSLESS, SCHRO_ENCODER_RATE_CONTROL_CONSTANT_LAMBDA, SCHRO_ENCODER_RATE_CONTROL_CONSTANT_ERROR, SCHRO_ENCODER_RATE_CONTROL_CONSTANT_QUALITY } SchroEncoderRateControlEnum; struct SchroEncoderSetting SchroEncoderSetting struct SchroEncoderSetting { const char *name; SchroEncoderSettingTypeEnum type; double min; double max; double default_value; const char **enum_list; }; enum SchroEncoderSettingTypeEnum SchroEncoderSettingTypeEnum typedef enum { SCHRO_ENCODER_SETTING_TYPE_BOOLEAN, SCHRO_ENCODER_SETTING_TYPE_INT, SCHRO_ENCODER_SETTING_TYPE_ENUM, SCHRO_ENCODER_SETTING_TYPE_DOUBLE, SCHRO_ENCODER_SETTING_TYPE_LAST } SchroEncoderSettingTypeEnum; SchroEngineIterateFunc () SchroEngineIterateFunc int (*SchroEngineIterateFunc) (SchroEncoder *encoder); schro_encoder_new () schro_encoder_new SchroEncoder * schro_encoder_new (void); Create a new encoder object. Returns :a new encoder object schro_encoder_free () schro_encoder_free void schro_encoder_free (SchroEncoder *encoder); Frees an encoder object and all its resources. encoder : an encoder object schro_encoder_get_video_format () schro_encoder_get_video_format SchroVideoFormat * schro_encoder_get_video_format (SchroEncoder *encoder); Creates a new SchroVideoFormat structure and copies the video format information of decoder into it. When no longer needed, the returned pointer should be freed using free(). encoder : an encoder object Returns :a pointer to a SchroVideoFormat structure schro_encoder_set_video_format () schro_encoder_set_video_format void schro_encoder_set_video_format (SchroEncoder *encoder, SchroVideoFormat *video_format); Sets the video format used by encoder to the values specified in format. This function may only be called before schro_encoder_start() is called on the encoder. encoder : an encoder object schro_encoder_end_of_stream () schro_encoder_end_of_stream void schro_encoder_end_of_stream (SchroEncoder *encoder); Tells the encoder that the end of the stream has been reached, and no more frames are available to encode. The encoder will then finish encoding. encoder : an encoder object schro_encoder_push_frame () schro_encoder_push_frame void schro_encoder_push_frame (SchroEncoder *encoder, SchroFrame *frame); Provides a frame to the encoder to encode. encoder : an encoder object frame : a frame to encode schro_encoder_encode_parse_info () schro_encoder_encode_parse_info void schro_encoder_encode_parse_info (SchroPack *bits, int parse_code); schro_encoder_pull () schro_encoder_pull SchroBuffer * schro_encoder_pull (SchroEncoder *encoder, int *n_decodable_frames); Pulls a buffer of compressed video from the encoder. If presentation_frame is not NULL, the frame number of the latest decodable frame is returned. encoder : an encoder object Returns :a buffer containing compressed video schro_encoder_analyse_picture () schro_encoder_analyse_picture void schro_encoder_analyse_picture (SchroAsyncStage *stage); schro_encoder_calculate_subband_weights () schro_encoder_calculate_subband_weights void schro_encoder_calculate_subband_weights (SchroEncoder *encoder, double (*perceptual_weight) (double)); schro_encoder_calculate_test_info () schro_encoder_calculate_test_info void schro_encoder_calculate_test_info (SchroEncoderFrame *frame); schro_encoder_choose_quantisers () schro_encoder_choose_quantisers void schro_encoder_choose_quantisers (SchroEncoderFrame *frame); schro_encoder_clean_up_transform () schro_encoder_clean_up_transform void schro_encoder_clean_up_transform (SchroEncoderFrame *frame); schro_encoder_encode_auxiliary_data () schro_encoder_encode_auxiliary_data SchroBuffer * schro_encoder_encode_auxiliary_data (SchroEncoder *encoder, SchroAuxiliaryDataID id, const void *data, int size); Packs data into a Dirac auxiliary data packet. Returns :a buffer schro_encoder_encode_end_of_stream () schro_encoder_encode_end_of_stream SchroBuffer * schro_encoder_encode_end_of_stream (SchroEncoder *encoder); Creates an end-of-stream packet. Returns :a buffer schro_encoder_encode_lowdelay_transform_data () schro_encoder_encode_lowdelay_transform_data void schro_encoder_encode_lowdelay_transform_data (SchroEncoderFrame *frame); schro_encoder_encode_picture () schro_encoder_encode_picture void schro_encoder_encode_picture (SchroAsyncStage *stage); schro_encoder_encode_picture_header () schro_encoder_encode_picture_header void schro_encoder_encode_picture_header (SchroEncoderFrame *frame); schro_encoder_encode_subband () schro_encoder_encode_subband void schro_encoder_encode_subband (SchroEncoderFrame *frame, int component, int index); schro_encoder_encode_subband_noarith () schro_encoder_encode_subband_noarith void schro_encoder_encode_subband_noarith (SchroEncoderFrame *frame, int component, int index); schro_encoder_engine_backref () schro_encoder_engine_backref int schro_encoder_engine_backref (SchroEncoder *encoder); schro_encoder_engine_backtest () schro_encoder_engine_backtest int schro_encoder_engine_backtest (SchroEncoder *encoder); schro_encoder_engine_intra_only () schro_encoder_engine_intra_only int schro_encoder_engine_intra_only (SchroEncoder *encoder); schro_encoder_engine_lossless () schro_encoder_engine_lossless int schro_encoder_engine_lossless (SchroEncoder *encoder); schro_encoder_engine_lowdelay () schro_encoder_engine_lowdelay int schro_encoder_engine_lowdelay (SchroEncoder *encoder); schro_encoder_engine_test_intra () schro_encoder_engine_test_intra int schro_encoder_engine_test_intra (SchroEncoder *encoder); schro_encoder_estimate_entropy () schro_encoder_estimate_entropy void schro_encoder_estimate_entropy (SchroEncoderFrame *frame); schro_encoder_frame_analyse () schro_encoder_frame_analyse void schro_encoder_frame_analyse (SchroEncoderFrame *frame); schro_encoder_frame_downsample () schro_encoder_frame_downsample void schro_encoder_frame_downsample (SchroEncoderFrame *frame); schro_encoder_frame_insert_buffer () schro_encoder_frame_insert_buffer void schro_encoder_frame_insert_buffer (SchroEncoderFrame *frame, SchroBuffer *buffer); Inserts a buffer into an encoder frame. frame : an encoder frame buffer : a buffer schro_encoder_frame_new () schro_encoder_frame_new SchroEncoderFrame * schro_encoder_frame_new (SchroEncoder *encoder); schro_encoder_frame_queue_get () schro_encoder_frame_queue_get SchroFrame * schro_encoder_frame_queue_get (SchroEncoder *encoder, SchroPictureNumber frame_number); schro_encoder_frame_queue_remove () schro_encoder_frame_queue_remove void schro_encoder_frame_queue_remove (SchroEncoder *encoder, SchroPictureNumber frame_number); schro_encoder_frame_ref () schro_encoder_frame_ref void schro_encoder_frame_ref (SchroEncoderFrame *frame); schro_encoder_frame_unref () schro_encoder_frame_unref void schro_encoder_frame_unref (SchroEncoderFrame *frame); schro_encoder_init_subbands () schro_encoder_init_subbands void schro_encoder_init_subbands (SchroEncoderFrame *frame); schro_encoder_insert_buffer () schro_encoder_insert_buffer void schro_encoder_insert_buffer (SchroEncoder *encoder, SchroBuffer *buffer); Inserts an application-provided buffer into the encoded video stream with the next frame that is pushed. encoder : an encoder object buffer : a buffer schro_encoder_output_push () schro_encoder_output_push void schro_encoder_output_push (SchroEncoder *encoder, SchroBuffer *buffer, int slot, int presentation_frame); schro_encoder_perceptual_weight_ccir959 () schro_encoder_perceptual_weight_ccir959 double schro_encoder_perceptual_weight_ccir959 (double cpd); schro_encoder_perceptual_weight_constant () schro_encoder_perceptual_weight_constant double schro_encoder_perceptual_weight_constant (double cpd); schro_encoder_perceptual_weight_moo () schro_encoder_perceptual_weight_moo double schro_encoder_perceptual_weight_moo (double cpd); schro_encoder_postanalyse_picture () schro_encoder_postanalyse_picture void schro_encoder_postanalyse_picture (SchroAsyncStage *stage); schro_encoder_push_ready () schro_encoder_push_ready int schro_encoder_push_ready (SchroEncoder *encoder); Returns true if the encoder has available space for additional video frames. encoder : an encoder object Returns :TRUE if the encoder is ready for another video frame to be pushed. schro_encoder_recalculate_allocations () schro_encoder_recalculate_allocations void schro_encoder_recalculate_allocations (SchroEncoder *encoder); schro_encoder_reconstruct_picture () schro_encoder_reconstruct_picture void schro_encoder_reconstruct_picture (SchroAsyncStage *stage); schro_encoder_reference_get () schro_encoder_reference_get SchroEncoderFrame * schro_encoder_reference_get (SchroEncoder *encoder, SchroPictureNumber frame_number); schro_encoder_set_default_subband_weights () schro_encoder_set_default_subband_weights void schro_encoder_set_default_subband_weights (SchroEncoder *encoder); schro_encoder_start () schro_encoder_start void schro_encoder_start (SchroEncoder *encoder); Locks in encoder configuration and causes the encoder to start encoding pictures. At this point, the encoder will start worker threads to do the actual encoding. encoder : an encoder object schro_encoder_wait () schro_encoder_wait SchroStateEnum schro_encoder_wait (SchroEncoder *encoder); Checks the state of the encoder. If the encoder requires the application to do something, an appropriate state code is returned. Otherwise, this function waits until the encoder requires the application to do something. encoder : an encoder object Returns :a state code schro_encoder_get_n_settings () schro_encoder_get_n_settings int schro_encoder_get_n_settings (void); schro_encoder_get_setting_info () schro_encoder_get_setting_info const SchroEncoderSetting * schro_encoder_get_setting_info (int i); schro_encoder_global_estimation () schro_encoder_global_estimation void schro_encoder_global_estimation (SchroEncoderFrame *frame); schro_encoder_init_error_tables () schro_encoder_init_error_tables void schro_encoder_init_error_tables (SchroEncoder *encoder); schro_encoder_phasecorr_estimation () schro_encoder_phasecorr_estimation void schro_encoder_phasecorr_estimation (SchroPhaseCorr *pc); schro_encoder_setting_get_double () schro_encoder_setting_get_double double schro_encoder_setting_get_double (SchroEncoder *encoder, const char *name); encoder : an encoder object Returns :the current value of an encoder option given by name schro_encoder_setting_set_double () schro_encoder_setting_set_double void schro_encoder_setting_set_double (SchroEncoder *encoder, const char *name, double d); set the encoder option given by name to value. encoder : an encoder object schroedinger-1.0.11/doc/xml/schrowavelet.xml0000664000175000017500000001010111707140273015761 00000000000000 schrowavelet 3 SCHROEDINGER Library schrowavelet Synopsis #define SCHRO_N_WAVELETS void schro_wavelet_transform_2d (SchroFrameData *fd, int type, int16_t *tmp); void schro_wavelet_inverse_transform_2d (SchroFrameData *fd_dest, SchroFrameData *fd_src, int type, int16_t *tmp); Description Details SCHRO_N_WAVELETS SCHRO_N_WAVELETS #define SCHRO_N_WAVELETS 7 schro_wavelet_transform_2d () schro_wavelet_transform_2d void schro_wavelet_transform_2d (SchroFrameData *fd, int type, int16_t *tmp); schro_wavelet_inverse_transform_2d () schro_wavelet_inverse_transform_2d void schro_wavelet_inverse_transform_2d (SchroFrameData *fd_dest, SchroFrameData *fd_src, int type, int16_t *tmp); schroedinger-1.0.11/doc/xml/schrometric.xml0000664000175000017500000004764311707140273015622 00000000000000 schrometric 3 SCHROEDINGER Library schrometric Synopsis struct SchroMetricScan; #define SCHRO_METRIC_INVALID int schro_metric_absdiff_u8 (uint8_t *a, int a_stride, uint8_t *b, int b_stride, int width, int height); int schro_metric_haar (uint8_t *src1, int stride1, uint8_t *src2, int stride2, int width, int height); int schro_metric_haar_const (uint8_t *data, int stride, int dc_value, int width, int height); int schro_metric_abssum_s16 (int16_t *data, int stride, int width, int height); int schro_metric_sum_u8 (uint8_t *data, int stride, int width, int height); int schro_metric_get (SchroFrameData *src1, SchroFrameData *src2, int width, int height); int schro_metric_get_biref (SchroFrameData *fd, SchroFrameData *src1, int weight1, SchroFrameData *src2, int weight2, int shift, int width, int height); int schro_metric_get_dc (SchroFrameData *src, int value, int width, int height); void schro_metric_scan_do_scan (SchroMetricScan *scan); int schro_metric_scan_get_min (SchroMetricScan *scan, int *dx, int *dy, uint32_t *chroma_metric); void schro_metric_scan_setup (SchroMetricScan *scan, int dx, int dy, int dist, int use_chroma); Description Details struct SchroMetricScan SchroMetricScan struct SchroMetricScan { SchroFrame *frame; SchroFrame *ref_frame; int block_width; int block_height; int x, y; int ref_x, ref_y; int scan_width; int scan_height; int gravity_scale; int gravity_x, gravity_y; int use_chroma; /* output */ uint32_t metrics[SCHRO_LIMIT_METRIC_SCAN*SCHRO_LIMIT_METRIC_SCAN]; uint32_t chroma_metrics[SCHRO_LIMIT_METRIC_SCAN*SCHRO_LIMIT_METRIC_SCAN]; }; SCHRO_METRIC_INVALID SCHRO_METRIC_INVALID #define SCHRO_METRIC_INVALID INT_MAX schro_metric_absdiff_u8 () schro_metric_absdiff_u8 int schro_metric_absdiff_u8 (uint8_t *a, int a_stride, uint8_t *b, int b_stride, int width, int height); schro_metric_haar () schro_metric_haar int schro_metric_haar (uint8_t *src1, int stride1, uint8_t *src2, int stride2, int width, int height); schro_metric_haar_const () schro_metric_haar_const int schro_metric_haar_const (uint8_t *data, int stride, int dc_value, int width, int height); schro_metric_abssum_s16 () schro_metric_abssum_s16 int schro_metric_abssum_s16 (int16_t *data, int stride, int width, int height); schro_metric_sum_u8 () schro_metric_sum_u8 int schro_metric_sum_u8 (uint8_t *data, int stride, int width, int height); schro_metric_get () schro_metric_get int schro_metric_get (SchroFrameData *src1, SchroFrameData *src2, int width, int height); schro_metric_get_biref () schro_metric_get_biref int schro_metric_get_biref (SchroFrameData *fd, SchroFrameData *src1, int weight1, SchroFrameData *src2, int weight2, int shift, int width, int height); schro_metric_get_dc () schro_metric_get_dc int schro_metric_get_dc (SchroFrameData *src, int value, int width, int height); schro_metric_scan_do_scan () schro_metric_scan_do_scan void schro_metric_scan_do_scan (SchroMetricScan *scan); schro_metric_scan_get_min () schro_metric_scan_get_min int schro_metric_scan_get_min (SchroMetricScan *scan, int *dx, int *dy, uint32_t *chroma_metric); schro_metric_scan_setup () schro_metric_scan_setup void schro_metric_scan_setup (SchroMetricScan *scan, int dx, int dy, int dist, int use_chroma); schroedinger-1.0.11/doc/xml/schrofilter.xml0000664000175000017500000003427211707140273015616 00000000000000 schrofilter 3 SCHROEDINGER Library schrofilter Synopsis void schro_frame_filter_adaptive_lowpass (SchroFrame *frame); void schro_frame_filter_addnoise (SchroFrame *frame, double sigma); void schro_frame_filter_cwm7 (SchroFrame *frame); void schro_frame_filter_cwmN (SchroFrame *frame, int weight); void schro_frame_filter_cwmN_ref (SchroFrame *frame, int weight); void schro_frame_filter_lowpass (SchroFrame *frame, int tap); void schro_frame_filter_lowpass2 (SchroFrame *frame, double sigma); void schro_frame_filter_lowpass_16 (SchroFrame *frame); void schro_frame_filter_wavelet (SchroFrame *frame); void schro_filter_cwm7 (uint8_t *d, uint8_t *s1, uint8_t *s2, uint8_t *s3, int n); void schro_filter_cwmN (uint8_t *d, uint8_t *s1, uint8_t *s2, uint8_t *s3, int n, int weight); void schro_filter_cwmN_ref (uint8_t *d, uint8_t *s1, uint8_t *s2, uint8_t *s3, int n, int weight); Description Details schro_frame_filter_adaptive_lowpass () schro_frame_filter_adaptive_lowpass void schro_frame_filter_adaptive_lowpass (SchroFrame *frame); schro_frame_filter_addnoise () schro_frame_filter_addnoise void schro_frame_filter_addnoise (SchroFrame *frame, double sigma); schro_frame_filter_cwm7 () schro_frame_filter_cwm7 void schro_frame_filter_cwm7 (SchroFrame *frame); schro_frame_filter_cwmN () schro_frame_filter_cwmN void schro_frame_filter_cwmN (SchroFrame *frame, int weight); schro_frame_filter_cwmN_ref () schro_frame_filter_cwmN_ref void schro_frame_filter_cwmN_ref (SchroFrame *frame, int weight); schro_frame_filter_lowpass () schro_frame_filter_lowpass void schro_frame_filter_lowpass (SchroFrame *frame, int tap); schro_frame_filter_lowpass2 () schro_frame_filter_lowpass2 void schro_frame_filter_lowpass2 (SchroFrame *frame, double sigma); schro_frame_filter_lowpass_16 () schro_frame_filter_lowpass_16 void schro_frame_filter_lowpass_16 (SchroFrame *frame); schro_frame_filter_wavelet () schro_frame_filter_wavelet void schro_frame_filter_wavelet (SchroFrame *frame); schro_filter_cwm7 () schro_filter_cwm7 void schro_filter_cwm7 (uint8_t *d, uint8_t *s1, uint8_t *s2, uint8_t *s3, int n); schro_filter_cwmN () schro_filter_cwmN void schro_filter_cwmN (uint8_t *d, uint8_t *s1, uint8_t *s2, uint8_t *s3, int n, int weight); schro_filter_cwmN_ref () schro_filter_cwmN_ref void schro_filter_cwmN_ref (uint8_t *d, uint8_t *s1, uint8_t *s2, uint8_t *s3, int n, int weight); schroedinger-1.0.11/doc/xml/schrounpack.xml0000664000175000017500000003237611707140273015615 00000000000000 schrounpack 3 SCHROEDINGER Library schrounpack Synopsis struct SchroUnpack; void schro_unpack_byte_sync (SchroUnpack *unpack); void schro_unpack_copy (SchroUnpack *dest, SchroUnpack *src); unsigned int schro_unpack_decode_bit (SchroUnpack *unpack); unsigned int schro_unpack_decode_bits (SchroUnpack *unpack, int n); int schro_unpack_decode_sint (SchroUnpack *unpack); void schro_unpack_decode_sint_s16 (int16_t *dest, SchroUnpack *unpack, int n); int schro_unpack_decode_sint_slow (SchroUnpack *unpack); unsigned int schro_unpack_decode_uint (SchroUnpack *unpack); int schro_unpack_get_bits_read (SchroUnpack *unpack); int schro_unpack_get_bits_remaining (SchroUnpack *unpack); void schro_unpack_init_with_data (SchroUnpack *unpack, uint8_t *data, int n_bytes, unsigned int guard_bit); void schro_unpack_limit_bits_remaining (SchroUnpack *unpack, int n_bits); void schro_unpack_skip_bits (SchroUnpack *unpack, int n_bits); Description Details struct SchroUnpack SchroUnpack struct SchroUnpack { /* pointer to data that haven't been shifted into the shift register */ uint8_t *data; /* number of bits remaining that haven't been shifted into the shift * register */ int n_bits_left; /* number of bits read by reader */ int n_bits_read; /* chunk of bits we're currently frobbing, aligned to (1<<31) */ uint32_t shift_register; int n_bits_in_shift_register; /* bit pattern used after an error */ unsigned int guard_bit; /* unpacking has overrun the end of the buffer */ int overrun; }; schro_unpack_byte_sync () schro_unpack_byte_sync void schro_unpack_byte_sync (SchroUnpack *unpack); schro_unpack_copy () schro_unpack_copy void schro_unpack_copy (SchroUnpack *dest, SchroUnpack *src); schro_unpack_decode_bit () schro_unpack_decode_bit unsigned int schro_unpack_decode_bit (SchroUnpack *unpack); schro_unpack_decode_bits () schro_unpack_decode_bits unsigned int schro_unpack_decode_bits (SchroUnpack *unpack, int n); schro_unpack_decode_sint () schro_unpack_decode_sint int schro_unpack_decode_sint (SchroUnpack *unpack); schro_unpack_decode_sint_s16 () schro_unpack_decode_sint_s16 void schro_unpack_decode_sint_s16 (int16_t *dest, SchroUnpack *unpack, int n); schro_unpack_decode_sint_slow () schro_unpack_decode_sint_slow int schro_unpack_decode_sint_slow (SchroUnpack *unpack); schro_unpack_decode_uint () schro_unpack_decode_uint unsigned int schro_unpack_decode_uint (SchroUnpack *unpack); schro_unpack_get_bits_read () schro_unpack_get_bits_read int schro_unpack_get_bits_read (SchroUnpack *unpack); schro_unpack_get_bits_remaining () schro_unpack_get_bits_remaining int schro_unpack_get_bits_remaining (SchroUnpack *unpack); schro_unpack_init_with_data () schro_unpack_init_with_data void schro_unpack_init_with_data (SchroUnpack *unpack, uint8_t *data, int n_bytes, unsigned int guard_bit); schro_unpack_limit_bits_remaining () schro_unpack_limit_bits_remaining void schro_unpack_limit_bits_remaining (SchroUnpack *unpack, int n_bits); schro_unpack_skip_bits () schro_unpack_skip_bits void schro_unpack_skip_bits (SchroUnpack *unpack, int n_bits); schroedinger-1.0.11/doc/xml/api-index-deprecated.xml0000644000175000017500000000027211707140273017235 00000000000000 schroedinger-1.0.11/doc/xml/schrocuda.xml0000664000175000017500000004575011707140273015250 00000000000000 schrocuda 3 SCHROEDINGER Library schrocuda Synopsis typedef SchroCUDAStream; SchroGPUMotion; #define SCHRO_FRAME_IS_CUDA (frame) void schro_cuda_init (void); void schro_gpumotion_copy (SchroGPUMotion *self, SchroMotion *motion); void schro_gpumotion_free (SchroGPUMotion *rv); void schro_gpumotion_init (SchroGPUMotion *self, SchroMotion *motion); SchroGPUMotion * schro_gpumotion_new (SchroCUDAStream stream); void schro_gpumotion_render (SchroGPUMotion *self, SchroMotion *motion, SchroFrame *gdest); void schro_frame_to_gpu (SchroFrame *dest, SchroFrame *src); void schro_gpuframe_add (SchroFrame *dest, SchroFrame *src); void schro_gpuframe_compare (SchroFrame *a, SchroFrame *b); void schro_gpuframe_convert (SchroFrame *dest, SchroFrame *src); void schro_gpuframe_inverse_iwt_transform (SchroFrame *frame, SchroParams *params); void schro_gpuframe_iwt_transform (SchroFrame *frame, SchroParams *params); void schro_gpuframe_subtract (SchroFrame *dest, SchroFrame *src); void schro_gpuframe_to_cpu (SchroFrame *dest, SchroFrame *src); void schro_gpuframe_upsample (SchroFrame *dst, SchroFrame *src); void schro_gpuframe_zero (SchroFrame *dest); void schro_upsampled_gpuframe_free (SchroUpsampledFrame *x); SchroUpsampledFrame * schro_upsampled_gpuframe_new (SchroVideoFormat *fmt); void schro_upsampled_gpuframe_upsample (SchroUpsampledFrame *rv); Description Details SchroCUDAStream SchroCUDAStream typedef int SchroCUDAStream; SchroGPUMotion SchroGPUMotion typedef struct _SchroGPUMotion SchroGPUMotion; SCHRO_FRAME_IS_CUDA() SCHRO_FRAME_IS_CUDA #define SCHRO_FRAME_IS_CUDA(frame) ((frame)->domain && ((frame)->domain->flags & SCHRO_MEMORY_DOMAIN_CUDA)) schro_cuda_init () schro_cuda_init void schro_cuda_init (void); schro_gpumotion_copy () schro_gpumotion_copy void schro_gpumotion_copy (SchroGPUMotion *self, SchroMotion *motion); schro_gpumotion_free () schro_gpumotion_free void schro_gpumotion_free (SchroGPUMotion *rv); schro_gpumotion_init () schro_gpumotion_init void schro_gpumotion_init (SchroGPUMotion *self, SchroMotion *motion); schro_gpumotion_new () schro_gpumotion_new SchroGPUMotion * schro_gpumotion_new (SchroCUDAStream stream); schro_gpumotion_render () schro_gpumotion_render void schro_gpumotion_render (SchroGPUMotion *self, SchroMotion *motion, SchroFrame *gdest); schro_frame_to_gpu () schro_frame_to_gpu void schro_frame_to_gpu (SchroFrame *dest, SchroFrame *src); schro_gpuframe_add () schro_gpuframe_add void schro_gpuframe_add (SchroFrame *dest, SchroFrame *src); schro_gpuframe_compare () schro_gpuframe_compare void schro_gpuframe_compare (SchroFrame *a, SchroFrame *b); schro_gpuframe_convert () schro_gpuframe_convert void schro_gpuframe_convert (SchroFrame *dest, SchroFrame *src); schro_gpuframe_inverse_iwt_transform () schro_gpuframe_inverse_iwt_transform void schro_gpuframe_inverse_iwt_transform (SchroFrame *frame, SchroParams *params); schro_gpuframe_iwt_transform () schro_gpuframe_iwt_transform void schro_gpuframe_iwt_transform (SchroFrame *frame, SchroParams *params); schro_gpuframe_subtract () schro_gpuframe_subtract void schro_gpuframe_subtract (SchroFrame *dest, SchroFrame *src); schro_gpuframe_to_cpu () schro_gpuframe_to_cpu void schro_gpuframe_to_cpu (SchroFrame *dest, SchroFrame *src); schro_gpuframe_upsample () schro_gpuframe_upsample void schro_gpuframe_upsample (SchroFrame *dst, SchroFrame *src); schro_gpuframe_zero () schro_gpuframe_zero void schro_gpuframe_zero (SchroFrame *dest); schro_upsampled_gpuframe_free () schro_upsampled_gpuframe_free void schro_upsampled_gpuframe_free (SchroUpsampledFrame *x); schro_upsampled_gpuframe_new () schro_upsampled_gpuframe_new SchroUpsampledFrame * schro_upsampled_gpuframe_new (SchroVideoFormat *fmt); schro_upsampled_gpuframe_upsample () schro_upsampled_gpuframe_upsample void schro_upsampled_gpuframe_upsample (SchroUpsampledFrame *rv); schroedinger-1.0.11/doc/xml/schroutils.xml0000664000175000017500000005305511707140273015471 00000000000000 schroutils 3 SCHROEDINGER Library schroutils Synopsis typedef schro_bool; #define SCHRO_GET (ptr, offset, type) #define OFFSET (ptr, offset) #define SCHRO_INTERNAL #define ARRAY_SIZE (x) #define MIN (a, b) #define MAX (a, b) #define CLAMP (x, a, b) #define DIVIDE_ROUND_UP (a, b) #define ROUND_UP_SHIFT (x, y) #define ROUND_UP_POW2 (x, y) #define ROUND_UP_2 (x) #define ROUND_UP_4 (x) #define ROUND_UP_8 (x) #define ROUND_UP_64 (x) #define ROUND_SHIFT (x, y) #define NEED_CLAMP (x, y, a, b) #define schro_divide (a, b) double schro_utils_entropy (double a, double total); int schro_utils_multiplier_to_quant_index (double x); double schro_utils_probability_to_entropy (double x); void schro_utils_reduce_fraction (int *n, int *d); int schro_dequantise (int q, int quant_factor, int quant_offset); int schro_quantise (int value, int quant_factor, int quant_offset); void schro_dequantise_s16 (int16_t *dest, int16_t *src, int quant_factor, int quant_offset, int n); void schro_quantise_s16 (int16_t *dest, int16_t *src, int quant_factor, int quant_offset, int n); void * schro_malloc (int size); void * schro_malloc0 (int size); void * schro_realloc (void *ptr, int size); void schro_free (void *ptr); double schro_utils_get_time (void); int muldiv64 (int a, int b, int c); Description Details schro_bool schro_bool typedef unsigned int schro_bool; SCHRO_GET() SCHRO_GET #define SCHRO_GET(ptr, offset, type) (*(type *)((uint8_t *)(ptr) + (offset)) ) OFFSET() OFFSET #define OFFSET(ptr,offset) ((void *)(((uint8_t *)(ptr)) + (offset))) SCHRO_INTERNAL SCHRO_INTERNAL #define SCHRO_INTERNAL __attribute__ ((visibility ("internal"))) ARRAY_SIZE() ARRAY_SIZE #define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0])) MIN() MIN #define MIN(a,b) ((a)<(b) ? (a) : (b)) MAX() MAX #define MAX(a,b) ((a)>(b) ? (a) : (b)) CLAMP() CLAMP #define CLAMP(x,a,b) ((x)<(a) ? (a) : ((x)>(b) ? (b) : (x))) DIVIDE_ROUND_UP() DIVIDE_ROUND_UP #define DIVIDE_ROUND_UP(a,b) (((a) + (b) - 1)/(b)) ROUND_UP_SHIFT() ROUND_UP_SHIFT #define ROUND_UP_SHIFT(x,y) (((x) + (1<<(y)) - 1)>>(y)) ROUND_UP_POW2() ROUND_UP_POW2 #define ROUND_UP_POW2(x,y) (((x) + (1<<(y)) - 1)&((~0)<<(y))) ROUND_UP_2() ROUND_UP_2 #define ROUND_UP_2(x) ROUND_UP_POW2(x,1) ROUND_UP_4() ROUND_UP_4 #define ROUND_UP_4(x) ROUND_UP_POW2(x,2) ROUND_UP_8() ROUND_UP_8 #define ROUND_UP_8(x) ROUND_UP_POW2(x,3) ROUND_UP_64() ROUND_UP_64 #define ROUND_UP_64(x) ROUND_UP_POW2(x,6) ROUND_SHIFT() ROUND_SHIFT #define ROUND_SHIFT(x,y) (((x) + (1<<((y)-1)))>>(y)) NEED_CLAMP() NEED_CLAMP #define NEED_CLAMP(x,y,a,b) ((x) < (a) || (y) > (b)) schro_divide() schro_divide #define schro_divide(a,b) (((a)<0)?(((a) - (b) + 1)/(b)):((a)/(b))) schro_utils_entropy () schro_utils_entropy double schro_utils_entropy (double a, double total); schro_utils_multiplier_to_quant_index () schro_utils_multiplier_to_quant_index int schro_utils_multiplier_to_quant_index (double x); schro_utils_probability_to_entropy () schro_utils_probability_to_entropy double schro_utils_probability_to_entropy (double x); schro_utils_reduce_fraction () schro_utils_reduce_fraction void schro_utils_reduce_fraction (int *n, int *d); schro_dequantise () schro_dequantise int schro_dequantise (int q, int quant_factor, int quant_offset); schro_quantise () schro_quantise int schro_quantise (int value, int quant_factor, int quant_offset); schro_dequantise_s16 () schro_dequantise_s16 void schro_dequantise_s16 (int16_t *dest, int16_t *src, int quant_factor, int quant_offset, int n); schro_quantise_s16 () schro_quantise_s16 void schro_quantise_s16 (int16_t *dest, int16_t *src, int quant_factor, int quant_offset, int n); schro_malloc () schro_malloc void * schro_malloc (int size); schro_malloc0 () schro_malloc0 void * schro_malloc0 (int size); schro_realloc () schro_realloc void * schro_realloc (void *ptr, int size); schro_free () schro_free void schro_free (void *ptr); schro_utils_get_time () schro_utils_get_time double schro_utils_get_time (void); muldiv64 () muldiv64 int muldiv64 (int a, int b, int c); schroedinger-1.0.11/doc/xml/schroasync.xml0000664000175000017500000002211411707140273015436 00000000000000 schroasync 3 SCHROEDINGER Library schroasync Synopsis SchroAsync; struct SchroAsyncTask; void (*SchroAsyncCompleteFunc) (void *Param1); int (*SchroAsyncScheduleFunc) (void *Param1, SchroExecDomain exec_domain); SchroThread; SchroAsync * schro_async_new (int n_threads, SchroAsyncScheduleFunc schedule, SchroAsyncCompleteFunc complete, void *closure); void schro_async_free (SchroAsync *async); void schro_async_lock (SchroAsync *async); void schro_async_unlock (SchroAsync *async); void schro_async_signal_scheduler (SchroAsync *async); int schro_async_wait_locked (SchroAsync *async); SchroExecDomain schro_async_get_exec_domain (void); Description Details SchroAsync SchroAsync typedef struct _SchroAsync SchroAsync; struct SchroAsyncTask SchroAsyncTask struct SchroAsyncTask { SchroAsyncTaskFunc task_func; void *priv; }; SchroAsyncCompleteFunc () SchroAsyncCompleteFunc void (*SchroAsyncCompleteFunc) (void *Param1); SchroAsyncScheduleFunc () SchroAsyncScheduleFunc int (*SchroAsyncScheduleFunc) (void *Param1, SchroExecDomain exec_domain); SchroThread SchroThread typedef struct _SchroThread SchroThread; schro_async_new () schro_async_new SchroAsync * schro_async_new (int n_threads, SchroAsyncScheduleFunc schedule, SchroAsyncCompleteFunc complete, void *closure); schro_async_free () schro_async_free void schro_async_free (SchroAsync *async); schro_async_lock () schro_async_lock void schro_async_lock (SchroAsync *async); schro_async_unlock () schro_async_unlock void schro_async_unlock (SchroAsync *async); schro_async_signal_scheduler () schro_async_signal_scheduler void schro_async_signal_scheduler (SchroAsync *async); schro_async_wait_locked () schro_async_wait_locked int schro_async_wait_locked (SchroAsync *async); schro_async_get_exec_domain () schro_async_get_exec_domain SchroExecDomain schro_async_get_exec_domain (void); schroedinger-1.0.11/doc/xml/schro.xml0000644000175000017500000000277711707140273014413 00000000000000 schro 3 SCHROEDINGER Library schro Synopsis void schro_init (void); Description Details schro_init () schro_init void schro_init (void); Intializes the Schroedinger library. This function must be called before any other function in the library. schroedinger-1.0.11/doc/xml/schroqueue.xml0000664000175000017500000002734411707140273015457 00000000000000 schroqueue 3 SCHROEDINGER Library schroqueue Synopsis struct SchroQueue; struct SchroQueueElement; void (*SchroQueueFreeFunc) (void *data, SchroPictureNumber number); void schro_queue_add (SchroQueue *queue, void *element, SchroPictureNumber picture_number); void schro_queue_clear (SchroQueue *queue); void schro_queue_delete (SchroQueue *queue, SchroPictureNumber picture_number); void * schro_queue_find (SchroQueue *queue, SchroPictureNumber picture_number); void schro_queue_free (SchroQueue *queue); int schro_queue_is_empty (SchroQueue *queue); int schro_queue_is_full (SchroQueue *queue); SchroQueue * schro_queue_new (int size, SchroQueueFreeFunc func); void schro_queue_pop (SchroQueue *queue); void * schro_queue_pull (SchroQueue *queue); void * schro_queue_remove (SchroQueue *queue, SchroPictureNumber picture_number); Description Details struct SchroQueue SchroQueue struct SchroQueue { int size; int n; SchroQueueElement *elements; SchroQueueFreeFunc free; }; struct SchroQueueElement SchroQueueElement struct SchroQueueElement { void *data; SchroPictureNumber picture_number; }; SchroQueueFreeFunc () SchroQueueFreeFunc void (*SchroQueueFreeFunc) (void *data, SchroPictureNumber number); schro_queue_add () schro_queue_add void schro_queue_add (SchroQueue *queue, void *element, SchroPictureNumber picture_number); schro_queue_clear () schro_queue_clear void schro_queue_clear (SchroQueue *queue); schro_queue_delete () schro_queue_delete void schro_queue_delete (SchroQueue *queue, SchroPictureNumber picture_number); schro_queue_find () schro_queue_find void * schro_queue_find (SchroQueue *queue, SchroPictureNumber picture_number); schro_queue_free () schro_queue_free void schro_queue_free (SchroQueue *queue); schro_queue_is_empty () schro_queue_is_empty int schro_queue_is_empty (SchroQueue *queue); schro_queue_is_full () schro_queue_is_full int schro_queue_is_full (SchroQueue *queue); schro_queue_new () schro_queue_new SchroQueue * schro_queue_new (int size, SchroQueueFreeFunc func); schro_queue_pop () schro_queue_pop void schro_queue_pop (SchroQueue *queue); schro_queue_pull () schro_queue_pull void * schro_queue_pull (SchroQueue *queue); schro_queue_remove () schro_queue_remove void * schro_queue_remove (SchroQueue *queue, SchroPictureNumber picture_number); schroedinger-1.0.11/doc/xml/schrooil.xml0000644000175000017500000000160511707140273015104 00000000000000 schrooil 3 SCHROEDINGER Library schrooil Synopsis Description Details schroedinger-1.0.11/doc/xml/schromotionest.xml0000664000175000017500000001512711707140273016350 00000000000000 schromotionest 3 SCHROEDINGER Library schromotionest Synopsis struct SchroMotionEst; SchroMotionScan; struct SchroBlock; void schro_motionest_free (SchroMotionEst *me); SchroMotionEst * schro_motionest_new (SchroEncoderFrame *frame); int schro_motionest_superblock_get_metric (SchroMotionEst *me, SchroBlock *block, int i, int j); int schro_block_check (SchroBlock *block); void schro_block_fixup (SchroBlock *block); Description Details struct SchroMotionEst SchroMotionEst struct SchroMotionEst { SchroEncoderFrame *encoder_frame; SchroParams *params; double lambda; SchroFrame *downsampled_src0[SCHRO_MAX_HIER_LEVELS]; SchroFrame *downsampled_src1[SCHRO_MAX_HIER_LEVELS]; SchroMotion *motion; int scan_distance; int badblocks; double hier_score; }; SchroMotionScan SchroMotionScan typedef struct _SchroMotionScan SchroMotionScan; struct SchroBlock SchroBlock struct SchroBlock { int valid; int error; int entropy; double score; SchroMotionVector mv[4][4]; }; schro_motionest_free () schro_motionest_free void schro_motionest_free (SchroMotionEst *me); schro_motionest_new () schro_motionest_new SchroMotionEst * schro_motionest_new (SchroEncoderFrame *frame); schro_motionest_superblock_get_metric () schro_motionest_superblock_get_metric int schro_motionest_superblock_get_metric (SchroMotionEst *me, SchroBlock *block, int i, int j); schro_block_check () schro_block_check int schro_block_check (SchroBlock *block); schro_block_fixup () schro_block_fixup void schro_block_fixup (SchroBlock *block); schroedinger-1.0.11/doc/xml/api-index-full.xml0000664000175000017500000033274011707140273016111 00000000000000 A SchroArith, struct in schroarith SchroArithContext, struct in schroarith schro_arith_decode_bit, function in schroarith schro_arith_decode_flush, function in schroarith schro_arith_decode_init, function in schroarith schro_arith_decode_sint, function in schroarith schro_arith_decode_uint, function in schroarith schro_arith_encode_bit, function in schroarith schro_arith_encode_init, function in schroarith schro_arith_encode_sint, function in schroarith schro_arith_encode_uint, function in schroarith schro_arith_estimate_init, function in schroarith schro_arith_estimate_sint, function in schroarith schro_arith_estimate_uint, function in schroarith schro_arith_flush, function in schroarith schro_arith_free, function in schroarith schro_arith_new, function in schroarith ARRAY_SIZE, macro in schroutils SCHRO_ASSERT, macro in schrodebug SchroAsync, struct in schroasync SchroAsyncCompleteFunc, user_function in schroasync SchroAsyncScheduleFunc, user_function in schroasync SchroAsyncTask, struct in schroasync schro_async_free, function in schroasync schro_async_get_exec_domain, function in schroasync schro_async_lock, function in schroasync schro_async_new, function in schroasync schro_async_signal_scheduler, function in schroasync schro_async_unlock, function in schroasync schro_async_wait_locked, function in schroasync SchroAuxiliaryDataID, enum in schrobitstream B SchroBlock, struct in schromotionest schro_block_check, function in schromotionest schro_block_fixup, function in schromotionest schro_bool, typedef in schroutils SchroBuffer, struct in schrobuffer schro_buffer_dup, function in schrobuffer schro_buffer_new, function in schrobuffer schro_buffer_new_and_alloc, function in schrobuffer schro_buffer_new_subbuffer, function in schrobuffer schro_buffer_new_with_data, function in schrobuffer schro_buffer_ref, function in schrobuffer schro_buffer_unref, function in schrobuffer C SchroChromaFormat, enum in schrobitstream CLAMP, macro in schroutils SchroColourMatrix, enum in schrobitstream SchroColourPrimaries, enum in schrobitstream SchroColourSpec, enum in schrobitstream SchroCUDAStream, typedef in schrocuda schro_cuda_init, function in schrocuda D SCHRO_DEBUG, macro in schrodebug schro_debug_get_level, function in schrodebug SCHRO_DEBUG_LEVEL, macro in schrodebug schro_debug_log, function in schrodebug schro_debug_set_level, function in schrodebug SchroDecoder, struct in schrodecoder schro_decoder_add_output_picture, function in schrodecoder schro_decoder_decode_block_data, function in schrodecoder schro_decoder_decode_lowdelay_transform_data, function in schrodecoder schro_decoder_decode_macroblock, function in schrodecoder schro_decoder_decode_parse_header, function in schrodecoder schro_decoder_decode_prediction_unit, function in schrodecoder schro_decoder_decode_transform_data, function in schrodecoder schro_decoder_free, function in schrodecoder schro_decoder_get_picture_number, function in schrodecoder schro_decoder_get_video_format, function in schrodecoder schro_decoder_init_subband_frame_data_interleaved, function in schrodecoder schro_decoder_iterate_picture, function in schrodecoder schro_decoder_new, function in schrodecoder schro_decoder_parse_block_data, function in schrodecoder schro_decoder_parse_lowdelay_transform_data, function in schrodecoder schro_decoder_parse_picture, function in schrodecoder schro_decoder_parse_picture_header, function in schrodecoder schro_decoder_parse_picture_prediction_parameters, function in schrodecoder schro_decoder_parse_transform_data, function in schrodecoder schro_decoder_parse_transform_parameters, function in schrodecoder schro_decoder_pull, function in schrodecoder schro_decoder_push, function in schrodecoder schro_decoder_push_end_of_stream, function in schrodecoder schro_decoder_push_ready, function in schrodecoder schro_decoder_reset, function in schrodecoder schro_decoder_set_earliest_frame, function in schrodecoder schro_decoder_set_skip_ratio, function in schrodecoder schro_decoder_subband_dc_predict, function in schrodecoder schro_decoder_wait, function in schrodecoder schro_dequantise, function in schroutils schro_dequantise_s16, function in schroutils schro_divide, macro in schroutils DIVIDE_ROUND_UP, macro in schroutils schro_dump, function in schrodebug E SchroEncoder, struct in schroencoder SchroEncoderFrame, struct in schroencoder SchroEncoderFrameStateEnum, enum in schroencoder SchroEncoderGOPEnum, enum in schroencoder SchroEncoderPerceptualEnum, enum in schroencoder SchroEncoderRateControlEnum, enum in schroencoder SchroEncoderSetting, struct in schroencoder SchroEncoderSettingTypeEnum, enum in schroencoder schro_encoder_analyse_picture, function in schroencoder schro_encoder_calculate_subband_weights, function in schroencoder schro_encoder_calculate_test_info, function in schroencoder schro_encoder_choose_quantisers, function in schroencoder schro_encoder_clean_up_transform, function in schroencoder schro_encoder_encode_auxiliary_data, function in schroencoder schro_encoder_encode_end_of_stream, function in schroencoder schro_encoder_encode_lowdelay_transform_data, function in schroencoder schro_encoder_encode_parse_info, function in schroencoder schro_encoder_encode_picture, function in schroencoder schro_encoder_encode_picture_header, function in schroencoder schro_encoder_encode_subband, function in schroencoder schro_encoder_encode_subband_noarith, function in schroencoder schro_encoder_end_of_stream, function in schroencoder schro_encoder_engine_backref, function in schroencoder schro_encoder_engine_backtest, function in schroencoder schro_encoder_engine_intra_only, function in schroencoder schro_encoder_engine_lossless, function in schroencoder schro_encoder_engine_lowdelay, function in schroencoder schro_encoder_engine_test_intra, function in schroencoder schro_encoder_estimate_entropy, function in schroencoder schro_encoder_frame_analyse, function in schroencoder schro_encoder_frame_downsample, function in schroencoder schro_encoder_frame_insert_buffer, function in schroencoder schro_encoder_frame_new, function in schroencoder schro_encoder_frame_queue_get, function in schroencoder schro_encoder_frame_queue_remove, function in schroencoder schro_encoder_frame_ref, function in schroencoder schro_encoder_frame_unref, function in schroencoder schro_encoder_free, function in schroencoder schro_encoder_get_n_settings, function in schroencoder schro_encoder_get_setting_info, function in schroencoder schro_encoder_get_video_format, function in schroencoder schro_encoder_global_estimation, function in schroencoder schro_encoder_init_error_tables, function in schroencoder schro_encoder_init_subbands, function in schroencoder schro_encoder_insert_buffer, function in schroencoder schro_encoder_new, function in schroencoder schro_encoder_output_push, function in schroencoder schro_encoder_perceptual_weight_ccir959, function in schroencoder schro_encoder_perceptual_weight_constant, function in schroencoder schro_encoder_perceptual_weight_moo, function in schroencoder schro_encoder_phasecorr_estimation, function in schroencoder schro_encoder_postanalyse_picture, function in schroencoder schro_encoder_pull, function in schroencoder schro_encoder_push_frame, function in schroencoder schro_encoder_push_ready, function in schroencoder schro_encoder_recalculate_allocations, function in schroencoder schro_encoder_reconstruct_picture, function in schroencoder schro_encoder_reference_get, function in schroencoder schro_encoder_setting_get_double, function in schroencoder schro_encoder_setting_set_double, function in schroencoder schro_encoder_set_default_subband_weights, function in schroencoder schro_encoder_set_video_format, function in schroencoder schro_encoder_start, function in schroencoder schro_encoder_wait, function in schroencoder SchroEngineIterateFunc, user_function in schroencoder SCHRO_ERROR, macro in schrodebug SchroExecDomain, typedef in schrodomain SCHRO_EXEC_DOMAIN_CPU, macro in schrodomain SCHRO_EXEC_DOMAIN_CUDA, macro in schrodomain SCHRO_EXEC_DOMAIN_OPENGL, macro in schrodomain F schro_fft_fwd_f32, function in schrofft schro_fft_generate_tables_f32, function in schrofft schro_fft_rev_f32, function in schrofft schro_filter_cwm7, function in schrofilter schro_filter_cwmN, function in schrofilter schro_filter_cwmN_ref, function in schrofilter SchroFrame, struct in schroframe SchroFrameData, struct in schroframe SchroFrameFormat, enum in schroframe SchroFrameFreeFunc, user_function in schroframe schro_frame_add, function in schroframe schro_frame_calculate_average_luma, function in schroframe schro_frame_clone, function in schroframe schro_frame_convert, function in schroframe schro_frame_convert_to_444, function in schroframe schro_frame_data_get_codeblock, function in schroframe SCHRO_FRAME_DATA_GET_LINE, macro in schroframe SCHRO_FRAME_DATA_GET_PIXEL_S16, macro in schroframe SCHRO_FRAME_DATA_GET_PIXEL_U8, macro in schroframe schro_frame_downsample, function in schroframe schro_frame_dup, function in schroframe schro_frame_edge_extend, function in schroframe schro_frame_filter_adaptive_lowpass, function in schrofilter schro_frame_filter_addnoise, function in schrofilter schro_frame_filter_cwm7, function in schrofilter schro_frame_filter_cwmN, function in schrofilter schro_frame_filter_cwmN_ref, function in schrofilter schro_frame_filter_lowpass, function in schrofilter schro_frame_filter_lowpass2, function in schrofilter schro_frame_filter_lowpass_16, function in schrofilter schro_frame_filter_wavelet, function in schrofilter SCHRO_FRAME_FORMAT_DEPTH, macro in schroframe SCHRO_FRAME_FORMAT_DEPTH_S16, macro in schroframe SCHRO_FRAME_FORMAT_DEPTH_S32, macro in schroframe SCHRO_FRAME_FORMAT_DEPTH_U8, macro in schroframe SCHRO_FRAME_FORMAT_H_SHIFT, macro in schroframe SCHRO_FRAME_FORMAT_V_SHIFT, macro in schroframe schro_frame_get_metric, function in schroframe schro_frame_get_subdata, function in schroframe schro_frame_inverse_iwt_transform_cuda, function in schroframe SCHRO_FRAME_IS_CUDA, macro in schrocuda SCHRO_FRAME_IS_PACKED, macro in schroframe schro_frame_iwt_transform, function in schroframe schro_frame_mark, function in schroframe schro_frame_md5, function in schroframe schro_frame_mean_squared_error, function in schroframe schro_frame_new, function in schroframe schro_frame_new_and_alloc, function in schroframe schro_frame_new_from_data_AYUV, function in schroframe schro_frame_new_from_data_I420, function in schroframe schro_frame_new_from_data_UYVY, function in schroframe schro_frame_new_from_data_YUY2, function in schroframe schro_frame_new_from_data_YV12, function in schroframe schro_frame_ref, function in schroframe schro_frame_set_free_callback, function in schroframe schro_frame_shift_left, function in schroframe schro_frame_shift_right, function in schroframe schro_frame_ssim, function in schroframe schro_frame_subtract, function in schroframe schro_frame_to_gpu, function in schrocuda schro_frame_unref, function in schroframe schro_frame_upsample_horiz, function in schroframe schro_frame_upsample_vert, function in schroframe schro_frame_zero_extend, function in schroframe schro_free, function in schroutils G SCHRO_GET, macro in schroutils SchroGlobalMotion, struct in schroparams schro_gpuframe_add, function in schrocuda schro_gpuframe_compare, function in schrocuda schro_gpuframe_convert, function in schrocuda schro_gpuframe_inverse_iwt_transform, function in schrocuda schro_gpuframe_iwt_transform, function in schrocuda schro_gpuframe_subtract, function in schrocuda schro_gpuframe_to_cpu, function in schrocuda schro_gpuframe_upsample, function in schrocuda schro_gpuframe_zero, function in schrocuda SchroGPUMotion, struct in schrocuda schro_gpumotion_copy, function in schrocuda schro_gpumotion_free, function in schrocuda schro_gpumotion_init, function in schrocuda schro_gpumotion_new, function in schrocuda schro_gpumotion_render, function in schrocuda H SchroHistogram, struct in schrohistogram SchroHistogramTable, struct in schrohistogram schro_histogram_add, function in schrohistogram schro_histogram_add_array_s16, function in schrohistogram schro_histogram_apply_table, function in schrohistogram schro_histogram_apply_table_range, function in schrohistogram schro_histogram_estimate_entropy, function in schrohistogram schro_histogram_estimate_noise_level, function in schrohistogram schro_histogram_estimate_slope, function in schrohistogram schro_histogram_get_range, function in schrohistogram schro_histogram_init, function in schrohistogram schro_histogram_scale, function in schrohistogram SCHRO_HISTOGRAM_SHIFT, macro in schrohistogram SCHRO_HISTOGRAM_SIZE, macro in schrohistogram schro_histogram_table_generate, function in schrohistogram I SCHRO_INFO, macro in schrodebug schro_init, function in schro SCHRO_INTERNAL, macro in schroutils L SCHRO_LIMIT_BLOCK_SIZE, macro in schrolimits SCHRO_LIMIT_ENCODER_TRANSFORM_DEPTH, macro in schrolimits SCHRO_LIMIT_FRAME_QUEUE_LENGTH, macro in schrolimits SCHRO_LIMIT_METRIC_SCAN, macro in schrolimits SCHRO_LIMIT_REFERENCE_FRAMES, macro in schrolimits SCHRO_LIMIT_SUBBANDS, macro in schrolimits SCHRO_LIMIT_TRANSFORM_DEPTH, macro in schrolimits SCHRO_LIMIT_WIDTH, macro in schrolimits SchroList, struct in schrolist SchroListFreeFunc, user_function in schrolist schro_list_append, function in schrolist schro_list_delete, function in schrolist schro_list_free, function in schrolist schro_list_get, function in schrolist schro_list_get_size, function in schrolist schro_list_insert, function in schrolist schro_list_new, function in schrolist schro_list_new_full, function in schrolist schro_list_prepend, function in schrolist schro_list_remove, function in schrolist schro_list_replace, function in schrolist SCHRO_LOG, macro in schrodebug M schro_malloc, function in schroutils schro_malloc0, function in schroutils MAX, macro in schroutils SchroMemoryDomain, struct in schrodomain schro_memory_domain_alloc, function in schrodomain schro_memory_domain_alloc_2d, function in schrodomain SCHRO_MEMORY_DOMAIN_CPU, macro in schrodomain SCHRO_MEMORY_DOMAIN_CUDA, macro in schrodomain schro_memory_domain_free, function in schrodomain schro_memory_domain_memfree, function in schrodomain schro_memory_domain_new, function in schrodomain schro_memory_domain_new_cuda, function in schrodomain schro_memory_domain_new_local, function in schrodomain SCHRO_MEMORY_DOMAIN_OPENGL, macro in schrodomain SCHRO_MEMORY_DOMAIN_SLOTS, macro in schrodomain SCHRO_MEMORY_DOMAIN_SLOT_ALLOCATED, macro in schrodomain SCHRO_MEMORY_DOMAIN_SLOT_IN_USE, macro in schrodomain SchroMetricScan, struct in schrometric schro_metric_absdiff_u8, function in schrometric schro_metric_abssum_s16, function in schrometric schro_metric_get, function in schrometric schro_metric_get_biref, function in schrometric schro_metric_get_dc, function in schrometric schro_metric_haar, function in schrometric schro_metric_haar_const, function in schrometric SCHRO_METRIC_INVALID, macro in schrometric schro_metric_scan_do_scan, function in schrometric schro_metric_scan_get_min, function in schrometric schro_metric_scan_setup, function in schrometric schro_metric_sum_u8, function in schrometric SCHRO_MILD_ASSERT, macro in schrodebug MIN, macro in schroutils SchroMotion, struct in schromotion SchroMotionEst, struct in schromotionest schro_motionest_free, function in schromotionest schro_motionest_new, function in schromotionest schro_motionest_superblock_get_metric, function in schromotionest SchroMotionField, struct in schroparams SchroMotionScan, struct in schromotionest SchroMotionVector, struct in schroparams schro_motion_block_estimate_entropy, function in schromotion schro_motion_copy_from, function in schromotion schro_motion_copy_to, function in schromotion schro_motion_dc_prediction, function in schromotion schro_motion_estimate_entropy, function in schromotion schro_motion_field_copy, function in schromotion schro_motion_field_free, function in schromotion schro_motion_field_inherit, function in schromotion schro_motion_field_lshift, function in schromotion schro_motion_field_new, function in schromotion schro_motion_field_scan, function in schromotion schro_motion_free, function in schromotion SCHRO_MOTION_GET_BLOCK, macro in schromotion schro_motion_get_global_prediction, function in schromotion schro_motion_get_mode_prediction, function in schromotion schro_motion_new, function in schromotion schro_motion_render, function in schromotion schro_motion_render_cuda, function in schromotion schro_motion_render_ref, function in schromotion schro_motion_split_prediction, function in schromotion schro_motion_superblock_estimate_entropy, function in schromotion schro_motion_superblock_try_estimate_entropy, function in schromotion schro_motion_vector_is_equal, function in schromotion schro_motion_vector_prediction, function in schromotion schro_motion_verify, function in schromotion muldiv64, function in schroutils N NEED_CLAMP, macro in schroutils SCHRO_N_WAVELETS, macro in schrowavelet O OFFSET, macro in schroutils P SchroPack, struct in schropack schro_pack_append, function in schropack schro_pack_append_zero, function in schropack schro_pack_copy, function in schropack schro_pack_encode_bit, function in schropack schro_pack_encode_bits, function in schropack schro_pack_encode_init, function in schropack schro_pack_encode_sint, function in schropack schro_pack_encode_uint, function in schropack schro_pack_estimate_sint, function in schropack schro_pack_estimate_uint, function in schropack schro_pack_flush, function in schropack schro_pack_free, function in schropack schro_pack_get_bit_offset, function in schropack schro_pack_get_offset, function in schropack schro_pack_new, function in schropack schro_pack_sync, function in schropack SchroParams, struct in schroparams schro_params_calculate_iwt_sizes, function in schroparams schro_params_calculate_mc_sizes, function in schroparams schro_params_get_block_params, function in schroparams schro_params_get_frame_format, function in schroparams schro_params_init, function in schroparams schro_params_is_default_codeblock, function in schroparams schro_params_is_default_quant_matrix, function in schroparams schro_params_set_block_params, function in schroparams schro_params_set_default_codeblock, function in schroparams schro_params_set_default_quant_matrix, function in schroparams schro_params_verify_block_params, function in schroparams SchroParseCode, enum in schrobitstream SCHRO_PARSE_CODE_IS_AUXILIARY_DATA, macro in schrobitstream SCHRO_PARSE_CODE_IS_CORE_SYNTAX, macro in schrobitstream SCHRO_PARSE_CODE_IS_END_OF_SEQUENCE, macro in schrobitstream SCHRO_PARSE_CODE_IS_INTER, macro in schrobitstream SCHRO_PARSE_CODE_IS_INTRA, macro in schrobitstream SCHRO_PARSE_CODE_IS_LOW_DELAY, macro in schrobitstream SCHRO_PARSE_CODE_IS_NON_REFERENCE, macro in schrobitstream SCHRO_PARSE_CODE_IS_PADDING, macro in schrobitstream SCHRO_PARSE_CODE_IS_PICTURE, macro in schrobitstream SCHRO_PARSE_CODE_IS_REFERENCE, macro in schrobitstream SCHRO_PARSE_CODE_IS_SEQ_HEADER, macro in schrobitstream SCHRO_PARSE_CODE_NUM_REFS, macro in schrobitstream SCHRO_PARSE_CODE_PICTURE, macro in schrobitstream SCHRO_PARSE_CODE_USING_AC, macro in schrobitstream SCHRO_PARSE_HEADER_SIZE, macro in schrobitstream SchroPicture, struct in schrodecoder SchroPictureNumber, typedef in schroparams schro_picture_new, function in schrodecoder schro_picture_ref, function in schrodecoder schro_picture_unref, function in schrodecoder Q schro_quantise, function in schroutils SchroQuantiserEngineEnum, enum in schroencoder schro_quantise_s16, function in schroutils SchroQueue, struct in schroqueue SchroQueueElement, struct in schroqueue SchroQueueFreeFunc, user_function in schroqueue schro_queue_add, function in schroqueue schro_queue_clear, function in schroqueue schro_queue_delete, function in schroqueue schro_queue_find, function in schroqueue schro_queue_free, function in schroqueue schro_queue_is_empty, function in schroqueue schro_queue_is_full, function in schroqueue schro_queue_new, function in schroqueue schro_queue_pop, function in schroqueue schro_queue_pull, function in schroqueue schro_queue_remove, function in schroqueue R schro_realloc, function in schroutils ROUND_SHIFT, macro in schroutils ROUND_UP_2, macro in schroutils ROUND_UP_4, macro in schroutils ROUND_UP_64, macro in schroutils ROUND_UP_8, macro in schroutils ROUND_UP_POW2, macro in schroutils ROUND_UP_SHIFT, macro in schroutils S SchroSignalRange, enum in schrobitstream SchroStateEnum, enum in schroencoder schro_subband_get_frame_data, function in schrosubband schro_subband_get_position, function in schrosubband SCHRO_SUBBAND_IS_HORIZONTALLY_ORIENTED, macro in schrosubband SCHRO_SUBBAND_IS_VERTICALLY_ORIENTED, macro in schrosubband SCHRO_SUBBAND_SHIFT, macro in schrosubband T SchroThread, struct in schroasync SchroTransferFunction, enum in schrobitstream U SchroUnpack, struct in schrounpack schro_unpack_byte_sync, function in schrounpack schro_unpack_copy, function in schrounpack schro_unpack_decode_bit, function in schrounpack schro_unpack_decode_bits, function in schrounpack schro_unpack_decode_sint, function in schrounpack schro_unpack_decode_sint_s16, function in schrounpack schro_unpack_decode_sint_slow, function in schrounpack schro_unpack_decode_uint, function in schrounpack schro_unpack_get_bits_read, function in schrounpack schro_unpack_get_bits_remaining, function in schrounpack schro_unpack_init_with_data, function in schrounpack schro_unpack_limit_bits_remaining, function in schrounpack schro_unpack_skip_bits, function in schrounpack SchroUpsampledFrame, struct in schroframe schro_upsampled_frame_free, function in schroframe schro_upsampled_frame_get_block_fast_precN, function in schroframe schro_upsampled_frame_get_block_precN, function in schroframe schro_upsampled_frame_get_pixel_prec0, function in schroframe schro_upsampled_frame_get_pixel_prec1, function in schroframe schro_upsampled_frame_get_pixel_prec3, function in schroframe schro_upsampled_frame_get_pixel_precN, function in schroframe schro_upsampled_frame_new, function in schroframe schro_upsampled_frame_upsample, function in schroframe schro_upsampled_gpuframe_free, function in schrocuda schro_upsampled_gpuframe_new, function in schrocuda schro_upsampled_gpuframe_upsample, function in schrocuda schro_utils_entropy, function in schroutils schro_utils_get_time, function in schroutils schro_utils_multiplier_to_quant_index, function in schroutils schro_utils_probability_to_entropy, function in schroutils schro_utils_reduce_fraction, function in schroutils V SchroVideoFormat, struct in schroparams SchroVideoFormatEnum, enum in schrobitstream schro_video_format_get_std_aspect_ratio, function in schrovideoformat schro_video_format_get_std_colour_spec, function in schrovideoformat schro_video_format_get_std_frame_rate, function in schrovideoformat schro_video_format_get_std_signal_range, function in schrovideoformat schro_video_format_get_std_video_format, function in schrovideoformat schro_video_format_set_std_aspect_ratio, function in schrovideoformat schro_video_format_set_std_colour_spec, function in schrovideoformat schro_video_format_set_std_frame_rate, function in schrovideoformat schro_video_format_set_std_signal_range, function in schrovideoformat schro_video_format_set_std_video_format, function in schrovideoformat schro_video_format_validate, function in schrovideoformat W SCHRO_WARNING, macro in schrodebug SchroWaveletIndex, enum in schrobitstream schro_wavelet_inverse_transform_2d, function in schrowavelet schro_wavelet_transform_2d, function in schrowavelet schroedinger-1.0.11/doc/xml/schrodebug.xml0000664000175000017500000001765011707140273015420 00000000000000 schrodebug 3 SCHROEDINGER Library schrodebug Synopsis #define SCHRO_ERROR (...) #define SCHRO_WARNING (...) #define SCHRO_INFO (...) #define SCHRO_DEBUG (...) #define SCHRO_LOG (...) #define SCHRO_DEBUG_LEVEL (level, ...) #define SCHRO_MILD_ASSERT (test) #define SCHRO_ASSERT (test) void schro_debug_log (int level, const char *file, const char *function, int line, const char *format, ...); void schro_debug_set_level (int level); int schro_debug_get_level (void); void schro_dump (int type, const char *format, ...); Description Details SCHRO_ERROR() SCHRO_ERROR #define SCHRO_ERROR(...) SCHRO_WARNING() SCHRO_WARNING #define SCHRO_WARNING(...) SCHRO_INFO() SCHRO_INFO #define SCHRO_INFO(...) SCHRO_DEBUG() SCHRO_DEBUG #define SCHRO_DEBUG(...) SCHRO_LOG() SCHRO_LOG #define SCHRO_LOG(...) SCHRO_DEBUG_LEVEL() SCHRO_DEBUG_LEVEL #define SCHRO_DEBUG_LEVEL(level,...) SCHRO_MILD_ASSERT() SCHRO_MILD_ASSERT #define SCHRO_MILD_ASSERT(test) SCHRO_ASSERT() SCHRO_ASSERT #define SCHRO_ASSERT(test) schro_debug_log () schro_debug_log void schro_debug_log (int level, const char *file, const char *function, int line, const char *format, ...); schro_debug_set_level () schro_debug_set_level void schro_debug_set_level (int level); schro_debug_get_level () schro_debug_get_level int schro_debug_get_level (void); schro_dump () schro_dump void schro_dump (int type, const char *format, ...); schroedinger-1.0.11/doc/xml/schropack.xml0000664000175000017500000003470711707140273015252 00000000000000 schropack 3 SCHROEDINGER Library schropack Synopsis struct SchroPack; SchroPack * schro_pack_new (void); void schro_pack_free (SchroPack *pack); void schro_pack_encode_init (SchroPack *pack, SchroBuffer *buffer); void schro_pack_sync (SchroPack *pack); void schro_pack_append (SchroPack *pack, const uint8_t *data, int len); void schro_pack_encode_bit (SchroPack *pack, int value); void schro_pack_encode_bits (SchroPack *pack, int n, unsigned int value); void schro_pack_encode_uint (SchroPack *pack, int value); void schro_pack_encode_sint (SchroPack *pack, int value); void schro_pack_copy (SchroPack *dest, SchroPack *src); int schro_pack_estimate_sint (int value); int schro_pack_estimate_uint (int value); void schro_pack_flush (SchroPack *pack); int schro_pack_get_bit_offset (SchroPack *pack); int schro_pack_get_offset (SchroPack *pack); void schro_pack_append_zero (SchroPack *pack, int len); Description Details struct SchroPack SchroPack struct SchroPack { SchroBuffer *buffer; int n; int shift; int n_pack; uint32_t value; int error; }; schro_pack_new () schro_pack_new SchroPack * schro_pack_new (void); schro_pack_free () schro_pack_free void schro_pack_free (SchroPack *pack); schro_pack_encode_init () schro_pack_encode_init void schro_pack_encode_init (SchroPack *pack, SchroBuffer *buffer); schro_pack_sync () schro_pack_sync void schro_pack_sync (SchroPack *pack); schro_pack_append () schro_pack_append void schro_pack_append (SchroPack *pack, const uint8_t *data, int len); schro_pack_encode_bit () schro_pack_encode_bit void schro_pack_encode_bit (SchroPack *pack, int value); schro_pack_encode_bits () schro_pack_encode_bits void schro_pack_encode_bits (SchroPack *pack, int n, unsigned int value); schro_pack_encode_uint () schro_pack_encode_uint void schro_pack_encode_uint (SchroPack *pack, int value); schro_pack_encode_sint () schro_pack_encode_sint void schro_pack_encode_sint (SchroPack *pack, int value); schro_pack_copy () schro_pack_copy void schro_pack_copy (SchroPack *dest, SchroPack *src); schro_pack_estimate_sint () schro_pack_estimate_sint int schro_pack_estimate_sint (int value); schro_pack_estimate_uint () schro_pack_estimate_uint int schro_pack_estimate_uint (int value); schro_pack_flush () schro_pack_flush void schro_pack_flush (SchroPack *pack); schro_pack_get_bit_offset () schro_pack_get_bit_offset int schro_pack_get_bit_offset (SchroPack *pack); schro_pack_get_offset () schro_pack_get_offset int schro_pack_get_offset (SchroPack *pack); schro_pack_append_zero () schro_pack_append_zero void schro_pack_append_zero (SchroPack *pack, int len); schroedinger-1.0.11/doc/xml/schroparams.xml0000664000175000017500000003675011707140273015617 00000000000000 schroparams 3 SCHROEDINGER Library schroparams Synopsis struct SchroVideoFormat; struct SchroParams; struct SchroMotionVector; struct SchroMotionField; struct SchroGlobalMotion; typedef SchroPictureNumber; void schro_params_calculate_iwt_sizes (SchroParams *params); void schro_params_calculate_mc_sizes (SchroParams *params); int schro_params_set_block_params (SchroParams *params, int index); void schro_params_set_default_codeblock (SchroParams *params); int schro_params_get_block_params (SchroParams *params); int schro_params_get_frame_format (int depth, SchroChromaFormat chroma_format); void schro_params_init (SchroParams *params, int video_format); schro_bool schro_params_is_default_codeblock (SchroParams *params); schro_bool schro_params_is_default_quant_matrix (SchroParams *params); void schro_params_set_default_quant_matrix (SchroParams *params); int schro_params_verify_block_params (SchroParams *params); Description Details struct SchroVideoFormat SchroVideoFormat struct SchroVideoFormat { SchroVideoFormatEnum index; int width; int height; SchroChromaFormat chroma_format; schro_bool interlaced; schro_bool top_field_first; int frame_rate_numerator; int frame_rate_denominator; int aspect_ratio_numerator; int aspect_ratio_denominator; int clean_width; int clean_height; int left_offset; int top_offset; int luma_offset; int luma_excursion; int chroma_offset; int chroma_excursion; SchroColourPrimaries colour_primaries; SchroColourMatrix colour_matrix; SchroTransferFunction transfer_function; int interlaced_coding; int unused0; int unused1; int unused2; }; struct SchroParams SchroParams struct SchroParams { }; struct SchroMotionVector SchroMotionVector struct SchroMotionVector { unsigned int pred_mode : 2; unsigned int using_global : 1; unsigned int split : 2; unsigned int unused : 3; unsigned int scan : 8; uint32_t metric; uint32_t chroma_metric; union { struct { int16_t dx[2]; int16_t dy[2]; } vec; struct { int16_t dc[3]; } dc; } u; }; struct SchroMotionField SchroMotionField struct SchroMotionField { int x_num_blocks; int y_num_blocks; SchroMotionVector *motion_vectors; }; struct SchroGlobalMotion SchroGlobalMotion struct SchroGlobalMotion { int b0; int b1; int a_exp; int a00; int a01; int a10; int a11; int c_exp; int c0; int c1; }; SchroPictureNumber SchroPictureNumber typedef uint32_t SchroPictureNumber; schro_params_calculate_iwt_sizes () schro_params_calculate_iwt_sizes void schro_params_calculate_iwt_sizes (SchroParams *params); Calculates the size of the array used for wavelet transformation using the current video format and transformation depth in the params structure. The params structure is updated with the new values. The structure fields changed are: iwt_chroma_width, iwt_chroma_height, iwt_luma_width, iwt_luma_height. params : pointer to SchroParams structure schro_params_calculate_mc_sizes () schro_params_calculate_mc_sizes void schro_params_calculate_mc_sizes (SchroParams *params); Calculates the size of the array used for motion compensation using the current video format and motion compensation paramters in the params structure. The params structure is updated with the new values. The structure fields changed are: x_num_blocks, y_num_blocks, mc_luma_width, mc_luma_height, mc_chroma_width, mc_chroma_height, x_offset, y_offset. params : pointer to SchroParams structure schro_params_set_block_params () schro_params_set_block_params int schro_params_set_block_params (SchroParams *params, int index); Sets the block parameters for motion compensation in the parameters structure pointed to by params to the standard block parameters given by index. params : pointer to SchroParams structure index : index to standard block parameters schro_params_set_default_codeblock () schro_params_set_default_codeblock void schro_params_set_default_codeblock (SchroParams *params); Sets the codeblock parameters in the parameters structure pointed to by params to the defaults. params : pointer to SchroParams structure schro_params_get_block_params () schro_params_get_block_params int schro_params_get_block_params (SchroParams *params); schro_params_get_frame_format () schro_params_get_frame_format int schro_params_get_frame_format (int depth, SchroChromaFormat chroma_format); schro_params_init () schro_params_init void schro_params_init (SchroParams *params, int video_format); schro_params_is_default_codeblock () schro_params_is_default_codeblock schro_bool schro_params_is_default_codeblock (SchroParams *params); params : pointer to SchroParams structure Returns :True if the codeblocks in params are the default codeblocks. schro_params_is_default_quant_matrix () schro_params_is_default_quant_matrix schro_bool schro_params_is_default_quant_matrix (SchroParams *params); schro_params_set_default_quant_matrix () schro_params_set_default_quant_matrix void schro_params_set_default_quant_matrix (SchroParams *params); schro_params_verify_block_params () schro_params_verify_block_params int schro_params_verify_block_params (SchroParams *params); schroedinger-1.0.11/doc/xml/schroframe.xml0000664000175000017500000020771311707140273015425 00000000000000 schroframe 3 SCHROEDINGER Library schroframe Synopsis struct SchroFrame; struct SchroFrameData; void (*SchroFrameFreeFunc) (SchroFrame *frame, void *priv); enum SchroFrameFormat; struct SchroUpsampledFrame; #define SCHRO_FRAME_FORMAT_DEPTH (format) #define SCHRO_FRAME_FORMAT_DEPTH_S16 #define SCHRO_FRAME_FORMAT_DEPTH_S32 #define SCHRO_FRAME_FORMAT_DEPTH_U8 #define SCHRO_FRAME_FORMAT_H_SHIFT (format) #define SCHRO_FRAME_FORMAT_V_SHIFT (format) #define SCHRO_FRAME_IS_PACKED (format) #define SCHRO_FRAME_DATA_GET_LINE (fd, i) #define SCHRO_FRAME_DATA_GET_PIXEL_S16 (fd, i, j) #define SCHRO_FRAME_DATA_GET_PIXEL_U8 (fd, i, j) SchroFrame * schro_frame_new (void); SchroFrame * schro_frame_new_and_alloc (SchroMemoryDomain *domain, SchroFrameFormat format, int width, int height); SchroFrame * schro_frame_new_from_data_AYUV (void *data, int width, int height); SchroFrame * schro_frame_new_from_data_I420 (void *data, int width, int height); SchroFrame * schro_frame_new_from_data_YUY2 (void *data, int width, int height); SchroFrame * schro_frame_dup (SchroFrame *frame); SchroFrame * schro_frame_ref (SchroFrame *frame); void schro_frame_unref (SchroFrame *frame); void schro_frame_set_free_callback (SchroFrame *frame, SchroFrameFreeFunc free_func, void *priv); SchroFrame * schro_frame_clone (SchroMemoryDomain *domain, SchroFrame *frame); void schro_frame_data_get_codeblock (SchroFrameData *dest, SchroFrameData *src, int x, int y, int horiz_codeblocks, int vert_codeblocks); int schro_frame_get_metric (SchroFrame *frame1, int x1, int y1, SchroFrame *frame2, int x2, int y2); void schro_frame_get_subdata (SchroFrame *frame, SchroFrameData *fd, int comp, int x, int y); void schro_frame_inverse_iwt_transform_cuda (SchroFrame *frame, SchroFrame *transform_frame, SchroParams *params); SchroFrame * schro_frame_new_from_data_UYVY (void *data, int width, int height); SchroFrame * schro_frame_new_from_data_YV12 (void *data, int width, int height); void schro_frame_convert (SchroFrame *dest, SchroFrame *src); SchroFrame * schro_frame_convert_to_444 (SchroFrame *frame); void schro_frame_add (SchroFrame *dest, SchroFrame *src); void schro_frame_subtract (SchroFrame *dest, SchroFrame *src); void schro_frame_shift_left (SchroFrame *frame, int shift); void schro_frame_shift_right (SchroFrame *frame, int shift); void schro_frame_edge_extend (SchroFrame *frame, int width, int height); void schro_frame_zero_extend (SchroFrame *frame, int width, int height); void schro_frame_iwt_transform (SchroFrame *frame, SchroParams *params); void schro_frame_downsample (SchroFrame *dest, SchroFrame *src); void schro_frame_mark (SchroFrame *frame, int value); void schro_frame_upsample_horiz (SchroFrame *dest, SchroFrame *src); void schro_frame_upsample_vert (SchroFrame *dest, SchroFrame *src); double schro_frame_ssim (SchroFrame *a, SchroFrame *b); void schro_frame_mean_squared_error (SchroFrame *a, SchroFrame *b, double *mse); void schro_frame_md5 (SchroFrame *frame, uint32_t *state); double schro_frame_calculate_average_luma (SchroFrame *frame); void schro_upsampled_frame_free (SchroUpsampledFrame *df); SchroUpsampledFrame * schro_upsampled_frame_new (SchroFrame *frame); void schro_upsampled_frame_upsample (SchroUpsampledFrame *df); void schro_upsampled_frame_get_block_fast_precN (SchroUpsampledFrame *upframe, int k, int x, int y, int prec, SchroFrameData *dest, SchroFrameData *fd); void schro_upsampled_frame_get_block_precN (SchroUpsampledFrame *upframe, int k, int x, int y, int prec, SchroFrameData *dest); int schro_upsampled_frame_get_pixel_prec0 (SchroUpsampledFrame *upframe, int k, int x, int y); int schro_upsampled_frame_get_pixel_prec1 (SchroUpsampledFrame *upframe, int k, int x, int y); int schro_upsampled_frame_get_pixel_prec3 (SchroUpsampledFrame *upframe, int k, int x, int y); int schro_upsampled_frame_get_pixel_precN (SchroUpsampledFrame *upframe, int k, int x, int y, int mv_precision); Description Details struct SchroFrame SchroFrame struct SchroFrame { int refcount; SchroFrameFreeFunc free; SchroMemoryDomain *domain; void *regions[3]; void *priv; SchroFrameFormat format; int width; int height; SchroFrameData components[3]; int is_virtual; int cached_lines[3][SCHRO_FRAME_CACHE_SIZE]; SchroFrame *virt_frame1; SchroFrame *virt_frame2; void (*render_line) (SchroFrame *frame, void *dest, int component, int i); void *virt_priv; void *virt_priv2; int extension; int cache_offset[3]; int is_upsampled; }; struct SchroFrameData SchroFrameData struct SchroFrameData { SchroFrameFormat format; void *data; int stride; int width; int height; int length; int h_shift; int v_shift; }; SchroFrameFreeFunc () SchroFrameFreeFunc void (*SchroFrameFreeFunc) (SchroFrame *frame, void *priv); enum SchroFrameFormat SchroFrameFormat typedef enum { SCHRO_FRAME_FORMAT_U8_444 = 0x00, SCHRO_FRAME_FORMAT_U8_422 = 0x01, SCHRO_FRAME_FORMAT_U8_420 = 0x03, SCHRO_FRAME_FORMAT_S16_444 = 0x04, SCHRO_FRAME_FORMAT_S16_422 = 0x05, SCHRO_FRAME_FORMAT_S16_420 = 0x07, SCHRO_FRAME_FORMAT_S32_444 = 0x08, SCHRO_FRAME_FORMAT_S32_422 = 0x09, SCHRO_FRAME_FORMAT_S32_420 = 0x0b, /* indirectly supported */ SCHRO_FRAME_FORMAT_YUYV = 0x100, /* YUYV order */ SCHRO_FRAME_FORMAT_UYVY = 0x101, /* UYVY order */ SCHRO_FRAME_FORMAT_AYUV = 0x102, SCHRO_FRAME_FORMAT_ARGB = 0x103, SCHRO_FRAME_FORMAT_RGB = 0x104, SCHRO_FRAME_FORMAT_v216 = 0x105, SCHRO_FRAME_FORMAT_v210 = 0x106, SCHRO_FRAME_FORMAT_AY64 = 0x107 } SchroFrameFormat; struct SchroUpsampledFrame SchroUpsampledFrame struct SchroUpsampledFrame { SchroFrame *frames[4]; }; SCHRO_FRAME_FORMAT_DEPTH() SCHRO_FRAME_FORMAT_DEPTH #define SCHRO_FRAME_FORMAT_DEPTH(format) ((format) & 0xc) SCHRO_FRAME_FORMAT_DEPTH_S16 SCHRO_FRAME_FORMAT_DEPTH_S16 #define SCHRO_FRAME_FORMAT_DEPTH_S16 0x04 SCHRO_FRAME_FORMAT_DEPTH_S32 SCHRO_FRAME_FORMAT_DEPTH_S32 #define SCHRO_FRAME_FORMAT_DEPTH_S32 0x08 SCHRO_FRAME_FORMAT_DEPTH_U8 SCHRO_FRAME_FORMAT_DEPTH_U8 #define SCHRO_FRAME_FORMAT_DEPTH_U8 0x00 SCHRO_FRAME_FORMAT_H_SHIFT() SCHRO_FRAME_FORMAT_H_SHIFT #define SCHRO_FRAME_FORMAT_H_SHIFT(format) ((format) & 0x1) SCHRO_FRAME_FORMAT_V_SHIFT() SCHRO_FRAME_FORMAT_V_SHIFT #define SCHRO_FRAME_FORMAT_V_SHIFT(format) (((format)>>1) & 0x1) SCHRO_FRAME_IS_PACKED() SCHRO_FRAME_IS_PACKED #define SCHRO_FRAME_IS_PACKED(format) (((format)>>8) & 0x1) SCHRO_FRAME_DATA_GET_LINE() SCHRO_FRAME_DATA_GET_LINE #define SCHRO_FRAME_DATA_GET_LINE(fd,i) (SCHRO_OFFSET((fd)->data,(fd)->stride*(i))) SCHRO_FRAME_DATA_GET_PIXEL_S16() SCHRO_FRAME_DATA_GET_PIXEL_S16 #define SCHRO_FRAME_DATA_GET_PIXEL_S16(fd,i,j) ((int16_t *)SCHRO_OFFSET((fd)->data,(fd)->stride*(j)+(i)*sizeof(int16_t))) SCHRO_FRAME_DATA_GET_PIXEL_U8() SCHRO_FRAME_DATA_GET_PIXEL_U8 #define SCHRO_FRAME_DATA_GET_PIXEL_U8(fd,i,j) ((uint8_t *)SCHRO_OFFSET((fd)->data,(fd)->stride*(j)+(i))) schro_frame_new () schro_frame_new SchroFrame * schro_frame_new (void); Creates a new SchroFrame object. The created frame is uninitialized and has no data storage associated with it. The caller must fill in the required information. Returns :a new SchroFrame object schro_frame_new_and_alloc () schro_frame_new_and_alloc SchroFrame * schro_frame_new_and_alloc (SchroMemoryDomain *domain, SchroFrameFormat format, int width, int height); Creates a new SchroFrame object with the requested size and format. Returns :a new SchroFrame object schro_frame_new_from_data_AYUV () schro_frame_new_from_data_AYUV SchroFrame * schro_frame_new_from_data_AYUV (void *data, int width, int height); Creates a new SchroFrame object with the requested size using the data pointed to by data. The data must be in AYUV format. The data must remain for the lifetime of the SchroFrame object. It is recommended to use schro_frame_set_free_callback() for notification when the data is no longer needed. Returns :a new SchroFrame object schro_frame_new_from_data_I420 () schro_frame_new_from_data_I420 SchroFrame * schro_frame_new_from_data_I420 (void *data, int width, int height); Creates a new SchroFrame object with the requested size using the data pointed to by data. The data must be in I420 format. The data must remain for the lifetime of the SchroFrame object. It is recommended to use schro_frame_set_free_callback() for notification when the data is no longer needed. Returns :a new SchroFrame object schro_frame_new_from_data_YUY2 () schro_frame_new_from_data_YUY2 SchroFrame * schro_frame_new_from_data_YUY2 (void *data, int width, int height); Creates a new SchroFrame object with the requested size using the data pointed to by data. The data must be in YUY2 format. The data must remain for the lifetime of the SchroFrame object. It is recommended to use schro_frame_set_free_callback() for notification when the data is no longer needed. Returns :a new SchroFrame object schro_frame_dup () schro_frame_dup SchroFrame * schro_frame_dup (SchroFrame *frame); Creates a new SchroFrame object with the same dimensions and format as frame, and copies the data from the frame to the new object. Returns :a new SchroFrame object schro_frame_ref () schro_frame_ref SchroFrame * schro_frame_ref (SchroFrame *frame); Increases the reference count of frame. frame : a frame object Returns :the value of frame schro_frame_unref () schro_frame_unref void schro_frame_unref (SchroFrame *frame); Decreases the reference count of frame. If the new reference count is 0, the frame is freed. If a frame free callback was set, this function is called. frame : a frame object schro_frame_set_free_callback () schro_frame_set_free_callback void schro_frame_set_free_callback (SchroFrame *frame, SchroFrameFreeFunc free_func, void *priv); Sets a function that will be called when the object reference count drops to zero and the object is freed. frame : a frame object free_func : the function to call when the frame is freed priv : callback key schro_frame_clone () schro_frame_clone SchroFrame * schro_frame_clone (SchroMemoryDomain *domain, SchroFrame *frame); Creates a new SchroFrame object with the same dimensions and format as frame. This function leaves the data in the new object uninitialized. Returns :a new SchroFrame object schro_frame_data_get_codeblock () schro_frame_data_get_codeblock void schro_frame_data_get_codeblock (SchroFrameData *dest, SchroFrameData *src, int x, int y, int horiz_codeblocks, int vert_codeblocks); schro_frame_get_metric () schro_frame_get_metric int schro_frame_get_metric (SchroFrame *frame1, int x1, int y1, SchroFrame *frame2, int x2, int y2); schro_frame_get_subdata () schro_frame_get_subdata void schro_frame_get_subdata (SchroFrame *frame, SchroFrameData *fd, int comp, int x, int y); schro_frame_inverse_iwt_transform_cuda () schro_frame_inverse_iwt_transform_cuda void schro_frame_inverse_iwt_transform_cuda (SchroFrame *frame, SchroFrame *transform_frame, SchroParams *params); schro_frame_new_from_data_UYVY () schro_frame_new_from_data_UYVY SchroFrame * schro_frame_new_from_data_UYVY (void *data, int width, int height); Creates a new SchroFrame object with the requested size using the data pointed to by data. The data must be in UYVY format. The data must remain for the lifetime of the SchroFrame object. It is recommended to use schro_frame_set_free_callback() for notification when the data is no longer needed. Returns :a new SchroFrame object schro_frame_new_from_data_YV12 () schro_frame_new_from_data_YV12 SchroFrame * schro_frame_new_from_data_YV12 (void *data, int width, int height); Creates a new SchroFrame object with the requested size using the data pointed to by data. The data must be in YV12 format. The data must remain for the lifetime of the SchroFrame object. It is recommended to use schro_frame_set_free_callback() for notification when the data is no longer needed. Returns :a new SchroFrame object schro_frame_convert () schro_frame_convert void schro_frame_convert (SchroFrame *dest, SchroFrame *src); Copies data from the source frame to the destination frame, converting formats if necessary. Only a few conversions are supported. dest : destination frame src : source frame schro_frame_convert_to_444 () schro_frame_convert_to_444 SchroFrame * schro_frame_convert_to_444 (SchroFrame *frame); schro_frame_add () schro_frame_add void schro_frame_add (SchroFrame *dest, SchroFrame *src); Adds data from the source frame to the destination frame. The frames must have the same chroma subsampling, and only a few combinations of bit depths are supported. dest : destination frame src : source frame schro_frame_subtract () schro_frame_subtract void schro_frame_subtract (SchroFrame *dest, SchroFrame *src); Subtracts data from the source frame to the destination frame. The frames must have the same chroma subsampling, and only a few combinations of bit depths are supported. dest : destination frame src : source frame schro_frame_shift_left () schro_frame_shift_left void schro_frame_shift_left (SchroFrame *frame, int shift); Shifts each value in frame to the left by shift bits. This operation happens in-place. frame : frame shift : number of bits to shift schro_frame_shift_right () schro_frame_shift_right void schro_frame_shift_right (SchroFrame *frame, int shift); Shifts each value in frame to the right by shift bits. This operation happens in-place. frame : frame shift : number of bits to shift schro_frame_edge_extend () schro_frame_edge_extend void schro_frame_edge_extend (SchroFrame *frame, int width, int height); Extends the edges of the subpicture defined from 0,0 to width,height to the size of frame. frame : frame width : width of subpicture height : height of subpicture schro_frame_zero_extend () schro_frame_zero_extend void schro_frame_zero_extend (SchroFrame *frame, int width, int height); schro_frame_iwt_transform () schro_frame_iwt_transform void schro_frame_iwt_transform (SchroFrame *frame, SchroParams *params); Performs an in-place integer wavelet transform on frame. The frame must have a bit depth of 16. frame : frame params : transform parameters schro_frame_downsample () schro_frame_downsample void schro_frame_downsample (SchroFrame *dest, SchroFrame *src); schro_frame_mark () schro_frame_mark void schro_frame_mark (SchroFrame *frame, int value); schro_frame_upsample_horiz () schro_frame_upsample_horiz void schro_frame_upsample_horiz (SchroFrame *dest, SchroFrame *src); schro_frame_upsample_vert () schro_frame_upsample_vert void schro_frame_upsample_vert (SchroFrame *dest, SchroFrame *src); schro_frame_ssim () schro_frame_ssim double schro_frame_ssim (SchroFrame *a, SchroFrame *b); schro_frame_mean_squared_error () schro_frame_mean_squared_error void schro_frame_mean_squared_error (SchroFrame *a, SchroFrame *b, double *mse); schro_frame_md5 () schro_frame_md5 void schro_frame_md5 (SchroFrame *frame, uint32_t *state); schro_frame_calculate_average_luma () schro_frame_calculate_average_luma double schro_frame_calculate_average_luma (SchroFrame *frame); schro_upsampled_frame_free () schro_upsampled_frame_free void schro_upsampled_frame_free (SchroUpsampledFrame *df); schro_upsampled_frame_new () schro_upsampled_frame_new SchroUpsampledFrame * schro_upsampled_frame_new (SchroFrame *frame); schro_upsampled_frame_upsample () schro_upsampled_frame_upsample void schro_upsampled_frame_upsample (SchroUpsampledFrame *df); schro_upsampled_frame_get_block_fast_precN () schro_upsampled_frame_get_block_fast_precN void schro_upsampled_frame_get_block_fast_precN (SchroUpsampledFrame *upframe, int k, int x, int y, int prec, SchroFrameData *dest, SchroFrameData *fd); schro_upsampled_frame_get_block_precN () schro_upsampled_frame_get_block_precN void schro_upsampled_frame_get_block_precN (SchroUpsampledFrame *upframe, int k, int x, int y, int prec, SchroFrameData *dest); schro_upsampled_frame_get_pixel_prec0 () schro_upsampled_frame_get_pixel_prec0 int schro_upsampled_frame_get_pixel_prec0 (SchroUpsampledFrame *upframe, int k, int x, int y); schro_upsampled_frame_get_pixel_prec1 () schro_upsampled_frame_get_pixel_prec1 int schro_upsampled_frame_get_pixel_prec1 (SchroUpsampledFrame *upframe, int k, int x, int y); schro_upsampled_frame_get_pixel_prec3 () schro_upsampled_frame_get_pixel_prec3 int schro_upsampled_frame_get_pixel_prec3 (SchroUpsampledFrame *upframe, int k, int x, int y); schro_upsampled_frame_get_pixel_precN () schro_upsampled_frame_get_pixel_precN int schro_upsampled_frame_get_pixel_precN (SchroUpsampledFrame *upframe, int k, int x, int y, int mv_precision); schroedinger-1.0.11/doc/xml/schrolimits.xml0000644000175000017500000001115711707140273015625 00000000000000 schrolimits 3 SCHROEDINGER Library schrolimits Synopsis #define SCHRO_LIMIT_WIDTH #define SCHRO_LIMIT_ENCODER_TRANSFORM_DEPTH #define SCHRO_LIMIT_FRAME_QUEUE_LENGTH #define SCHRO_LIMIT_REFERENCE_FRAMES #define SCHRO_LIMIT_SUBBANDS #define SCHRO_LIMIT_TRANSFORM_DEPTH #define SCHRO_LIMIT_BLOCK_SIZE #define SCHRO_LIMIT_METRIC_SCAN Description Details SCHRO_LIMIT_WIDTH SCHRO_LIMIT_WIDTH #define SCHRO_LIMIT_WIDTH 2048 Maximum picture width. SCHRO_LIMIT_ENCODER_TRANSFORM_DEPTH SCHRO_LIMIT_ENCODER_TRANSFORM_DEPTH #define SCHRO_LIMIT_ENCODER_TRANSFORM_DEPTH 6 The maximum transform depth that the encoder can handle. Must be less than SCHRO_LIMIT_TRANSFORM_DEPTH. SCHRO_LIMIT_FRAME_QUEUE_LENGTH SCHRO_LIMIT_FRAME_QUEUE_LENGTH #define SCHRO_LIMIT_FRAME_QUEUE_LENGTH 40 The maximum number of pictures being processed by the encoder. SCHRO_LIMIT_REFERENCE_FRAMES SCHRO_LIMIT_REFERENCE_FRAMES #define SCHRO_LIMIT_REFERENCE_FRAMES 8 The maximum number of active reference frames. In the encoder, the number of active reference frames may be much larger than in the resulting stream. SCHRO_LIMIT_SUBBANDS SCHRO_LIMIT_SUBBANDS #define SCHRO_LIMIT_SUBBANDS (1+3*SCHRO_LIMIT_TRANSFORM_DEPTH) The maximum number of subbands. SCHRO_LIMIT_TRANSFORM_DEPTH SCHRO_LIMIT_TRANSFORM_DEPTH #define SCHRO_LIMIT_TRANSFORM_DEPTH 6 The maximum transform depth that the decoder can handle. SCHRO_LIMIT_BLOCK_SIZE SCHRO_LIMIT_BLOCK_SIZE #define SCHRO_LIMIT_BLOCK_SIZE 64 Maximum block size. Both length and separation must be less than or equal to this limit. SCHRO_LIMIT_METRIC_SCAN SCHRO_LIMIT_METRIC_SCAN #define SCHRO_LIMIT_METRIC_SCAN 42 schroedinger-1.0.11/doc/xml/schrofft.xml0000664000175000017500000001530411707140273015103 00000000000000 schrofft 3 SCHROEDINGER Library schrofft Synopsis void schro_fft_fwd_f32 (float *d_real, float *d_imag, const float *s_real, const float *s_imag, const float *costable, const float *sintable, int shift); void schro_fft_generate_tables_f32 (float *costable, float *sintable, int shift); void schro_fft_rev_f32 (float *d_real, float *d_imag, const float *s_real, const float *s_imag, const float *costable, const float *sintable, int shift); Description Details schro_fft_fwd_f32 () schro_fft_fwd_f32 void schro_fft_fwd_f32 (float *d_real, float *d_imag, const float *s_real, const float *s_imag, const float *costable, const float *sintable, int shift); schro_fft_generate_tables_f32 () schro_fft_generate_tables_f32 void schro_fft_generate_tables_f32 (float *costable, float *sintable, int shift); schro_fft_rev_f32 () schro_fft_rev_f32 void schro_fft_rev_f32 (float *d_real, float *d_imag, const float *s_real, const float *s_imag, const float *costable, const float *sintable, int shift); schroedinger-1.0.11/doc/xml/schrobuffer.xml0000664000175000017500000001524111707140273015575 00000000000000 schrobuffer 3 SCHROEDINGER Library schrobuffer Synopsis struct SchroBuffer; SchroBuffer * schro_buffer_new (void); SchroBuffer * schro_buffer_new_and_alloc (int size); SchroBuffer * schro_buffer_new_with_data (void *data, int size); SchroBuffer * schro_buffer_new_subbuffer (SchroBuffer *buffer, int offset, int length); SchroBuffer * schro_buffer_ref (SchroBuffer *buffer); void schro_buffer_unref (SchroBuffer *buffer); SchroBuffer * schro_buffer_dup (SchroBuffer *buffer); Description Details struct SchroBuffer SchroBuffer struct SchroBuffer { }; schro_buffer_new () schro_buffer_new SchroBuffer * schro_buffer_new (void); schro_buffer_new_and_alloc () schro_buffer_new_and_alloc SchroBuffer * schro_buffer_new_and_alloc (int size); schro_buffer_new_with_data () schro_buffer_new_with_data SchroBuffer * schro_buffer_new_with_data (void *data, int size); schro_buffer_new_subbuffer () schro_buffer_new_subbuffer SchroBuffer * schro_buffer_new_subbuffer (SchroBuffer *buffer, int offset, int length); schro_buffer_ref () schro_buffer_ref SchroBuffer * schro_buffer_ref (SchroBuffer *buffer); schro_buffer_unref () schro_buffer_unref void schro_buffer_unref (SchroBuffer *buffer); schro_buffer_dup () schro_buffer_dup SchroBuffer * schro_buffer_dup (SchroBuffer *buffer); schroedinger-1.0.11/doc/xml/schrobitstream.xml0000664000175000017500000003404211707140273016316 00000000000000 schrobitstream 3 SCHROEDINGER Library schrobitstream Synopsis enum SchroAuxiliaryDataID; enum SchroParseCode; enum SchroVideoFormatEnum; enum SchroChromaFormat; enum SchroColourMatrix; enum SchroColourSpec; enum SchroColourPrimaries; enum SchroWaveletIndex; enum SchroSignalRange; enum SchroTransferFunction; #define SCHRO_PARSE_HEADER_SIZE #define SCHRO_PARSE_CODE_PICTURE (is_ref, n_refs, is_lowdelay, is_noarith) #define SCHRO_PARSE_CODE_IS_INTER (x) #define SCHRO_PARSE_CODE_IS_INTRA (x) #define SCHRO_PARSE_CODE_IS_NON_REFERENCE (x) #define SCHRO_PARSE_CODE_IS_REFERENCE (x) #define SCHRO_PARSE_CODE_IS_LOW_DELAY (x) #define SCHRO_PARSE_CODE_IS_PICTURE (x) #define SCHRO_PARSE_CODE_NUM_REFS (x) #define SCHRO_PARSE_CODE_IS_AUXILIARY_DATA (x) #define SCHRO_PARSE_CODE_IS_CORE_SYNTAX (x) #define SCHRO_PARSE_CODE_IS_END_OF_SEQUENCE (x) #define SCHRO_PARSE_CODE_IS_PADDING (x) #define SCHRO_PARSE_CODE_IS_SEQ_HEADER (x) #define SCHRO_PARSE_CODE_USING_AC (x) Description Details enum SchroAuxiliaryDataID SchroAuxiliaryDataID typedef enum { SCHRO_AUX_DATA_INVALID, SCHRO_AUX_DATA_ENCODER_STRING, SCHRO_AUX_DATA_SMPTE_12M_TIMECODE, SCHRO_AUX_DATA_MD5_CHECKSUM, SCHRO_AUX_DATA_BITRATE, SCHRO_AUX_DATA_USER = 0x80 } SchroAuxiliaryDataID; enum SchroParseCode SchroParseCode typedef enum { SCHRO_PARSE_CODE_SEQUENCE_HEADER = 0x00, SCHRO_PARSE_CODE_END_OF_SEQUENCE = 0x10, SCHRO_PARSE_CODE_AUXILIARY_DATA = 0x20, SCHRO_PARSE_CODE_PADDING = 0x30, SCHRO_PARSE_CODE_INTRA_REF = 0x0c, SCHRO_PARSE_CODE_INTRA_NON_REF = 0x08, SCHRO_PARSE_CODE_INTRA_REF_NOARITH = 0x4c, SCHRO_PARSE_CODE_INTRA_NON_REF_NOARITH = 0x48, SCHRO_PARSE_CODE_INTER_REF_1 = 0x0d, SCHRO_PARSE_CODE_INTER_REF_1_NOARITH = 0x4d, SCHRO_PARSE_CODE_INTER_REF_2 = 0x0e, SCHRO_PARSE_CODE_INTER_REF_2_NOARITH = 0x4e, SCHRO_PARSE_CODE_INTER_NON_REF_1 = 0x09, SCHRO_PARSE_CODE_INTER_NON_REF_1_NOARITH = 0x49, SCHRO_PARSE_CODE_INTER_NON_REF_2 = 0x0a, SCHRO_PARSE_CODE_INTER_NON_REF_2_NOARITH = 0x4a, SCHRO_PARSE_CODE_LD_INTRA_REF = 0xcc, SCHRO_PARSE_CODE_LD_INTRA_NON_REF = 0xc8 } SchroParseCode; enum SchroVideoFormatEnum SchroVideoFormatEnum typedef enum { SCHRO_VIDEO_FORMAT_CUSTOM = 0, SCHRO_VIDEO_FORMAT_QSIF, SCHRO_VIDEO_FORMAT_QCIF, SCHRO_VIDEO_FORMAT_SIF, SCHRO_VIDEO_FORMAT_CIF, SCHRO_VIDEO_FORMAT_4SIF, SCHRO_VIDEO_FORMAT_4CIF, SCHRO_VIDEO_FORMAT_SD480I_60, SCHRO_VIDEO_FORMAT_SD576I_50, SCHRO_VIDEO_FORMAT_HD720P_60, SCHRO_VIDEO_FORMAT_HD720P_50, SCHRO_VIDEO_FORMAT_HD1080I_60, SCHRO_VIDEO_FORMAT_HD1080I_50, SCHRO_VIDEO_FORMAT_HD1080P_60, SCHRO_VIDEO_FORMAT_HD1080P_50, SCHRO_VIDEO_FORMAT_DC2K_24, SCHRO_VIDEO_FORMAT_DC4K_24, SCHRO_VIDEO_FORMAT_UHDTV_4K_60, SCHRO_VIDEO_FORMAT_UHDTV_4K_50, SCHRO_VIDEO_FORMAT_UHDTV_8K_60, SCHRO_VIDEO_FORMAT_UHDTV_8K_50 } SchroVideoFormatEnum; enum SchroChromaFormat SchroChromaFormat typedef enum { SCHRO_CHROMA_444 = 0, SCHRO_CHROMA_422, SCHRO_CHROMA_420 } SchroChromaFormat; enum SchroColourMatrix SchroColourMatrix typedef enum { SCHRO_COLOUR_MATRIX_HDTV = 0, SCHRO_COLOUR_MATRIX_SDTV = 1, SCHRO_COLOUR_MATRIX_REVERSIBLE = 2 } SchroColourMatrix; enum SchroColourSpec SchroColourSpec typedef enum { SCHRO_COLOUR_SPEC_CUSTOM = 0, SCHRO_COLOUR_SPEC_SDTV_525 = 1, SCHRO_COLOUR_SPEC_SDTV_625 = 2, SCHRO_COLOUR_SPEC_HDTV = 3, SCHRO_COLOUR_SPEC_CINEMA = 4 } SchroColourSpec; enum SchroColourPrimaries SchroColourPrimaries typedef enum { SCHRO_COLOUR_PRIMARY_HDTV = 0, SCHRO_COLOUR_PRIMARY_SDTV_525 = 1, SCHRO_COLOUR_PRIMARY_SDTV_625 = 2, SCHRO_COLOUR_PRIMARY_CINEMA = 3 } SchroColourPrimaries; enum SchroWaveletIndex SchroWaveletIndex typedef enum { SCHRO_WAVELET_DESLAURIERS_DUBUC_9_7, SCHRO_WAVELET_LE_GALL_5_3, SCHRO_WAVELET_DESLAURIERS_DUBUC_13_7, SCHRO_WAVELET_HAAR_0, SCHRO_WAVELET_HAAR_1, SCHRO_WAVELET_FIDELITY, SCHRO_WAVELET_DAUBECHIES_9_7 } SchroWaveletIndex; enum SchroSignalRange SchroSignalRange typedef enum { SCHRO_SIGNAL_RANGE_CUSTOM = 0, SCHRO_SIGNAL_RANGE_8BIT_FULL = 1, SCHRO_SIGNAL_RANGE_8BIT_VIDEO = 2, SCHRO_SIGNAL_RANGE_10BIT_VIDEO = 3, SCHRO_SIGNAL_RANGE_12BIT_VIDEO = 4 } SchroSignalRange; enum SchroTransferFunction SchroTransferFunction typedef enum { SCHRO_TRANSFER_CHAR_TV_GAMMA = 0, SCHRO_TRANSFER_CHAR_EXTENDED_GAMUT = 1, SCHRO_TRANSFER_CHAR_LINEAR = 2, SCHRO_TRANSFER_CHAR_DCI_GAMMA = 3 } SchroTransferFunction; SCHRO_PARSE_HEADER_SIZE SCHRO_PARSE_HEADER_SIZE #define SCHRO_PARSE_HEADER_SIZE (4+1+4+4) SCHRO_PARSE_CODE_PICTURE() SCHRO_PARSE_CODE_PICTURE #define SCHRO_PARSE_CODE_PICTURE(is_ref,n_refs,is_lowdelay,is_noarith) SCHRO_PARSE_CODE_IS_INTER() SCHRO_PARSE_CODE_IS_INTER #define SCHRO_PARSE_CODE_IS_INTER(x) (SCHRO_PARSE_CODE_IS_PICTURE(x) && SCHRO_PARSE_CODE_NUM_REFS(x) > 0) SCHRO_PARSE_CODE_IS_INTRA() SCHRO_PARSE_CODE_IS_INTRA #define SCHRO_PARSE_CODE_IS_INTRA(x) (SCHRO_PARSE_CODE_IS_PICTURE(x) && SCHRO_PARSE_CODE_NUM_REFS(x) == 0) SCHRO_PARSE_CODE_IS_NON_REFERENCE() SCHRO_PARSE_CODE_IS_NON_REFERENCE #define SCHRO_PARSE_CODE_IS_NON_REFERENCE(x) (((x) & 0xc) == 0x08) SCHRO_PARSE_CODE_IS_REFERENCE() SCHRO_PARSE_CODE_IS_REFERENCE #define SCHRO_PARSE_CODE_IS_REFERENCE(x) (((x) & 0xc) == 0x0c) SCHRO_PARSE_CODE_IS_LOW_DELAY() SCHRO_PARSE_CODE_IS_LOW_DELAY #define SCHRO_PARSE_CODE_IS_LOW_DELAY(x) (((x) & 0x88) == 0x88) SCHRO_PARSE_CODE_IS_PICTURE() SCHRO_PARSE_CODE_IS_PICTURE #define SCHRO_PARSE_CODE_IS_PICTURE(x) ((x) & 0x8) SCHRO_PARSE_CODE_NUM_REFS() SCHRO_PARSE_CODE_NUM_REFS #define SCHRO_PARSE_CODE_NUM_REFS(x) ((x) & 0x3) SCHRO_PARSE_CODE_IS_AUXILIARY_DATA() SCHRO_PARSE_CODE_IS_AUXILIARY_DATA #define SCHRO_PARSE_CODE_IS_AUXILIARY_DATA(x) ((x) == SCHRO_PARSE_CODE_AUXILIARY_DATA) SCHRO_PARSE_CODE_IS_CORE_SYNTAX() SCHRO_PARSE_CODE_IS_CORE_SYNTAX #define SCHRO_PARSE_CODE_IS_CORE_SYNTAX(x) (((x) & 0x88) == 0x08) SCHRO_PARSE_CODE_IS_END_OF_SEQUENCE() SCHRO_PARSE_CODE_IS_END_OF_SEQUENCE #define SCHRO_PARSE_CODE_IS_END_OF_SEQUENCE(x) ((x) == SCHRO_PARSE_CODE_END_OF_SEQUENCE) SCHRO_PARSE_CODE_IS_PADDING() SCHRO_PARSE_CODE_IS_PADDING #define SCHRO_PARSE_CODE_IS_PADDING(x) ((x) == SCHRO_PARSE_CODE_PADDING) SCHRO_PARSE_CODE_IS_SEQ_HEADER() SCHRO_PARSE_CODE_IS_SEQ_HEADER #define SCHRO_PARSE_CODE_IS_SEQ_HEADER(x) ((x) == SCHRO_PARSE_CODE_SEQUENCE_HEADER) SCHRO_PARSE_CODE_USING_AC() SCHRO_PARSE_CODE_USING_AC #define SCHRO_PARSE_CODE_USING_AC(x) (((x) & 0x48) == 0x08) schroedinger-1.0.11/doc/xml/schromotion.xml0000664000175000017500000010051711707140273015632 00000000000000 schromotion 3 SCHROEDINGER Library schromotion Synopsis struct SchroMotion; #define SCHRO_MOTION_GET_BLOCK (motion, x, y) void schro_motion_dc_prediction (SchroMotion *motion, int x, int y, int *pred); void schro_motion_vector_prediction (SchroMotion *motion, int x, int y, int *pred_x, int *pred_y, int mode); int schro_motion_split_prediction (SchroMotion *motion, int x, int y); int schro_motion_get_mode_prediction (SchroMotion *motion, int x, int y); int schro_motion_block_estimate_entropy (SchroMotion *motion, int i, int j); void schro_motion_copy_from (SchroMotion *motion, int i, int j, SchroBlock *block); void schro_motion_copy_to (SchroMotion *motion, int i, int j, SchroBlock *block); int schro_motion_estimate_entropy (SchroMotion *motion); void schro_motion_field_lshift (SchroMotionField *mf, int n); void schro_motion_free (SchroMotion *motion); int schro_motion_get_global_prediction (SchroMotion *motion, int x, int y); SchroMotion * schro_motion_new (SchroParams *params, SchroUpsampledFrame *ref1, SchroUpsampledFrame *ref2); void schro_motion_render (SchroMotion *motion, SchroFrame *dest, SchroFrame *addframe, int add, SchroFrame *output_frame); void schro_motion_render_cuda (SchroMotion *motion, SchroFrame *dest); void schro_motion_render_ref (SchroMotion *motion, SchroFrame *dest, SchroFrame *addframe, int add, SchroFrame *output_frame); int schro_motion_superblock_estimate_entropy (SchroMotion *motion, int i, int j); int schro_motion_superblock_try_estimate_entropy (SchroMotion *motion, int i, int j, SchroBlock *block); int schro_motion_vector_is_equal (SchroMotionVector *mv1, SchroMotionVector *mv2); SchroMotionField * schro_motion_field_new (int x_num_blocks, int y_num_blocks); void schro_motion_field_free (SchroMotionField *field); void schro_motion_field_scan (SchroMotionField *field, SchroParams *params, SchroFrame *frame, SchroFrame *ref, int dist); void schro_motion_field_inherit (SchroMotionField *field, SchroMotionField *parent); void schro_motion_field_copy (SchroMotionField *field, SchroMotionField *parent); int schro_motion_verify (SchroMotion *mf); Description Details struct SchroMotion SchroMotion struct SchroMotion { SchroUpsampledFrame *src1; SchroUpsampledFrame *src2; SchroMotionVector *motion_vectors; SchroParams *params; uint8_t *tmpdata; int ref_weight_precision; int ref1_weight; int ref2_weight; int mv_precision; int xoffset; int yoffset; int xbsep; int ybsep; int xblen; int yblen; SchroFrameData block; SchroFrameData alloc_block; SchroFrameData obmc_weight; SchroFrameData alloc_block_ref[2]; SchroFrameData block_ref[2]; int weight_x[SCHRO_LIMIT_BLOCK_SIZE]; int weight_y[SCHRO_LIMIT_BLOCK_SIZE]; int width; int height; int max_fast_x; int max_fast_y; schro_bool simple_weight; schro_bool oneref_noscale; }; SCHRO_MOTION_GET_BLOCK() SCHRO_MOTION_GET_BLOCK #define SCHRO_MOTION_GET_BLOCK(motion,x,y) schro_motion_dc_prediction () schro_motion_dc_prediction void schro_motion_dc_prediction (SchroMotion *motion, int x, int y, int *pred); schro_motion_vector_prediction () schro_motion_vector_prediction void schro_motion_vector_prediction (SchroMotion *motion, int x, int y, int *pred_x, int *pred_y, int mode); schro_motion_split_prediction () schro_motion_split_prediction int schro_motion_split_prediction (SchroMotion *motion, int x, int y); schro_motion_get_mode_prediction () schro_motion_get_mode_prediction int schro_motion_get_mode_prediction (SchroMotion *motion, int x, int y); schro_motion_block_estimate_entropy () schro_motion_block_estimate_entropy int schro_motion_block_estimate_entropy (SchroMotion *motion, int i, int j); schro_motion_copy_from () schro_motion_copy_from void schro_motion_copy_from (SchroMotion *motion, int i, int j, SchroBlock *block); schro_motion_copy_to () schro_motion_copy_to void schro_motion_copy_to (SchroMotion *motion, int i, int j, SchroBlock *block); schro_motion_estimate_entropy () schro_motion_estimate_entropy int schro_motion_estimate_entropy (SchroMotion *motion); schro_motion_field_lshift () schro_motion_field_lshift void schro_motion_field_lshift (SchroMotionField *mf, int n); schro_motion_free () schro_motion_free void schro_motion_free (SchroMotion *motion); schro_motion_get_global_prediction () schro_motion_get_global_prediction int schro_motion_get_global_prediction (SchroMotion *motion, int x, int y); schro_motion_new () schro_motion_new SchroMotion * schro_motion_new (SchroParams *params, SchroUpsampledFrame *ref1, SchroUpsampledFrame *ref2); schro_motion_render () schro_motion_render void schro_motion_render (SchroMotion *motion, SchroFrame *dest, SchroFrame *addframe, int add, SchroFrame *output_frame); schro_motion_render_cuda () schro_motion_render_cuda void schro_motion_render_cuda (SchroMotion *motion, SchroFrame *dest); schro_motion_render_ref () schro_motion_render_ref void schro_motion_render_ref (SchroMotion *motion, SchroFrame *dest, SchroFrame *addframe, int add, SchroFrame *output_frame); schro_motion_superblock_estimate_entropy () schro_motion_superblock_estimate_entropy int schro_motion_superblock_estimate_entropy (SchroMotion *motion, int i, int j); schro_motion_superblock_try_estimate_entropy () schro_motion_superblock_try_estimate_entropy int schro_motion_superblock_try_estimate_entropy (SchroMotion *motion, int i, int j, SchroBlock *block); schro_motion_vector_is_equal () schro_motion_vector_is_equal int schro_motion_vector_is_equal (SchroMotionVector *mv1, SchroMotionVector *mv2); schro_motion_field_new () schro_motion_field_new SchroMotionField * schro_motion_field_new (int x_num_blocks, int y_num_blocks); schro_motion_field_free () schro_motion_field_free void schro_motion_field_free (SchroMotionField *field); schro_motion_field_scan () schro_motion_field_scan void schro_motion_field_scan (SchroMotionField *field, SchroParams *params, SchroFrame *frame, SchroFrame *ref, int dist); schro_motion_field_inherit () schro_motion_field_inherit void schro_motion_field_inherit (SchroMotionField *field, SchroMotionField *parent); schro_motion_field_copy () schro_motion_field_copy void schro_motion_field_copy (SchroMotionField *field, SchroMotionField *parent); schro_motion_verify () schro_motion_verify int schro_motion_verify (SchroMotion *mf); schroedinger-1.0.11/doc/schroedinger-sections.txt0000644000175000017500000003626111707140273017010 00000000000000
schrobitstream SchroAuxiliaryDataID SchroParseCode SchroVideoFormatEnum SchroChromaFormat SchroColourMatrix SchroColourSpec SchroColourPrimaries SchroWaveletIndex SchroSignalRange SchroTransferFunction SCHRO_PARSE_HEADER_SIZE SCHRO_PARSE_CODE_PICTURE SCHRO_PARSE_CODE_IS_INTER SCHRO_PARSE_CODE_IS_INTRA SCHRO_PARSE_CODE_IS_NON_REFERENCE SCHRO_PARSE_CODE_IS_REFERENCE SCHRO_PARSE_CODE_IS_LOW_DELAY SCHRO_PARSE_CODE_IS_PICTURE SCHRO_PARSE_CODE_NUM_REFS SCHRO_PARSE_CODE_IS_AUXILIARY_DATA SCHRO_PARSE_CODE_IS_CORE_SYNTAX SCHRO_PARSE_CODE_IS_END_OF_SEQUENCE SCHRO_PARSE_CODE_IS_PADDING SCHRO_PARSE_CODE_IS_SEQ_HEADER SCHRO_PARSE_CODE_USING_AC
schrolimits SCHRO_LIMIT_WIDTH SCHRO_LIMIT_ENCODER_TRANSFORM_DEPTH SCHRO_LIMIT_FRAME_QUEUE_LENGTH SCHRO_LIMIT_REFERENCE_FRAMES SCHRO_LIMIT_SUBBANDS SCHRO_LIMIT_TRANSFORM_DEPTH SCHRO_LIMIT_BLOCK_SIZE SCHRO_LIMIT_METRIC_SCAN
schrodecoder SchroDecoder schro_decoder_new schro_decoder_free schro_decoder_reset schro_decoder_get_video_format schro_decoder_add_output_picture schro_decoder_push_ready schro_decoder_push schro_decoder_push_end_of_stream schro_decoder_pull schro_decoder_is_parse_unit schro_decoder_is_access_unit schro_decoder_is_intra schro_decoder_is_picture schro_decoder_iterate schro_decoder_wait schro_decoder_set_earliest_frame schro_decoder_set_skip_ratio schro_decoder_get_picture_number schro_decoder_decode_parse_header schro_decoder_decode_transform_data schro_decoder_decode_lowdelay_transform_data schro_decoder_subband_dc_predict schro_decoder_compare_access_unit_buffer schro_decoder_decode_block_data schro_decoder_decode_macroblock schro_decoder_decode_picture schro_decoder_decode_prediction_unit schro_decoder_init_subband_frame_data_interleaved schro_decoder_iterate_picture schro_decoder_parse_access_unit schro_decoder_parse_block_data schro_decoder_parse_lowdelay_transform_data schro_decoder_parse_picture schro_decoder_parse_picture_header schro_decoder_parse_picture_prediction_parameters schro_decoder_parse_transform_data schro_decoder_parse_transform_parameters schro_decoder_x_check_references schro_decoder_x_combine schro_decoder_x_decode_motion schro_decoder_x_decode_residual schro_decoder_x_render_motion schro_decoder_x_upsample schro_decoder_x_wavelet_transform SchroPicture schro_picture_new schro_picture_ref schro_picture_unref
schrodomain SchroExecDomain SchroMemoryDomain SCHRO_EXEC_DOMAIN_CPU SCHRO_EXEC_DOMAIN_CUDA SCHRO_EXEC_DOMAIN_OPENGL SCHRO_MEMORY_DOMAIN_CPU SCHRO_MEMORY_DOMAIN_CUDA SCHRO_MEMORY_DOMAIN_OPENGL SCHRO_MEMORY_DOMAIN_SLOTS SCHRO_MEMORY_DOMAIN_SLOT_ALLOCATED SCHRO_MEMORY_DOMAIN_SLOT_IN_USE schro_memory_domain_alloc schro_memory_domain_alloc_2d schro_memory_domain_free schro_memory_domain_memfree schro_memory_domain_new schro_memory_domain_new_cuda schro_memory_domain_new_local
schrocuda SchroCUDAStream SchroGPUMotion SCHRO_FRAME_IS_CUDA schro_cuda_init schro_gpumotion_copy schro_gpumotion_free schro_gpumotion_init schro_gpumotion_new schro_gpumotion_render schro_frame_to_gpu schro_gpuframe_add schro_gpuframe_compare schro_gpuframe_convert schro_gpuframe_inverse_iwt_transform schro_gpuframe_iwt_transform schro_gpuframe_subtract schro_gpuframe_to_cpu schro_gpuframe_upsample schro_gpuframe_zero schro_upsampled_gpuframe_free schro_upsampled_gpuframe_new schro_upsampled_gpuframe_upsample
schropack SchroPack schro_pack_new schro_pack_free schro_pack_encode_init schro_pack_sync schro_pack_append schro_pack_encode_bit schro_pack_encode_bits schro_pack_encode_uint schro_pack_encode_sint schro_pack_copy schro_pack_estimate_sint schro_pack_estimate_uint schro_pack_flush schro_pack_get_bit_offset schro_pack_get_offset schro_pack_append_zero
schrowavelet SCHRO_N_WAVELETS schro_wavelet_transform_2d schro_wavelet_inverse_transform_2d schro_split_ext_desl93 schro_split_ext_53 schro_split_ext_135 schro_split_ext_haar schro_split_ext_fidelity schro_split_ext_daub97 schro_synth_ext_desl93 schro_synth_ext_53 schro_synth_ext_135 schro_synth_ext_haar schro_synth_ext_fidelity schro_synth_ext_daub97 schro_iwt_desl_9_3 schro_iwt_5_3 schro_iwt_13_5 schro_iwt_haar0 schro_iwt_haar1 schro_iwt_haar2 schro_iwt_fidelity schro_iwt_daub_9_7 schro_iiwt_desl_9_3 schro_iiwt_5_3 schro_iiwt_13_5 schro_iiwt_haar0 schro_iiwt_haar1 schro_iiwt_haar2 schro_iiwt_fidelity schro_iiwt_daub_9_7
schroarith SchroArith SchroArithContext schro_arith_new schro_arith_free schro_arith_decode_init schro_arith_encode_init schro_arith_flush schro_arith_decode_bit schro_arith_decode_flush schro_arith_decode_sint schro_arith_decode_uint schro_arith_encode_bit schro_arith_encode_sint schro_arith_encode_uint schro_arith_estimate_bit schro_arith_estimate_init schro_arith_estimate_sint schro_arith_estimate_uint
schrobuffer SchroBuffer schro_buffer_new schro_buffer_new_and_alloc schro_buffer_new_with_data schro_buffer_new_subbuffer schro_buffer_ref schro_buffer_unref schro_buffer_compare_data schro_buffer_dup
schrodebug SCHRO_ERROR SCHRO_WARNING SCHRO_INFO SCHRO_DEBUG SCHRO_LOG SCHRO_DEBUG_LEVEL SCHRO_MILD_ASSERT SCHRO_ASSERT schro_debug_log schro_debug_set_level schro_debug_get_level schro_dump
schroencoder SchroEncoder SchroEncoderFrame SchroEncoderFrameStateEnum SchroEncoderPerceptualEnum SchroPrefEnum SchroEncoderSettings SchroQuantiserEngineEnum SchroStateEnum SchroEncoderGOPEnum SchroEncoderRateControlEnum SchroEncoderSetting SchroEncoderSettingTypeEnum SchroEngineIterateFunc schro_encoder_new schro_encoder_free schro_encoder_get_video_format schro_encoder_set_video_format schro_encoder_end_of_stream schro_encoder_push_frame schro_encoder_copy_to_frame_buffer schro_encoder_encode_access_unit_header schro_encoder_encode_parse_info schro_encoder_pull schro_encoder_preference_get_range schro_encoder_preference_get schro_encoder_preference_set schro_encoder_analyse_picture schro_encoder_calculate_subband_weights schro_encoder_calculate_test_info schro_encoder_choose_quantisers schro_encoder_clean_up_transform schro_encoder_encode_access_unit schro_encoder_encode_auxiliary_data schro_encoder_encode_end_of_stream schro_encoder_encode_lowdelay_transform_data schro_encoder_encode_picture schro_encoder_encode_picture_all schro_encoder_encode_picture_header schro_encoder_encode_subband schro_encoder_encode_subband_noarith schro_encoder_engine_backref schro_encoder_engine_backtest schro_encoder_engine_intra_only schro_encoder_engine_lossless schro_encoder_engine_lowdelay schro_encoder_engine_test_intra schro_encoder_engine_tworef schro_encoder_estimate_entropy schro_encoder_frame_analyse schro_encoder_frame_downsample schro_encoder_frame_insert_buffer schro_encoder_frame_new schro_encoder_frame_queue_get schro_encoder_frame_queue_remove schro_encoder_frame_ref schro_encoder_frame_unref schro_encoder_init_subbands schro_encoder_insert_buffer schro_encoder_output_push schro_encoder_perceptual_weight_ccir959 schro_encoder_perceptual_weight_constant schro_encoder_perceptual_weight_moo schro_encoder_postanalyse_picture schro_encoder_predict_picture schro_encoder_push_ready schro_encoder_recalculate_allocations schro_encoder_reconstruct_picture schro_encoder_reference_add schro_encoder_reference_get schro_encoder_set_default_subband_weights schro_encoder_start schro_encoder_wait schro_encoder_get_n_settings schro_encoder_get_setting_info schro_encoder_global_estimation schro_encoder_init_error_tables schro_encoder_phasecorr_estimation schro_encoder_setting_get_double schro_encoder_setting_set_double
schro schro_init
schroparams SchroVideoFormat SchroParams SchroMotionVector SchroMotionField SchroMotionVectorDC SchroGlobalMotion SchroPictureNumber schro_params_calculate_iwt_sizes schro_params_calculate_mc_sizes schro_params_set_block_params schro_params_set_default_codeblock schro_params_get_block_params schro_params_get_frame_format schro_params_init schro_params_is_default_codeblock schro_params_is_default_quant_matrix schro_params_set_default_quant_matrix schro_params_verify_block_params
schrovideoformat schro_video_format_validate schro_video_format_set_std_video_format schro_video_format_get_std_video_format schro_video_format_set_std_frame_rate schro_video_format_get_std_frame_rate schro_video_format_set_std_aspect_ratio schro_video_format_get_std_aspect_ratio schro_video_format_set_std_signal_range schro_video_format_get_std_signal_range schro_video_format_set_std_colour_spec schro_video_format_get_std_colour_spec
schroframe SchroFrame SchroFrameData SchroFrameFreeFunc SchroFrameFormat SchroUpsampledFrame SCHRO_FRAME_FORMAT_DEPTH SCHRO_FRAME_FORMAT_DEPTH_S16 SCHRO_FRAME_FORMAT_DEPTH_S32 SCHRO_FRAME_FORMAT_DEPTH_U8 SCHRO_FRAME_FORMAT_H_SHIFT SCHRO_FRAME_FORMAT_V_SHIFT SCHRO_FRAME_IS_PACKED SCHRO_FRAME_DATA_GET_LINE SCHRO_FRAME_DATA_GET_PIXEL_S16 SCHRO_FRAME_DATA_GET_PIXEL_U8 schro_frame_new schro_frame_new_and_alloc schro_frame_new_from_data_AYUV schro_frame_new_from_data_I420 schro_frame_new_from_data_YUY2 schro_frame_dup schro_frame_ref schro_frame_unref schro_frame_set_free_callback schro_frame_clone schro_frame_data_get_codeblock schro_frame_get_metric schro_frame_get_subdata schro_frame_inverse_iwt_transform_cuda schro_frame_new_from_data_UYVY schro_frame_new_from_data_YV12 schro_frame_convert schro_frame_convert_to_444 schro_frame_add schro_frame_subtract schro_frame_shift_left schro_frame_shift_right schro_frame_edge_extend schro_frame_zero_extend schro_frame_iwt_transform schro_frame_inverse_iwt_transform schro_frame_downsample schro_frame_mark schro_frame_upsample_horiz schro_frame_upsample_vert schro_frame_ssim schro_frame_mean_squared_error schro_frame_md5 schro_frame_calculate_average_luma schro_upsampled_frame_free schro_upsampled_frame_new schro_upsampled_frame_upsample schro_upsampled_frame_get_block_fast_precN schro_upsampled_frame_get_block_precN schro_upsampled_frame_get_pixel_prec0 schro_upsampled_frame_get_pixel_prec1 schro_upsampled_frame_get_pixel_prec3 schro_upsampled_frame_get_pixel_precN
schrofft schro_fft_fwd_f32 schro_fft_generate_tables_f32 schro_fft_rev_f32
schrofilter schro_frame_filter_adaptive_lowpass schro_frame_filter_addnoise schro_frame_filter_cwm7 schro_frame_filter_cwmN schro_frame_filter_cwmN_ref schro_frame_filter_lowpass schro_frame_filter_lowpass2 schro_frame_filter_lowpass_16 schro_frame_filter_wavelet schro_filter_cwm7 schro_filter_cwmN schro_filter_cwmN_ref
schroutils schro_bool SCHRO_GET OFFSET SCHRO_INTERNAL ARRAY_SIZE MIN MAX CLAMP DIVIDE_ROUND_UP ROUND_UP_SHIFT ROUND_UP_POW2 ROUND_UP_2 ROUND_UP_4 ROUND_UP_8 ROUND_UP_64 ROUND_SHIFT NEED_CLAMP schro_divide schro_utils_entropy schro_utils_multiplier_to_quant_index schro_utils_probability_to_entropy schro_utils_reduce_fraction schro_dequantise schro_quantise schro_dequantise_s16 schro_quantise_s16 schro_malloc schro_malloc0 schro_realloc schro_free schro_utils_get_time muldiv64 SCHRO_BEGIN_DECLS SCHRO_END_DECLS SCHRO_GNUC_PREREQ
schroasync SchroAsync SchroAsyncTask SchroAsyncCompleteFunc SchroAsyncScheduleFunc SchroThread schro_async_new schro_async_free schro_async_get_num_completed schro_async_lock schro_async_unlock schro_async_pull schro_async_pull_locked schro_async_run_locked schro_async_signal_scheduler schro_async_wait_locked schro_async_wait_one schro_async_add_cuda schro_async_get_exec_domain schro_async_wait
schrometric SchroMetricScan SCHRO_METRIC_INVALID schro_metric_absdiff_u8 schro_metric_haar schro_metric_haar_const schro_metric_abssum_s16 schro_metric_sum_u8 schro_metric_get schro_metric_get_biref schro_metric_get_dc schro_metric_scan_do_scan schro_metric_scan_get_min schro_metric_scan_setup
schromotion SchroMotion SCHRO_MOTION_GET_BLOCK SCHRO_MOTION_GET_DC_BLOCK schro_motion_dc_prediction schro_motion_vector_prediction schro_motion_split_prediction schro_motion_get_mode_prediction schro_motion_block_estimate_entropy schro_motion_copy_from schro_motion_copy_to schro_motion_estimate_entropy schro_motion_field_global_estimation schro_motion_field_lshift schro_motion_free schro_motion_get_global_prediction schro_motion_new schro_motion_render schro_motion_render_cuda schro_motion_render_ref schro_motion_superblock_estimate_entropy schro_motion_superblock_try_estimate_entropy schro_motion_vector_is_equal schro_motion_field_new schro_motion_field_free schro_motion_field_scan schro_motion_field_inherit schro_motion_field_copy schro_motion_verify
schromotionest SchroMotionEst SchroMotionScan SchroBlock schro_motionest_free schro_motionest_new schro_motionest_superblock_get_metric schro_block_check schro_block_fixup
schrohistogram SchroHistogram SchroHistogramTable SCHRO_HISTOGRAM_SHIFT SCHRO_HISTOGRAM_SIZE schro_histogram_init schro_histogram_add schro_histogram_add_array_s16 schro_histogram_apply_table schro_histogram_apply_table_range schro_histogram_estimate_entropy schro_histogram_estimate_noise_level schro_histogram_estimate_slope schro_histogram_get_range schro_histogram_scale
schro_histogram_table_generate
schrounpack SchroUnpack schro_unpack_byte_sync schro_unpack_copy schro_unpack_decode_bit schro_unpack_decode_bits schro_unpack_decode_sint schro_unpack_decode_sint_s16 schro_unpack_decode_sint_slow schro_unpack_decode_uint schro_unpack_get_bits_read schro_unpack_get_bits_remaining schro_unpack_init_with_data schro_unpack_limit_bits_remaining schro_unpack_skip_bits
schroqueue SchroQueue SchroQueueElement SchroQueueFreeFunc schro_queue_add schro_queue_clear schro_queue_delete schro_queue_find schro_queue_free schro_queue_is_empty schro_queue_is_full schro_queue_new schro_queue_pop schro_queue_pull schro_queue_remove
schrosubband SCHRO_SUBBAND_IS_HORIZONTALLY_ORIENTED SCHRO_SUBBAND_IS_VERTICALLY_ORIENTED SCHRO_SUBBAND_SHIFT schro_subband_get schro_subband_get_frame_data schro_subband_get_position
schrooil oil_lift_haar_split oil_lift_haar_synth oil_mas10_across_u8 oil_multsumshift8_str_s16 oil_splat_s16_ns oil_split_haar oil_sum_s32_s16 oil_sum_s32_u8 oil_sum_square_diff_u8 oil_synth_haar oil_addc_rshift_clipconv_u8_s16 oil_convert_f64_s16 oil_convert_f64_u8 oil_iir3_across_s16_f64 oil_iir3_across_u8_f64 oil_iir3_rev_s16_f64 oil_iir3_rev_u8_f64 oil_iir3_s16_f64 oil_iir3_u8_f64 oil_mas10_s16 oil_mas12across_addc_rshift_u8 oil_mas4_s16 oil_mas4_u8 oil_mas8_across_u8 oil_mas8_s16 schro_cog_mas10_u8_edgeextend schro_cog_mas8_u8_edgeextend
schrolist SchroList SchroListFreeFunc schro_list_append schro_list_delete schro_list_free schro_list_get schro_list_get_size schro_list_insert schro_list_new schro_list_new_full schro_list_prepend schro_list_remove schro_list_replace
schroedinger-1.0.11/doc/schroedinger.types0000644000175000017500000000000011707140273015466 00000000000000schroedinger-1.0.11/doc/schroedinger-overrides.txt0000644000175000017500000000000010763346510017144 00000000000000schroedinger-1.0.11/doc/Makefile.am0000644000175000017500000000571511344322440013775 00000000000000## 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=schroedinger # The top-level SGML file. You can change this if you want to. DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml # 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=../schroedinger # Extra options to pass to gtkdoc-scangobj. Not normally needed. SCANGOBJ_OPTIONS= # Extra options to supply to gtkdoc-scan. # e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" SCAN_OPTIONS= # Extra options to supply to gtkdoc-mkdb. # e.g. MKDB_OPTIONS=--sgml-mode --output-format=xml MKDB_OPTIONS=--sgml-mode --output-format=xml # 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= # 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)/schroedinger/*.h CFILE_GLOB=$(top_srcdir)/schroedinger/*.c # Header files to ignore when scanning. # e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h IGNORE_HFILES=schro-stdint.h \ arith.h \ arith_coalesce.h \ common.h \ convert_base.h \ convert_base_coalesce.h \ convert_packed.h \ cudaframe.h \ cudainit.h \ cudamotion.h \ cudaupsample.h \ cudawavelet.h \ motion_kernel_divb.h \ motion_kernel_shared.h \ motion_kernel_tex.h \ upsample_kernel.h \ wavelet.h \ wavelet_common.h \ wavelets.h # Images to copy into HTML directory. # e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png HTML_IMAGES= # 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= # 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= # 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= GTKDOC_LIBS= # 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 += schroedinger-1.0.11/doc/Makefile.in0000664000175000017500000004617311707140261014015 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/gtk-doc.make subdir = doc ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-auto-alt.m4 \ $(top_srcdir)/m4/as-compiler-flag.m4 \ $(top_srcdir)/m4/as-host-defines.m4 \ $(top_srcdir)/m4/as-version.m4 $(top_srcdir)/m4/gst-args.m4 \ $(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)/m4/pkg.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUDA_CFLAGS = @CUDA_CFLAGS@ CUDA_LIBS = @CUDA_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ GCOV = @GCOV@ GCOV_CFLAGS = @GCOV_CFLAGS@ GCOV_LIBS = @GCOV_LIBS@ GREP = @GREP@ GTHREAD_CFLAGS = @GTHREAD_CFLAGS@ GTHREAD_LIBS = @GTHREAD_LIBS@ GTKDOC_CHECK = @GTKDOC_CHECK@ 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@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ NVCC = @NVCC@ NVCCFLAGS = @NVCCFLAGS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENGL_CFLAGS = @OPENGL_CFLAGS@ OPENGL_LIBS = @OPENGL_LIBS@ ORCC = @ORCC@ ORC_CFLAGS = @ORC_CFLAGS@ ORC_LIBS = @ORC_LIBS@ 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@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SCHRO_CFLAGS = @SCHRO_CFLAGS@ SCHRO_LIBS = @SCHRO_LIBS@ SCHRO_LIBVERSION = @SCHRO_LIBVERSION@ SCHRO_MAJORMINOR = @SCHRO_MAJORMINOR@ SCHRO_PKG_DEPS = @SCHRO_PKG_DEPS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ THREAD_IMPL = @THREAD_IMPL@ VERSION = @VERSION@ 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_CXX = @ac_ct_CXX@ 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@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ 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 = schroedinger # The top-level SGML file. You can change this if you want to. DOC_MAIN_SGML_FILE = $(DOC_MODULE)-docs.sgml # 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 = ../schroedinger # Extra options to pass to gtkdoc-scangobj. Not normally needed. SCANGOBJ_OPTIONS = # Extra options to supply to gtkdoc-scan. # e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" SCAN_OPTIONS = # Extra options to supply to gtkdoc-mkdb. # e.g. MKDB_OPTIONS=--sgml-mode --output-format=xml MKDB_OPTIONS = --sgml-mode --output-format=xml # 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 = # 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)/schroedinger/*.h CFILE_GLOB = $(top_srcdir)/schroedinger/*.c # Header files to ignore when scanning. # e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h IGNORE_HFILES = schro-stdint.h \ arith.h \ arith_coalesce.h \ common.h \ convert_base.h \ convert_base_coalesce.h \ convert_packed.h \ cudaframe.h \ cudainit.h \ cudamotion.h \ cudaupsample.h \ cudawavelet.h \ motion_kernel_divb.h \ motion_kernel_shared.h \ motion_kernel_tex.h \ upsample_kernel.h \ wavelet.h \ wavelet_common.h \ wavelets.h # Images to copy into HTML directory. # e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png HTML_IMAGES = # 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 = # 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 = # 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 = GTKDOC_LIBS = @GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_CC = $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_CC = $(LIBTOOL) --mode=compile $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_LD = $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) @GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_LD = $(LIBTOOL) --mode=link $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) # 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) # This includes the standard gtk-doc make rules, copied by gtkdocize. # Other files to distribute # e.g. EXTRA_DIST += version.xml.in EXTRA_DIST = $(content_files) $(HTML_IMAGES) $(DOC_MAIN_SGML_FILE) \ $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt DOC_STAMPS = scan-build.stamp tmpl-build.stamp sgml-build.stamp html-build.stamp \ $(srcdir)/tmpl.stamp $(srcdir)/sgml.stamp $(srcdir)/html.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) 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) --foreign doc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign doc/Makefile .PRECIOUS: 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 tags: TAGS TAGS: ctags: CTAGS CTAGS: 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 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 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 uninstall uninstall-am \ uninstall-local @ENABLE_GTK_DOC_TRUE@all-local: html-build.stamp @ENABLE_GTK_DOC_FALSE@all-local: docs: html-build.stamp #### scan #### scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB) @echo 'gtk-doc: Scanning header files' @-chmod -R u+w $(srcdir) cd $(srcdir) && \ gtkdoc-scan --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="$(IGNORE_HFILES)" $(SCAN_OPTIONS) $(EXTRA_HFILES) if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null 2>&1 ; then \ CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" CFLAGS="$(GTKDOC_CFLAGS)" LDFLAGS="$(GTKDOC_LIBS)" gtkdoc-scangobj $(SCANGOBJ_OPTIONS) --module=$(DOC_MODULE) --output-dir=$(srcdir) ; \ else \ cd $(srcdir) ; \ for i in $(SCANOBJ_FILES) ; do \ 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 #### templates #### tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt @echo 'gtk-doc: Rebuilding template files' @-chmod -R u+w $(srcdir) cd $(srcdir) && gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS) touch tmpl-build.stamp tmpl.stamp: tmpl-build.stamp @true tmpl/*.sgml: @true #### xml #### sgml-build.stamp: tmpl.stamp $(HFILE_GLOB) $(CFILE_GLOB) $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files) @echo 'gtk-doc: Building XML' @-chmod -R u+w $(srcdir) cd $(srcdir) && \ gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $(MKDB_OPTIONS) touch sgml-build.stamp sgml.stamp: sgml-build.stamp @true #### html #### html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) @echo 'gtk-doc: Building HTML' @-chmod -R u+w $(srcdir) rm -rf $(srcdir)/html mkdir $(srcdir)/html cd $(srcdir)/html && gtkdoc-mkhtml $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) html ) @echo 'gtk-doc: Fixing cross-references' cd $(srcdir) && gtkdoc-fixxref --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) touch html-build.stamp ############## clean-local: rm -f *~ *.bak rm -rf .libs distclean-local: cd $(srcdir) && \ rm -rf xml $(REPORT_FILES) \ $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt maintainer-clean-local: clean cd $(srcdir) && rm -rf xml html install-data-local: -installfiles=`echo $(srcdir)/html/*`; \ if test "$$installfiles" = '$(srcdir)/html/*'; \ 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 $(srcdir)/html/index.sgml' ; \ $(INSTALL_DATA) $(srcdir)/html/index.sgml $(DESTDIR)$(TARGET_DIR) || :; \ which gtkdoc-rebase >/dev/null && \ gtkdoc-rebase --relative --dest-dir=$(DESTDIR) --html-dir=$(DESTDIR)$(TARGET_DIR) ; \ fi uninstall-local: rm -f $(DESTDIR)$(TARGET_DIR)/* # # 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 dist-hook: dist-check-gtkdoc dist-hook-local mkdir $(distdir)/tmpl mkdir $(distdir)/xml mkdir $(distdir)/html -cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl -cp $(srcdir)/xml/*.xml $(distdir)/xml cp $(srcdir)/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 # 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: schroedinger-1.0.11/doc/html/0000775000175000017500000000000011707140273012764 500000000000000schroedinger-1.0.11/doc/html/schroedinger-schroarith.html0000664000175000017500000005410111707140273020413 00000000000000 schroarith

schroarith

schroarith

Synopsis

struct              SchroArith;
struct              SchroArithContext;
SchroArith *        schro_arith_new                     (void);
void                schro_arith_free                    (SchroArith *arith);
void                schro_arith_decode_init             (SchroArith *arith,
                                                         SchroBuffer *buffer);
void                schro_arith_encode_init             (SchroArith *arith,
                                                         SchroBuffer *buffer);
void                schro_arith_flush                   (SchroArith *arith);
int                 schro_arith_decode_bit              (SchroArith *arith,
                                                         unsigned int context);
void                schro_arith_decode_flush            (SchroArith *arith);
int                 schro_arith_decode_sint             (SchroArith *arith,
                                                         unsigned int cont_context,
                                                         unsigned int value_context,
                                                         unsigned int sign_context);
int                 schro_arith_decode_uint             (SchroArith *arith,
                                                         unsigned int cont_context,
                                                         unsigned int value_context);
void                schro_arith_encode_bit              (SchroArith *arith,
                                                         int context,
                                                         int value);
void                schro_arith_encode_sint             (SchroArith *arith,
                                                         int cont_context,
                                                         int value_context,
                                                         int sign_context,
                                                         int value);
void                schro_arith_encode_uint             (SchroArith *arith,
                                                         int cont_context,
                                                         int value_context,
                                                         int value);
void                schro_arith_estimate_init           (SchroArith *arith);
void                schro_arith_estimate_sint           (SchroArith *arith,
                                                         int cont_context,
                                                         int value_context,
                                                         int sign_context,
                                                         int value);
void                schro_arith_estimate_uint           (SchroArith *arith,
                                                         int cont_context,
                                                         int value_context,
                                                         int value);

Description

Details

struct SchroArith

struct SchroArith {
  SchroBuffer *buffer;
  uint8_t *dataptr;
  uintptr_t offset;

  uint32_t range[2];
  uint32_t code;
  uint32_t range_size;
  int cntr;
  int carry;

  uint16_t probabilities[SCHRO_CTX_LAST];
  uint16_t lut[512];
  SchroArithContext contexts[SCHRO_CTX_LAST];
};


struct SchroArithContext

struct SchroArithContext {
  unsigned int next;
#ifdef unused
  int stat_range;
  int n_bits;
  int n_symbols;
  int ones;
#endif
};


schro_arith_new ()

SchroArith *        schro_arith_new                     (void);


schro_arith_free ()

void                schro_arith_free                    (SchroArith *arith);


schro_arith_decode_init ()

void                schro_arith_decode_init             (SchroArith *arith,
                                                         SchroBuffer *buffer);


schro_arith_encode_init ()

void                schro_arith_encode_init             (SchroArith *arith,
                                                         SchroBuffer *buffer);


schro_arith_flush ()

void                schro_arith_flush                   (SchroArith *arith);


schro_arith_decode_bit ()

int                 schro_arith_decode_bit              (SchroArith *arith,
                                                         unsigned int context);


schro_arith_decode_flush ()

void                schro_arith_decode_flush            (SchroArith *arith);


schro_arith_decode_sint ()

int                 schro_arith_decode_sint             (SchroArith *arith,
                                                         unsigned int cont_context,
                                                         unsigned int value_context,
                                                         unsigned int sign_context);


schro_arith_decode_uint ()

int                 schro_arith_decode_uint             (SchroArith *arith,
                                                         unsigned int cont_context,
                                                         unsigned int value_context);


schro_arith_encode_bit ()

void                schro_arith_encode_bit              (SchroArith *arith,
                                                         int context,
                                                         int value);


schro_arith_encode_sint ()

void                schro_arith_encode_sint             (SchroArith *arith,
                                                         int cont_context,
                                                         int value_context,
                                                         int sign_context,
                                                         int value);


schro_arith_encode_uint ()

void                schro_arith_encode_uint             (SchroArith *arith,
                                                         int cont_context,
                                                         int value_context,
                                                         int value);


schro_arith_estimate_init ()

void                schro_arith_estimate_init           (SchroArith *arith);


schro_arith_estimate_sint ()

void                schro_arith_estimate_sint           (SchroArith *arith,
                                                         int cont_context,
                                                         int value_context,
                                                         int sign_context,
                                                         int value);


schro_arith_estimate_uint ()

void                schro_arith_estimate_uint           (SchroArith *arith,
                                                         int cont_context,
                                                         int value_context,
                                                         int value);

schroedinger-1.0.11/doc/html/schroedinger-schroutils.html0000664000175000017500000005347211707140273020456 00000000000000 schroutils

schroutils

schroutils

Synopsis

typedef             schro_bool;
#define             SCHRO_GET                           (ptr,
                                                         offset,
                                                         type)
#define             OFFSET                              (ptr,
                                                         offset)
#define             SCHRO_INTERNAL
#define             ARRAY_SIZE                          (x)
#define             MIN                                 (a,
                                                         b)
#define             MAX                                 (a,
                                                         b)
#define             CLAMP                               (x,
                                                         a,
                                                         b)
#define             DIVIDE_ROUND_UP                     (a,
                                                         b)
#define             ROUND_UP_SHIFT                      (x,
                                                         y)
#define             ROUND_UP_POW2                       (x,
                                                         y)
#define             ROUND_UP_2                          (x)
#define             ROUND_UP_4                          (x)
#define             ROUND_UP_8                          (x)
#define             ROUND_UP_64                         (x)
#define             ROUND_SHIFT                         (x,
                                                         y)
#define             NEED_CLAMP                          (x,
                                                         y,
                                                         a,
                                                         b)
#define             schro_divide                        (a,
                                                         b)
double              schro_utils_entropy                 (double a,
                                                         double total);
int                 schro_utils_multiplier_to_quant_index
                                                        (double x);
double              schro_utils_probability_to_entropy  (double x);
void                schro_utils_reduce_fraction         (int *n,
                                                         int *d);
int                 schro_dequantise                    (int q,
                                                         int quant_factor,
                                                         int quant_offset);
int                 schro_quantise                      (int value,
                                                         int quant_factor,
                                                         int quant_offset);
void                schro_dequantise_s16                (int16_t *dest,
                                                         int16_t *src,
                                                         int quant_factor,
                                                         int quant_offset,
                                                         int n);
void                schro_quantise_s16                  (int16_t *dest,
                                                         int16_t *src,
                                                         int quant_factor,
                                                         int quant_offset,
                                                         int n);
void *              schro_malloc                        (int size);
void *              schro_malloc0                       (int size);
void *              schro_realloc                       (void *ptr,
                                                         int size);
void                schro_free                          (void *ptr);
double              schro_utils_get_time                (void);
int                 muldiv64                            (int a,
                                                         int b,
                                                         int c);

Description

Details

schro_bool

typedef unsigned int schro_bool;


SCHRO_GET()

#define SCHRO_GET(ptr, offset, type) (*(type *)((uint8_t *)(ptr) + (offset)) )


OFFSET()

#define OFFSET(ptr,offset) ((void *)(((uint8_t *)(ptr)) + (offset)))


SCHRO_INTERNAL

#define SCHRO_INTERNAL __attribute__ ((visibility ("internal")))


ARRAY_SIZE()

#define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))


MIN()

#define MIN(a,b) ((a)<(b) ? (a) : (b))


MAX()

#define MAX(a,b) ((a)>(b) ? (a) : (b))


CLAMP()

#define CLAMP(x,a,b) ((x)<(a) ? (a) : ((x)>(b) ? (b) : (x)))


DIVIDE_ROUND_UP()

#define DIVIDE_ROUND_UP(a,b) (((a) + (b) - 1)/(b))


ROUND_UP_SHIFT()

#define ROUND_UP_SHIFT(x,y) (((x) + (1<<(y)) - 1)>>(y))


ROUND_UP_POW2()

#define ROUND_UP_POW2(x,y) (((x) + (1<<(y)) - 1)&((~0)<<(y)))


ROUND_UP_2()

#define ROUND_UP_2(x) ROUND_UP_POW2(x,1)


ROUND_UP_4()

#define ROUND_UP_4(x) ROUND_UP_POW2(x,2)


ROUND_UP_8()

#define ROUND_UP_8(x) ROUND_UP_POW2(x,3)


ROUND_UP_64()

#define ROUND_UP_64(x) ROUND_UP_POW2(x,6)


ROUND_SHIFT()

#define ROUND_SHIFT(x,y) (((x) + (1<<((y)-1)))>>(y))


NEED_CLAMP()

#define NEED_CLAMP(x,y,a,b) ((x) < (a) || (y) > (b))


schro_divide()

#define schro_divide(a,b) (((a)<0)?(((a) - (b) + 1)/(b)):((a)/(b)))


schro_utils_entropy ()

double              schro_utils_entropy                 (double a,
                                                         double total);


schro_utils_multiplier_to_quant_index ()

int                 schro_utils_multiplier_to_quant_index
                                                        (double x);


schro_utils_probability_to_entropy ()

double              schro_utils_probability_to_entropy  (double x);


schro_utils_reduce_fraction ()

void                schro_utils_reduce_fraction         (int *n,
                                                         int *d);


schro_dequantise ()

int                 schro_dequantise                    (int q,
                                                         int quant_factor,
                                                         int quant_offset);


schro_quantise ()

int                 schro_quantise                      (int value,
                                                         int quant_factor,
                                                         int quant_offset);


schro_dequantise_s16 ()

void                schro_dequantise_s16                (int16_t *dest,
                                                         int16_t *src,
                                                         int quant_factor,
                                                         int quant_offset,
                                                         int n);


schro_quantise_s16 ()

void                schro_quantise_s16                  (int16_t *dest,
                                                         int16_t *src,
                                                         int quant_factor,
                                                         int quant_offset,
                                                         int n);


schro_malloc ()

void *              schro_malloc                        (int size);


schro_malloc0 ()

void *              schro_malloc0                       (int size);


schro_realloc ()

void *              schro_realloc                       (void *ptr,
                                                         int size);


schro_free ()

void                schro_free                          (void *ptr);


schro_utils_get_time ()

double              schro_utils_get_time                (void);


muldiv64 ()

int                 muldiv64                            (int a,
                                                         int b,
                                                         int c);

schroedinger-1.0.11/doc/html/schroedinger-schrolist.html0000664000175000017500000003520711707140273020265 00000000000000 schrolist

schrolist

schrolist

Synopsis

struct              SchroList;
void                (*SchroListFreeFunc)                (void *member,
                                                         void *priv);
void                schro_list_append                   (SchroList *list,
                                                         void *value);
void                schro_list_delete                   (SchroList *list,
                                                         int i);
void                schro_list_free                     (SchroList *list);
void *              schro_list_get                      (SchroList *list,
                                                         int i);
int                 schro_list_get_size                 (SchroList *list);
void                schro_list_insert                   (SchroList *list,
                                                         int i,
                                                         void *value);
SchroList *         schro_list_new                      (void);
SchroList *         schro_list_new_full                 (SchroListFreeFunc freefunc,
                                                         void *priv);
void                schro_list_prepend                  (SchroList *list,
                                                         void *value);
void *              schro_list_remove                   (SchroList *list,
                                                         int i);
void *              schro_list_replace                  (SchroList *list,
                                                         int i,
                                                         void *value);

Description

Details

struct SchroList

struct SchroList {
  void **members;
  int n;
  int n_alloc;

  SchroListFreeFunc free;
  void *priv;
};


SchroListFreeFunc ()

void                (*SchroListFreeFunc)                (void *member,
                                                         void *priv);


schro_list_append ()

void                schro_list_append                   (SchroList *list,
                                                         void *value);


schro_list_delete ()

void                schro_list_delete                   (SchroList *list,
                                                         int i);


schro_list_free ()

void                schro_list_free                     (SchroList *list);


schro_list_get ()

void *              schro_list_get                      (SchroList *list,
                                                         int i);


schro_list_get_size ()

int                 schro_list_get_size                 (SchroList *list);


schro_list_insert ()

void                schro_list_insert                   (SchroList *list,
                                                         int i,
                                                         void *value);


schro_list_new ()

SchroList *         schro_list_new                      (void);


schro_list_new_full ()

SchroList *         schro_list_new_full                 (SchroListFreeFunc freefunc,
                                                         void *priv);


schro_list_prepend ()

void                schro_list_prepend                  (SchroList *list,
                                                         void *value);


schro_list_remove ()

void *              schro_list_remove                   (SchroList *list,
                                                         int i);


schro_list_replace ()

void *              schro_list_replace                  (SchroList *list,
                                                         int i,
                                                         void *value);

schroedinger-1.0.11/doc/html/left.png0000644000175000017500000000056511707140273014350 00000000000000‰PNG  IHDRשÍÊ~PLTEÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ(((;;;@@@€€€ƒƒƒ§§§×××ßßßãããçççëëëóóóûûûÿÿÿv:òütRNS $04 schrowavelet

schrowavelet

schrowavelet

Synopsis

#define             SCHRO_N_WAVELETS
void                schro_wavelet_transform_2d          (SchroFrameData *fd,
                                                         int type,
                                                         int16_t *tmp);
void                schro_wavelet_inverse_transform_2d  (SchroFrameData *fd_dest,
                                                         SchroFrameData *fd_src,
                                                         int type,
                                                         int16_t *tmp);

Description

Details

SCHRO_N_WAVELETS

#define SCHRO_N_WAVELETS 7


schro_wavelet_transform_2d ()

void                schro_wavelet_transform_2d          (SchroFrameData *fd,
                                                         int type,
                                                         int16_t *tmp);


schro_wavelet_inverse_transform_2d ()

void                schro_wavelet_inverse_transform_2d  (SchroFrameData *fd_dest,
                                                         SchroFrameData *fd_src,
                                                         int type,
                                                         int16_t *tmp);

schroedinger-1.0.11/doc/html/schroedinger-schrodomain.html0000664000175000017500000003324311707140273020557 00000000000000 schrodomain

schrodomain

schrodomain

Description

Details

SchroExecDomain

typedef int SchroExecDomain;


struct SchroMemoryDomain

struct SchroMemoryDomain {
  SchroMutex * mutex;

  unsigned int flags;

  void *(*alloc) (int size);
  void *(*alloc_2d) (int depth, int width, int height);
  void (*free) (void *ptr, int size);

  struct {
    unsigned int flags;
    void *ptr;
    int size;
    void *priv;
  } slots[SCHRO_MEMORY_DOMAIN_SLOTS];
};


SCHRO_EXEC_DOMAIN_CPU

#define SCHRO_EXEC_DOMAIN_CPU 0x0001


SCHRO_EXEC_DOMAIN_CUDA

#define SCHRO_EXEC_DOMAIN_CUDA 0x0002


SCHRO_EXEC_DOMAIN_OPENGL

#define SCHRO_EXEC_DOMAIN_OPENGL 0x0003


SCHRO_MEMORY_DOMAIN_CPU

#define SCHRO_MEMORY_DOMAIN_CPU 0x0001


SCHRO_MEMORY_DOMAIN_CUDA

#define SCHRO_MEMORY_DOMAIN_CUDA 0x0002


SCHRO_MEMORY_DOMAIN_OPENGL

#define SCHRO_MEMORY_DOMAIN_OPENGL 0x0004


SCHRO_MEMORY_DOMAIN_SLOTS

#define SCHRO_MEMORY_DOMAIN_SLOTS 1000


SCHRO_MEMORY_DOMAIN_SLOT_ALLOCATED

#define SCHRO_MEMORY_DOMAIN_SLOT_ALLOCATED 0x0001


SCHRO_MEMORY_DOMAIN_SLOT_IN_USE

#define SCHRO_MEMORY_DOMAIN_SLOT_IN_USE 0x0002


schro_memory_domain_alloc ()

void *              schro_memory_domain_alloc           (SchroMemoryDomain *domain,
                                                         int size);


schro_memory_domain_alloc_2d ()

void *              schro_memory_domain_alloc_2d        (SchroMemoryDomain *domain,
                                                         int depth,
                                                         int width,
                                                         int height);


schro_memory_domain_free ()

void                schro_memory_domain_free            (SchroMemoryDomain *domain);


schro_memory_domain_memfree ()

void                schro_memory_domain_memfree         (SchroMemoryDomain *domain,
                                                         void *ptr);


schro_memory_domain_new ()

SchroMemoryDomain * schro_memory_domain_new             (void);


schro_memory_domain_new_cuda ()

SchroMemoryDomain * schro_memory_domain_new_cuda        (void);


schro_memory_domain_new_local ()

SchroMemoryDomain * schro_memory_domain_new_local       (void);

schroedinger-1.0.11/doc/html/right.png0000644000175000017500000000057411707140273014533 00000000000000‰PNG  IHDRשÍÊ{PLTEÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ###+++@@@«««¿¿¿ÃÃÃÇÇÇÏÏÏïïïÿÿÿçWôtRNS (48@GX[«·¿ÃÏÓ×ßãçï÷yþ±t–IDATxÚ…ÐÉÂ0 PS–@XZ -%”­eþÿ Iä‰ÁÜ<ï`ÙeAÙ¬Zìç9(ñÆ1'n/îÊ"Á¤²ÜU!‡DЉhŒwÎÅ$¢ñ4QX$°Ô AlþXRü^>8ŽMzšãmtúºü¾Ä>äk¸Ð7â½ œïOŠ$ôÙž³=mVQ.JO£é9 »ñ• IEND®B`‚schroedinger-1.0.11/doc/html/schropublic.html0000664000175000017500000000515511707140273016115 00000000000000 Schroedinger Public API schroedinger-1.0.11/doc/html/up.png0000644000175000017500000000044311707140273014035 00000000000000‰PNG  IHDRàw=øêIDATxÚí•!ƒ0†ÈЉ $11Dp°·p€Ê‰É‰É‰‰ D%²˜@ o%/!ò¶–eˆýÉg*¾/išÔYÔ`ƒ„߻ȡ]1§ü„@Y– µ¦È ³Êƒ Ïó ( &b(Çã&b'ç"ör>b/ç#ör>b/ç#«~@šÉ‡‘<Ï)¢·“¯¨ëšäV!@)E‘ˆ®ç‹ãxRæû>ô§µ~Ñ4 …tE R†k‘÷d¯ô˜ãX~àŒ€”Ò4%Ë2 ÜM ÒÂ{Û™~:[dÏ9¿Üt¾) À ¿IEND®B`‚schroedinger-1.0.11/doc/html/schroedinger-schrodebug.html0000664000175000017500000002214211707140273020372 00000000000000 schrodebug

schrodebug

schrodebug

Synopsis

#define             SCHRO_ERROR                         (...)
#define             SCHRO_WARNING                       (...)
#define             SCHRO_INFO                          (...)
#define             SCHRO_DEBUG                         (...)
#define             SCHRO_LOG                           (...)
#define             SCHRO_DEBUG_LEVEL                   (level,
                                                         ...)
#define             SCHRO_MILD_ASSERT                   (test)
#define             SCHRO_ASSERT                        (test)
void                schro_debug_log                     (int level,
                                                         const char *file,
                                                         const char *function,
                                                         int line,
                                                         const char *format,
                                                         ...);
void                schro_debug_set_level               (int level);
int                 schro_debug_get_level               (void);
void                schro_dump                          (int type,
                                                         const char *format,
                                                         ...);

Description

Details

SCHRO_ERROR()

#define             SCHRO_ERROR(...)


SCHRO_WARNING()

#define             SCHRO_WARNING(...)


SCHRO_INFO()

#define             SCHRO_INFO(...)


SCHRO_DEBUG()

#define             SCHRO_DEBUG(...)


SCHRO_LOG()

#define             SCHRO_LOG(...)


SCHRO_DEBUG_LEVEL()

#define             SCHRO_DEBUG_LEVEL(level,...)


SCHRO_MILD_ASSERT()

#define             SCHRO_MILD_ASSERT(test)


SCHRO_ASSERT()

#define             SCHRO_ASSERT(test)


schro_debug_log ()

void                schro_debug_log                     (int level,
                                                         const char *file,
                                                         const char *function,
                                                         int line,
                                                         const char *format,
                                                         ...);


schro_debug_set_level ()

void                schro_debug_set_level               (int level);


schro_debug_get_level ()

int                 schro_debug_get_level               (void);


schro_dump ()

void                schro_dump                          (int type,
                                                         const char *format,
                                                         ...);

schroedinger-1.0.11/doc/html/schroedinger-schrobitstream.html0000664000175000017500000003544611707140273021311 00000000000000 schrobitstream

schrobitstream

schrobitstream

Description

Details

enum SchroAuxiliaryDataID

typedef enum {
  SCHRO_AUX_DATA_INVALID,
  SCHRO_AUX_DATA_ENCODER_STRING,
  SCHRO_AUX_DATA_SMPTE_12M_TIMECODE,
  SCHRO_AUX_DATA_MD5_CHECKSUM,
  SCHRO_AUX_DATA_BITRATE,
  SCHRO_AUX_DATA_USER = 0x80
} SchroAuxiliaryDataID;


enum SchroParseCode

typedef enum {
  SCHRO_PARSE_CODE_SEQUENCE_HEADER = 0x00,
  SCHRO_PARSE_CODE_END_OF_SEQUENCE = 0x10,
  SCHRO_PARSE_CODE_AUXILIARY_DATA = 0x20,
  SCHRO_PARSE_CODE_PADDING = 0x30,

  SCHRO_PARSE_CODE_INTRA_REF = 0x0c,
  SCHRO_PARSE_CODE_INTRA_NON_REF = 0x08,
  SCHRO_PARSE_CODE_INTRA_REF_NOARITH = 0x4c,
  SCHRO_PARSE_CODE_INTRA_NON_REF_NOARITH = 0x48,

  SCHRO_PARSE_CODE_INTER_REF_1 = 0x0d,
  SCHRO_PARSE_CODE_INTER_REF_1_NOARITH = 0x4d,
  SCHRO_PARSE_CODE_INTER_REF_2 = 0x0e,
  SCHRO_PARSE_CODE_INTER_REF_2_NOARITH = 0x4e,

  SCHRO_PARSE_CODE_INTER_NON_REF_1 = 0x09,
  SCHRO_PARSE_CODE_INTER_NON_REF_1_NOARITH = 0x49,
  SCHRO_PARSE_CODE_INTER_NON_REF_2 = 0x0a,
  SCHRO_PARSE_CODE_INTER_NON_REF_2_NOARITH = 0x4a,

  SCHRO_PARSE_CODE_LD_INTRA_REF = 0xcc,
  SCHRO_PARSE_CODE_LD_INTRA_NON_REF = 0xc8
} SchroParseCode;


enum SchroVideoFormatEnum

typedef enum {
  SCHRO_VIDEO_FORMAT_CUSTOM = 0,
  SCHRO_VIDEO_FORMAT_QSIF,
  SCHRO_VIDEO_FORMAT_QCIF,
  SCHRO_VIDEO_FORMAT_SIF,
  SCHRO_VIDEO_FORMAT_CIF,
  SCHRO_VIDEO_FORMAT_4SIF,
  SCHRO_VIDEO_FORMAT_4CIF,
  SCHRO_VIDEO_FORMAT_SD480I_60,
  SCHRO_VIDEO_FORMAT_SD576I_50,
  SCHRO_VIDEO_FORMAT_HD720P_60,
  SCHRO_VIDEO_FORMAT_HD720P_50,
  SCHRO_VIDEO_FORMAT_HD1080I_60,
  SCHRO_VIDEO_FORMAT_HD1080I_50,
  SCHRO_VIDEO_FORMAT_HD1080P_60,
  SCHRO_VIDEO_FORMAT_HD1080P_50,
  SCHRO_VIDEO_FORMAT_DC2K_24,
  SCHRO_VIDEO_FORMAT_DC4K_24,
  SCHRO_VIDEO_FORMAT_UHDTV_4K_60,
  SCHRO_VIDEO_FORMAT_UHDTV_4K_50,
  SCHRO_VIDEO_FORMAT_UHDTV_8K_60,
  SCHRO_VIDEO_FORMAT_UHDTV_8K_50
} SchroVideoFormatEnum;


enum SchroChromaFormat

typedef enum {
  SCHRO_CHROMA_444 = 0,
  SCHRO_CHROMA_422,
  SCHRO_CHROMA_420
} SchroChromaFormat;


enum SchroColourMatrix

typedef enum {
  SCHRO_COLOUR_MATRIX_HDTV = 0,
  SCHRO_COLOUR_MATRIX_SDTV = 1,
  SCHRO_COLOUR_MATRIX_REVERSIBLE = 2
} SchroColourMatrix;


enum SchroColourSpec

typedef enum {
  SCHRO_COLOUR_SPEC_CUSTOM = 0,
  SCHRO_COLOUR_SPEC_SDTV_525 = 1,
  SCHRO_COLOUR_SPEC_SDTV_625 = 2,
  SCHRO_COLOUR_SPEC_HDTV = 3,
  SCHRO_COLOUR_SPEC_CINEMA = 4
} SchroColourSpec;


enum SchroColourPrimaries

typedef enum {
  SCHRO_COLOUR_PRIMARY_HDTV = 0,
  SCHRO_COLOUR_PRIMARY_SDTV_525 = 1,
  SCHRO_COLOUR_PRIMARY_SDTV_625 = 2,
  SCHRO_COLOUR_PRIMARY_CINEMA = 3
} SchroColourPrimaries;


enum SchroWaveletIndex

typedef enum {
  SCHRO_WAVELET_DESLAURIERS_DUBUC_9_7,
  SCHRO_WAVELET_LE_GALL_5_3,
  SCHRO_WAVELET_DESLAURIERS_DUBUC_13_7,
  SCHRO_WAVELET_HAAR_0,
  SCHRO_WAVELET_HAAR_1,
  SCHRO_WAVELET_FIDELITY,
  SCHRO_WAVELET_DAUBECHIES_9_7
} SchroWaveletIndex;


enum SchroSignalRange

typedef enum {
  SCHRO_SIGNAL_RANGE_CUSTOM = 0,
  SCHRO_SIGNAL_RANGE_8BIT_FULL = 1,
  SCHRO_SIGNAL_RANGE_8BIT_VIDEO = 2,
  SCHRO_SIGNAL_RANGE_10BIT_VIDEO = 3,
  SCHRO_SIGNAL_RANGE_12BIT_VIDEO = 4
} SchroSignalRange;


enum SchroTransferFunction

typedef enum {
  SCHRO_TRANSFER_CHAR_TV_GAMMA = 0,
  SCHRO_TRANSFER_CHAR_EXTENDED_GAMUT = 1,
  SCHRO_TRANSFER_CHAR_LINEAR = 2,
  SCHRO_TRANSFER_CHAR_DCI_GAMMA = 3
} SchroTransferFunction;


SCHRO_PARSE_HEADER_SIZE

#define SCHRO_PARSE_HEADER_SIZE (4+1+4+4)


SCHRO_PARSE_CODE_PICTURE()

#define             SCHRO_PARSE_CODE_PICTURE(is_ref,n_refs,is_lowdelay,is_noarith)


SCHRO_PARSE_CODE_IS_INTER()

#define SCHRO_PARSE_CODE_IS_INTER(x) (SCHRO_PARSE_CODE_IS_PICTURE(x) && SCHRO_PARSE_CODE_NUM_REFS(x) > 0)


SCHRO_PARSE_CODE_IS_INTRA()

#define SCHRO_PARSE_CODE_IS_INTRA(x) (SCHRO_PARSE_CODE_IS_PICTURE(x) && SCHRO_PARSE_CODE_NUM_REFS(x) == 0)


SCHRO_PARSE_CODE_IS_NON_REFERENCE()

#define SCHRO_PARSE_CODE_IS_NON_REFERENCE(x) (((x) & 0xc) == 0x08)


SCHRO_PARSE_CODE_IS_REFERENCE()

#define SCHRO_PARSE_CODE_IS_REFERENCE(x) (((x) & 0xc) == 0x0c)


SCHRO_PARSE_CODE_IS_LOW_DELAY()

#define SCHRO_PARSE_CODE_IS_LOW_DELAY(x) (((x) & 0x88) == 0x88)


SCHRO_PARSE_CODE_IS_PICTURE()

#define SCHRO_PARSE_CODE_IS_PICTURE(x) ((x) & 0x8)


SCHRO_PARSE_CODE_NUM_REFS()

#define SCHRO_PARSE_CODE_NUM_REFS(x) ((x) & 0x3)


SCHRO_PARSE_CODE_IS_AUXILIARY_DATA()

#define SCHRO_PARSE_CODE_IS_AUXILIARY_DATA(x) ((x) == SCHRO_PARSE_CODE_AUXILIARY_DATA)


SCHRO_PARSE_CODE_IS_CORE_SYNTAX()

#define SCHRO_PARSE_CODE_IS_CORE_SYNTAX(x) (((x) & 0x88) == 0x08)


SCHRO_PARSE_CODE_IS_END_OF_SEQUENCE()

#define SCHRO_PARSE_CODE_IS_END_OF_SEQUENCE(x) ((x) == SCHRO_PARSE_CODE_END_OF_SEQUENCE)


SCHRO_PARSE_CODE_IS_PADDING()

#define SCHRO_PARSE_CODE_IS_PADDING(x) ((x) == SCHRO_PARSE_CODE_PADDING)


SCHRO_PARSE_CODE_IS_SEQ_HEADER()

#define SCHRO_PARSE_CODE_IS_SEQ_HEADER(x) ((x) == SCHRO_PARSE_CODE_SEQUENCE_HEADER)


SCHRO_PARSE_CODE_USING_AC()

#define SCHRO_PARSE_CODE_USING_AC(x) (((x) & 0x48) == 0x08)

schroedinger-1.0.11/doc/html/schroedinger-schrooil.html0000664000175000017500000000462011707140273020070 00000000000000 schrooil

schrooil

schrooil

Synopsis


Description

Details

schroedinger-1.0.11/doc/html/schroedinger-schrometric.html0000664000175000017500000005463011707140273020576 00000000000000 schrometric

schrometric

schrometric

Synopsis

struct              SchroMetricScan;
#define             SCHRO_METRIC_INVALID
int                 schro_metric_absdiff_u8             (uint8_t *a,
                                                         int a_stride,
                                                         uint8_t *b,
                                                         int b_stride,
                                                         int width,
                                                         int height);
int                 schro_metric_haar                   (uint8_t *src1,
                                                         int stride1,
                                                         uint8_t *src2,
                                                         int stride2,
                                                         int width,
                                                         int height);
int                 schro_metric_haar_const             (uint8_t *data,
                                                         int stride,
                                                         int dc_value,
                                                         int width,
                                                         int height);
int                 schro_metric_abssum_s16             (int16_t *data,
                                                         int stride,
                                                         int width,
                                                         int height);
int                 schro_metric_sum_u8                 (uint8_t *data,
                                                         int stride,
                                                         int width,
                                                         int height);
int                 schro_metric_get                    (SchroFrameData *src1,
                                                         SchroFrameData *src2,
                                                         int width,
                                                         int height);
int                 schro_metric_get_biref              (SchroFrameData *fd,
                                                         SchroFrameData *src1,
                                                         int weight1,
                                                         SchroFrameData *src2,
                                                         int weight2,
                                                         int shift,
                                                         int width,
                                                         int height);
int                 schro_metric_get_dc                 (SchroFrameData *src,
                                                         int value,
                                                         int width,
                                                         int height);
void                schro_metric_scan_do_scan           (SchroMetricScan *scan);
int                 schro_metric_scan_get_min           (SchroMetricScan *scan,
                                                         int *dx,
                                                         int *dy,
                                                         uint32_t *chroma_metric);
void                schro_metric_scan_setup             (SchroMetricScan *scan,
                                                         int dx,
                                                         int dy,
                                                         int dist,
                                                         int use_chroma);

Description

Details

struct SchroMetricScan

struct SchroMetricScan {
  SchroFrame *frame;
  SchroFrame *ref_frame;
  int block_width;
  int block_height;
  int x, y;
  int ref_x, ref_y;
  int scan_width;
  int scan_height;
  int gravity_scale;
  int gravity_x, gravity_y;
  int use_chroma;
  /* output */
  uint32_t metrics[SCHRO_LIMIT_METRIC_SCAN*SCHRO_LIMIT_METRIC_SCAN];
  uint32_t chroma_metrics[SCHRO_LIMIT_METRIC_SCAN*SCHRO_LIMIT_METRIC_SCAN];
};


SCHRO_METRIC_INVALID

#define SCHRO_METRIC_INVALID INT_MAX


schro_metric_absdiff_u8 ()

int                 schro_metric_absdiff_u8             (uint8_t *a,
                                                         int a_stride,
                                                         uint8_t *b,
                                                         int b_stride,
                                                         int width,
                                                         int height);


schro_metric_haar ()

int                 schro_metric_haar                   (uint8_t *src1,
                                                         int stride1,
                                                         uint8_t *src2,
                                                         int stride2,
                                                         int width,
                                                         int height);


schro_metric_haar_const ()

int                 schro_metric_haar_const             (uint8_t *data,
                                                         int stride,
                                                         int dc_value,
                                                         int width,
                                                         int height);


schro_metric_abssum_s16 ()

int                 schro_metric_abssum_s16             (int16_t *data,
                                                         int stride,
                                                         int width,
                                                         int height);


schro_metric_sum_u8 ()

int                 schro_metric_sum_u8                 (uint8_t *data,
                                                         int stride,
                                                         int width,
                                                         int height);


schro_metric_get ()

int                 schro_metric_get                    (SchroFrameData *src1,
                                                         SchroFrameData *src2,
                                                         int width,
                                                         int height);


schro_metric_get_biref ()

int                 schro_metric_get_biref              (SchroFrameData *fd,
                                                         SchroFrameData *src1,
                                                         int weight1,
                                                         SchroFrameData *src2,
                                                         int weight2,
                                                         int shift,
                                                         int width,
                                                         int height);


schro_metric_get_dc ()

int                 schro_metric_get_dc                 (SchroFrameData *src,
                                                         int value,
                                                         int width,
                                                         int height);


schro_metric_scan_do_scan ()

void                schro_metric_scan_do_scan           (SchroMetricScan *scan);


schro_metric_scan_get_min ()

int                 schro_metric_scan_get_min           (SchroMetricScan *scan,
                                                         int *dx,
                                                         int *dy,
                                                         uint32_t *chroma_metric);


schro_metric_scan_setup ()

void                schro_metric_scan_setup             (SchroMetricScan *scan,
                                                         int dx,
                                                         int dy,
                                                         int dist,
                                                         int use_chroma);

schroedinger-1.0.11/doc/html/index.html0000664000175000017500000001153511707140273014706 00000000000000 Schroedinger Reference Manual schroedinger-1.0.11/doc/html/schroedinger-schroencoder.html0000664000175000017500000021647411707140273020740 00000000000000 schroencoder

schroencoder

schroencoder

Synopsis

struct              SchroEncoder;
struct              SchroEncoderFrame;
enum                SchroEncoderFrameStateEnum;
enum                SchroEncoderPerceptualEnum;
enum                SchroQuantiserEngineEnum;
enum                SchroStateEnum;
enum                SchroEncoderGOPEnum;
enum                SchroEncoderRateControlEnum;
struct              SchroEncoderSetting;
enum                SchroEncoderSettingTypeEnum;
int                 (*SchroEngineIterateFunc)           (SchroEncoder *encoder);
SchroEncoder *      schro_encoder_new                   (void);
void                schro_encoder_free                  (SchroEncoder *encoder);
SchroVideoFormat *  schro_encoder_get_video_format      (SchroEncoder *encoder);
void                schro_encoder_set_video_format      (SchroEncoder *encoder,
                                                         SchroVideoFormat *video_format);
void                schro_encoder_end_of_stream         (SchroEncoder *encoder);
void                schro_encoder_push_frame            (SchroEncoder *encoder,
                                                         SchroFrame *frame);
void                schro_encoder_encode_parse_info     (SchroPack *bits,
                                                         int parse_code);
SchroBuffer *       schro_encoder_pull                  (SchroEncoder *encoder,
                                                         int *n_decodable_frames);
void                schro_encoder_analyse_picture       (SchroAsyncStage *stage);
void                schro_encoder_calculate_subband_weights
                                                        (SchroEncoder *encoder,
                                                         double (*perceptual_weight) (double));
void                schro_encoder_calculate_test_info   (SchroEncoderFrame *frame);
void                schro_encoder_choose_quantisers     (SchroEncoderFrame *frame);
void                schro_encoder_clean_up_transform    (SchroEncoderFrame *frame);
SchroBuffer *       schro_encoder_encode_auxiliary_data (SchroEncoder *encoder,
                                                         SchroAuxiliaryDataID id,
                                                         const void *data,
                                                         int size);
SchroBuffer *       schro_encoder_encode_end_of_stream  (SchroEncoder *encoder);
void                schro_encoder_encode_lowdelay_transform_data
                                                        (SchroEncoderFrame *frame);
void                schro_encoder_encode_picture        (SchroAsyncStage *stage);
void                schro_encoder_encode_picture_header (SchroEncoderFrame *frame);
void                schro_encoder_encode_subband        (SchroEncoderFrame *frame,
                                                         int component,
                                                         int index);
void                schro_encoder_encode_subband_noarith
                                                        (SchroEncoderFrame *frame,
                                                         int component,
                                                         int index);
int                 schro_encoder_engine_backref        (SchroEncoder *encoder);
int                 schro_encoder_engine_backtest       (SchroEncoder *encoder);
int                 schro_encoder_engine_intra_only     (SchroEncoder *encoder);
int                 schro_encoder_engine_lossless       (SchroEncoder *encoder);
int                 schro_encoder_engine_lowdelay       (SchroEncoder *encoder);
int                 schro_encoder_engine_test_intra     (SchroEncoder *encoder);
void                schro_encoder_estimate_entropy      (SchroEncoderFrame *frame);
void                schro_encoder_frame_analyse         (SchroEncoderFrame *frame);
void                schro_encoder_frame_downsample      (SchroEncoderFrame *frame);
void                schro_encoder_frame_insert_buffer   (SchroEncoderFrame *frame,
                                                         SchroBuffer *buffer);
SchroEncoderFrame * schro_encoder_frame_new             (SchroEncoder *encoder);
SchroFrame *        schro_encoder_frame_queue_get       (SchroEncoder *encoder,
                                                         SchroPictureNumber frame_number);
void                schro_encoder_frame_queue_remove    (SchroEncoder *encoder,
                                                         SchroPictureNumber frame_number);
void                schro_encoder_frame_ref             (SchroEncoderFrame *frame);
void                schro_encoder_frame_unref           (SchroEncoderFrame *frame);
void                schro_encoder_init_subbands         (SchroEncoderFrame *frame);
void                schro_encoder_insert_buffer         (SchroEncoder *encoder,
                                                         SchroBuffer *buffer);
void                schro_encoder_output_push           (SchroEncoder *encoder,
                                                         SchroBuffer *buffer,
                                                         int slot,
                                                         int presentation_frame);
double              schro_encoder_perceptual_weight_ccir959
                                                        (double cpd);
double              schro_encoder_perceptual_weight_constant
                                                        (double cpd);
double              schro_encoder_perceptual_weight_moo (double cpd);
void                schro_encoder_postanalyse_picture   (SchroAsyncStage *stage);
int                 schro_encoder_push_ready            (SchroEncoder *encoder);
void                schro_encoder_recalculate_allocations
                                                        (SchroEncoder *encoder);
void                schro_encoder_reconstruct_picture   (SchroAsyncStage *stage);
SchroEncoderFrame * schro_encoder_reference_get         (SchroEncoder *encoder,
                                                         SchroPictureNumber frame_number);
void                schro_encoder_set_default_subband_weights
                                                        (SchroEncoder *encoder);
void                schro_encoder_start                 (SchroEncoder *encoder);
SchroStateEnum      schro_encoder_wait                  (SchroEncoder *encoder);
int                 schro_encoder_get_n_settings        (void);
const SchroEncoderSetting * schro_encoder_get_setting_info
                                                        (int i);
void                schro_encoder_global_estimation     (SchroEncoderFrame *frame);
void                schro_encoder_init_error_tables     (SchroEncoder *encoder);
void                schro_encoder_phasecorr_estimation  (SchroPhaseCorr *pc);
double              schro_encoder_setting_get_double    (SchroEncoder *encoder,
                                                         const char *name);
void                schro_encoder_setting_set_double    (SchroEncoder *encoder,
                                                         const char *name,
                                                         double d);

Description

Details

struct SchroEncoder

struct SchroEncoder {
};


struct SchroEncoderFrame

struct SchroEncoderFrame {
};


enum SchroEncoderFrameStateEnum

typedef enum {
  SCHRO_ENCODER_FRAME_STAGE_NEW = 0,
  SCHRO_ENCODER_FRAME_STAGE_ANALYSE,
  SCHRO_ENCODER_FRAME_STAGE_SC_DETECT_1,
  SCHRO_ENCODER_FRAME_STAGE_SC_DETECT_2,
  SCHRO_ENCODER_FRAME_STAGE_HAVE_GOP,
  SCHRO_ENCODER_FRAME_STAGE_HAVE_PARAMS,
  SCHRO_ENCODER_FRAME_STAGE_PREDICT_ROUGH,
  SCHRO_ENCODER_FRAME_STAGE_PREDICT_PEL,
  SCHRO_ENCODER_FRAME_STAGE_PREDICT_SUBPEL,
  SCHRO_ENCODER_FRAME_STAGE_MODE_DECISION,
  SCHRO_ENCODER_FRAME_STAGE_HAVE_REFS,
  SCHRO_ENCODER_FRAME_STAGE_HAVE_QUANTS,
  SCHRO_ENCODER_FRAME_STAGE_ENCODING,
  SCHRO_ENCODER_FRAME_STAGE_RECONSTRUCT,
  SCHRO_ENCODER_FRAME_STAGE_POSTANALYSE,
  SCHRO_ENCODER_FRAME_STAGE_DONE,
  SCHRO_ENCODER_FRAME_STAGE_FREE,
  SCHRO_ENCODER_FRAME_STAGE_LAST /* this should be last */
} SchroEncoderFrameStateEnum;


enum SchroEncoderPerceptualEnum

typedef enum {
  SCHRO_ENCODER_PERCEPTUAL_CONSTANT,
  SCHRO_ENCODER_PERCEPTUAL_CCIR959,
  SCHRO_ENCODER_PERCEPTUAL_MOO,
  SCHRO_ENCODER_PERCEPTUAL_MANOS_SAKRISON
} SchroEncoderPerceptualEnum;


enum SchroQuantiserEngineEnum

typedef enum {
  SCHRO_QUANTISER_ENGINE_SIMPLE,
  SCHRO_QUANTISER_ENGINE_RDO_BIT_ALLOCATION,
  SCHRO_QUANTISER_ENGINE_CBR,
  SCHRO_QUANTISER_ENGINE_LOSSLESS,
  SCHRO_QUANTISER_ENGINE_LOWDELAY,
  SCHRO_QUANTISER_ENGINE_RDO_LAMBDA,
  SCHRO_QUANTISER_ENGINE_CONSTANT_ERROR
} SchroQuantiserEngineEnum;


enum SchroStateEnum

typedef enum {
  SCHRO_STATE_NEED_FRAME,
  SCHRO_STATE_HAVE_BUFFER,
  SCHRO_STATE_AGAIN,
  SCHRO_STATE_END_OF_STREAM
} SchroStateEnum;


enum SchroEncoderGOPEnum

typedef enum {
  SCHRO_ENCODER_GOP_ADAPTIVE,
  SCHRO_ENCODER_GOP_INTRA_ONLY,
  SCHRO_ENCODER_GOP_BACKREF,
  SCHRO_ENCODER_GOP_CHAINED_BACKREF,
  SCHRO_ENCODER_GOP_BIREF,
  SCHRO_ENCODER_GOP_CHAINED_BIREF,
} SchroEncoderGOPEnum;


enum SchroEncoderRateControlEnum

typedef enum {
  SCHRO_ENCODER_RATE_CONTROL_CONSTANT_NOISE_THRESHOLD,
  SCHRO_ENCODER_RATE_CONTROL_CONSTANT_BITRATE,
  SCHRO_ENCODER_RATE_CONTROL_LOW_DELAY,
  SCHRO_ENCODER_RATE_CONTROL_LOSSLESS,
  SCHRO_ENCODER_RATE_CONTROL_CONSTANT_LAMBDA,
  SCHRO_ENCODER_RATE_CONTROL_CONSTANT_ERROR,
  SCHRO_ENCODER_RATE_CONTROL_CONSTANT_QUALITY
} SchroEncoderRateControlEnum;


struct SchroEncoderSetting

struct SchroEncoderSetting {
  const char *name;
  SchroEncoderSettingTypeEnum type;

  double min;
  double max;
  double default_value;

  const char **enum_list;
};


enum SchroEncoderSettingTypeEnum

typedef enum {
  SCHRO_ENCODER_SETTING_TYPE_BOOLEAN,
  SCHRO_ENCODER_SETTING_TYPE_INT,
  SCHRO_ENCODER_SETTING_TYPE_ENUM,
  SCHRO_ENCODER_SETTING_TYPE_DOUBLE,
  SCHRO_ENCODER_SETTING_TYPE_LAST
} SchroEncoderSettingTypeEnum;


SchroEngineIterateFunc ()

int                 (*SchroEngineIterateFunc)           (SchroEncoder *encoder);


schro_encoder_new ()

SchroEncoder *      schro_encoder_new                   (void);

Create a new encoder object.

Returns :

a new encoder object

schro_encoder_free ()

void                schro_encoder_free                  (SchroEncoder *encoder);

Frees an encoder object and all its resources.

encoder :

an encoder object

schro_encoder_get_video_format ()

SchroVideoFormat *  schro_encoder_get_video_format      (SchroEncoder *encoder);

Creates a new SchroVideoFormat structure and copies the video format information of decoder into it.

When no longer needed, the returned pointer should be freed using free().

encoder :

an encoder object

Returns :

a pointer to a SchroVideoFormat structure

schro_encoder_set_video_format ()

void                schro_encoder_set_video_format      (SchroEncoder *encoder,
                                                         SchroVideoFormat *video_format);

Sets the video format used by encoder to the values specified in format. This function may only be called before schro_encoder_start() is called on the encoder.

encoder :

an encoder object

schro_encoder_end_of_stream ()

void                schro_encoder_end_of_stream         (SchroEncoder *encoder);

Tells the encoder that the end of the stream has been reached, and no more frames are available to encode. The encoder will then finish encoding.

encoder :

an encoder object

schro_encoder_push_frame ()

void                schro_encoder_push_frame            (SchroEncoder *encoder,
                                                         SchroFrame *frame);

Provides a frame to the encoder to encode.

encoder :

an encoder object

frame :

a frame to encode

schro_encoder_encode_parse_info ()

void                schro_encoder_encode_parse_info     (SchroPack *bits,
                                                         int parse_code);


schro_encoder_pull ()

SchroBuffer *       schro_encoder_pull                  (SchroEncoder *encoder,
                                                         int *n_decodable_frames);

Pulls a buffer of compressed video from the encoder. If presentation_frame is not NULL, the frame number of the latest decodable frame is returned.

encoder :

an encoder object

Returns :

a buffer containing compressed video

schro_encoder_analyse_picture ()

void                schro_encoder_analyse_picture       (SchroAsyncStage *stage);


schro_encoder_calculate_subband_weights ()

void                schro_encoder_calculate_subband_weights
                                                        (SchroEncoder *encoder,
                                                         double (*perceptual_weight) (double));


schro_encoder_calculate_test_info ()

void                schro_encoder_calculate_test_info   (SchroEncoderFrame *frame);


schro_encoder_choose_quantisers ()

void                schro_encoder_choose_quantisers     (SchroEncoderFrame *frame);


schro_encoder_clean_up_transform ()

void                schro_encoder_clean_up_transform    (SchroEncoderFrame *frame);


schro_encoder_encode_auxiliary_data ()

SchroBuffer *       schro_encoder_encode_auxiliary_data (SchroEncoder *encoder,
                                                         SchroAuxiliaryDataID id,
                                                         const void *data,
                                                         int size);

Packs data into a Dirac auxiliary data packet.

Returns :

a buffer

schro_encoder_encode_end_of_stream ()

SchroBuffer *       schro_encoder_encode_end_of_stream  (SchroEncoder *encoder);

Creates an end-of-stream packet.

Returns :

a buffer

schro_encoder_encode_lowdelay_transform_data ()

void                schro_encoder_encode_lowdelay_transform_data
                                                        (SchroEncoderFrame *frame);


schro_encoder_encode_picture ()

void                schro_encoder_encode_picture        (SchroAsyncStage *stage);


schro_encoder_encode_picture_header ()

void                schro_encoder_encode_picture_header (SchroEncoderFrame *frame);


schro_encoder_encode_subband ()

void                schro_encoder_encode_subband        (SchroEncoderFrame *frame,
                                                         int component,
                                                         int index);


schro_encoder_encode_subband_noarith ()

void                schro_encoder_encode_subband_noarith
                                                        (SchroEncoderFrame *frame,
                                                         int component,
                                                         int index);


schro_encoder_engine_backref ()

int                 schro_encoder_engine_backref        (SchroEncoder *encoder);


schro_encoder_engine_backtest ()

int                 schro_encoder_engine_backtest       (SchroEncoder *encoder);


schro_encoder_engine_intra_only ()

int                 schro_encoder_engine_intra_only     (SchroEncoder *encoder);


schro_encoder_engine_lossless ()

int                 schro_encoder_engine_lossless       (SchroEncoder *encoder);


schro_encoder_engine_lowdelay ()

int                 schro_encoder_engine_lowdelay       (SchroEncoder *encoder);


schro_encoder_engine_test_intra ()

int                 schro_encoder_engine_test_intra     (SchroEncoder *encoder);


schro_encoder_estimate_entropy ()

void                schro_encoder_estimate_entropy      (SchroEncoderFrame *frame);


schro_encoder_frame_analyse ()

void                schro_encoder_frame_analyse         (SchroEncoderFrame *frame);


schro_encoder_frame_downsample ()

void                schro_encoder_frame_downsample      (SchroEncoderFrame *frame);


schro_encoder_frame_insert_buffer ()

void                schro_encoder_frame_insert_buffer   (SchroEncoderFrame *frame,
                                                         SchroBuffer *buffer);

Inserts a buffer into an encoder frame.

frame :

an encoder frame

buffer :

a buffer

schro_encoder_frame_new ()

SchroEncoderFrame * schro_encoder_frame_new             (SchroEncoder *encoder);


schro_encoder_frame_queue_get ()

SchroFrame *        schro_encoder_frame_queue_get       (SchroEncoder *encoder,
                                                         SchroPictureNumber frame_number);


schro_encoder_frame_queue_remove ()

void                schro_encoder_frame_queue_remove    (SchroEncoder *encoder,
                                                         SchroPictureNumber frame_number);


schro_encoder_frame_ref ()

void                schro_encoder_frame_ref             (SchroEncoderFrame *frame);


schro_encoder_frame_unref ()

void                schro_encoder_frame_unref           (SchroEncoderFrame *frame);


schro_encoder_init_subbands ()

void                schro_encoder_init_subbands         (SchroEncoderFrame *frame);


schro_encoder_insert_buffer ()

void                schro_encoder_insert_buffer         (SchroEncoder *encoder,
                                                         SchroBuffer *buffer);

Inserts an application-provided buffer into the encoded video stream with the next frame that is pushed.

encoder :

an encoder object

buffer :

a buffer

schro_encoder_output_push ()

void                schro_encoder_output_push           (SchroEncoder *encoder,
                                                         SchroBuffer *buffer,
                                                         int slot,
                                                         int presentation_frame);


schro_encoder_perceptual_weight_ccir959 ()

double              schro_encoder_perceptual_weight_ccir959
                                                        (double cpd);


schro_encoder_perceptual_weight_constant ()

double              schro_encoder_perceptual_weight_constant
                                                        (double cpd);


schro_encoder_perceptual_weight_moo ()

double              schro_encoder_perceptual_weight_moo (double cpd);


schro_encoder_postanalyse_picture ()

void                schro_encoder_postanalyse_picture   (SchroAsyncStage *stage);


schro_encoder_push_ready ()

int                 schro_encoder_push_ready            (SchroEncoder *encoder);

Returns true if the encoder has available space for additional video frames.

encoder :

an encoder object

Returns :

TRUE if the encoder is ready for another video frame to be pushed.

schro_encoder_recalculate_allocations ()

void                schro_encoder_recalculate_allocations
                                                        (SchroEncoder *encoder);


schro_encoder_reconstruct_picture ()

void                schro_encoder_reconstruct_picture   (SchroAsyncStage *stage);


schro_encoder_reference_get ()

SchroEncoderFrame * schro_encoder_reference_get         (SchroEncoder *encoder,
                                                         SchroPictureNumber frame_number);


schro_encoder_set_default_subband_weights ()

void                schro_encoder_set_default_subband_weights
                                                        (SchroEncoder *encoder);


schro_encoder_start ()

void                schro_encoder_start                 (SchroEncoder *encoder);

Locks in encoder configuration and causes the encoder to start encoding pictures. At this point, the encoder will start worker threads to do the actual encoding.

encoder :

an encoder object

schro_encoder_wait ()

SchroStateEnum      schro_encoder_wait                  (SchroEncoder *encoder);

Checks the state of the encoder. If the encoder requires the application to do something, an appropriate state code is returned. Otherwise, this function waits until the encoder requires the application to do something.

encoder :

an encoder object

Returns :

a state code

schro_encoder_get_n_settings ()

int                 schro_encoder_get_n_settings        (void);


schro_encoder_get_setting_info ()

const SchroEncoderSetting * schro_encoder_get_setting_info
                                                        (int i);


schro_encoder_global_estimation ()

void                schro_encoder_global_estimation     (SchroEncoderFrame *frame);


schro_encoder_init_error_tables ()

void                schro_encoder_init_error_tables     (SchroEncoder *encoder);


schro_encoder_phasecorr_estimation ()

void                schro_encoder_phasecorr_estimation  (SchroPhaseCorr *pc);


schro_encoder_setting_get_double ()

double              schro_encoder_setting_get_double    (SchroEncoder *encoder,
                                                         const char *name);

encoder :

an encoder object

Returns :

the current value of an encoder option given by name

schro_encoder_setting_set_double ()

void                schro_encoder_setting_set_double    (SchroEncoder *encoder,
                                                         const char *name,
                                                         double d);

set the encoder option given by name to value.

encoder :

an encoder object
schroedinger-1.0.11/doc/html/home.png0000644000175000017500000000110211707140273014332 00000000000000‰PNG  IHDRשÍÊðPLTEÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  $$$(((,,,000888<<<@@@OOOPPP[[[___```lll{{{€€€‹‹‹£££¯¯¯¿¿¿ÃÃÃÇÇÇÏÏÏÓÓÓÛÛÛßßßãããëëëïïïóóó÷÷÷ÿÿÿÕ?“*tRNS  $(,4@GKSghkotw‡‹›Ÿ«·»¿ÃËÏÓÛßçïó÷ûa7™Þ×IDATxÚ­Ï[W‚P†áÁ̳ijÓ2¡†LK<`[Ñ4jg8ÿÿ߸öb³è¢‹žËy/¾5ðéÓF~QЈŒJ¾T*ìÄðæN½‘³‡/ q°]1¶àzJœ•+z ÏD›=9”…ƒã­ñ€Ó4bv‰Â«1;ÈõâP=š• ]j*P gãúot ×»>&¹*´ööŸ™ÄBËþî@Ñ ŽŒ$nè¾ì?q— ½ øn’AƒÿC&‰ÐÞ™c~¨a¨ßÄ|Ò„ê·ZL÷\!éC‰VF@Ú~IEND®B`‚schroedinger-1.0.11/doc/html/schroedinger-schrohistogram.html0000664000175000017500000001642011707140273021303 00000000000000 schrohistogram

schrohistogram

schrohistogram

Synopsis

void                schro_histogram_table_generate      (SchroHistogramTable *table,
                                                         double (*func) (int value, void *priv),
                                                         void *priv);

Description

Details

schro_histogram_table_generate ()

void                schro_histogram_table_generate      (SchroHistogramTable *table,
                                                         double (*func) (int value, void *priv),
                                                         void *priv);

table :

int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv: int value, void *priv:
schroedinger-1.0.11/doc/html/schroedinger-schroqueue.html0000664000175000017500000003655011707140273020440 00000000000000 schroqueue

schroqueue

schroqueue

Synopsis

struct              SchroQueue;
struct              SchroQueueElement;
void                (*SchroQueueFreeFunc)               (void *data,
                                                         SchroPictureNumber number);
void                schro_queue_add                     (SchroQueue *queue,
                                                         void *element,
                                                         SchroPictureNumber picture_number);
void                schro_queue_clear                   (SchroQueue *queue);
void                schro_queue_delete                  (SchroQueue *queue,
                                                         SchroPictureNumber picture_number);
void *              schro_queue_find                    (SchroQueue *queue,
                                                         SchroPictureNumber picture_number);
void                schro_queue_free                    (SchroQueue *queue);
int                 schro_queue_is_empty                (SchroQueue *queue);
int                 schro_queue_is_full                 (SchroQueue *queue);
SchroQueue *        schro_queue_new                     (int size,
                                                         SchroQueueFreeFunc func);
void                schro_queue_pop                     (SchroQueue *queue);
void *              schro_queue_pull                    (SchroQueue *queue);
void *              schro_queue_remove                  (SchroQueue *queue,
                                                         SchroPictureNumber picture_number);

Description

Details

struct SchroQueue

struct SchroQueue {
  int size;
  int n;

  SchroQueueElement *elements;
  SchroQueueFreeFunc free;
};


struct SchroQueueElement

struct SchroQueueElement {
  void *data;
  SchroPictureNumber picture_number;
};


SchroQueueFreeFunc ()

void                (*SchroQueueFreeFunc)               (void *data,
                                                         SchroPictureNumber number);


schro_queue_add ()

void                schro_queue_add                     (SchroQueue *queue,
                                                         void *element,
                                                         SchroPictureNumber picture_number);


schro_queue_clear ()

void                schro_queue_clear                   (SchroQueue *queue);


schro_queue_delete ()

void                schro_queue_delete                  (SchroQueue *queue,
                                                         SchroPictureNumber picture_number);


schro_queue_find ()

void *              schro_queue_find                    (SchroQueue *queue,
                                                         SchroPictureNumber picture_number);


schro_queue_free ()

void                schro_queue_free                    (SchroQueue *queue);


schro_queue_is_empty ()

int                 schro_queue_is_empty                (SchroQueue *queue);


schro_queue_is_full ()

int                 schro_queue_is_full                 (SchroQueue *queue);


schro_queue_new ()

SchroQueue *        schro_queue_new                     (int size,
                                                         SchroQueueFreeFunc func);


schro_queue_pop ()

void                schro_queue_pop                     (SchroQueue *queue);


schro_queue_pull ()

void *              schro_queue_pull                    (SchroQueue *queue);


schro_queue_remove ()

void *              schro_queue_remove                  (SchroQueue *queue,
                                                         SchroPictureNumber picture_number);

schroedinger-1.0.11/doc/html/schroedinger-schroparams.html0000664000175000017500000004526411707140273020601 00000000000000 schroparams

schroparams

schroparams

Description

Details

struct SchroVideoFormat

struct SchroVideoFormat {
  SchroVideoFormatEnum index;
  int width;
  int height;
  SchroChromaFormat chroma_format;

  schro_bool interlaced;
  schro_bool top_field_first;

  int frame_rate_numerator;
  int frame_rate_denominator;
  int aspect_ratio_numerator;
  int aspect_ratio_denominator;

  int clean_width;
  int clean_height;
  int left_offset;
  int top_offset;

  int luma_offset;
  int luma_excursion;
  int chroma_offset;
  int chroma_excursion;

  SchroColourPrimaries colour_primaries;
  SchroColourMatrix colour_matrix;
  SchroTransferFunction transfer_function;

  int interlaced_coding;

  int unused0;
  int unused1;
  int unused2;
};


struct SchroParams

struct SchroParams {
};


struct SchroMotionVector

struct SchroMotionVector {
  unsigned int pred_mode : 2;
  unsigned int using_global : 1;
  unsigned int split : 2;
  unsigned int unused : 3;
  unsigned int scan : 8;
  uint32_t metric;
  uint32_t chroma_metric;
  union {
    struct {
      int16_t dx[2];
      int16_t dy[2];
    } vec;
    struct {
      int16_t dc[3];
    } dc;
  } u;
};


struct SchroMotionField

struct SchroMotionField {
  int x_num_blocks;
  int y_num_blocks;
  SchroMotionVector *motion_vectors;
};


struct SchroGlobalMotion

struct SchroGlobalMotion {
  int b0;
  int b1;
  int a_exp;
  int a00;
  int a01;
  int a10;
  int a11;
  int c_exp;
  int c0;
  int c1;
};


SchroPictureNumber

typedef uint32_t SchroPictureNumber;


schro_params_calculate_iwt_sizes ()

void                schro_params_calculate_iwt_sizes    (SchroParams *params);

Calculates the size of the array used for wavelet transformation using the current video format and transformation depth in the params structure. The params structure is updated with the new values.

The structure fields changed are: iwt_chroma_width, iwt_chroma_height, iwt_luma_width, iwt_luma_height.

params :

pointer to SchroParams structure

schro_params_calculate_mc_sizes ()

void                schro_params_calculate_mc_sizes     (SchroParams *params);

Calculates the size of the array used for motion compensation using the current video format and motion compensation paramters in the params structure. The params structure is updated with the new values.

The structure fields changed are: x_num_blocks, y_num_blocks, mc_luma_width, mc_luma_height, mc_chroma_width, mc_chroma_height, x_offset, y_offset.

params :

pointer to SchroParams structure

schro_params_set_block_params ()

int                 schro_params_set_block_params       (SchroParams *params,
                                                         int index);

Sets the block parameters for motion compensation in the parameters structure pointed to by params to the standard block parameters given by index.

params :

pointer to SchroParams structure

index :

index to standard block parameters

schro_params_set_default_codeblock ()

void                schro_params_set_default_codeblock  (SchroParams *params);

Sets the codeblock parameters in the parameters structure pointed to by params to the defaults.

params :

pointer to SchroParams structure

schro_params_get_block_params ()

int                 schro_params_get_block_params       (SchroParams *params);


schro_params_get_frame_format ()

int                 schro_params_get_frame_format       (int depth,
                                                         SchroChromaFormat chroma_format);


schro_params_init ()

void                schro_params_init                   (SchroParams *params,
                                                         int video_format);


schro_params_is_default_codeblock ()

schro_bool          schro_params_is_default_codeblock   (SchroParams *params);

params :

pointer to SchroParams structure

Returns :

True if the codeblocks in params are the default codeblocks.

schro_params_is_default_quant_matrix ()

schro_bool          schro_params_is_default_quant_matrix
                                                        (SchroParams *params);


schro_params_set_default_quant_matrix ()

void                schro_params_set_default_quant_matrix
                                                        (SchroParams *params);


schro_params_verify_block_params ()

int                 schro_params_verify_block_params    (SchroParams *params);

schroedinger-1.0.11/doc/html/schroedinger-schrofilter.html0000664000175000017500000004054211707140273020575 00000000000000 schrofilter

schrofilter

schrofilter

Synopsis

void                schro_frame_filter_adaptive_lowpass (SchroFrame *frame);
void                schro_frame_filter_addnoise         (SchroFrame *frame,
                                                         double sigma);
void                schro_frame_filter_cwm7             (SchroFrame *frame);
void                schro_frame_filter_cwmN             (SchroFrame *frame,
                                                         int weight);
void                schro_frame_filter_cwmN_ref         (SchroFrame *frame,
                                                         int weight);
void                schro_frame_filter_lowpass          (SchroFrame *frame,
                                                         int tap);
void                schro_frame_filter_lowpass2         (SchroFrame *frame,
                                                         double sigma);
void                schro_frame_filter_lowpass_16       (SchroFrame *frame);
void                schro_frame_filter_wavelet          (SchroFrame *frame);
void                schro_filter_cwm7                   (uint8_t *d,
                                                         uint8_t *s1,
                                                         uint8_t *s2,
                                                         uint8_t *s3,
                                                         int n);
void                schro_filter_cwmN                   (uint8_t *d,
                                                         uint8_t *s1,
                                                         uint8_t *s2,
                                                         uint8_t *s3,
                                                         int n,
                                                         int weight);
void                schro_filter_cwmN_ref               (uint8_t *d,
                                                         uint8_t *s1,
                                                         uint8_t *s2,
                                                         uint8_t *s3,
                                                         int n,
                                                         int weight);

Description

Details

schro_frame_filter_adaptive_lowpass ()

void                schro_frame_filter_adaptive_lowpass (SchroFrame *frame);


schro_frame_filter_addnoise ()

void                schro_frame_filter_addnoise         (SchroFrame *frame,
                                                         double sigma);


schro_frame_filter_cwm7 ()

void                schro_frame_filter_cwm7             (SchroFrame *frame);


schro_frame_filter_cwmN ()

void                schro_frame_filter_cwmN             (SchroFrame *frame,
                                                         int weight);


schro_frame_filter_cwmN_ref ()

void                schro_frame_filter_cwmN_ref         (SchroFrame *frame,
                                                         int weight);


schro_frame_filter_lowpass ()

void                schro_frame_filter_lowpass          (SchroFrame *frame,
                                                         int tap);


schro_frame_filter_lowpass2 ()

void                schro_frame_filter_lowpass2         (SchroFrame *frame,
                                                         double sigma);


schro_frame_filter_lowpass_16 ()

void                schro_frame_filter_lowpass_16       (SchroFrame *frame);


schro_frame_filter_wavelet ()

void                schro_frame_filter_wavelet          (SchroFrame *frame);


schro_filter_cwm7 ()

void                schro_filter_cwm7                   (uint8_t *d,
                                                         uint8_t *s1,
                                                         uint8_t *s2,
                                                         uint8_t *s3,
                                                         int n);


schro_filter_cwmN ()

void                schro_filter_cwmN                   (uint8_t *d,
                                                         uint8_t *s1,
                                                         uint8_t *s2,
                                                         uint8_t *s3,
                                                         int n,
                                                         int weight);


schro_filter_cwmN_ref ()

void                schro_filter_cwmN_ref               (uint8_t *d,
                                                         uint8_t *s1,
                                                         uint8_t *s2,
                                                         uint8_t *s3,
                                                         int n,
                                                         int weight);

schroedinger-1.0.11/doc/html/schroedinger-schrosubband.html0000664000175000017500000001522011707140273020721 00000000000000 schrosubband

schrosubband

schrosubband

Synopsis

#define             SCHRO_SUBBAND_IS_HORIZONTALLY_ORIENTED(position)
#define             SCHRO_SUBBAND_IS_VERTICALLY_ORIENTED(position)
#define             SCHRO_SUBBAND_SHIFT                 (position)
void                schro_subband_get_frame_data        (SchroFrameData *dest,
                                                         SchroFrame *frame,
                                                         int component,
                                                         int position,
                                                         SchroParams *params);
int                 schro_subband_get_position          (int index);

Description

Details

SCHRO_SUBBAND_IS_HORIZONTALLY_ORIENTED()

#define SCHRO_SUBBAND_IS_HORIZONTALLY_ORIENTED(position) (((position)&3) == 2)


SCHRO_SUBBAND_IS_VERTICALLY_ORIENTED()

#define SCHRO_SUBBAND_IS_VERTICALLY_ORIENTED(position) (((position)&3) == 1)


SCHRO_SUBBAND_SHIFT()

#define SCHRO_SUBBAND_SHIFT(position) ((position)>>2)


schro_subband_get_frame_data ()

void                schro_subband_get_frame_data        (SchroFrameData *dest,
                                                         SchroFrame *frame,
                                                         int component,
                                                         int position,
                                                         SchroParams *params);


schro_subband_get_position ()

int                 schro_subband_get_position          (int index);

schroedinger-1.0.11/doc/html/schroedinger-schrodecoder.html0000664000175000017500000014411211707140273020713 00000000000000 schrodecoder

schrodecoder

schrodecoder

Synopsis

struct              SchroDecoder;
SchroDecoder *      schro_decoder_new                   (void);
void                schro_decoder_free                  (SchroDecoder *decoder);
void                schro_decoder_reset                 (SchroDecoder *decoder);
SchroVideoFormat *  schro_decoder_get_video_format      (SchroDecoder *decoder);
void                schro_decoder_add_output_picture    (SchroDecoder *decoder,
                                                         SchroFrame *frame);
int                 schro_decoder_push_ready            (SchroDecoder *decoder);
int                 schro_decoder_push                  (SchroDecoder *decoder,
                                                         SchroBuffer *buffer);
int                 schro_decoder_push_end_of_stream    (SchroDecoder *decoder);
SchroFrame *        schro_decoder_pull                  (SchroDecoder *decoder);
int                 schro_decoder_wait                  (SchroDecoder *decoder);
void                schro_decoder_set_earliest_frame    (SchroDecoder *decoder,
                                                         SchroPictureNumber earliest_frame);
void                schro_decoder_set_skip_ratio        (SchroDecoder *decoder,
                                                         double ratio);
SchroPictureNumber  schro_decoder_get_picture_number    (SchroDecoder *decoder);

int                 schro_decoder_decode_parse_header   (SchroUnpack *unpack);
void                schro_decoder_decode_transform_data (SchroPicture *picture);
void                schro_decoder_decode_lowdelay_transform_data
                                                        (SchroPicture *picture);
void                schro_decoder_subband_dc_predict    (SchroFrameData *fd);
void                schro_decoder_decode_block_data     (SchroPicture *picture);
void                schro_decoder_decode_macroblock     (SchroPicture *picture,
                                                         SchroArith **arith,
                                                         SchroUnpack *unpack,
                                                         int i,
                                                         int j);
void                schro_decoder_decode_prediction_unit
                                                        (SchroPicture *picture,
                                                         SchroArith **arith,
                                                         SchroUnpack *unpack,
                                                         SchroMotionVector *motion_vectors,
                                                         int x,
                                                         int y);
void                schro_decoder_init_subband_frame_data_interleaved
                                                        (SchroPicture *picture);
int                 schro_decoder_iterate_picture       (SchroDecoderInstance *instance,
                                                         SchroBuffer *buffer,
                                                         SchroUnpack *unpack,
                                                         int parse_code);
void                schro_decoder_parse_block_data      (SchroPicture *picture,
                                                         SchroUnpack *unpack);
void                schro_decoder_parse_lowdelay_transform_data
                                                        (SchroPicture *picture,
                                                         SchroUnpack *unpack);
void                schro_decoder_parse_picture         (SchroPicture *picture,
                                                         SchroUnpack *unpack);
void                schro_decoder_parse_picture_header  (SchroPicture *picture,
                                                         SchroUnpack *unpack);
void                schro_decoder_parse_picture_prediction_parameters
                                                        (SchroPicture *picture,
                                                         SchroUnpack *unpack);
void                schro_decoder_parse_transform_data  (SchroPicture *picture,
                                                         SchroUnpack *unpack);
void                schro_decoder_parse_transform_parameters
                                                        (SchroPicture *picture,
                                                         SchroUnpack *unpack);
struct              SchroPicture;
SchroPicture *      schro_picture_new                   (SchroDecoderInstance *instance);
SchroPicture *      schro_picture_ref                   (SchroPicture *picture);
void                schro_picture_unref                 (SchroPicture *picture);

Description

Details

struct SchroDecoder

struct SchroDecoder {
};


schro_decoder_new ()

SchroDecoder *      schro_decoder_new                   (void);

Creates a new decoder object. The decoder object should be freed using schro_decoder_free() when it is no longer needed.

Returns :

a new decoder object

schro_decoder_free ()

void                schro_decoder_free                  (SchroDecoder *decoder);

Frees a decoder object.

decoder :

decoder object

schro_decoder_reset ()

void                schro_decoder_reset                 (SchroDecoder *decoder);

Resets the internal state of the decoder. This function should be called after a discontinuity of the stream, for example, as the result of a seek.

decoder :

a decoder object

schro_decoder_get_video_format ()

SchroVideoFormat *  schro_decoder_get_video_format      (SchroDecoder *decoder);

Returns a structure containing information on the video format being decoded by the decoder. This structure should be freed using free() when it is no longer needed.

decoder :

a decoder object

Returns :

a video format structure

schro_decoder_add_output_picture ()

void                schro_decoder_add_output_picture    (SchroDecoder *decoder,
                                                         SchroFrame *frame);

Adds a frame provided by the application to the picture queue. Frames in the picture queue will be used for decoding images, and are eventually returned to the application by schro_decoder_pull().

The caller loses its reference to frame after calling this function.

decoder :

a decoder object

frame :

the frame to add to the picture queue

schro_decoder_push_ready ()

int                 schro_decoder_push_ready            (SchroDecoder *decoder);

This function is used by the application to determine if it should push more data to the decoder.

decoder :

a decoder object

Returns :

TRUE if the decoder is ready for more data

schro_decoder_push ()

int                 schro_decoder_push                  (SchroDecoder *decoder,
                                                         SchroBuffer *buffer);


schro_decoder_push_end_of_stream ()

int                 schro_decoder_push_end_of_stream    (SchroDecoder *decoder);


schro_decoder_pull ()

SchroFrame *        schro_decoder_pull                  (SchroDecoder *decoder);

Removes the next picture from the picture queue and returns a frame containing the image.

The application provides the frames that pictures are decoded into, and the same frames are returned from this function. However, the order of frames returned may be different than the order that the application provides the frames to the decoder.

An exception to this is that skipped frames are indicated by a frame having a height and width equal to 0. This frame is created using schro_frame_new(), and is not one of the frames provided by the application.

Frames should be freed using schro_frame_unref() when no longer needed. The frame must not be reused by the application, since it may contain a reference frame still in use by the decoder.

decoder :

a decoder object

Returns :

the next picture

schro_decoder_wait ()

int                 schro_decoder_wait                  (SchroDecoder *decoder);

Waits until the decoder requires the application to do something, e.g., push more data or remove a frame from the picture queue, and then returns the decoder status.

decoder :

a decoder object

Returns :

decoder status

schro_decoder_set_earliest_frame ()

void                schro_decoder_set_earliest_frame    (SchroDecoder *decoder,
                                                         SchroPictureNumber earliest_frame);

The application can tell the decoder the earliest frame it is interested in by calling this function. Subsequent calls to schro_decoder_pull() will only return pictures with picture numbers greater than or equal to this number. The decoder will avoid decoding pictures that will not be displayed or used as reference pictures.

This feature can be used for frame-accurate seeking.

This function can be called at any time during decoding. Calling this function with a picture number less than the current earliest frame setting is invalid.

decoder :

a decoder object

earliest_frame :

the earliest frame that the application is interested in

schro_decoder_set_skip_ratio ()

void                schro_decoder_set_skip_ratio        (SchroDecoder *decoder,
                                                         double ratio);

Sets the skip ratio of the decoder. The skip ratio is used by the decoder to skip decoding of some pictures. Reference pictures are always decoded.

A picture is skipped when the running average of the proportion of pictures skipped is less than the skip ratio. Reference frames are always decoded and contribute to the running average. Thus, the actual ratio of skipped pictures may be larger than the requested skip ratio.

The decoder indicates a skipped picture in the pictures returned by schro_decoder_pull() by a frame that has a width and height of 0.

The default skip ratio is 1.0, indicating that all pictures should be decoded. A skip ratio of 0.0 indicates that no pictures should be decoded, although as mentioned above, some pictures will be decoded anyway. Values outside the range of 0.0 to 1.0 are quietly clamped to that range.

This function may be called at any time during decoding.

decoder :

a decoder object

ratio :

skip ratio.

schro_decoder_get_picture_number ()

SchroPictureNumber  schro_decoder_get_picture_number    (SchroDecoder *decoder);

Returns the picture number of the next picture that will be returned by schro_decoder_pull().

decoder :

a decoder object

Returns :

a picture number

schro_decoder_decode_parse_header ()

int                 schro_decoder_decode_parse_header   (SchroUnpack *unpack);


schro_decoder_decode_transform_data ()

void                schro_decoder_decode_transform_data (SchroPicture *picture);


schro_decoder_decode_lowdelay_transform_data ()

void                schro_decoder_decode_lowdelay_transform_data
                                                        (SchroPicture *picture);


schro_decoder_subband_dc_predict ()

void                schro_decoder_subband_dc_predict    (SchroFrameData *fd);


schro_decoder_decode_block_data ()

void                schro_decoder_decode_block_data     (SchroPicture *picture);


schro_decoder_decode_macroblock ()

void                schro_decoder_decode_macroblock     (SchroPicture *picture,
                                                         SchroArith **arith,
                                                         SchroUnpack *unpack,
                                                         int i,
                                                         int j);


schro_decoder_decode_prediction_unit ()

void                schro_decoder_decode_prediction_unit
                                                        (SchroPicture *picture,
                                                         SchroArith **arith,
                                                         SchroUnpack *unpack,
                                                         SchroMotionVector *motion_vectors,
                                                         int x,
                                                         int y);


schro_decoder_init_subband_frame_data_interleaved ()

void                schro_decoder_init_subband_frame_data_interleaved
                                                        (SchroPicture *picture);


schro_decoder_iterate_picture ()

int                 schro_decoder_iterate_picture       (SchroDecoderInstance *instance,
                                                         SchroBuffer *buffer,
                                                         SchroUnpack *unpack,
                                                         int parse_code);


schro_decoder_parse_block_data ()

void                schro_decoder_parse_block_data      (SchroPicture *picture,
                                                         SchroUnpack *unpack);


schro_decoder_parse_lowdelay_transform_data ()

void                schro_decoder_parse_lowdelay_transform_data
                                                        (SchroPicture *picture,
                                                         SchroUnpack *unpack);


schro_decoder_parse_picture ()

void                schro_decoder_parse_picture         (SchroPicture *picture,
                                                         SchroUnpack *unpack);


schro_decoder_parse_picture_header ()

void                schro_decoder_parse_picture_header  (SchroPicture *picture,
                                                         SchroUnpack *unpack);


schro_decoder_parse_picture_prediction_parameters ()

void                schro_decoder_parse_picture_prediction_parameters
                                                        (SchroPicture *picture,
                                                         SchroUnpack *unpack);


schro_decoder_parse_transform_data ()

void                schro_decoder_parse_transform_data  (SchroPicture *picture,
                                                         SchroUnpack *unpack);


schro_decoder_parse_transform_parameters ()

void                schro_decoder_parse_transform_parameters
                                                        (SchroPicture *picture,
                                                         SchroUnpack *unpack);


struct SchroPicture

struct SchroPicture {
  int refcount;

  SchroDecoderInstance *decoder_instance;

  int busy;
  int skip;
  int error;

  SchroBuffer *input_buffer;
  SchroParams params;
  SchroPictureNumber picture_number;
  SchroPictureNumber reference1;
  SchroPictureNumber reference2;
  SchroPictureNumber retired_picture_number;
  SchroPicture *ref0;
  SchroPicture *ref1;
  SchroFrame *planar_output_frame;
  SchroFrame *ref_output_frame;

  SchroAsyncStage stages[9];

  int is_ref;

  int zero_residual;

  SchroFrame *transform_frame;
  SchroFrame *frame;
  SchroFrame *mc_tmp_frame;
  SchroMotion *motion;
  SchroFrame *output_picture;
  SchroUpsampledFrame *upsampled_frame;

  int subband_length[3][SCHRO_LIMIT_SUBBANDS];
  int subband_quant_index[3][SCHRO_LIMIT_SUBBANDS];
  SchroBuffer *subband_buffer[3][SCHRO_LIMIT_SUBBANDS];
  SchroFrameData subband_data[3][SCHRO_LIMIT_SUBBANDS];

  SchroBuffer *motion_buffers[9];

  SchroBuffer *lowdelay_buffer;

  int has_md5;
  uint8_t md5_checksum[32];

  /* private data that is associated with this picture */
  SchroTag *tag;
};


schro_picture_new ()

SchroPicture *      schro_picture_new                   (SchroDecoderInstance *instance);

Creates a new picture for decoder.

Internal API.

Returns :

a new picture

schro_picture_ref ()

SchroPicture *      schro_picture_ref                   (SchroPicture *picture);


schro_picture_unref ()

void                schro_picture_unref                 (SchroPicture *picture);

schroedinger-1.0.11/doc/html/schrointernal.html0000664000175000017500000001032511707140273016446 00000000000000 Schroedinger Internal API schroedinger-1.0.11/doc/html/schroedinger.devhelp20000664000175000017500000017117411707140273017026 00000000000000 schroedinger-1.0.11/doc/html/schroedinger-schroframe.html0000664000175000017500000023765411707140273020416 00000000000000 schroframe

schroframe

schroframe

Synopsis

struct              SchroFrame;
struct              SchroFrameData;
void                (*SchroFrameFreeFunc)               (SchroFrame *frame,
                                                         void *priv);
enum                SchroFrameFormat;
struct              SchroUpsampledFrame;
#define             SCHRO_FRAME_FORMAT_DEPTH            (format)
#define             SCHRO_FRAME_FORMAT_DEPTH_S16
#define             SCHRO_FRAME_FORMAT_DEPTH_S32
#define             SCHRO_FRAME_FORMAT_DEPTH_U8
#define             SCHRO_FRAME_FORMAT_H_SHIFT          (format)
#define             SCHRO_FRAME_FORMAT_V_SHIFT          (format)
#define             SCHRO_FRAME_IS_PACKED               (format)
#define             SCHRO_FRAME_DATA_GET_LINE           (fd,
                                                         i)
#define             SCHRO_FRAME_DATA_GET_PIXEL_S16      (fd,
                                                         i,
                                                         j)
#define             SCHRO_FRAME_DATA_GET_PIXEL_U8       (fd,
                                                         i,
                                                         j)
SchroFrame *        schro_frame_new                     (void);
SchroFrame *        schro_frame_new_and_alloc           (SchroMemoryDomain *domain,
                                                         SchroFrameFormat format,
                                                         int width,
                                                         int height);
SchroFrame *        schro_frame_new_from_data_AYUV      (void *data,
                                                         int width,
                                                         int height);
SchroFrame *        schro_frame_new_from_data_I420      (void *data,
                                                         int width,
                                                         int height);
SchroFrame *        schro_frame_new_from_data_YUY2      (void *data,
                                                         int width,
                                                         int height);
SchroFrame *        schro_frame_dup                     (SchroFrame *frame);
SchroFrame *        schro_frame_ref                     (SchroFrame *frame);
void                schro_frame_unref                   (SchroFrame *frame);
void                schro_frame_set_free_callback       (SchroFrame *frame,
                                                         SchroFrameFreeFunc free_func,
                                                         void *priv);
SchroFrame *        schro_frame_clone                   (SchroMemoryDomain *domain,
                                                         SchroFrame *frame);
void                schro_frame_data_get_codeblock      (SchroFrameData *dest,
                                                         SchroFrameData *src,
                                                         int x,
                                                         int y,
                                                         int horiz_codeblocks,
                                                         int vert_codeblocks);
int                 schro_frame_get_metric              (SchroFrame *frame1,
                                                         int x1,
                                                         int y1,
                                                         SchroFrame *frame2,
                                                         int x2,
                                                         int y2);
void                schro_frame_get_subdata             (SchroFrame *frame,
                                                         SchroFrameData *fd,
                                                         int comp,
                                                         int x,
                                                         int y);
void                schro_frame_inverse_iwt_transform_cuda
                                                        (SchroFrame *frame,
                                                         SchroFrame *transform_frame,
                                                         SchroParams *params);
SchroFrame *        schro_frame_new_from_data_UYVY      (void *data,
                                                         int width,
                                                         int height);
SchroFrame *        schro_frame_new_from_data_YV12      (void *data,
                                                         int width,
                                                         int height);

void                schro_frame_convert                 (SchroFrame *dest,
                                                         SchroFrame *src);
SchroFrame *        schro_frame_convert_to_444          (SchroFrame *frame);
void                schro_frame_add                     (SchroFrame *dest,
                                                         SchroFrame *src);
void                schro_frame_subtract                (SchroFrame *dest,
                                                         SchroFrame *src);
void                schro_frame_shift_left              (SchroFrame *frame,
                                                         int shift);
void                schro_frame_shift_right             (SchroFrame *frame,
                                                         int shift);
void                schro_frame_edge_extend             (SchroFrame *frame,
                                                         int width,
                                                         int height);
void                schro_frame_zero_extend             (SchroFrame *frame,
                                                         int width,
                                                         int height);
void                schro_frame_iwt_transform           (SchroFrame *frame,
                                                         SchroParams *params);
void                schro_frame_downsample              (SchroFrame *dest,
                                                         SchroFrame *src);
void                schro_frame_mark                    (SchroFrame *frame,
                                                         int value);
void                schro_frame_upsample_horiz          (SchroFrame *dest,
                                                         SchroFrame *src);
void                schro_frame_upsample_vert           (SchroFrame *dest,
                                                         SchroFrame *src);

double              schro_frame_ssim                    (SchroFrame *a,
                                                         SchroFrame *b);
void                schro_frame_mean_squared_error      (SchroFrame *a,
                                                         SchroFrame *b,
                                                         double *mse);
void                schro_frame_md5                     (SchroFrame *frame,
                                                         uint32_t *state);
double              schro_frame_calculate_average_luma  (SchroFrame *frame);


void                schro_upsampled_frame_free          (SchroUpsampledFrame *df);
SchroUpsampledFrame * schro_upsampled_frame_new         (SchroFrame *frame);
void                schro_upsampled_frame_upsample      (SchroUpsampledFrame *df);
void                schro_upsampled_frame_get_block_fast_precN
                                                        (SchroUpsampledFrame *upframe,
                                                         int k,
                                                         int x,
                                                         int y,
                                                         int prec,
                                                         SchroFrameData *dest,
                                                         SchroFrameData *fd);
void                schro_upsampled_frame_get_block_precN
                                                        (SchroUpsampledFrame *upframe,
                                                         int k,
                                                         int x,
                                                         int y,
                                                         int prec,
                                                         SchroFrameData *dest);
int                 schro_upsampled_frame_get_pixel_prec0
                                                        (SchroUpsampledFrame *upframe,
                                                         int k,
                                                         int x,
                                                         int y);
int                 schro_upsampled_frame_get_pixel_prec1
                                                        (SchroUpsampledFrame *upframe,
                                                         int k,
                                                         int x,
                                                         int y);
int                 schro_upsampled_frame_get_pixel_prec3
                                                        (SchroUpsampledFrame *upframe,
                                                         int k,
                                                         int x,
                                                         int y);
int                 schro_upsampled_frame_get_pixel_precN
                                                        (SchroUpsampledFrame *upframe,
                                                         int k,
                                                         int x,
                                                         int y,
                                                         int mv_precision);

Description

Details

struct SchroFrame

struct SchroFrame {
  int refcount;
  SchroFrameFreeFunc free;
  SchroMemoryDomain *domain;
  void *regions[3];
  void *priv;

  SchroFrameFormat format;
  int width;
  int height;

  SchroFrameData components[3];

  int is_virtual;
  int cached_lines[3][SCHRO_FRAME_CACHE_SIZE];
  SchroFrame *virt_frame1;
  SchroFrame *virt_frame2;
  void (*render_line) (SchroFrame *frame, void *dest, int component, int i);
  void *virt_priv;
  void *virt_priv2;

  int extension;
  int cache_offset[3];
  int is_upsampled;
};


struct SchroFrameData

struct SchroFrameData {
  SchroFrameFormat format;
  void *data;
  int stride;
  int width;
  int height;
  int length;
  int h_shift;
  int v_shift;
};


SchroFrameFreeFunc ()

void                (*SchroFrameFreeFunc)               (SchroFrame *frame,
                                                         void *priv);


enum SchroFrameFormat

typedef enum {
  SCHRO_FRAME_FORMAT_U8_444 = 0x00,
  SCHRO_FRAME_FORMAT_U8_422 = 0x01,
  SCHRO_FRAME_FORMAT_U8_420 = 0x03,

  SCHRO_FRAME_FORMAT_S16_444 = 0x04,
  SCHRO_FRAME_FORMAT_S16_422 = 0x05,
  SCHRO_FRAME_FORMAT_S16_420 = 0x07,

  SCHRO_FRAME_FORMAT_S32_444 = 0x08,
  SCHRO_FRAME_FORMAT_S32_422 = 0x09,
  SCHRO_FRAME_FORMAT_S32_420 = 0x0b,

  /* indirectly supported */
  SCHRO_FRAME_FORMAT_YUYV = 0x100, /* YUYV order */
  SCHRO_FRAME_FORMAT_UYVY = 0x101, /* UYVY order */
  SCHRO_FRAME_FORMAT_AYUV = 0x102,
  SCHRO_FRAME_FORMAT_ARGB = 0x103,
  SCHRO_FRAME_FORMAT_RGB = 0x104,
  SCHRO_FRAME_FORMAT_v216 = 0x105,
  SCHRO_FRAME_FORMAT_v210 = 0x106,
  SCHRO_FRAME_FORMAT_AY64 = 0x107
} SchroFrameFormat;


struct SchroUpsampledFrame

struct SchroUpsampledFrame {
  SchroFrame *frames[4];
};


SCHRO_FRAME_FORMAT_DEPTH()

#define SCHRO_FRAME_FORMAT_DEPTH(format) ((format) & 0xc)


SCHRO_FRAME_FORMAT_DEPTH_S16

#define SCHRO_FRAME_FORMAT_DEPTH_S16 0x04


SCHRO_FRAME_FORMAT_DEPTH_S32

#define SCHRO_FRAME_FORMAT_DEPTH_S32 0x08


SCHRO_FRAME_FORMAT_DEPTH_U8

#define SCHRO_FRAME_FORMAT_DEPTH_U8 0x00


SCHRO_FRAME_FORMAT_H_SHIFT()

#define SCHRO_FRAME_FORMAT_H_SHIFT(format) ((format) & 0x1)


SCHRO_FRAME_FORMAT_V_SHIFT()

#define SCHRO_FRAME_FORMAT_V_SHIFT(format) (((format)>>1) & 0x1)


SCHRO_FRAME_IS_PACKED()

#define SCHRO_FRAME_IS_PACKED(format) (((format)>>8) & 0x1)


SCHRO_FRAME_DATA_GET_LINE()

#define SCHRO_FRAME_DATA_GET_LINE(fd,i) (SCHRO_OFFSET((fd)->data,(fd)->stride*(i)))


SCHRO_FRAME_DATA_GET_PIXEL_S16()

#define SCHRO_FRAME_DATA_GET_PIXEL_S16(fd,i,j) ((int16_t *)SCHRO_OFFSET((fd)->data,(fd)->stride*(j)+(i)*sizeof(int16_t)))


SCHRO_FRAME_DATA_GET_PIXEL_U8()

#define SCHRO_FRAME_DATA_GET_PIXEL_U8(fd,i,j) ((uint8_t *)SCHRO_OFFSET((fd)->data,(fd)->stride*(j)+(i)))


schro_frame_new ()

SchroFrame *        schro_frame_new                     (void);

Creates a new SchroFrame object. The created frame is uninitialized and has no data storage associated with it. The caller must fill in the required information.

Returns :

a new SchroFrame object

schro_frame_new_and_alloc ()

SchroFrame *        schro_frame_new_and_alloc           (SchroMemoryDomain *domain,
                                                         SchroFrameFormat format,
                                                         int width,
                                                         int height);

Creates a new SchroFrame object with the requested size and format.

Returns :

a new SchroFrame object

schro_frame_new_from_data_AYUV ()

SchroFrame *        schro_frame_new_from_data_AYUV      (void *data,
                                                         int width,
                                                         int height);

Creates a new SchroFrame object with the requested size using the data pointed to by data. The data must be in AYUV format. The data must remain for the lifetime of the SchroFrame object. It is recommended to use schro_frame_set_free_callback() for notification when the data is no longer needed.

Returns :

a new SchroFrame object

schro_frame_new_from_data_I420 ()

SchroFrame *        schro_frame_new_from_data_I420      (void *data,
                                                         int width,
                                                         int height);

Creates a new SchroFrame object with the requested size using the data pointed to by data. The data must be in I420 format. The data must remain for the lifetime of the SchroFrame object. It is recommended to use schro_frame_set_free_callback() for notification when the data is no longer needed.

Returns :

a new SchroFrame object

schro_frame_new_from_data_YUY2 ()

SchroFrame *        schro_frame_new_from_data_YUY2      (void *data,
                                                         int width,
                                                         int height);

Creates a new SchroFrame object with the requested size using the data pointed to by data. The data must be in YUY2 format. The data must remain for the lifetime of the SchroFrame object. It is recommended to use schro_frame_set_free_callback() for notification when the data is no longer needed.

Returns :

a new SchroFrame object

schro_frame_dup ()

SchroFrame *        schro_frame_dup                     (SchroFrame *frame);

Creates a new SchroFrame object with the same dimensions and format as frame, and copies the data from the frame to the new object.

Returns :

a new SchroFrame object

schro_frame_ref ()

SchroFrame *        schro_frame_ref                     (SchroFrame *frame);

Increases the reference count of frame.

frame :

a frame object

Returns :

the value of frame

schro_frame_unref ()

void                schro_frame_unref                   (SchroFrame *frame);

Decreases the reference count of frame. If the new reference count is 0, the frame is freed. If a frame free callback was set, this function is called.

frame :

a frame object

schro_frame_set_free_callback ()

void                schro_frame_set_free_callback       (SchroFrame *frame,
                                                         SchroFrameFreeFunc free_func,
                                                         void *priv);

Sets a function that will be called when the object reference count drops to zero and the object is freed.

frame :

a frame object

free_func :

the function to call when the frame is freed

priv :

callback key

schro_frame_clone ()

SchroFrame *        schro_frame_clone                   (SchroMemoryDomain *domain,
                                                         SchroFrame *frame);

Creates a new SchroFrame object with the same dimensions and format as frame. This function leaves the data in the new object uninitialized.

Returns :

a new SchroFrame object

schro_frame_data_get_codeblock ()

void                schro_frame_data_get_codeblock      (SchroFrameData *dest,
                                                         SchroFrameData *src,
                                                         int x,
                                                         int y,
                                                         int horiz_codeblocks,
                                                         int vert_codeblocks);


schro_frame_get_metric ()

int                 schro_frame_get_metric              (SchroFrame *frame1,
                                                         int x1,
                                                         int y1,
                                                         SchroFrame *frame2,
                                                         int x2,
                                                         int y2);


schro_frame_get_subdata ()

void                schro_frame_get_subdata             (SchroFrame *frame,
                                                         SchroFrameData *fd,
                                                         int comp,
                                                         int x,
                                                         int y);


schro_frame_inverse_iwt_transform_cuda ()

void                schro_frame_inverse_iwt_transform_cuda
                                                        (SchroFrame *frame,
                                                         SchroFrame *transform_frame,
                                                         SchroParams *params);


schro_frame_new_from_data_UYVY ()

SchroFrame *        schro_frame_new_from_data_UYVY      (void *data,
                                                         int width,
                                                         int height);

Creates a new SchroFrame object with the requested size using the data pointed to by data. The data must be in UYVY format. The data must remain for the lifetime of the SchroFrame object. It is recommended to use schro_frame_set_free_callback() for notification when the data is no longer needed.

Returns :

a new SchroFrame object

schro_frame_new_from_data_YV12 ()

SchroFrame *        schro_frame_new_from_data_YV12      (void *data,
                                                         int width,
                                                         int height);

Creates a new SchroFrame object with the requested size using the data pointed to by data. The data must be in YV12 format. The data must remain for the lifetime of the SchroFrame object. It is recommended to use schro_frame_set_free_callback() for notification when the data is no longer needed.

Returns :

a new SchroFrame object

schro_frame_convert ()

void                schro_frame_convert                 (SchroFrame *dest,
                                                         SchroFrame *src);

Copies data from the source frame to the destination frame, converting formats if necessary. Only a few conversions are supported.

dest :

destination frame

src :

source frame

schro_frame_convert_to_444 ()

SchroFrame *        schro_frame_convert_to_444          (SchroFrame *frame);


schro_frame_add ()

void                schro_frame_add                     (SchroFrame *dest,
                                                         SchroFrame *src);

Adds data from the source frame to the destination frame. The frames must have the same chroma subsampling, and only a few combinations of bit depths are supported.

dest :

destination frame

src :

source frame

schro_frame_subtract ()

void                schro_frame_subtract                (SchroFrame *dest,
                                                         SchroFrame *src);

Subtracts data from the source frame to the destination frame. The frames must have the same chroma subsampling, and only a few combinations of bit depths are supported.

dest :

destination frame

src :

source frame

schro_frame_shift_left ()

void                schro_frame_shift_left              (SchroFrame *frame,
                                                         int shift);

Shifts each value in frame to the left by shift bits. This operation happens in-place.

frame :

frame

shift :

number of bits to shift

schro_frame_shift_right ()

void                schro_frame_shift_right             (SchroFrame *frame,
                                                         int shift);

Shifts each value in frame to the right by shift bits. This operation happens in-place.

frame :

frame

shift :

number of bits to shift

schro_frame_edge_extend ()

void                schro_frame_edge_extend             (SchroFrame *frame,
                                                         int width,
                                                         int height);

Extends the edges of the subpicture defined from 0,0 to width,height to the size of frame.

frame :

frame

width :

width of subpicture

height :

height of subpicture

schro_frame_zero_extend ()

void                schro_frame_zero_extend             (SchroFrame *frame,
                                                         int width,
                                                         int height);


schro_frame_iwt_transform ()

void                schro_frame_iwt_transform           (SchroFrame *frame,
                                                         SchroParams *params);

Performs an in-place integer wavelet transform on frame. The frame must have a bit depth of 16.

frame :

frame

params :

transform parameters

schro_frame_downsample ()

void                schro_frame_downsample              (SchroFrame *dest,
                                                         SchroFrame *src);


schro_frame_mark ()

void                schro_frame_mark                    (SchroFrame *frame,
                                                         int value);


schro_frame_upsample_horiz ()

void                schro_frame_upsample_horiz          (SchroFrame *dest,
                                                         SchroFrame *src);


schro_frame_upsample_vert ()

void                schro_frame_upsample_vert           (SchroFrame *dest,
                                                         SchroFrame *src);


schro_frame_ssim ()

double              schro_frame_ssim                    (SchroFrame *a,
                                                         SchroFrame *b);


schro_frame_mean_squared_error ()

void                schro_frame_mean_squared_error      (SchroFrame *a,
                                                         SchroFrame *b,
                                                         double *mse);


schro_frame_md5 ()

void                schro_frame_md5                     (SchroFrame *frame,
                                                         uint32_t *state);


schro_frame_calculate_average_luma ()

double              schro_frame_calculate_average_luma  (SchroFrame *frame);


schro_upsampled_frame_free ()

void                schro_upsampled_frame_free          (SchroUpsampledFrame *df);


schro_upsampled_frame_new ()

SchroUpsampledFrame * schro_upsampled_frame_new         (SchroFrame *frame);


schro_upsampled_frame_upsample ()

void                schro_upsampled_frame_upsample      (SchroUpsampledFrame *df);


schro_upsampled_frame_get_block_fast_precN ()

void                schro_upsampled_frame_get_block_fast_precN
                                                        (SchroUpsampledFrame *upframe,
                                                         int k,
                                                         int x,
                                                         int y,
                                                         int prec,
                                                         SchroFrameData *dest,
                                                         SchroFrameData *fd);


schro_upsampled_frame_get_block_precN ()

void                schro_upsampled_frame_get_block_precN
                                                        (SchroUpsampledFrame *upframe,
                                                         int k,
                                                         int x,
                                                         int y,
                                                         int prec,
                                                         SchroFrameData *dest);


schro_upsampled_frame_get_pixel_prec0 ()

int                 schro_upsampled_frame_get_pixel_prec0
                                                        (SchroUpsampledFrame *upframe,
                                                         int k,
                                                         int x,
                                                         int y);


schro_upsampled_frame_get_pixel_prec1 ()

int                 schro_upsampled_frame_get_pixel_prec1
                                                        (SchroUpsampledFrame *upframe,
                                                         int k,
                                                         int x,
                                                         int y);


schro_upsampled_frame_get_pixel_prec3 ()

int                 schro_upsampled_frame_get_pixel_prec3
                                                        (SchroUpsampledFrame *upframe,
                                                         int k,
                                                         int x,
                                                         int y);


schro_upsampled_frame_get_pixel_precN ()

int                 schro_upsampled_frame_get_pixel_precN
                                                        (SchroUpsampledFrame *upframe,
                                                         int k,
                                                         int x,
                                                         int y,
                                                         int mv_precision);

schroedinger-1.0.11/doc/html/schroedinger-schromotion.html0000664000175000017500000011755111707140273020622 00000000000000 schromotion

schromotion

schromotion

Synopsis

struct              SchroMotion;
#define             SCHRO_MOTION_GET_BLOCK              (motion,
                                                         x,
                                                         y)
void                schro_motion_dc_prediction          (SchroMotion *motion,
                                                         int x,
                                                         int y,
                                                         int *pred);
void                schro_motion_vector_prediction      (SchroMotion *motion,
                                                         int x,
                                                         int y,
                                                         int *pred_x,
                                                         int *pred_y,
                                                         int mode);
int                 schro_motion_split_prediction       (SchroMotion *motion,
                                                         int x,
                                                         int y);
int                 schro_motion_get_mode_prediction    (SchroMotion *motion,
                                                         int x,
                                                         int y);
int                 schro_motion_block_estimate_entropy (SchroMotion *motion,
                                                         int i,
                                                         int j);
void                schro_motion_copy_from              (SchroMotion *motion,
                                                         int i,
                                                         int j,
                                                         SchroBlock *block);
void                schro_motion_copy_to                (SchroMotion *motion,
                                                         int i,
                                                         int j,
                                                         SchroBlock *block);
int                 schro_motion_estimate_entropy       (SchroMotion *motion);
void                schro_motion_field_lshift           (SchroMotionField *mf,
                                                         int n);
void                schro_motion_free                   (SchroMotion *motion);
int                 schro_motion_get_global_prediction  (SchroMotion *motion,
                                                         int x,
                                                         int y);
SchroMotion *       schro_motion_new                    (SchroParams *params,
                                                         SchroUpsampledFrame *ref1,
                                                         SchroUpsampledFrame *ref2);
void                schro_motion_render                 (SchroMotion *motion,
                                                         SchroFrame *dest,
                                                         SchroFrame *addframe,
                                                         int add,
                                                         SchroFrame *output_frame);
void                schro_motion_render_cuda            (SchroMotion *motion,
                                                         SchroFrame *dest);
void                schro_motion_render_ref             (SchroMotion *motion,
                                                         SchroFrame *dest,
                                                         SchroFrame *addframe,
                                                         int add,
                                                         SchroFrame *output_frame);
int                 schro_motion_superblock_estimate_entropy
                                                        (SchroMotion *motion,
                                                         int i,
                                                         int j);
int                 schro_motion_superblock_try_estimate_entropy
                                                        (SchroMotion *motion,
                                                         int i,
                                                         int j,
                                                         SchroBlock *block);
int                 schro_motion_vector_is_equal        (SchroMotionVector *mv1,
                                                         SchroMotionVector *mv2);
SchroMotionField *  schro_motion_field_new              (int x_num_blocks,
                                                         int y_num_blocks);
void                schro_motion_field_free             (SchroMotionField *field);
void                schro_motion_field_scan             (SchroMotionField *field,
                                                         SchroParams *params,
                                                         SchroFrame *frame,
                                                         SchroFrame *ref,
                                                         int dist);
void                schro_motion_field_inherit          (SchroMotionField *field,
                                                         SchroMotionField *parent);
void                schro_motion_field_copy             (SchroMotionField *field,
                                                         SchroMotionField *parent);
int                 schro_motion_verify                 (SchroMotion *mf);

Description

Details

struct SchroMotion

struct SchroMotion {
  SchroUpsampledFrame *src1;
  SchroUpsampledFrame *src2;
  SchroMotionVector *motion_vectors;
  SchroParams *params;

  uint8_t *tmpdata;

  int ref_weight_precision;
  int ref1_weight;
  int ref2_weight;
  int mv_precision;
  int xoffset;
  int yoffset;
  int xbsep;
  int ybsep;
  int xblen;
  int yblen;

  SchroFrameData block;
  SchroFrameData alloc_block;
  SchroFrameData obmc_weight;

  SchroFrameData alloc_block_ref[2];
  SchroFrameData block_ref[2];

  int weight_x[SCHRO_LIMIT_BLOCK_SIZE];
  int weight_y[SCHRO_LIMIT_BLOCK_SIZE];
  int width;
  int height;
  int max_fast_x;
  int max_fast_y;

  schro_bool simple_weight;
  schro_bool oneref_noscale;
};


SCHRO_MOTION_GET_BLOCK()

#define             SCHRO_MOTION_GET_BLOCK(motion,x,y)


schro_motion_dc_prediction ()

void                schro_motion_dc_prediction          (SchroMotion *motion,
                                                         int x,
                                                         int y,
                                                         int *pred);


schro_motion_vector_prediction ()

void                schro_motion_vector_prediction      (SchroMotion *motion,
                                                         int x,
                                                         int y,
                                                         int *pred_x,
                                                         int *pred_y,
                                                         int mode);


schro_motion_split_prediction ()

int                 schro_motion_split_prediction       (SchroMotion *motion,
                                                         int x,
                                                         int y);


schro_motion_get_mode_prediction ()

int                 schro_motion_get_mode_prediction    (SchroMotion *motion,
                                                         int x,
                                                         int y);


schro_motion_block_estimate_entropy ()

int                 schro_motion_block_estimate_entropy (SchroMotion *motion,
                                                         int i,
                                                         int j);


schro_motion_copy_from ()

void                schro_motion_copy_from              (SchroMotion *motion,
                                                         int i,
                                                         int j,
                                                         SchroBlock *block);


schro_motion_copy_to ()

void                schro_motion_copy_to                (SchroMotion *motion,
                                                         int i,
                                                         int j,
                                                         SchroBlock *block);


schro_motion_estimate_entropy ()

int                 schro_motion_estimate_entropy       (SchroMotion *motion);


schro_motion_field_lshift ()

void                schro_motion_field_lshift           (SchroMotionField *mf,
                                                         int n);


schro_motion_free ()

void                schro_motion_free                   (SchroMotion *motion);


schro_motion_get_global_prediction ()

int                 schro_motion_get_global_prediction  (SchroMotion *motion,
                                                         int x,
                                                         int y);


schro_motion_new ()

SchroMotion *       schro_motion_new                    (SchroParams *params,
                                                         SchroUpsampledFrame *ref1,
                                                         SchroUpsampledFrame *ref2);


schro_motion_render ()

void                schro_motion_render                 (SchroMotion *motion,
                                                         SchroFrame *dest,
                                                         SchroFrame *addframe,
                                                         int add,
                                                         SchroFrame *output_frame);


schro_motion_render_cuda ()

void                schro_motion_render_cuda            (SchroMotion *motion,
                                                         SchroFrame *dest);


schro_motion_render_ref ()

void                schro_motion_render_ref             (SchroMotion *motion,
                                                         SchroFrame *dest,
                                                         SchroFrame *addframe,
                                                         int add,
                                                         SchroFrame *output_frame);


schro_motion_superblock_estimate_entropy ()

int                 schro_motion_superblock_estimate_entropy
                                                        (SchroMotion *motion,
                                                         int i,
                                                         int j);


schro_motion_superblock_try_estimate_entropy ()

int                 schro_motion_superblock_try_estimate_entropy
                                                        (SchroMotion *motion,
                                                         int i,
                                                         int j,
                                                         SchroBlock *block);


schro_motion_vector_is_equal ()

int                 schro_motion_vector_is_equal        (SchroMotionVector *mv1,
                                                         SchroMotionVector *mv2);


schro_motion_field_new ()

SchroMotionField *  schro_motion_field_new              (int x_num_blocks,
                                                         int y_num_blocks);


schro_motion_field_free ()

void                schro_motion_field_free             (SchroMotionField *field);


schro_motion_field_scan ()

void                schro_motion_field_scan             (SchroMotionField *field,
                                                         SchroParams *params,
                                                         SchroFrame *frame,
                                                         SchroFrame *ref,
                                                         int dist);


schro_motion_field_inherit ()

void                schro_motion_field_inherit          (SchroMotionField *field,
                                                         SchroMotionField *parent);


schro_motion_field_copy ()

void                schro_motion_field_copy             (SchroMotionField *field,
                                                         SchroMotionField *parent);


schro_motion_verify ()

int                 schro_motion_verify                 (SchroMotion *mf);

schroedinger-1.0.11/doc/html/index.sgml0000664000175000017500000020355111707140273014705 00000000000000 schroedinger-1.0.11/doc/html/schroedinger-schromotionest.html0000664000175000017500000002201111707140273021320 00000000000000 schromotionest

schromotionest

schromotionest

Description

Details

struct SchroMotionEst

struct SchroMotionEst {
  SchroEncoderFrame *encoder_frame;
  SchroParams *params;

  double lambda;

  SchroFrame *downsampled_src0[SCHRO_MAX_HIER_LEVELS];
  SchroFrame *downsampled_src1[SCHRO_MAX_HIER_LEVELS];

  SchroMotion *motion;

  int scan_distance;

  int badblocks;
  double hier_score;
};


SchroMotionScan

typedef struct _SchroMotionScan SchroMotionScan;


struct SchroBlock

struct SchroBlock {
  int valid;
  int error;
  int entropy;

  double score;

  SchroMotionVector mv[4][4];
};


schro_motionest_free ()

void                schro_motionest_free                (SchroMotionEst *me);


schro_motionest_new ()

SchroMotionEst *    schro_motionest_new                 (SchroEncoderFrame *frame);


schro_motionest_superblock_get_metric ()

int                 schro_motionest_superblock_get_metric
                                                        (SchroMotionEst *me,
                                                         SchroBlock *block,
                                                         int i,
                                                         int j);


schro_block_check ()

int                 schro_block_check                   (SchroBlock *block);


schro_block_fixup ()

void                schro_block_fixup                   (SchroBlock *block);

schroedinger-1.0.11/doc/html/schroedinger-schroasync.html0000664000175000017500000002714611707140273020432 00000000000000 schroasync

schroasync

schroasync

Description

Details

SchroAsync

typedef struct _SchroAsync SchroAsync;


struct SchroAsyncTask

struct SchroAsyncTask {
  SchroAsyncTaskFunc task_func;
  void *priv;
};


SchroAsyncCompleteFunc ()

void                (*SchroAsyncCompleteFunc)           (void *Param1);


SchroAsyncScheduleFunc ()

int                 (*SchroAsyncScheduleFunc)           (void *Param1,
                                                         SchroExecDomain exec_domain);


SchroThread

typedef struct _SchroThread SchroThread;


schro_async_new ()

SchroAsync *        schro_async_new                     (int n_threads,
                                                         SchroAsyncScheduleFunc schedule,
                                                         SchroAsyncCompleteFunc complete,
                                                         void *closure);


schro_async_free ()

void                schro_async_free                    (SchroAsync *async);


schro_async_lock ()

void                schro_async_lock                    (SchroAsync *async);


schro_async_unlock ()

void                schro_async_unlock                  (SchroAsync *async);


schro_async_signal_scheduler ()

void                schro_async_signal_scheduler        (SchroAsync *async);


schro_async_wait_locked ()

int                 schro_async_wait_locked             (SchroAsync *async);


schro_async_get_exec_domain ()

SchroExecDomain     schro_async_get_exec_domain         (void);

schroedinger-1.0.11/doc/html/schroedinger-schrobuffer.html0000664000175000017500000002276611707140273020571 00000000000000 schrobuffer

schrobuffer

schrobuffer

Description

Details

struct SchroBuffer

struct SchroBuffer {
};


schro_buffer_new ()

SchroBuffer *       schro_buffer_new                    (void);


schro_buffer_new_and_alloc ()

SchroBuffer *       schro_buffer_new_and_alloc          (int size);


schro_buffer_new_with_data ()

SchroBuffer *       schro_buffer_new_with_data          (void *data,
                                                         int size);


schro_buffer_new_subbuffer ()

SchroBuffer *       schro_buffer_new_subbuffer          (SchroBuffer *buffer,
                                                         int offset,
                                                         int length);


schro_buffer_ref ()

SchroBuffer *       schro_buffer_ref                    (SchroBuffer *buffer);


schro_buffer_unref ()

void                schro_buffer_unref                  (SchroBuffer *buffer);


schro_buffer_dup ()

SchroBuffer *       schro_buffer_dup                    (SchroBuffer *buffer);

schroedinger-1.0.11/doc/html/schroedinger-schropack.html0000664000175000017500000004312411707140273020225 00000000000000 schropack

schropack

schropack

Synopsis

struct              SchroPack;
SchroPack *         schro_pack_new                      (void);
void                schro_pack_free                     (SchroPack *pack);
void                schro_pack_encode_init              (SchroPack *pack,
                                                         SchroBuffer *buffer);
void                schro_pack_sync                     (SchroPack *pack);
void                schro_pack_append                   (SchroPack *pack,
                                                         const uint8_t *data,
                                                         int len);
void                schro_pack_encode_bit               (SchroPack *pack,
                                                         int value);
void                schro_pack_encode_bits              (SchroPack *pack,
                                                         int n,
                                                         unsigned int value);
void                schro_pack_encode_uint              (SchroPack *pack,
                                                         int value);
void                schro_pack_encode_sint              (SchroPack *pack,
                                                         int value);
void                schro_pack_copy                     (SchroPack *dest,
                                                         SchroPack *src);
int                 schro_pack_estimate_sint            (int value);
int                 schro_pack_estimate_uint            (int value);
void                schro_pack_flush                    (SchroPack *pack);
int                 schro_pack_get_bit_offset           (SchroPack *pack);
int                 schro_pack_get_offset               (SchroPack *pack);
void                schro_pack_append_zero              (SchroPack *pack,
                                                         int len);

Description

Details

struct SchroPack

struct SchroPack {
  SchroBuffer *buffer;

  int n;
  int shift;
  int n_pack;

  uint32_t value;

  int error;
};


schro_pack_new ()

SchroPack *         schro_pack_new                      (void);


schro_pack_free ()

void                schro_pack_free                     (SchroPack *pack);


schro_pack_encode_init ()

void                schro_pack_encode_init              (SchroPack *pack,
                                                         SchroBuffer *buffer);


schro_pack_sync ()

void                schro_pack_sync                     (SchroPack *pack);


schro_pack_append ()

void                schro_pack_append                   (SchroPack *pack,
                                                         const uint8_t *data,
                                                         int len);


schro_pack_encode_bit ()

void                schro_pack_encode_bit               (SchroPack *pack,
                                                         int value);


schro_pack_encode_bits ()

void                schro_pack_encode_bits              (SchroPack *pack,
                                                         int n,
                                                         unsigned int value);


schro_pack_encode_uint ()

void                schro_pack_encode_uint              (SchroPack *pack,
                                                         int value);


schro_pack_encode_sint ()

void                schro_pack_encode_sint              (SchroPack *pack,
                                                         int value);


schro_pack_copy ()

void                schro_pack_copy                     (SchroPack *dest,
                                                         SchroPack *src);


schro_pack_estimate_sint ()

int                 schro_pack_estimate_sint            (int value);


schro_pack_estimate_uint ()

int                 schro_pack_estimate_uint            (int value);


schro_pack_flush ()

void                schro_pack_flush                    (SchroPack *pack);


schro_pack_get_bit_offset ()

int                 schro_pack_get_bit_offset           (SchroPack *pack);


schro_pack_get_offset ()

int                 schro_pack_get_offset               (SchroPack *pack);


schro_pack_append_zero ()

void                schro_pack_append_zero              (SchroPack *pack,
                                                         int len);

schroedinger-1.0.11/doc/html/style.css0000644000175000017500000001210011707140273014546 00000000000000.synopsis, .classsynopsis { /* tango:aluminium 1/2 */ background: #eeeeec; border: solid 1px #d3d7cf; padding: 0.5em; } .programlisting { /* tango:sky blue 0/1 */ background: #e6f3ff; border: solid 1px #729fcf; padding: 0.5em; } .variablelist { padding: 4px; margin-left: 3em; } .variablelist td:first-child { vertical-align: top; } @media screen { sup 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: 3.2em; padding-bottom: 20em; } /* style and size the navigation bar */ table.navigation#top { position: fixed; /* tango:scarlet red 0/1 */ background: #ffe6e6; border: solid 1px #ef2929; margin-top: 0; margin-bottom: 0; top: 0; left: 0; height: 3em; z-index: 10; } .navigation a, .navigation a:visited { /* tango:scarlet red 3 */ color: #a40000; } .navigation a:hover { /* tango:scarlet red 1 */ color: #ef2929; } td.shortcuts { /* tango:scarlet red 1 */ color: #ef2929; font-size: 80%; white-space: nowrap; } } @media print { table.navigation { visibility: collapse; display: none; } div.titlepage table.navigation { visibility: visible; display: table; /* tango:scarlet red 0/1 */ background: #ffe6e6; border: solid 1px #ef2929; margin-top: 0; margin-bottom: 0; top: 0; left: 0; height: 3em; } } .navigation .title { font-size: 200%; } 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.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; } hr { /* tango:aluminium 3 */ color: #babdb6; background: #babdb6; border: none 0px; height: 1px; clear: both; } .footer { padding-top: 3.5em; /* tango:aluminium 3 */ color: #babdb6; text-align: center; font-size: 80%; } .warning { /* tango:orange 0/1 */ background: #ffeed9; border-color: #ffb04f; } .note { /* tango:chameleon 0/0.5 */ background: #d8ffb2; border-color: #abf562; } .note, .warning { padding: 0.5em; border-width: 1px; border-style: solid; } .note h3, .warning h3 { margin-top: 0.0em } .note p, .warning p { margin-bottom: 0.0em } /* blob links */ h2 .extralinks, h3 .extralinks { float: right; /* tango:aluminium 3 */ color: #babdb6; font-size: 80%; font-weight: normal; } .annotation { /* tango:aluminium 5 */ color: #555753; font-size: 80%; font-weight: normal; } /* code listings */ .listing_code .programlisting .cbracket { color: #a40000; } /* tango: scarlet red 3 */ .listing_code .programlisting .comment { color: #a1a39d; } /* tango: aluminium 4 */ .listing_code .programlisting .function { color: #000000; font-weight: bold; } .listing_code .programlisting .function a { color: #11326b; font-weight: bold; } /* tango: sky blue 4 */ .listing_code .programlisting .keyword { color: #4e9a06; } /* tango: chameleon 3 */ .listing_code .programlisting .linenum { color: #babdb6; } /* tango: aluminium 3 */ .listing_code .programlisting .normal { color: #000000; } .listing_code .programlisting .number { color: #75507b; } /* tango: plum 2 */ .listing_code .programlisting .preproc { color: #204a87; } /* tango: sky blue 3 */ .listing_code .programlisting .string { color: #c17d11; } /* tango: chocolate 2 */ .listing_code .programlisting .type { color: #000000; } .listing_code .programlisting .type a { color: #11326b; } /* tango: sky blue 4 */ .listing_code .programlisting .symbol { color: #ce5c00; } /* tango: orange 3 */ .listing_frame { /* tango:sky blue 1 */ border: solid 1px #729fcf; padding: 0px; } .listing_lines, .listing_code { margin-top: 0px; margin-bottom: 0px; padding: 0.5em; } .listing_lines { /* tango:sky blue 0.5 */ background: #a6c5e3; /* tango:aluminium 6 */ color: #2e3436; } .listing_code { /* tango:sky blue 0 */ background: #e6f3ff; } .listing_code .programlisting { /* override from previous */ border: none 0px; padding: 0px; } .listing_lines pre, .listing_code pre { margin: 0px; } schroedinger-1.0.11/doc/html/schroedinger-schro.html0000664000175000017500000000574411707140273017374 00000000000000 schro

schro

schro

Synopsis

void                schro_init                          (void);

Description

Details

schro_init ()

void                schro_init                          (void);

Intializes the Schroedinger library. This function must be called before any other function in the library.

schroedinger-1.0.11/doc/html/schroedinger-schrovideoformat.html0000664000175000017500000005052711707140273021633 00000000000000 schrovideoformat

schrovideoformat

schrovideoformat

Description

Details

schro_video_format_validate ()

int                 schro_video_format_validate         (SchroVideoFormat *format);


schro_video_format_set_std_video_format ()

void                schro_video_format_set_std_video_format
                                                        (SchroVideoFormat *format,
                                                         SchroVideoFormatEnum index);

Initializes the video format structure pointed to by format to the standard Dirac video formats specified by index.


schro_video_format_get_std_video_format ()

SchroVideoFormatEnum schro_video_format_get_std_video_format
                                                        (SchroVideoFormat *format);

In Dirac streams, video formats are encoded by specifying a standard format, and then modifying that to get the desired video format. This function guesses a standard format to use as a starting point for encoding the video format pointed to by format.

format :

pointer to SchroVideoFormat structure

Returns :

an index to the optimal standard format

schro_video_format_set_std_frame_rate ()

void                schro_video_format_set_std_frame_rate
                                                        (SchroVideoFormat *format,
                                                         int index);

Sets the frame rate of the video format structure pointed to by format to the Dirac standard frame specified by index.


schro_video_format_get_std_frame_rate ()

int                 schro_video_format_get_std_frame_rate
                                                        (SchroVideoFormat *format);

In Dirac bitstreams, frame rates can be one of several standard frame rates, encoded as an index, or the numerator and denominator of the framerate can be encoded directly. This function looks up the frame rate contained in the video format structure format in the list of standard frame rates. If the frame rate is a standard frame rate, the corresponding index is returned, otherwise 0 is returned.

Returns :

index to a standard Dirac frame rate, or 0 if the frame rate is custom.

schro_video_format_set_std_aspect_ratio ()

void                schro_video_format_set_std_aspect_ratio
                                                        (SchroVideoFormat *format,
                                                         int index);


schro_video_format_get_std_aspect_ratio ()

int                 schro_video_format_get_std_aspect_ratio
                                                        (SchroVideoFormat *format);


schro_video_format_set_std_signal_range ()

void                schro_video_format_set_std_signal_range
                                                        (SchroVideoFormat *format,
                                                         SchroSignalRange index);

Sets the signal range of the video format structure to one of the standard values indicated by index.


schro_video_format_get_std_signal_range ()

SchroSignalRange    schro_video_format_get_std_signal_range
                                                        (SchroVideoFormat *format);

In Dirac bitstreams, signal ranges can be one of several standard signal ranges, encoded as an index, or the extents of the signal range can be encoded directly. This function looks up the signal range contained in the video format structure format in the list of standard signal ranges. If the signal range is a standard signal range, the corresponding index is returned, otherwise 0 is returned.

format :

pointer to SchroVideoFormat structure

Returns :

index to standard signal range, or 0 if there is no corresponding standard signal range.

schro_video_format_set_std_colour_spec ()

void                schro_video_format_set_std_colour_spec
                                                        (SchroVideoFormat *format,
                                                         SchroColourSpec index);

Sets the colour specification of the video format structure to one of the standard values indicated by index.

format :

pointer to SchroVideoFormat structure

index :

index to standard colour specification

schro_video_format_get_std_colour_spec ()

SchroColourSpec     schro_video_format_get_std_colour_spec
                                                        (SchroVideoFormat *format);

In Dirac bitstreams, colour specifications can be one of several standard colour specifications, encoded as an index, or the individual parts of the colour specication can be encoded. This function looks up the colour specification contained in the video format structure format in the list of standard colour specifications. If the colour specification is a standard colour specification, the corresponding index is returned, otherwise 0 is returned.

format :

pointer to SchroVideoFormat structure

Returns :

index to standard colour specification, or 0 if there is no corresponding standard colour specification.
schroedinger-1.0.11/doc/html/schroedinger-schrounpack.html0000664000175000017500000004042511707140273020571 00000000000000 schrounpack

schrounpack

schrounpack

Synopsis

struct              SchroUnpack;
void                schro_unpack_byte_sync              (SchroUnpack *unpack);
void                schro_unpack_copy                   (SchroUnpack *dest,
                                                         SchroUnpack *src);
unsigned int        schro_unpack_decode_bit             (SchroUnpack *unpack);
unsigned int        schro_unpack_decode_bits            (SchroUnpack *unpack,
                                                         int n);
int                 schro_unpack_decode_sint            (SchroUnpack *unpack);
void                schro_unpack_decode_sint_s16        (int16_t *dest,
                                                         SchroUnpack *unpack,
                                                         int n);
int                 schro_unpack_decode_sint_slow       (SchroUnpack *unpack);
unsigned int        schro_unpack_decode_uint            (SchroUnpack *unpack);
int                 schro_unpack_get_bits_read          (SchroUnpack *unpack);
int                 schro_unpack_get_bits_remaining     (SchroUnpack *unpack);
void                schro_unpack_init_with_data         (SchroUnpack *unpack,
                                                         uint8_t *data,
                                                         int n_bytes,
                                                         unsigned int guard_bit);
void                schro_unpack_limit_bits_remaining   (SchroUnpack *unpack,
                                                         int n_bits);
void                schro_unpack_skip_bits              (SchroUnpack *unpack,
                                                         int n_bits);

Description

Details

struct SchroUnpack

struct SchroUnpack {
  /* pointer to data that haven't been shifted into the shift register */
  uint8_t *data;

  /* number of bits remaining that haven't been shifted into the shift
   * register */
  int n_bits_left;

  /* number of bits read by reader */
  int n_bits_read;

  /* chunk of bits we're currently frobbing, aligned to (1<<31) */
  uint32_t shift_register;
  int n_bits_in_shift_register;

  /* bit pattern used after an error */
  unsigned int guard_bit;

  /* unpacking has overrun the end of the buffer */
  int overrun;
};


schro_unpack_byte_sync ()

void                schro_unpack_byte_sync              (SchroUnpack *unpack);


schro_unpack_copy ()

void                schro_unpack_copy                   (SchroUnpack *dest,
                                                         SchroUnpack *src);


schro_unpack_decode_bit ()

unsigned int        schro_unpack_decode_bit             (SchroUnpack *unpack);


schro_unpack_decode_bits ()

unsigned int        schro_unpack_decode_bits            (SchroUnpack *unpack,
                                                         int n);


schro_unpack_decode_sint ()

int                 schro_unpack_decode_sint            (SchroUnpack *unpack);


schro_unpack_decode_sint_s16 ()

void                schro_unpack_decode_sint_s16        (int16_t *dest,
                                                         SchroUnpack *unpack,
                                                         int n);


schro_unpack_decode_sint_slow ()

int                 schro_unpack_decode_sint_slow       (SchroUnpack *unpack);


schro_unpack_decode_uint ()

unsigned int        schro_unpack_decode_uint            (SchroUnpack *unpack);


schro_unpack_get_bits_read ()

int                 schro_unpack_get_bits_read          (SchroUnpack *unpack);


schro_unpack_get_bits_remaining ()

int                 schro_unpack_get_bits_remaining     (SchroUnpack *unpack);


schro_unpack_init_with_data ()

void                schro_unpack_init_with_data         (SchroUnpack *unpack,
                                                         uint8_t *data,
                                                         int n_bytes,
                                                         unsigned int guard_bit);


schro_unpack_limit_bits_remaining ()

void                schro_unpack_limit_bits_remaining   (SchroUnpack *unpack,
                                                         int n_bits);


schro_unpack_skip_bits ()

void                schro_unpack_skip_bits              (SchroUnpack *unpack,
                                                         int n_bits);

schroedinger-1.0.11/doc/html/schroedinger-schrofft.html0000664000175000017500000002002411707140273020060 00000000000000 schrofft

schrofft

schrofft

Synopsis

void                schro_fft_fwd_f32                   (float *d_real,
                                                         float *d_imag,
                                                         const float *s_real,
                                                         const float *s_imag,
                                                         const float *costable,
                                                         const float *sintable,
                                                         int shift);
void                schro_fft_generate_tables_f32       (float *costable,
                                                         float *sintable,
                                                         int shift);
void                schro_fft_rev_f32                   (float *d_real,
                                                         float *d_imag,
                                                         const float *s_real,
                                                         const float *s_imag,
                                                         const float *costable,
                                                         const float *sintable,
                                                         int shift);

Description

Details

schro_fft_fwd_f32 ()

void                schro_fft_fwd_f32                   (float *d_real,
                                                         float *d_imag,
                                                         const float *s_real,
                                                         const float *s_imag,
                                                         const float *costable,
                                                         const float *sintable,
                                                         int shift);


schro_fft_generate_tables_f32 ()

void                schro_fft_generate_tables_f32       (float *costable,
                                                         float *sintable,
                                                         int shift);


schro_fft_rev_f32 ()

void                schro_fft_rev_f32                   (float *d_real,
                                                         float *d_imag,
                                                         const float *s_real,
                                                         const float *s_imag,
                                                         const float *costable,
                                                         const float *sintable,
                                                         int shift);

schroedinger-1.0.11/doc/html/schroedinger-schrolimits.html0000664000175000017500000001347411707140273020615 00000000000000 schrolimits

schrolimits

schrolimits

Description

Details

SCHRO_LIMIT_WIDTH

#define SCHRO_LIMIT_WIDTH 2048

Maximum picture width.


SCHRO_LIMIT_ENCODER_TRANSFORM_DEPTH

#define SCHRO_LIMIT_ENCODER_TRANSFORM_DEPTH 6

The maximum transform depth that the encoder can handle. Must be less than SCHRO_LIMIT_TRANSFORM_DEPTH.


SCHRO_LIMIT_FRAME_QUEUE_LENGTH

#define SCHRO_LIMIT_FRAME_QUEUE_LENGTH 40

The maximum number of pictures being processed by the encoder.


SCHRO_LIMIT_REFERENCE_FRAMES

#define SCHRO_LIMIT_REFERENCE_FRAMES 8

The maximum number of active reference frames. In the encoder, the number of active reference frames may be much larger than in the resulting stream.


SCHRO_LIMIT_SUBBANDS

#define SCHRO_LIMIT_SUBBANDS (1+3*SCHRO_LIMIT_TRANSFORM_DEPTH)

The maximum number of subbands.


SCHRO_LIMIT_TRANSFORM_DEPTH

#define SCHRO_LIMIT_TRANSFORM_DEPTH 6

The maximum transform depth that the decoder can handle.


SCHRO_LIMIT_BLOCK_SIZE

#define SCHRO_LIMIT_BLOCK_SIZE 64

Maximum block size. Both length and separation must be less than or equal to this limit.


SCHRO_LIMIT_METRIC_SCAN

#define SCHRO_LIMIT_METRIC_SCAN 42

schroedinger-1.0.11/doc/html/schroedinger-schrocuda.html0000664000175000017500000006140211707140273020222 00000000000000 schrocuda

schrocuda

schrocuda

Description

Details

SchroCUDAStream

typedef int SchroCUDAStream;


SchroGPUMotion

typedef struct _SchroGPUMotion SchroGPUMotion;


SCHRO_FRAME_IS_CUDA()

#define SCHRO_FRAME_IS_CUDA(frame) ((frame)->domain && ((frame)->domain->flags & SCHRO_MEMORY_DOMAIN_CUDA))


schro_cuda_init ()

void                schro_cuda_init                     (void);


schro_gpumotion_copy ()

void                schro_gpumotion_copy                (SchroGPUMotion *self,
                                                         SchroMotion *motion);


schro_gpumotion_free ()

void                schro_gpumotion_free                (SchroGPUMotion *rv);


schro_gpumotion_init ()

void                schro_gpumotion_init                (SchroGPUMotion *self,
                                                         SchroMotion *motion);


schro_gpumotion_new ()

SchroGPUMotion *    schro_gpumotion_new                 (SchroCUDAStream stream);


schro_gpumotion_render ()

void                schro_gpumotion_render              (SchroGPUMotion *self,
                                                         SchroMotion *motion,
                                                         SchroFrame *gdest);


schro_frame_to_gpu ()

void                schro_frame_to_gpu                  (SchroFrame *dest,
                                                         SchroFrame *src);


schro_gpuframe_add ()

void                schro_gpuframe_add                  (SchroFrame *dest,
                                                         SchroFrame *src);


schro_gpuframe_compare ()

void                schro_gpuframe_compare              (SchroFrame *a,
                                                         SchroFrame *b);


schro_gpuframe_convert ()

void                schro_gpuframe_convert              (SchroFrame *dest,
                                                         SchroFrame *src);


schro_gpuframe_inverse_iwt_transform ()

void                schro_gpuframe_inverse_iwt_transform
                                                        (SchroFrame *frame,
                                                         SchroParams *params);


schro_gpuframe_iwt_transform ()

void                schro_gpuframe_iwt_transform        (SchroFrame *frame,
                                                         SchroParams *params);


schro_gpuframe_subtract ()

void                schro_gpuframe_subtract             (SchroFrame *dest,
                                                         SchroFrame *src);


schro_gpuframe_to_cpu ()

void                schro_gpuframe_to_cpu               (SchroFrame *dest,
                                                         SchroFrame *src);


schro_gpuframe_upsample ()

void                schro_gpuframe_upsample             (SchroFrame *dst,
                                                         SchroFrame *src);


schro_gpuframe_zero ()

void                schro_gpuframe_zero                 (SchroFrame *dest);


schro_upsampled_gpuframe_free ()

void                schro_upsampled_gpuframe_free       (SchroUpsampledFrame *x);


schro_upsampled_gpuframe_new ()

SchroUpsampledFrame * schro_upsampled_gpuframe_new      (SchroVideoFormat *fmt);


schro_upsampled_gpuframe_upsample ()

void                schro_upsampled_gpuframe_upsample   (SchroUpsampledFrame *rv);

schroedinger-1.0.11/doc/schroedinger-docs.sgml0000644000175000017500000000330511344322440016220 00000000000000 Schroedinger Reference Manual Schroedinger Public API Schroedinger Internal API schroedinger-1.0.11/doc/tmpl/0000775000175000017500000000000011707140273012774 500000000000000schroedinger-1.0.11/doc/tmpl/schrofilter.sgml0000644000175000017500000000262311707140273016125 00000000000000 schrofilter @frame: @frame: @sigma: @frame: @frame: @weight: @frame: @weight: @frame: @tap: @frame: @sigma: @frame: @frame: @d: @s1: @s2: @s3: @n: @d: @s1: @s2: @s3: @n: @weight: @d: @s1: @s2: @s3: @n: @weight: schroedinger-1.0.11/doc/tmpl/schromotion.sgml0000644000175000017500000000641611707140273016151 00000000000000 schromotion @src1: @src2: @motion_vectors: @params: @tmpdata: @ref_weight_precision: @ref1_weight: @ref2_weight: @mv_precision: @xoffset: @yoffset: @xbsep: @ybsep: @xblen: @yblen: @block: @alloc_block: @obmc_weight: @alloc_block_ref: @block_ref: @weight_x: @weight_y: @width: @height: @max_fast_x: @max_fast_y: @simple_weight: @oneref_noscale: @motion: @x: @y: @motion: @x: @y: @pred: @motion: @x: @y: @pred_x: @pred_y: @mode: @motion: @x: @y: @Returns: @motion: @x: @y: @Returns: @motion: @i: @j: @Returns: @motion: @i: @j: @block: @motion: @i: @j: @block: @motion: @Returns: @mf: @n: @motion: @motion: @x: @y: @Returns: @params: @ref1: @ref2: @Returns: @motion: @dest: @addframe: @add: @output_frame: @motion: @dest: @motion: @dest: @addframe: @add: @output_frame: @motion: @i: @j: @Returns: @motion: @i: @j: @block: @Returns: @mv1: @mv2: @Returns: @x_num_blocks: @y_num_blocks: @Returns: @field: @field: @params: @frame: @ref: @dist: @field: @parent: @field: @parent: @mf: @Returns: schroedinger-1.0.11/doc/tmpl/schrogpumotion.sgml0000644000175000017500000000137711707140273016666 00000000000000 schrogpumotion @stream: @Returns: @rv: @self: @motion: @self: @motion: @self: @motion: @gdest: schroedinger-1.0.11/doc/tmpl/schroasync.sgml0000644000175000017500000000245211707140273015755 00000000000000 schroasync @task_func: @priv: @Param1: @Param1: @exec_domain: @Returns: @n_threads: @schedule: @complete: @closure: @Returns: @async: @async: @async: @async: @async: @Returns: @void: @Returns: schroedinger-1.0.11/doc/tmpl/schropredict.sgml0000644000175000017500000000165011707140273016271 00000000000000 schropredict @frame: @x_num_blocks: @y_num_blocks: @Returns: @field: @field: @params: @frame: @ref: @dist: @field: @parent: @field: @parent: @mf: @Returns: schroedinger-1.0.11/doc/tmpl/common.sgml0000644000175000017500000000040311707140273015063 00000000000000 common schroedinger-1.0.11/doc/tmpl/schrounpack.sgml0000644000175000017500000000327711707140273016127 00000000000000 schrounpack @data: @n_bits_left: @n_bits_read: @shift_register: @n_bits_in_shift_register: @guard_bit: @overrun: @unpack: @dest: @src: @unpack: @Returns: @unpack: @n: @Returns: @unpack: @Returns: @dest: @unpack: @n: @unpack: @Returns: @unpack: @Returns: @unpack: @Returns: @unpack: @Returns: @unpack: @data: @n_bytes: @guard_bit: @unpack: @n_bits: @unpack: @n_bits: schroedinger-1.0.11/doc/tmpl/schrotables.sgml0000644000175000017500000000040611707140273016107 00000000000000 schrotables schroedinger-1.0.11/doc/tmpl/schrossim.sgml0000644000175000017500000000053311707140273015611 00000000000000 schrossim @a: @b: @Returns: schroedinger-1.0.11/doc/tmpl/schro.sgml0000644000175000017500000000055111707140273014715 00000000000000 schro @void: schroedinger-1.0.11/doc/tmpl/schrofft.sgml0000644000175000017500000000126011707140273015413 00000000000000 schrofft @d_real: @d_imag: @s_real: @s_imag: @costable: @sintable: @shift: @costable: @sintable: @shift: @d_real: @d_imag: @s_real: @s_imag: @costable: @sintable: @shift: schroedinger-1.0.11/doc/tmpl/schrometric.sgml0000644000175000017500000000366211707140273016127 00000000000000 schrometric @frame: @ref_frame: @block_width: @block_height: @x: @y: @ref_x: @ref_y: @scan_width: @scan_height: @gravity_scale: @gravity_x: @gravity_y: @use_chroma: @metrics: @chroma_metrics: @a: @a_stride: @b: @b_stride: @width: @height: @Returns: @src1: @stride1: @src2: @stride2: @width: @height: @Returns: @data: @stride: @dc_value: @width: @height: @Returns: @data: @stride: @width: @height: @Returns: @data: @stride: @width: @height: @Returns: @src1: @src2: @width: @height: @Returns: @fd: @src1: @weight1: @src2: @weight2: @shift: @width: @height: @Returns: @src: @value: @width: @height: @Returns: @scan: @scan: @dx: @dy: @chroma_metric: @Returns: @scan: @dx: @dy: @dist: @use_chroma: schroedinger-1.0.11/doc/tmpl/wavelets.sgml0000644000175000017500000000102711707140273015430 00000000000000 wavelets @SCHRO_WAVELET_DESLAURIES_DUBUC_9_7: @SCHRO_WAVELET_LE_GALL_5_3: @SCHRO_WAVELET_DESLAURIES_DUBUC_13_7: @SCHRO_WAVELET_HAAR_0: @SCHRO_WAVELET_HAAR_1: @SCHRO_WAVELET_FIDELITY: @SCHRO_WAVELET_DAUBECHIES_9_7: schroedinger-1.0.11/doc/tmpl/schrogpuframe.sgml0000644000175000017500000000263011707140273016444 00000000000000 schrogpuframe @dest: @src: @dest: @src: @dest: @src: @dest: @src: @dest: @src: @frame: @params: @frame: @params: @a: @b: @dst: @src: @fmt: @Returns: @rv: @temp_f: @src: @fmt: @x: @dest: schroedinger-1.0.11/doc/tmpl/cudainit.sgml0000644000175000017500000000040511707140273015375 00000000000000 cudainit schroedinger-1.0.11/doc/tmpl/schrooil.sgml0000644000175000017500000000045011707140273015417 00000000000000 schrooil schroedinger-1.0.11/doc/tmpl/wavelet_common.sgml0000644000175000017500000000041311707140273016613 00000000000000 wavelet_common schroedinger-1.0.11/doc/tmpl/cudaupsample.sgml0000644000175000017500000000041111707140273016255 00000000000000 cudaupsample schroedinger-1.0.11/doc/tmpl/schrodomain.sgml0000644000175000017500000000343611707140273016112 00000000000000 schrodomain @mutex: @flags: @alloc: @alloc_2d: @free: @domain: @size: @Returns: @domain: @depth: @width: @height: @Returns: @domain: @domain: @ptr: @void: @Returns: @void: @Returns: @void: @Returns: schroedinger-1.0.11/doc/tmpl/schroobmc.sgml0000644000175000017500000000137611707140273015564 00000000000000 schroobmc @regions: @region_data: @horiz_ramp: @vert_ramp: @x_ramp: @y_ramp: @x_len: @y_len: @x_sep: @y_sep: @weights: @start_x: @start_y: @end_x: @end_y: @obmc: @x_len: @y_len: @x_sep: @y_sep: @ref1_weight: @ref2_weight: @ref_shift: @obmc: schroedinger-1.0.11/doc/tmpl/motion_kernel_shared.sgml0000644000175000017500000000042111707140273017766 00000000000000 motion_kernel_shared schroedinger-1.0.11/doc/tmpl/upsample_kernel.sgml0000644000175000017500000000041411707140273016763 00000000000000 upsample_kernel schroedinger-1.0.11/doc/tmpl/cudaframe.sgml0000644000175000017500000000040611707140273015525 00000000000000 cudaframe schroedinger-1.0.11/doc/tmpl/schroanalysis.sgml0000644000175000017500000000103011707140273016452 00000000000000 schroanalysis @frame: @frame: @a: @b: @mse: schroedinger-1.0.11/doc/tmpl/schroparams.sgml0000644000175000017500000000455211707140273016126 00000000000000 schroparams @index: @width: @height: @chroma_format: @interlaced: @top_field_first: @frame_rate_numerator: @frame_rate_denominator: @aspect_ratio_numerator: @aspect_ratio_denominator: @clean_width: @clean_height: @left_offset: @top_offset: @luma_offset: @luma_excursion: @chroma_offset: @chroma_excursion: @colour_primaries: @colour_matrix: @transfer_function: @interlaced_coding: @unused0: @unused1: @unused2: @pred_mode: @using_global: @split: @unused: @scan: @metric: @chroma_metric: @x_num_blocks: @y_num_blocks: @motion_vectors: @b0: @b1: @a_exp: @a00: @a01: @a10: @a11: @c_exp: @c0: @c1: @params: @params: @params: @index: @Returns: @params: @params: @Returns: @depth: @chroma_format: @Returns: @params: @video_format: @params: @Returns: @params: @Returns: @params: @params: @Returns: schroedinger-1.0.11/doc/tmpl/schrocuda.sgml0000644000175000017500000000415211707140273015553 00000000000000 schrocuda @frame: @void: @self: @motion: @rv: @self: @motion: @stream: @Returns: @self: @motion: @gdest: @dest: @src: @dest: @src: @a: @b: @dest: @src: @frame: @params: @frame: @params: @dest: @src: @dest: @src: @dst: @src: @dest: @x: @fmt: @Returns: @rv: schroedinger-1.0.11/doc/tmpl/schrovideoformat.sgml0000644000175000017500000000271611707140273017162 00000000000000 schrovideoformat @format: @Returns: @format: @index: @format: @Returns: @format: @index: @format: @Returns: @format: @index: @format: @Returns: @format: @index: @format: @Returns: @format: @index: @format: @Returns: schroedinger-1.0.11/doc/tmpl/arith_coalesce.sgml0000644000175000017500000000041311707140273016541 00000000000000 arith_coalesce schroedinger-1.0.11/doc/tmpl/wavelet.sgml0000644000175000017500000000642611707140273015255 00000000000000 wavelet @ptr: @offset: @hi: @lo: @n: @data: @stride: @width: @height: @tmp: @hi: @lo: @n: @data: @stride: @width: @height: @tmp: @hi: @lo: @n: @data: @stride: @width: @height: @tmp: @hi: @lo: @n: @data: @stride: @width: @height: @tmp: @hi: @lo: @n: @hi: @lo: @n: @data: @stride: @width: @height: @tmp: @hi: @lo: @n: @hi: @lo: @n: @hi: @lo: @n: @hi: @lo: @n: @hi: @lo: @n: @hi: @lo: @n: @data: @stride: @width: @height: @tmp: @data: @stride: @width: @height: @tmp: @data: @stride: @width: @height: @tmp: @data: @stride: @width: @height: @tmp: @data: @stride: @width: @height: @tmp: @data: @stride: @width: @height: @tmp: @data: @stride: @width: @height: @tmp: @data: @stride: @width: @height: @tmp: @data: @stride: @width: @height: @tmp: @data: @stride: @width: @height: @tmp: @data: @stride: @width: @height: @tmp: @fd: @type: @tmp: @fd: @type: @tmp: schroedinger-1.0.11/doc/tmpl/ignore.sgml0000644000175000017500000000000011707140273015047 00000000000000schroedinger-1.0.11/doc/tmpl/convert_base.sgml0000644000175000017500000000041111707140273016244 00000000000000 convert_base schroedinger-1.0.11/doc/tmpl/schroarith.sgml0000664000175000017500000000420111707140273015743 00000000000000 schroarith @buffer: @dataptr: @offset: @range: @code: @range_size: @cntr: @carry: @probabilities: @lut: @contexts: @next: @stat_range: @n_bits: @n_symbols: @ones: @void: @Returns: @arith: @arith: @buffer: @arith: @buffer: @arith: @arith: @context: @Returns: @arith: @arith: @cont_context: @value_context: @sign_context: @Returns: @arith: @cont_context: @value_context: @Returns: @arith: @context: @value: @arith: @cont_context: @value_context: @sign_context: @value: @arith: @cont_context: @value_context: @value: @arith: @arith: @cont_context: @value_context: @sign_context: @value: @arith: @cont_context: @value_context: @value: schroedinger-1.0.11/doc/tmpl/motion_kernel_tex.sgml0000644000175000017500000000041611707140273017324 00000000000000 motion_kernel_tex schroedinger-1.0.11/doc/tmpl/schrolist.sgml0000644000175000017500000000265011707140273015613 00000000000000 schrolist @members: @n: @n_alloc: @free: @priv: @member: @priv: @list: @value: @list: @i: @list: @list: @i: @Returns: @list: @Returns: @list: @i: @value: @void: @Returns: @freefunc: @priv: @Returns: @list: @value: @list: @i: @Returns: @list: @i: @value: @Returns: schroedinger-1.0.11/doc/tmpl/schroframe.sgml0000664000175000017500000001471311707140273015737 00000000000000 schroframe @refcount: @free: @domain: @regions: @priv: @format: @width: @height: @components: @is_virtual: @cached_lines: @virt_frame1: @virt_frame2: @render_line: @virt_priv: @virt_priv2: @extension: @cache_offset: @is_upsampled: @format: @data: @stride: @width: @height: @length: @h_shift: @v_shift: @frame: @priv: @SCHRO_FRAME_FORMAT_U8_444: @SCHRO_FRAME_FORMAT_U8_422: @SCHRO_FRAME_FORMAT_U8_420: @SCHRO_FRAME_FORMAT_S16_444: @SCHRO_FRAME_FORMAT_S16_422: @SCHRO_FRAME_FORMAT_S16_420: @SCHRO_FRAME_FORMAT_S32_444: @SCHRO_FRAME_FORMAT_S32_422: @SCHRO_FRAME_FORMAT_S32_420: @SCHRO_FRAME_FORMAT_YUYV: @SCHRO_FRAME_FORMAT_UYVY: @SCHRO_FRAME_FORMAT_AYUV: @SCHRO_FRAME_FORMAT_ARGB: @SCHRO_FRAME_FORMAT_RGB: @SCHRO_FRAME_FORMAT_v216: @SCHRO_FRAME_FORMAT_v210: @SCHRO_FRAME_FORMAT_AY64: @frames: @format: @format: @format: @format: @fd: @i: @fd: @i: @j: @fd: @i: @j: @void: @Returns: @domain: @format: @width: @height: @Returns: @data: @width: @height: @Returns: @data: @width: @height: @Returns: @data: @width: @height: @Returns: @frame: @Returns: @frame: @Returns: @frame: @frame: @free_func: @priv: @domain: @frame: @Returns: @dest: @src: @x: @y: @horiz_codeblocks: @vert_codeblocks: @frame1: @x1: @y1: @frame2: @x2: @y2: @Returns: @frame: @fd: @comp: @x: @y: @frame: @transform_frame: @params: @data: @width: @height: @Returns: @data: @width: @height: @Returns: @dest: @src: @frame: @Returns: @dest: @src: @dest: @src: @frame: @shift: @frame: @shift: @frame: @width: @height: @frame: @width: @height: @frame: @params: @dest: @src: @frame: @value: @dest: @src: @dest: @src: @a: @b: @Returns: @a: @b: @mse: @frame: @state: @frame: @Returns: @df: @frame: @Returns: @df: @upframe: @k: @x: @y: @prec: @dest: @fd: @upframe: @k: @x: @y: @prec: @dest: @upframe: @k: @x: @y: @Returns: @upframe: @k: @x: @y: @Returns: @upframe: @k: @x: @y: @Returns: @upframe: @k: @x: @y: @mv_precision: @Returns: schroedinger-1.0.11/doc/tmpl/arith.sgml0000644000175000017500000000040211707140273014701 00000000000000 arith schroedinger-1.0.11/doc/tmpl/schrobitstream.sgml0000644000175000017500000001073311707140273016633 00000000000000 schrobitstream @SCHRO_AUX_DATA_INVALID: @SCHRO_AUX_DATA_ENCODER_STRING: @SCHRO_AUX_DATA_SMPTE_12M_TIMECODE: @SCHRO_AUX_DATA_MD5_CHECKSUM: @SCHRO_AUX_DATA_BITRATE: @SCHRO_AUX_DATA_USER: @SCHRO_PARSE_CODE_SEQUENCE_HEADER: @SCHRO_PARSE_CODE_END_OF_SEQUENCE: @SCHRO_PARSE_CODE_AUXILIARY_DATA: @SCHRO_PARSE_CODE_PADDING: @SCHRO_PARSE_CODE_INTRA_REF: @SCHRO_PARSE_CODE_INTRA_NON_REF: @SCHRO_PARSE_CODE_INTRA_REF_NOARITH: @SCHRO_PARSE_CODE_INTRA_NON_REF_NOARITH: @SCHRO_PARSE_CODE_INTER_REF_1: @SCHRO_PARSE_CODE_INTER_REF_1_NOARITH: @SCHRO_PARSE_CODE_INTER_REF_2: @SCHRO_PARSE_CODE_INTER_REF_2_NOARITH: @SCHRO_PARSE_CODE_INTER_NON_REF_1: @SCHRO_PARSE_CODE_INTER_NON_REF_1_NOARITH: @SCHRO_PARSE_CODE_INTER_NON_REF_2: @SCHRO_PARSE_CODE_INTER_NON_REF_2_NOARITH: @SCHRO_PARSE_CODE_LD_INTRA_REF: @SCHRO_PARSE_CODE_LD_INTRA_NON_REF: @SCHRO_VIDEO_FORMAT_CUSTOM: @SCHRO_VIDEO_FORMAT_QSIF: @SCHRO_VIDEO_FORMAT_QCIF: @SCHRO_VIDEO_FORMAT_SIF: @SCHRO_VIDEO_FORMAT_CIF: @SCHRO_VIDEO_FORMAT_4SIF: @SCHRO_VIDEO_FORMAT_4CIF: @SCHRO_VIDEO_FORMAT_SD480I_60: @SCHRO_VIDEO_FORMAT_SD576I_50: @SCHRO_VIDEO_FORMAT_HD720P_60: @SCHRO_VIDEO_FORMAT_HD720P_50: @SCHRO_VIDEO_FORMAT_HD1080I_60: @SCHRO_VIDEO_FORMAT_HD1080I_50: @SCHRO_VIDEO_FORMAT_HD1080P_60: @SCHRO_VIDEO_FORMAT_HD1080P_50: @SCHRO_VIDEO_FORMAT_DC2K_24: @SCHRO_VIDEO_FORMAT_DC4K_24: @SCHRO_VIDEO_FORMAT_UHDTV_4K_60: @SCHRO_VIDEO_FORMAT_UHDTV_4K_50: @SCHRO_VIDEO_FORMAT_UHDTV_8K_60: @SCHRO_VIDEO_FORMAT_UHDTV_8K_50: @SCHRO_CHROMA_444: @SCHRO_CHROMA_422: @SCHRO_CHROMA_420: @SCHRO_COLOUR_MATRIX_HDTV: @SCHRO_COLOUR_MATRIX_SDTV: @SCHRO_COLOUR_MATRIX_REVERSIBLE: @SCHRO_COLOUR_SPEC_CUSTOM: @SCHRO_COLOUR_SPEC_SDTV_525: @SCHRO_COLOUR_SPEC_SDTV_625: @SCHRO_COLOUR_SPEC_HDTV: @SCHRO_COLOUR_SPEC_CINEMA: @SCHRO_COLOUR_PRIMARY_HDTV: @SCHRO_COLOUR_PRIMARY_SDTV_525: @SCHRO_COLOUR_PRIMARY_SDTV_625: @SCHRO_COLOUR_PRIMARY_CINEMA: @SCHRO_WAVELET_DESLAURIERS_DUBUC_9_7: @SCHRO_WAVELET_LE_GALL_5_3: @SCHRO_WAVELET_DESLAURIERS_DUBUC_13_7: @SCHRO_WAVELET_HAAR_0: @SCHRO_WAVELET_HAAR_1: @SCHRO_WAVELET_FIDELITY: @SCHRO_WAVELET_DAUBECHIES_9_7: @SCHRO_SIGNAL_RANGE_CUSTOM: @SCHRO_SIGNAL_RANGE_8BIT_FULL: @SCHRO_SIGNAL_RANGE_8BIT_VIDEO: @SCHRO_SIGNAL_RANGE_10BIT_VIDEO: @SCHRO_SIGNAL_RANGE_12BIT_VIDEO: @SCHRO_TRANSFER_CHAR_TV_GAMMA: @SCHRO_TRANSFER_CHAR_EXTENDED_GAMUT: @SCHRO_TRANSFER_CHAR_LINEAR: @SCHRO_TRANSFER_CHAR_DCI_GAMMA: @is_ref: @n_refs: @is_lowdelay: @is_noarith: @x: @x: @x: @x: @x: @x: @x: @x: @x: @x: @x: @x: @x: schroedinger-1.0.11/doc/tmpl/cudawavelet.sgml0000644000175000017500000000041011707140273016075 00000000000000 cudawavelet schroedinger-1.0.11/doc/tmpl/schrosubband.sgml0000644000175000017500000000143411707140273016255 00000000000000 schrosubband @position: @position: @position: @dest: @frame: @component: @position: @params: @index: @Returns: schroedinger-1.0.11/doc/tmpl/motion_kernel_divb.sgml0000644000175000017500000000041711707140273017451 00000000000000 motion_kernel_divb schroedinger-1.0.11/doc/tmpl/schroengine.sgml0000644000175000017500000000231411707140273016102 00000000000000 schroengine @SCHRO_QUANTISER_ENGINE_SIMPLE: @SCHRO_QUANTISER_ENGINE_RATE_DISTORTION: @SCHRO_QUANTISER_ENGINE_LOSSLESS: @SCHRO_QUANTISER_ENGINE_LOWDELAY: @SCHRO_QUANTISER_ENGINE_RATE_DISTORTION_2: @encoder: @Returns: @encoder: @Returns: @encoder: @Returns: @encoder: @Returns: @encoder: @Returns: @encoder: @Returns: @encoder: @Returns: schroedinger-1.0.11/doc/tmpl/schrophasecorrelation.sgml0000644000175000017500000000055211707140273020201 00000000000000 schrophasecorrelation @me: schroedinger-1.0.11/doc/tmpl/schrobuffer.sgml0000644000175000017500000000176111707140273016113 00000000000000 schrobuffer @void: @Returns: @size: @Returns: @data: @size: @Returns: @buffer: @offset: @length: @Returns: @buffer: @Returns: @buffer: @buffer: @Returns: schroedinger-1.0.11/doc/tmpl/schrohistogram.sgml0000664000175000017500000000327711707140273016645 00000000000000 schrohistogram @table: @int value, void *priv: @int value, void *priv: @int value, void *priv: @int value, void *priv: @int value, void *priv: @int value, void *priv: @int value, void *priv: @int value, void *priv: @int value, void *priv: @int value, void *priv: @int value, void *priv: @int value, void *priv: @int value, void *priv: @int value, void *priv: @int value, void *priv: @int value, void *priv: @int value, void *priv: @int value, void *priv: @int value, void *priv: @int value, void *priv: @int value, void *priv: @int value, void *priv: @int value, void *priv: @int value, void *priv: @int value, void *priv: @int value, void *priv: @int value, void *priv: @int value, void *priv: @int value, void *priv: @int value, void *priv: @int value, void *priv: @int value, void *priv: @int value, void *priv: @int value, void *priv: @int value, void *priv: @int value, void *priv: @int value, void *priv: @int value, void *priv: @int value, void *priv: @int value, void *priv: @int value, void *priv: @int value, void *priv: @int value, void *priv: @int value, void *priv: @int value, void *priv: @int value, void *priv: @int value, void *priv: @int value, void *priv: @int value, void *priv: @int value, void *priv: @int value, void *priv: @int value, void *priv: @int value, void *priv: @int value, void *priv: @int value, void *priv: @func: @priv: schroedinger-1.0.11/doc/tmpl/cudamotion.sgml0000644000175000017500000000040711707140273015741 00000000000000 cudamotion schroedinger-1.0.11/doc/tmpl/schroedinger-0.9-unused.sgml0000644000175000017500000007737011707140273020075 00000000000000 arith arith_coalesce common convert_base convert_base_coalesce convert_packed cudaframe cudainit cudamotion cudaupsample cudawavelet motion_kernel_divb motion_kernel_shared motion_kernel_tex schroanalysis schrocog schrocuda schrodomain schroengine schrogpuframe schrogpumotion schromotionest schrophasecorrelation schrossim schrotables schrovideoformat upsample_kernel wavelet wavelet_common wavelets @x: @y: @a: @b: @x: @y: @x: @fd: @i: @j: @fd: @i: @j: @frame: @maj: @min: @motion: @x: @y: @motion: @x: @y: @x: @x: @x: @x: @x: @x: @Param1: @Param1: @exec_domain: @Returns: @valid: @error: @entropy: @score: @mv: @SCHRO_COLOUR_SPEC_CUSTOM: @SCHRO_COLOUR_SPEC_SDTV_525: @SCHRO_COLOUR_SPEC_SDTV_625: @SCHRO_COLOUR_SPEC_HDTV: @SCHRO_COLOUR_SPEC_CINEMA: @SCHRO_ENCODER_GOP_ADAPTIVE: @SCHRO_ENCODER_GOP_INTRA_ONLY: @SCHRO_ENCODER_GOP_BACKREF: @SCHRO_ENCODER_GOP_CHAINED_BACKREF: @SCHRO_ENCODER_GOP_BIREF: @SCHRO_ENCODER_GOP_CHAINED_BIREF: @SCHRO_ENCODER_RATE_CONTROL_CONSTANT_NOISE_THRESHOLD: @SCHRO_ENCODER_RATE_CONTROL_CONSTANT_BITRATE: @SCHRO_ENCODER_RATE_CONTROL_LOW_DELAY: @SCHRO_ENCODER_RATE_CONTROL_LOSSLESS: @name: @type: @min: @max: @default_value: @enum_list: @SCHRO_ENCODER_SETTING_TYPE_BOOLEAN: @SCHRO_ENCODER_SETTING_TYPE_INT: @SCHRO_ENCODER_SETTING_TYPE_ENUM: @SCHRO_ENCODER_SETTING_TYPE_DOUBLE: @SCHRO_ENCODER_SETTING_TYPE_LAST: @encoder: @Returns: @mutex: @mutex: @flags: @alloc: @alloc_2d: @free: @frame: @ref_frame: @block_width: @block_height: @x: @y: @ref_x: @ref_y: @scan_width: @scan_height: @gravity_scale: @gravity_x: @gravity_y: @metrics: @encoder_frame: @params: @lambda: @src0: @downsampled_src0: @src1: @downsampled_src1: @motion: @sblocks: @downsampled_mf: @refcount: @decoder: @state: @needed_state: @working: @busy: @skip: @error: @input_buffer: @params: @picture_number: @reference1: @reference2: @retired_picture_number: @ref0: @ref1: @planar_output_frame: @is_ref: @tmpbuf: @zero_residual: @transform_frame: @frame: @mc_tmp_frame: @motion: @output_picture: @upsampled_frame: @subband_length: @subband_quant_index: @subband_buffer: @subband_data: @motion_buffers: @lowdelay_buffer: @has_md5: @md5_checksum: @vectors: @pred_mode: @using_global: @split: @common: @dc: @dx: @dy: @metric: @cost: @SCHRO_SIGNAL_RANGE_CUSTOM: @SCHRO_SIGNAL_RANGE_8BIT_FULL: @SCHRO_SIGNAL_RANGE_8BIT_VIDEO: @SCHRO_SIGNAL_RANGE_10BIT_VIDEO: @SCHRO_SIGNAL_RANGE_12BIT_VIDEO: @SCHRO_TRANSFER_CHAR_TV_GAMMA: @SCHRO_TRANSFER_CHAR_EXTENDED_GAMUT: @SCHRO_TRANSFER_CHAR_LINEAR: @SCHRO_TRANSFER_CHAR_DCI_GAMMA: @d1: @s1: @s2_2: @n: @dest: @src: @n: @dest: @src: @n: @d: @s: @i1: @i2: @i3: @s2_4: @n: @d: @s: @i1: @i2: @i3: @s2_4: @n: @d: @s: @i_3: @s2_4: @n: @d: @s: @i_3: @s2_4: @n: @d: @s: @i_3: @s2_4: @n: @d: @s: @i_3: @s2_4: @n: @d: @s1_np3: @s2_4: @s3_2: @n: @dest: @src: @taps: @offsetshift: @n: @d: @s1_np3: @s2_4: @s3_2: @n: @d: @s1_np3: @s2_4: @s3_2: @n: @d: @s1_a8: @s2_8: @s3_2: @n: @d: @s1_np3: @s2_4: @s3_2: @n: @async: @Returns: @async: @min_waiting: @block: @Returns: @block: @a: @b: @Returns: @buffer: @Returns: @d: @s: @taps: @offset: @shift: @index_offset: @n: @d: @s: @taps: @offset: @shift: @index_offset: @n: @a: @b: @Returns: @decoder: @buffer: @decoder: @picture: @decoder: @picture: @arith: @unpack: @i: @j: @picture: @picture: @picture: @arith: @unpack: @motion_vectors: @x: @y: @picture: @decoder: @Returns: @picture: @buffer: @Returns: @buffer: @Returns: @decoder: @Returns: @decoder: @component: @decoder: @picture: @picture: @picture: @picture: @picture: @picture: @picture: @decoder: @Returns: @decoder: @Returns: @decoder: @Returns: @picture: @picture: @picture: @picture: @picture: @picture: @picture: @dest: @src: @quant_factor: @quant_offset: @n: @encoder: @Returns: @Returns: @i: @Returns: @me: @frame: @encoder: @me: @frame: @encoder: @name: @Returns: @encoder: @name: @d: @domain: @frame: @Returns: @dest: @src: @x: @y: @horiz_codeblocks: @vert_codeblocks: @frame1: @x1: @y1: @frame2: @x2: @y2: @Returns: @frame: @fd: @comp: @x: @y: @frame: @transform_frame: @params: @data: @width: @height: @Returns: @data: @width: @height: @Returns: @dest: @src: @ptr: @dest: @src: @a: @b: @dest: @src: @frame: @params: @frame: @params: @dest: @src: @dest: @src: @dst: @src: @dest: @self: @motion: @rv: @self: @motion: @stream: @Returns: @self: @motion: @gdest: @size: @Returns: @size: @Returns: @domain: @size: @Returns: @domain: @depth: @width: @height: @Returns: @domain: @domain: @ptr: @Returns: @Returns: @Returns: @src1: @src2: @width: @height: @Returns: @fd: @src1: @weight1: @src2: @weight2: @shift: @width: @height: @Returns: @src: @value: @width: @height: @Returns: @scan: @scan: @dx: @dy: @Returns: @scan: @dx: @dy: @dist: @motion: @i: @j: @Returns: @motion: @i: @j: @block: @motion: @i: @j: @block: @motion: @Returns: @mf: @gm: @mv_precision: @mf: @gm: @mv_precision: @mf: @n: @motion: @motion: @x: @y: @Returns: @params: @ref1: @ref2: @Returns: @motion: @dest: @motion: @dest: @motion: @dest: @motion: @i: @j: @Returns: @motion: @i: @j: @block: @Returns: @mv1: @mv2: @Returns: @me: @frame: @Returns: @me: @block: @i: @j: @Returns: @pack: @len: @params: @Returns: @params: @Returns: @params: @params: @Returns: @decoder: @Returns: @picture: @Returns: @picture: @pred: @pred: @vec: @list: @frame: @ref: @refnum: @x: @y: @dx: @dy: @dist: @dest: @src: @quant_factor: @quant_offset: @n: @ptr: @size: @Returns: @upframe: @k: @x: @y: @prec: @fd: @upframe: @k: @x: @y: @prec: @fd: @upframe: @k: @x: @y: @Returns: @upframe: @k: @x: @y: @Returns: @upframe: @k: @x: @y: @Returns: @upframe: @k: @x: @y: @mv_precision: @Returns: @x: @fmt: @Returns: @rv: @temp_f: @src: @fmt: @Returns: schroedinger-1.0.11/doc/tmpl/schropack.sgml0000644000175000017500000000337311707140273015561 00000000000000 schropack @buffer: @n: @shift: @n_pack: @value: @error: @void: @Returns: @pack: @pack: @buffer: @pack: @pack: @data: @len: @pack: @value: @pack: @n: @value: @pack: @value: @pack: @value: @dest: @src: @value: @Returns: @value: @Returns: @pack: @pack: @Returns: @pack: @Returns: @pack: @len: schroedinger-1.0.11/doc/tmpl/schrodebug.sgml0000664000175000017500000000227711707140273015735 00000000000000 schrodebug @...: @...: @...: @...: @...: @level: @...: @test: @test: @level: @file: @function: @line: @format: @...: @level: @void: @Returns: @type: @format: @...: schroedinger-1.0.11/doc/tmpl/convert_base_coalesce.sgml0000644000175000017500000000042211707140273020104 00000000000000 convert_base_coalesce schroedinger-1.0.11/doc/tmpl/schroedinger-1.0-unused.sgml0000644000175000017500000007755611707140273020073 00000000000000 arith arith_coalesce common convert_base convert_base_coalesce convert_packed cudaframe cudainit cudamotion cudaupsample cudawavelet motion_kernel_divb motion_kernel_shared motion_kernel_tex schroanalysis schrocog schrocuda schrodomain schroengine schrogpuframe schrogpumotion schromotionest schrophasecorrelation schrossim schrotables schrovideoformat upsample_kernel wavelet wavelet_common wavelets @x: @y: @a: @b: @x: @y: @x: @fd: @i: @j: @fd: @i: @j: @frame: @maj: @min: @motion: @x: @y: @motion: @x: @y: @x: @x: @x: @x: @x: @x: @Param1: @Param1: @exec_domain: @Returns: @valid: @error: @entropy: @score: @mv: @SCHRO_COLOUR_SPEC_CUSTOM: @SCHRO_COLOUR_SPEC_SDTV_525: @SCHRO_COLOUR_SPEC_SDTV_625: @SCHRO_COLOUR_SPEC_HDTV: @SCHRO_COLOUR_SPEC_CINEMA: @SCHRO_ENCODER_GOP_ADAPTIVE: @SCHRO_ENCODER_GOP_INTRA_ONLY: @SCHRO_ENCODER_GOP_BACKREF: @SCHRO_ENCODER_GOP_CHAINED_BACKREF: @SCHRO_ENCODER_GOP_BIREF: @SCHRO_ENCODER_GOP_CHAINED_BIREF: @SCHRO_ENCODER_RATE_CONTROL_CONSTANT_NOISE_THRESHOLD: @SCHRO_ENCODER_RATE_CONTROL_CONSTANT_BITRATE: @SCHRO_ENCODER_RATE_CONTROL_LOW_DELAY: @SCHRO_ENCODER_RATE_CONTROL_LOSSLESS: @SCHRO_ENCODER_RATE_CONTROL_CONSTANT_LAMBDA: @SCHRO_ENCODER_RATE_CONTROL_CONSTANT_ERROR: @name: @type: @min: @max: @default_value: @enum_list: @SCHRO_ENCODER_SETTING_TYPE_BOOLEAN: @SCHRO_ENCODER_SETTING_TYPE_INT: @SCHRO_ENCODER_SETTING_TYPE_ENUM: @SCHRO_ENCODER_SETTING_TYPE_DOUBLE: @SCHRO_ENCODER_SETTING_TYPE_LAST: @encoder: @Returns: @mutex: @mutex: @flags: @alloc: @alloc_2d: @free: @frame: @ref_frame: @block_width: @block_height: @x: @y: @ref_x: @ref_y: @scan_width: @scan_height: @gravity_scale: @gravity_x: @gravity_y: @metrics: @encoder_frame: @params: @lambda: @src0: @downsampled_src0: @src1: @downsampled_src1: @motion: @sblocks: @downsampled_mf: @badblocks: @hier_score: @refcount: @decoder: @state: @needed_state: @working: @busy: @skip: @error: @input_buffer: @params: @picture_number: @reference1: @reference2: @retired_picture_number: @ref0: @ref1: @planar_output_frame: @is_ref: @tmpbuf: @zero_residual: @transform_frame: @frame: @mc_tmp_frame: @motion: @output_picture: @upsampled_frame: @subband_length: @subband_quant_index: @subband_buffer: @subband_data: @motion_buffers: @lowdelay_buffer: @has_md5: @md5_checksum: @vectors: @pred_mode: @using_global: @split: @common: @dc: @dx: @dy: @metric: @cost: @SCHRO_SIGNAL_RANGE_CUSTOM: @SCHRO_SIGNAL_RANGE_8BIT_FULL: @SCHRO_SIGNAL_RANGE_8BIT_VIDEO: @SCHRO_SIGNAL_RANGE_10BIT_VIDEO: @SCHRO_SIGNAL_RANGE_12BIT_VIDEO: @SCHRO_TRANSFER_CHAR_TV_GAMMA: @SCHRO_TRANSFER_CHAR_EXTENDED_GAMUT: @SCHRO_TRANSFER_CHAR_LINEAR: @SCHRO_TRANSFER_CHAR_DCI_GAMMA: @d1: @s1: @s2_2: @n: @dest: @src: @n: @dest: @src: @n: @d: @s: @i1: @i2: @i3: @s2_4: @n: @d: @s: @i1: @i2: @i3: @s2_4: @n: @d: @s: @i_3: @s2_4: @n: @d: @s: @i_3: @s2_4: @n: @d: @s: @i_3: @s2_4: @n: @d: @s: @i_3: @s2_4: @n: @d: @s1_np3: @s2_4: @s3_2: @n: @dest: @src: @taps: @offsetshift: @n: @d: @s1_np3: @s2_4: @s3_2: @n: @d: @s1_np3: @s2_4: @s3_2: @n: @d: @s1_a8: @s2_8: @s3_2: @n: @d: @s1_np3: @s2_4: @s3_2: @n: @async: @Returns: @async: @min_waiting: @block: @Returns: @block: @a: @b: @Returns: @buffer: @Returns: @d: @s: @taps: @offset: @shift: @index_offset: @n: @d: @s: @taps: @offset: @shift: @index_offset: @n: @a: @b: @Returns: @decoder: @buffer: @decoder: @picture: @decoder: @picture: @arith: @unpack: @i: @j: @picture: @picture: @picture: @arith: @unpack: @motion_vectors: @x: @y: @picture: @decoder: @Returns: @picture: @buffer: @Returns: @buffer: @Returns: @decoder: @Returns: @decoder: @component: @decoder: @picture: @picture: @picture: @picture: @picture: @picture: @picture: @decoder: @Returns: @decoder: @Returns: @decoder: @Returns: @picture: @picture: @picture: @picture: @picture: @picture: @picture: @dest: @src: @quant_factor: @quant_offset: @n: @encoder: @Returns: @Returns: @i: @Returns: @me: @frame: @encoder: @me: @frame: @encoder: @name: @Returns: @encoder: @name: @d: @domain: @frame: @Returns: @dest: @src: @x: @y: @horiz_codeblocks: @vert_codeblocks: @frame1: @x1: @y1: @frame2: @x2: @y2: @Returns: @frame: @fd: @comp: @x: @y: @frame: @transform_frame: @params: @data: @width: @height: @Returns: @data: @width: @height: @Returns: @dest: @src: @ptr: @dest: @src: @a: @b: @dest: @src: @frame: @params: @frame: @params: @dest: @src: @dest: @src: @dst: @src: @dest: @self: @motion: @rv: @self: @motion: @stream: @Returns: @self: @motion: @gdest: @size: @Returns: @size: @Returns: @domain: @size: @Returns: @domain: @depth: @width: @height: @Returns: @domain: @domain: @ptr: @Returns: @Returns: @Returns: @src1: @src2: @width: @height: @Returns: @fd: @src1: @weight1: @src2: @weight2: @shift: @width: @height: @Returns: @src: @value: @width: @height: @Returns: @scan: @scan: @dx: @dy: @Returns: @scan: @dx: @dy: @dist: @motion: @i: @j: @Returns: @motion: @i: @j: @block: @motion: @i: @j: @block: @motion: @Returns: @mf: @gm: @mv_precision: @mf: @gm: @mv_precision: @mf: @n: @motion: @motion: @x: @y: @Returns: @params: @ref1: @ref2: @Returns: @motion: @dest: @motion: @dest: @motion: @dest: @motion: @i: @j: @Returns: @motion: @i: @j: @block: @Returns: @mv1: @mv2: @Returns: @me: @frame: @Returns: @me: @block: @i: @j: @Returns: @pack: @len: @params: @Returns: @params: @Returns: @params: @params: @Returns: @decoder: @Returns: @picture: @Returns: @picture: @pred: @pred: @vec: @list: @frame: @ref: @refnum: @x: @y: @dx: @dy: @dist: @dest: @src: @quant_factor: @quant_offset: @n: @ptr: @size: @Returns: @upframe: @k: @x: @y: @prec: @fd: @upframe: @k: @x: @y: @prec: @fd: @upframe: @k: @x: @y: @Returns: @upframe: @k: @x: @y: @Returns: @upframe: @k: @x: @y: @Returns: @upframe: @k: @x: @y: @mv_precision: @Returns: @x: @fmt: @Returns: @rv: @temp_f: @src: @fmt: @Returns: schroedinger-1.0.11/doc/tmpl/schrolimits.sgml0000644000175000017500000000155511707140273016144 00000000000000 schrolimits schroedinger-1.0.11/doc/tmpl/convert_packed.sgml0000644000175000017500000000041311707140273016563 00000000000000 convert_packed schroedinger-1.0.11/doc/tmpl/schromotionest.sgml0000644000175000017500000000212411707140273016655 00000000000000 schromotionest @encoder_frame: @params: @lambda: @downsampled_src0: @downsampled_src1: @motion: @scan_distance: @badblocks: @hier_score: @valid: @error: @entropy: @score: @mv: @me: @frame: @Returns: @me: @block: @i: @j: @Returns: @block: @Returns: @block: schroedinger-1.0.11/doc/tmpl/schroutils.sgml0000644000175000017500000000543111707140273016000 00000000000000 schroutils @ptr: @offset: @type: @ptr: @offset: @x: @a: @b: @a: @b: @x: @a: @b: @a: @b: @x: @y: @x: @y: @x: @x: @x: @x: @x: @y: @x: @y: @a: @b: @a: @b: @a: @total: @Returns: @x: @Returns: @x: @Returns: @n: @d: @q: @quant_factor: @quant_offset: @Returns: @value: @quant_factor: @quant_offset: @Returns: @dest: @src: @quant_factor: @quant_offset: @n: @dest: @src: @quant_factor: @quant_offset: @n: @size: @Returns: @size: @Returns: @ptr: @size: @Returns: @ptr: @void: @Returns: @a: @b: @c: @Returns: schroedinger-1.0.11/doc/tmpl/schrowavelet.sgml0000664000175000017500000000110411707140273016302 00000000000000 schrowavelet @fd: @type: @tmp: @fd_dest: @fd_src: @type: @tmp: schroedinger-1.0.11/doc/tmpl/schroqueue.sgml0000644000175000017500000000302711707140273015763 00000000000000 schroqueue @size: @n: @elements: @free: @data: @picture_number: @data: @number: @queue: @element: @picture_number: @queue: @queue: @picture_number: @queue: @picture_number: @Returns: @queue: @queue: @Returns: @queue: @Returns: @size: @func: @Returns: @queue: @queue: @Returns: @queue: @picture_number: @Returns: schroedinger-1.0.11/doc/tmpl/schroencoder.sgml0000664000175000017500000002056111707140273016262 00000000000000 schroencoder @SCHRO_ENCODER_FRAME_STAGE_NEW: @SCHRO_ENCODER_FRAME_STAGE_ANALYSE: @SCHRO_ENCODER_FRAME_STAGE_SC_DETECT_1: @SCHRO_ENCODER_FRAME_STAGE_SC_DETECT_2: @SCHRO_ENCODER_FRAME_STAGE_HAVE_GOP: @SCHRO_ENCODER_FRAME_STAGE_HAVE_PARAMS: @SCHRO_ENCODER_FRAME_STAGE_PREDICT_ROUGH: @SCHRO_ENCODER_FRAME_STAGE_PREDICT_PEL: @SCHRO_ENCODER_FRAME_STAGE_PREDICT_SUBPEL: @SCHRO_ENCODER_FRAME_STAGE_MODE_DECISION: @SCHRO_ENCODER_FRAME_STAGE_HAVE_REFS: @SCHRO_ENCODER_FRAME_STAGE_HAVE_QUANTS: @SCHRO_ENCODER_FRAME_STAGE_ENCODING: @SCHRO_ENCODER_FRAME_STAGE_RECONSTRUCT: @SCHRO_ENCODER_FRAME_STAGE_POSTANALYSE: @SCHRO_ENCODER_FRAME_STAGE_DONE: @SCHRO_ENCODER_FRAME_STAGE_FREE: @SCHRO_ENCODER_FRAME_STAGE_LAST: @SCHRO_ENCODER_PERCEPTUAL_CONSTANT: @SCHRO_ENCODER_PERCEPTUAL_CCIR959: @SCHRO_ENCODER_PERCEPTUAL_MOO: @SCHRO_ENCODER_PERCEPTUAL_MANOS_SAKRISON: @SCHRO_QUANTISER_ENGINE_SIMPLE: @SCHRO_QUANTISER_ENGINE_RDO_BIT_ALLOCATION: @SCHRO_QUANTISER_ENGINE_CBR: @SCHRO_QUANTISER_ENGINE_LOSSLESS: @SCHRO_QUANTISER_ENGINE_LOWDELAY: @SCHRO_QUANTISER_ENGINE_RDO_LAMBDA: @SCHRO_QUANTISER_ENGINE_CONSTANT_ERROR: @SCHRO_STATE_NEED_FRAME: @SCHRO_STATE_HAVE_BUFFER: @SCHRO_STATE_AGAIN: @SCHRO_STATE_END_OF_STREAM: @SCHRO_ENCODER_GOP_ADAPTIVE: @SCHRO_ENCODER_GOP_INTRA_ONLY: @SCHRO_ENCODER_GOP_BACKREF: @SCHRO_ENCODER_GOP_CHAINED_BACKREF: @SCHRO_ENCODER_GOP_BIREF: @SCHRO_ENCODER_GOP_CHAINED_BIREF: @SCHRO_ENCODER_RATE_CONTROL_CONSTANT_NOISE_THRESHOLD: @SCHRO_ENCODER_RATE_CONTROL_CONSTANT_BITRATE: @SCHRO_ENCODER_RATE_CONTROL_LOW_DELAY: @SCHRO_ENCODER_RATE_CONTROL_LOSSLESS: @SCHRO_ENCODER_RATE_CONTROL_CONSTANT_LAMBDA: @SCHRO_ENCODER_RATE_CONTROL_CONSTANT_ERROR: @SCHRO_ENCODER_RATE_CONTROL_CONSTANT_QUALITY: @name: @type: @min: @max: @default_value: @enum_list: @SCHRO_ENCODER_SETTING_TYPE_BOOLEAN: @SCHRO_ENCODER_SETTING_TYPE_INT: @SCHRO_ENCODER_SETTING_TYPE_ENUM: @SCHRO_ENCODER_SETTING_TYPE_DOUBLE: @SCHRO_ENCODER_SETTING_TYPE_LAST: @encoder: @Returns: @void: @Returns: @encoder: @encoder: @Returns: @encoder: @video_format: @encoder: @encoder: @frame: @bits: @parse_code: @encoder: @n_decodable_frames: @Returns: @stage: @encoder: @perceptual_weight: @frame: @frame: @frame: @encoder: @id: @data: @size: @Returns: @encoder: @Returns: @frame: @stage: @frame: @frame: @component: @index: @frame: @component: @index: @encoder: @Returns: @encoder: @Returns: @encoder: @Returns: @encoder: @Returns: @encoder: @Returns: @encoder: @Returns: @frame: @frame: @frame: @frame: @buffer: @encoder: @Returns: @encoder: @frame_number: @Returns: @encoder: @frame_number: @frame: @frame: @frame: @encoder: @buffer: @encoder: @buffer: @slot: @presentation_frame: @cpd: @Returns: @cpd: @Returns: @cpd: @Returns: @stage: @encoder: @Returns: @encoder: @stage: @encoder: @frame_number: @Returns: @encoder: @encoder: @encoder: @Returns: @void: @Returns: @i: @Returns: @frame: @encoder: @pc: @encoder: @name: @Returns: @encoder: @name: @d: schroedinger-1.0.11/doc/tmpl/schroedinger-unused.sgml0000664000175000017500000005547311707140273017573 00000000000000 arith arith_coalesce common convert_base convert_base_coalesce convert_packed cudaframe cudainit cudamotion cudaupsample cudawavelet motion_kernel_divb motion_kernel_shared motion_kernel_tex schroanalysis schrocog schroengine schrogpuframe schrogpumotion schroobmc schrophasecorrelation schropredict schrossim schrotables upsample_kernel wavelet wavelet_common wavelets @maj: @min: @motion: @x: @y: @transform_depth: @wavelet_filter_index: @profile: @level: @xbsep_luma: @ybsep_luma: @xblen_luma: @yblen_luma: @regions: @region_data: @horiz_ramp: @vert_ramp: @x_ramp: @y_ramp: @x_len: @y_len: @x_sep: @y_sep: @weights: @start_x: @start_y: @end_x: @end_y: @vectors: @pred_mode: @using_global: @split: @common: @dc: @dx: @dy: @metric: @cost: @SCHRO_PREF_ENGINE: @SCHRO_PREF_QUANT_ENGINE: @SCHRO_PREF_REF_DISTANCE: @SCHRO_PREF_TRANSFORM_DEPTH: @SCHRO_PREF_INTRA_WAVELET: @SCHRO_PREF_INTER_WAVELET: @SCHRO_PREF_LAMBDA: @SCHRO_PREF_PSNR: @SCHRO_PREF_BITRATE: @SCHRO_PREF_NOARITH: @SCHRO_PREF_MD5: @SCHRO_PREF_LAST: @d1: @s1: @s2_2: @n: @dest: @src: @n: @dest: @src: @n: @d: @s: @i1: @i2: @i3: @s2_4: @n: @d: @s: @i1: @i2: @i3: @s2_4: @n: @d: @s: @i_3: @s2_4: @n: @d: @s: @i_3: @s2_4: @n: @d: @s: @i_3: @s2_4: @n: @d: @s: @i_3: @s2_4: @n: @i1: @i2: @n: @i1: @i2: @n: @d: @s1_a10: @s2_10: @s3_2: @n: @d: @s1_np3: @s2_4: @s3_2: @n: @dest: @src: @taps: @offsetshift: @n: @d: @s1_np3: @s2_4: @s3_2: @n: @d: @s1_np3: @s2_4: @s3_2: @n: @d: @s1_a8: @s2_8: @s3_2: @n: @d: @s1_np3: @s2_4: @s3_2: @n: @d: @s: @sstr: @s2_8: @s3_1: @s4_1: @n: @dest: @src: @n: @d: @s: @n: @d_1: @src: @n: @d_1: @src: @n: @d_1: @s1: @s2: @n: @d: @s: @n: @arith: @i: @value: @async: @async: @Returns: @async: @Returns: @async: @Returns: @async: @func: @ptr: @async: @min_waiting: @async: @a: @b: @Returns: @d: @s: @taps: @offset: @shift: @index_offset: @n: @d: @s: @taps: @offset: @shift: @index_offset: @n: @a: @b: @Returns: @decoder: @buffer: @decoder: @decoder: @picture: @picture: @picture: @buffer: @Returns: @buffer: @Returns: @buffer: @Returns: @buffer: @Returns: @buffer: @Returns: @decoder: @Returns: @decoder: @component: @decoder: @picture: @picture: @picture: @picture: @picture: @picture: @picture: @encoder: @buffer: @encoder: @Returns: @encoder: @bits: @frame: @encoder: @Returns: @encoder: @Returns: @frame: @frame: @frame: @frame: @encoder: @pref: @Returns: @encoder: @pref: @min: @max: @Returns: @encoder: @pref: @value: @Returns: @encoder: @encoder_frame: @frame: @params: @data: @stride: @width: @height: @tmp: @data: @stride: @width: @height: @tmp: @data: @stride: @width: @height: @tmp: @data: @stride: @width: @height: @tmp: @data: @stride: @width: @height: @tmp: @data: @stride: @width: @height: @tmp: @data: @stride: @width: @height: @tmp: @data: @stride: @width: @height: @tmp: @data: @stride: @width: @height: @tmp: @data: @stride: @width: @height: @tmp: @data: @stride: @width: @height: @tmp: @data: @stride: @width: @height: @tmp: @data: @stride: @width: @height: @tmp: @data: @stride: @width: @height: @tmp: @data: @stride: @width: @height: @tmp: @data: @stride: @width: @height: @tmp: @mf: @gm: @mv_precision: @mf: @gm: @mv_precision: @obmc: @obmc: @x_len: @y_len: @x_sep: @y_sep: @ref1_weight: @ref2_weight: @ref_shift: @pred: @pred: @vec: @list: @frame: @ref: @refnum: @x: @y: @dx: @dy: @dist: @hi: @lo: @n: @hi: @lo: @n: @hi: @lo: @n: @hi: @lo: @n: @hi: @lo: @n: @hi: @lo: @n: @frame: @component: @position: @params: @data: @stride: @width: @height: @hi: @lo: @n: @hi: @lo: @n: @hi: @lo: @n: @hi: @lo: @n: @hi: @lo: @n: @hi: @lo: @n: schroedinger-1.0.11/doc/tmpl/schrocog.sgml0000644000175000017500000000102411707140273015402 00000000000000 schrocog @d: @s: @taps: @offset: @shift: @index_offset: @n: @d: @s: @taps: @offset: @shift: @index_offset: @n: schroedinger-1.0.11/doc/tmpl/schrodecoder.sgml0000664000175000017500000001007511707140273016247 00000000000000 schrodecoder @void: @Returns: @decoder: @decoder: @decoder: @Returns: @decoder: @frame: @decoder: @Returns: @decoder: @buffer: @Returns: @decoder: @Returns: @decoder: @Returns: @decoder: @Returns: @decoder: @earliest_frame: @decoder: @ratio: @decoder: @Returns: @unpack: @Returns: @picture: @picture: @fd: @picture: @picture: @arith: @unpack: @i: @j: @picture: @arith: @unpack: @motion_vectors: @x: @y: @picture: @instance: @buffer: @unpack: @parse_code: @Returns: @picture: @unpack: @picture: @unpack: @picture: @unpack: @picture: @unpack: @picture: @unpack: @picture: @unpack: @picture: @unpack: @refcount: @decoder_instance: @busy: @skip: @error: @input_buffer: @params: @picture_number: @reference1: @reference2: @retired_picture_number: @ref0: @ref1: @planar_output_frame: @ref_output_frame: @stages: @is_ref: @zero_residual: @transform_frame: @frame: @mc_tmp_frame: @motion: @output_picture: @upsampled_frame: @subband_length: @subband_quant_index: @subband_buffer: @subband_data: @motion_buffers: @lowdelay_buffer: @has_md5: @md5_checksum: @tag: @instance: @Returns: @picture: @Returns: @picture: schroedinger-1.0.11/orc.mak0000644000175000017500000000370611541755167012466 00000000000000# # 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 cp tmp-orc.c $(srcdir)/$(ORC_SOURCE)-dist.c cp $(ORC_SOURCE).h $(srcdir)/$(ORC_SOURCE)-dist.h orcc_v_gen = cp_v_gen = if HAVE_ORCC tmp-orc.c: $(srcdir)/$(ORC_SOURCE).orc $(orcc_v_gen)$(ORCC) $(ORCC_FLAGS) --inline --implementation -o tmp-orc.c $(srcdir)/$(ORC_SOURCE).orc $(ORC_SOURCE).h: $(srcdir)/$(ORC_SOURCE).orc $(orcc_v_gen)$(ORCC) $(ORCC_FLAGS) --inline --header -o $(ORC_SOURCE).h $(srcdir)/$(ORC_SOURCE).orc else tmp-orc.c: $(srcdir)/$(ORC_SOURCE).orc $(cp_v_gen)cp $(srcdir)/$(ORC_SOURCE)-dist.c tmp-orc.c $(ORC_SOURCE).h: $(srcdir)/$(ORC_SOURCE).orc $(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 dist-hook-orc: tmp-orc.c $(ORC_SOURCE).h rm -f tmp-orc.c~ cmp -s tmp-orc.c $(srcdir)/$(ORC_SOURCE)-dist.c || \ cp tmp-orc.c $(srcdir)/$(ORC_SOURCE)-dist.c cmp -s $(ORC_SOURCE).h $(srcdir)/$(ORC_SOURCE)-dist.h || \ cp $(ORC_SOURCE).h $(srcdir)/$(ORC_SOURCE)-dist.h cp -p $(srcdir)/$(ORC_SOURCE)-dist.c $(distdir)/ cp -p $(srcdir)/$(ORC_SOURCE)-dist.h $(distdir)/ schroedinger-1.0.11/COPYING0000644000175000017500000000051410735025462012226 00000000000000This library is licensed under 4 different licenses and you can choose to use it under the terms of any one of them. The four licenses are the MPL 1.1, the LGPL, the GPL and the MIT license. Check the COPYING.MPL, COPYING.LGPL, COPYING.GPL and COPYING.MIT for details. See also the LEGAL file for details about known patents etc. schroedinger-1.0.11/aclocal.m40000664000175000017500000011110611707140260013027 00000000000000# generated automatically by aclocal 1.11.1 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008, 2009 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. # 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. m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],, [m4_warning([this file was generated for autoconf 2.68. You have another version of autoconf. It may work, but is not guaranteed to. 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'.])]) # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 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_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.11.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.11.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # Figure out how to run the assembler. -*- Autoconf -*- # Copyright (C) 2001, 2003, 2004, 2005, 2006 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. # serial 5 # AM_PROG_AS # ---------- AC_DEFUN([AM_PROG_AS], [# By default we simply use the C compiler to build assembly code. AC_REQUIRE([AC_PROG_CC]) test "${CCAS+set}" = set || CCAS=$CC test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS AC_ARG_VAR([CCAS], [assembler compiler command (defaults to CC)]) AC_ARG_VAR([CCASFLAGS], [assembler compiler flags (defaults to CFLAGS)]) _AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([CCAS])])dnl ]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005 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. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 # 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. # serial 9 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 # 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. # serial 10 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], UPC, [depcc="$UPC" am_compiler_list=], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [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'. 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_$1_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 m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [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 8's {/usr,}/bin/sh. touch 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 ;; 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_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 # 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. #serial 5 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 # 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. # serial 8 # AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2008, 2009 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. # serial 16 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.62])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl dnl The `parallel-tests' driver may need to know about EXEEXT, so add the dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl ]) dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005, 2008 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_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 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. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2009 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. # serial 4 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [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. AC_MSG_CHECKING([for style of include used by $am_make]) 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 AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008 # 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. # serial 6 # AM_PROG_CC_C_O # -------------- # Like AC_PROG_CC_C_O, but changed for automake. AC_DEFUN([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC_C_O])dnl AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl # FIXME: we rely on the cache variable name because # there is no other way. set dummy $CC am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o if test "$am_t" != 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 dnl Make sure AC_PROG_CC is never called again, or it will override our dnl setting of CC. m4_define([AC_PROG_CC], [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])]) ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 # 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. # serial 6 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005, 2006 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_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2008 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. # serial 4 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 # 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. # serial 5 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005 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_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006, 2008 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. # serial 2 # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 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. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/as-auto-alt.m4]) m4_include([m4/as-compiler-flag.m4]) m4_include([m4/as-host-defines.m4]) m4_include([m4/as-version.m4]) m4_include([m4/gst-args.m4]) m4_include([m4/gtk-doc.m4]) m4_include([m4/libtool.m4]) m4_include([m4/ltoptions.m4]) m4_include([m4/ltsugar.m4]) m4_include([m4/ltversion.m4]) m4_include([m4/lt~obsolete.m4]) m4_include([m4/pkg.m4]) schroedinger-1.0.11/depcomp0000755000175000017500000004426711707122105012555 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2009-04-28.21; # UTC # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free # Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by `PROGRAMS ARGS'. object Object file output by `PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputing dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u="sed s,\\\\\\\\,/,g" depmode=msvisualcpp fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts `$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want: # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" # Add `dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mechanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for `:' # in the target name. This is to cope with DOS-style filenames: # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: schroedinger-1.0.11/schroedinger.spec.in0000644000175000017500000001054511161526031015125 00000000000000Name: libschroedinger Version: @VERSION@ Release: gst.1 Summary: Library for decoding and encoding video in the Dirac format Group: Applications/Multimedia License: LGPL/MIT/MPL URL: http://schrodinger.sourceforge.net/ Source: http://schrodinger.sourceforge.net/schroedinger-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: gtk-doc BuildRequires: liboil-devel >= 0.3.13 BuildRequires: gstreamer-devel BuildRequires: gstreamer-plugins-base-devel %description Library for decoding and encoding video in the Dirac format. It is implemented in ANSI C and optimized through the us of liboil. libschro is written as a collaboration between the BBC Research and Development, David Schleef and Fluendo. %package devel Summary: Development files and static libraries for libschroedinger Group: Development/Libraries Requires: %{name} = %{version}-%{release} %description devel libschroedinger-devel contains the files needed to build packages that depend on libschroedinger. %prep %setup -q -n schroedinger-%{version} %build %configure # parallel build does not work # make %{?_smp_mflags} make %install rm -rf $RPM_BUILD_ROOT %makeinstall # Clean out files that should not be part of the rpm. rm -f $RPM_BUILD_ROOT%{_libdir}/*.{a,la} rm -f $RPM_BUILD_ROOT%{_libdir}/gstreamer-0.10/*.{a,la} %clean rm -rf $RPM_BUILD_ROOT %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %files %defattr(-,root,root) %doc COPYING COPYING.MIT COPYING.GPL COPYING.LGPL COPYING.MPL %{_libdir}/libschroedinger-1.0.so.* %{_libdir}/gstreamer-0.10/libgstschro.so %files devel %defattr(-,root,root) %{_libdir}/pkgconfig/schroedinger-1.0.pc %{_libdir}/libschroedinger-1.0.so %{_includedir}/schroedinger-1.0/schroedinger/schroanalysis.h %{_includedir}/schroedinger-1.0/schroedinger/schroarith.h %{_includedir}/schroedinger-1.0/schroedinger/schroasync.h %{_includedir}/schroedinger-1.0/schroedinger/schrobitstream.h %{_includedir}/schroedinger-1.0/schroedinger/schrobuffer.h %{_includedir}/schroedinger-1.0/schroedinger/schrodebug.h %{_includedir}/schroedinger-1.0/schroedinger/schrodecoder.h %{_includedir}/schroedinger-1.0/schroedinger/schroencoder.h %{_includedir}/schroedinger-1.0/schroedinger/schroengine.h %{_includedir}/schroedinger-1.0/schroedinger/schrofft.h %{_includedir}/schroedinger-1.0/schroedinger/schrofilter.h %{_includedir}/schroedinger-1.0/schroedinger/schroframe.h %{_includedir}/schroedinger-1.0/schroedinger/schro.h %{_includedir}/schroedinger-1.0/schroedinger/schrohistogram.h %{_includedir}/schroedinger-1.0/schroedinger/schrometric.h %{_includedir}/schroedinger-1.0/schroedinger/schromotion.h %{_includedir}/schroedinger-1.0/schroedinger/schroparams.h %{_includedir}/schroedinger-1.0/schroedinger/schrophasecorrelation.h %{_includedir}/schroedinger-1.0/schroedinger/schroqueue.h %{_includedir}/schroedinger-1.0/schroedinger/schrossim.h %{_includedir}/schroedinger-1.0/schroedinger/schro-stdint.h %{_includedir}/schroedinger-1.0/schroedinger/schrotables.h %{_includedir}/schroedinger-1.0/schroedinger/schrounpack.h %{_includedir}/schroedinger-1.0/schroedinger/schroutils.h %{_includedir}/schroedinger-1.0/schroedinger/schrowavelet.h %{_includedir}/schroedinger-1.0/schroedinger/schrocog.h %{_includedir}/schroedinger-1.0/schroedinger/schrodomain.h %{_includedir}/schroedinger-1.0/schroedinger/schromotionest.h %{_includedir}/schroedinger-1.0/schroedinger/schrolimits.h %{_includedir}/schroedinger-1.0/schroedinger/schrolist.h %{_includedir}/schroedinger-1.0/schroedinger/schropack.h %{_includedir}/schroedinger-1.0/schroedinger/schrovideoformat.h %{_includedir}/schroedinger-1.0/schroedinger/schrovirtframe.h %{_includedir}/schroedinger-1.0/schroedinger/schroparse.h %{_datadir}/gtk-doc/html/schroedinger %changelog * Wed May 7 2008 Christian Schaller - Added Schrovirtframe.h * Fri Feb 22 2008 David Schleef - Update for 1.0 * Fri Feb 1 2008 Christian F.K. Schaller - add schromotionest.h - remove schropredict.h * Tue Jan 22 2008 Christian F.K. Schaller - Update for latest changes * Thu Apr 05 2007 Thomas Vander Stichele - Further updates. * Thu Apr 27 2006 Christian F.K. Schaller - Updates for carid -> schroedinger change schroedinger-1.0.11/schroedinger-uninstalled.pc.in0000644000175000017500000000052011541755167017125 00000000000000prefix= exec_prefix= libdir=${pcfiledir}/schroedinger/ includedir=${pcfiledir}/ Name: schro-@SCHRO_MAJORMINOR@ uninstalled Description: Dirac codec library Version: @VERSION@ Requires.private: @SCHRO_PKG_DEPS@ Libs: -L${libdir} -lschroedinger-@SCHRO_MAJORMINOR@ Libs.private: @PTHREAD_LIBS@ @LIBM@ Cflags: -I${includedir} -I@srcdir@