Imported Upstream version 1.2.0
Alessio Treglia
13 years ago
0 | # Makefile.in generated by automake 1.11 from Makefile.am. | |
0 | # Makefile.in generated by automake 1.11.1 from Makefile.am. | |
1 | 1 | # @configure_input@ |
2 | 2 | |
3 | 3 | # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, |
349 | 349 | # (which will cause the Makefiles to be regenerated when you run `make'); |
350 | 350 | # (2) otherwise, pass the desired values on the `make' command line. |
351 | 351 | $(RECURSIVE_TARGETS): |
352 | @failcom='exit 1'; \ | |
352 | @fail= failcom='exit 1'; \ | |
353 | 353 | for f in x $$MAKEFLAGS; do \ |
354 | 354 | case $$f in \ |
355 | 355 | *=* | --[!k]*);; \ |
374 | 374 | fi; test -z "$$fail" |
375 | 375 | |
376 | 376 | $(RECURSIVE_CLEAN_TARGETS): |
377 | @failcom='exit 1'; \ | |
377 | @fail= failcom='exit 1'; \ | |
378 | 378 | for f in x $$MAKEFLAGS; do \ |
379 | 379 | case $$f in \ |
380 | 380 | *=* | --[!k]*);; \ |
538 | 538 | fi; \ |
539 | 539 | done |
540 | 540 | -test -n "$(am__skip_mode_fix)" \ |
541 | || find "$(distdir)" -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ | |
541 | || find "$(distdir)" -type d ! -perm -755 \ | |
542 | -exec chmod u+rwx,go+rx {} \; -o \ | |
542 | 543 | ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ |
543 | 544 | ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ |
544 | 545 | ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ |
582 | 583 | distcheck: dist |
583 | 584 | case '$(DIST_ARCHIVES)' in \ |
584 | 585 | *.tar.gz*) \ |
585 | GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ | |
586 | GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ | |
586 | 587 | *.tar.bz2*) \ |
587 | bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ | |
588 | bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ | |
588 | 589 | *.tar.lzma*) \ |
589 | unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\ | |
590 | lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ | |
590 | 591 | *.tar.xz*) \ |
591 | 592 | xz -dc $(distdir).tar.xz | $(am__untar) ;;\ |
592 | 593 | *.tar.Z*) \ |
593 | 594 | uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ |
594 | 595 | *.shar.gz*) \ |
595 | GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ | |
596 | GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ | |
596 | 597 | *.zip*) \ |
597 | 598 | unzip $(distdir).zip ;;\ |
598 | 599 | esac |
0 | # generated automatically by aclocal 1.11 -*- Autoconf -*- | |
0 | # generated automatically by aclocal 1.11.1 -*- Autoconf -*- | |
1 | 1 | |
2 | 2 | # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, |
3 | 3 | # 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. |
12 | 12 | |
13 | 13 | m4_ifndef([AC_AUTOCONF_VERSION], |
14 | 14 | [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl |
15 | m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.64],, | |
16 | [m4_warning([this file was generated for autoconf 2.64. | |
15 | m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.65],, | |
16 | [m4_warning([this file was generated for autoconf 2.65. | |
17 | 17 | You have another version of autoconf. It may work, but is not guaranteed to. |
18 | 18 | If you have problems, you may need to regenerate the build system entirely. |
19 | 19 | To do so, use the procedure documented by the package, typically `autoreconf'.])]) |
2459 | 2459 | ;; |
2460 | 2460 | |
2461 | 2461 | # This must be Linux ELF. |
2462 | linux* | k*bsd*-gnu) | |
2462 | linux* | k*bsd*-gnu | kopensolaris*-gnu) | |
2463 | 2463 | version_type=linux |
2464 | 2464 | need_lib_prefix=no |
2465 | 2465 | need_version=no |
3098 | 3098 | ;; |
3099 | 3099 | |
3100 | 3100 | # This must be Linux ELF. |
3101 | linux* | k*bsd*-gnu) | |
3101 | linux* | k*bsd*-gnu | kopensolaris*-gnu) | |
3102 | 3102 | lt_cv_deplibs_check_method=pass_all |
3103 | 3103 | ;; |
3104 | 3104 | |
3719 | 3719 | ;; |
3720 | 3720 | esac |
3721 | 3721 | ;; |
3722 | linux* | k*bsd*-gnu) | |
3722 | linux* | k*bsd*-gnu | kopensolaris*-gnu) | |
3723 | 3723 | case $cc_basename in |
3724 | 3724 | KCC*) |
3725 | 3725 | # KAI C++ Compiler |
4003 | 4003 | _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' |
4004 | 4004 | ;; |
4005 | 4005 | |
4006 | linux* | k*bsd*-gnu) | |
4006 | linux* | k*bsd*-gnu | kopensolaris*-gnu) | |
4007 | 4007 | case $cc_basename in |
4008 | 4008 | # old Intel for x86_64 which still supported -KPIC. |
4009 | 4009 | ecc*) |
4299 | 4299 | fi |
4300 | 4300 | supports_anon_versioning=no |
4301 | 4301 | case `$LD -v 2>&1` in |
4302 | *GNU\ gold*) supports_anon_versioning=yes ;; | |
4302 | 4303 | *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 |
4303 | 4304 | *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... |
4304 | 4305 | *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... |
4390 | 4391 | _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' |
4391 | 4392 | ;; |
4392 | 4393 | |
4393 | gnu* | linux* | tpf* | k*bsd*-gnu) | |
4394 | gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) | |
4394 | 4395 | tmp_diet=no |
4395 | 4396 | if test "$host_os" = linux-dietlibc; then |
4396 | 4397 | case $cc_basename in |
5870 | 5871 | _LT_TAGVAR(inherit_rpath, $1)=yes |
5871 | 5872 | ;; |
5872 | 5873 | |
5873 | linux* | k*bsd*-gnu) | |
5874 | linux* | k*bsd*-gnu | kopensolaris*-gnu) | |
5874 | 5875 | case $cc_basename in |
5875 | 5876 | KCC*) |
5876 | 5877 | # Kuck and Associates, Inc. (KAI) C++ Compiler |
7877 | 7878 | |
7878 | 7879 | # Generated from ltversion.in. |
7879 | 7880 | |
7880 | # serial 3012 ltversion.m4 | |
7881 | # serial 3017 ltversion.m4 | |
7881 | 7882 | # This file is part of GNU Libtool |
7882 | 7883 | |
7883 | m4_define([LT_PACKAGE_VERSION], [2.2.6]) | |
7884 | m4_define([LT_PACKAGE_REVISION], [1.3012]) | |
7884 | m4_define([LT_PACKAGE_VERSION], [2.2.6b]) | |
7885 | m4_define([LT_PACKAGE_REVISION], [1.3017]) | |
7885 | 7886 | |
7886 | 7887 | AC_DEFUN([LTVERSION_VERSION], |
7887 | [macro_version='2.2.6' | |
7888 | macro_revision='1.3012' | |
7888 | [macro_version='2.2.6b' | |
7889 | macro_revision='1.3017' | |
7889 | 7890 | _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) |
7890 | 7891 | _LT_DECL(, macro_revision, 0) |
7891 | 7892 | ]) |
7998 | 7999 | [am__api_version='1.11' |
7999 | 8000 | dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to |
8000 | 8001 | dnl require some minimum version. Point them to the right macro. |
8001 | m4_if([$1], [1.11], [], | |
8002 | m4_if([$1], [1.11.1], [], | |
8002 | 8003 | [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl |
8003 | 8004 | ]) |
8004 | 8005 | |
8014 | 8015 | # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. |
8015 | 8016 | # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. |
8016 | 8017 | AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], |
8017 | [AM_AUTOMAKE_VERSION([1.11])dnl | |
8018 | [AM_AUTOMAKE_VERSION([1.11.1])dnl | |
8018 | 8019 | m4_ifndef([AC_AUTOCONF_VERSION], |
8019 | 8020 | [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl |
8020 | 8021 | _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) |
0 | 0 | #! /bin/sh |
1 | 1 | # Attempt to guess a canonical system name. |
2 | 2 | # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, |
3 | # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 | |
3 | # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 | |
4 | 4 | # Free Software Foundation, Inc. |
5 | 5 | |
6 | timestamp='2009-04-27' | |
6 | timestamp='2009-06-10' | |
7 | 7 | |
8 | 8 | # This file is free software; you can redistribute it and/or modify it |
9 | 9 | # under the terms of the GNU General Public License as published by |
169 | 169 | arm*|i386|m68k|ns32k|sh3*|sparc|vax) |
170 | 170 | eval $set_cc_for_build |
171 | 171 | if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ |
172 | | grep __ELF__ >/dev/null | |
172 | | grep -q __ELF__ | |
173 | 173 | then |
174 | 174 | # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). |
175 | 175 | # Return netbsd for either. FIX? |
655 | 655 | # => hppa64-hp-hpux11.23 |
656 | 656 | |
657 | 657 | if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | |
658 | grep __LP64__ >/dev/null | |
658 | grep -q __LP64__ | |
659 | 659 | then |
660 | 660 | HP_ARCH="hppa2.0w" |
661 | 661 | else |
821 | 821 | [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) |
822 | 822 | echo i${UNAME_MACHINE}-pc-mks |
823 | 823 | exit ;; |
824 | 8664:Windows_NT:*) | |
825 | echo x86_64-pc-mks | |
826 | exit ;; | |
824 | 827 | i*:Windows_NT*:* | Pentium*:Windows_NT*:*) |
825 | 828 | # How do we know it's Interix rather than the generic POSIX subsystem? |
826 | 829 | # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we |
881 | 884 | m68*:Linux:*:*) |
882 | 885 | echo ${UNAME_MACHINE}-unknown-linux-gnu |
883 | 886 | exit ;; |
884 | mips:Linux:*:*) | |
887 | mips:Linux:*:* | mips64:Linux:*:*) | |
885 | 888 | eval $set_cc_for_build |
886 | 889 | sed 's/^ //' << EOF >$dummy.c |
887 | 890 | #undef CPU |
888 | #undef mips | |
889 | #undef mipsel | |
891 | #undef ${UNAME_MACHINE} | |
892 | #undef ${UNAME_MACHINE}el | |
890 | 893 | #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) |
891 | CPU=mipsel | |
894 | CPU=${UNAME_MACHINE}el | |
892 | 895 | #else |
893 | 896 | #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) |
894 | CPU=mips | |
895 | #else | |
896 | CPU= | |
897 | #endif | |
898 | #endif | |
899 | EOF | |
900 | eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' | |
901 | /^CPU/{ | |
902 | s: ::g | |
903 | p | |
904 | }'`" | |
905 | test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } | |
906 | ;; | |
907 | mips64:Linux:*:*) | |
908 | eval $set_cc_for_build | |
909 | sed 's/^ //' << EOF >$dummy.c | |
910 | #undef CPU | |
911 | #undef mips64 | |
912 | #undef mips64el | |
913 | #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) | |
914 | CPU=mips64el | |
915 | #else | |
916 | #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) | |
917 | CPU=mips64 | |
897 | CPU=${UNAME_MACHINE} | |
918 | 898 | #else |
919 | 899 | CPU= |
920 | 900 | #endif |
946 | 926 | EV67) UNAME_MACHINE=alphaev67 ;; |
947 | 927 | EV68*) UNAME_MACHINE=alphaev68 ;; |
948 | 928 | esac |
949 | objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null | |
929 | objdump --private-headers /bin/sh | grep -q ld.so.1 | |
950 | 930 | if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi |
951 | 931 | echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} |
952 | 932 | exit ;; |
1000 | 980 | elf32-i386) |
1001 | 981 | TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" |
1002 | 982 | ;; |
1003 | a.out-i386-linux) | |
1004 | echo "${UNAME_MACHINE}-pc-linux-gnuaout" | |
1005 | exit ;; | |
1006 | "") | |
1007 | # Either a pre-BFD a.out linker (linux-gnuoldld) or | |
1008 | # one that does not give us useful --help. | |
1009 | echo "${UNAME_MACHINE}-pc-linux-gnuoldld" | |
1010 | exit ;; | |
1011 | 983 | esac |
1012 | 984 | # Determine whether the default compiler is a.out or elf |
1013 | 985 | eval $set_cc_for_build |
1073 | 1045 | i*86:syllable:*:*) |
1074 | 1046 | echo ${UNAME_MACHINE}-pc-syllable |
1075 | 1047 | exit ;; |
1076 | i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) | |
1048 | i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) | |
1077 | 1049 | echo i386-unknown-lynxos${UNAME_RELEASE} |
1078 | 1050 | exit ;; |
1079 | 1051 | i*86:*DOS:*:*) |
1181 | 1153 | rs6000:LynxOS:2.*:*) |
1182 | 1154 | echo rs6000-unknown-lynxos${UNAME_RELEASE} |
1183 | 1155 | exit ;; |
1184 | PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) | |
1156 | PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) | |
1185 | 1157 | echo powerpc-unknown-lynxos${UNAME_RELEASE} |
1186 | 1158 | exit ;; |
1187 | 1159 | SM[BE]S:UNIX_SV:*:*) |
0 | 0 | #! /bin/sh |
1 | 1 | # Configuration validation subroutine script. |
2 | 2 | # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, |
3 | # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 | |
3 | # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 | |
4 | 4 | # Free Software Foundation, Inc. |
5 | 5 | |
6 | timestamp='2009-04-17' | |
6 | timestamp='2009-06-11' | |
7 | 7 | |
8 | 8 | # This file is (in principle) common to ALL GNU software. |
9 | 9 | # The presence of a machine in this file suggests that SOME GNU software |
151 | 151 | -apple | -axis | -knuth | -cray) |
152 | 152 | os= |
153 | 153 | basic_machine=$1 |
154 | ;; | |
155 | -bluegene*) | |
156 | os=-cnk | |
154 | 157 | ;; |
155 | 158 | -sim | -cisco | -oki | -wec | -winbond) |
156 | 159 | os= |
466 | 469 | basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` |
467 | 470 | os=-linux |
468 | 471 | ;; |
472 | bluegene*) | |
473 | basic_machine=powerpc-ibm | |
474 | os=-cnk | |
475 | ;; | |
469 | 476 | c90) |
470 | 477 | basic_machine=c90-cray |
471 | 478 | os=-unicos |
1259 | 1266 | # Each alternative MUST END IN A *, to match a version number. |
1260 | 1267 | # -sysv* is not here because it comes later, after sysvr4. |
1261 | 1268 | -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ |
1262 | | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | |
1269 | | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | |
1263 | 1270 | | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ |
1264 | 1271 | | -kopensolaris* \ |
1265 | 1272 | | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ |
1612 | 1619 | -sunos*) |
1613 | 1620 | vendor=sun |
1614 | 1621 | ;; |
1615 | -aix*) | |
1622 | -cnk*|-aix*) | |
1616 | 1623 | vendor=ibm |
1617 | 1624 | ;; |
1618 | 1625 | -beos*) |
0 | 0 | #! /bin/sh |
1 | 1 | # Guess values for system-dependent variables and create Makefiles. |
2 | # Generated by GNU Autoconf 2.64. | |
2 | # Generated by GNU Autoconf 2.65. | |
3 | # | |
3 | 4 | # |
4 | 5 | # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, |
5 | # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software | |
6 | # Foundation, Inc. | |
6 | # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, | |
7 | # Inc. | |
8 | # | |
7 | 9 | # |
8 | 10 | # This configure script is free software; the Free Software Foundation |
9 | 11 | # gives unlimited permission to copy, distribute and modify it. |
672 | 674 | |
673 | 675 | |
674 | 676 | |
675 | exec 7<&0 </dev/null 6>&1 | |
677 | test -n "$DJDIR" || exec 7<&0 </dev/null | |
678 | exec 6>&1 | |
676 | 679 | |
677 | 680 | # Name of the host. |
678 | 681 | # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, |
1551 | 1554 | LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a |
1552 | 1555 | nonstandard directory <lib dir> |
1553 | 1556 | LIBS libraries to pass to the linker, e.g. -l<library> |
1554 | CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> if | |
1557 | CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if | |
1555 | 1558 | you have headers in a nonstandard directory <include dir> |
1556 | 1559 | CPP C preprocessor |
1557 | 1560 | |
1622 | 1625 | if $ac_init_version; then |
1623 | 1626 | cat <<\_ACEOF |
1624 | 1627 | configure |
1625 | generated by GNU Autoconf 2.64 | |
1628 | generated by GNU Autoconf 2.65 | |
1626 | 1629 | |
1627 | 1630 | Copyright (C) 2009 Free Software Foundation, Inc. |
1628 | 1631 | This configure script is free software; the Free Software Foundation |
1669 | 1672 | ac_retval=1 |
1670 | 1673 | fi |
1671 | 1674 | eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} |
1672 | return $ac_retval | |
1675 | as_fn_set_status $ac_retval | |
1673 | 1676 | |
1674 | 1677 | } # ac_fn_c_try_compile |
1675 | 1678 | |
1715 | 1718 | # left behind by Apple's compiler. We do this before executing the actions. |
1716 | 1719 | rm -rf conftest.dSYM conftest_ipa8_conftest.oo |
1717 | 1720 | eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} |
1718 | return $ac_retval | |
1721 | as_fn_set_status $ac_retval | |
1719 | 1722 | |
1720 | 1723 | } # ac_fn_c_try_link |
1721 | 1724 | |
1783 | 1786 | ac_retval=1 |
1784 | 1787 | fi |
1785 | 1788 | eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} |
1786 | return $ac_retval | |
1789 | as_fn_set_status $ac_retval | |
1787 | 1790 | |
1788 | 1791 | } # ac_fn_c_try_cpp |
1789 | 1792 | |
1825 | 1828 | fi |
1826 | 1829 | rm -rf conftest.dSYM conftest_ipa8_conftest.oo |
1827 | 1830 | eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} |
1828 | return $ac_retval | |
1831 | as_fn_set_status $ac_retval | |
1829 | 1832 | |
1830 | 1833 | } # ac_fn_c_try_run |
1831 | 1834 | |
2157 | 2160 | |
2158 | 2161 | fi |
2159 | 2162 | eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} |
2160 | return $ac_retval | |
2163 | as_fn_set_status $ac_retval | |
2161 | 2164 | |
2162 | 2165 | } # ac_fn_c_compute_int |
2163 | 2166 | cat >config.log <<_ACEOF |
2165 | 2168 | running configure, to aid debugging if configure makes a mistake. |
2166 | 2169 | |
2167 | 2170 | It was created by $as_me, which was |
2168 | generated by GNU Autoconf 2.64. Invocation command line was | |
2171 | generated by GNU Autoconf 2.65. Invocation command line was | |
2169 | 2172 | |
2170 | 2173 | $ $0 $@ |
2171 | 2174 | |
2418 | 2421 | for ac_site_file in "$ac_site_file1" "$ac_site_file2" |
2419 | 2422 | do |
2420 | 2423 | test "x$ac_site_file" = xNONE && continue |
2421 | if test -r "$ac_site_file"; then | |
2424 | if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then | |
2422 | 2425 | { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 |
2423 | 2426 | $as_echo "$as_me: loading site script $ac_site_file" >&6;} |
2424 | 2427 | sed 's/^/| /' "$ac_site_file" >&5 |
2427 | 2430 | done |
2428 | 2431 | |
2429 | 2432 | if test -r "$cache_file"; then |
2430 | # Some versions of bash will fail to source /dev/null (special | |
2431 | # files actually), so we avoid doing that. | |
2432 | if test -f "$cache_file"; then | |
2433 | # Some versions of bash will fail to source /dev/null (special files | |
2434 | # actually), so we avoid doing that. DJGPP emulates it as a regular file. | |
2435 | if test /dev/null != "$cache_file" && test -f "$cache_file"; then | |
2433 | 2436 | { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 |
2434 | 2437 | $as_echo "$as_me: loading cache $cache_file" >&6;} |
2435 | 2438 | case $cache_file in |
2852 | 2855 | |
2853 | 2856 | fi |
2854 | 2857 | |
2858 | test -d ./--version && rmdir ./--version | |
2855 | 2859 | if test "${ac_cv_path_mkdir+set}" = set; then |
2856 | 2860 | MKDIR_P="$ac_cv_path_mkdir -p" |
2857 | 2861 | else |
2859 | 2863 | # value for MKDIR_P within a source directory, because that will |
2860 | 2864 | # break other packages using the cache if that directory is |
2861 | 2865 | # removed, or if the value is a relative name. |
2862 | test -d ./--version && rmdir ./--version | |
2863 | 2866 | MKDIR_P="$ac_install_sh -d" |
2864 | 2867 | fi |
2865 | 2868 | fi |
2976 | 2979 | |
2977 | 2980 | # Define the identity of the package. |
2978 | 2981 | PACKAGE=gavl |
2979 | VERSION=1.1.2 | |
2982 | VERSION=1.2.0 | |
2980 | 2983 | |
2981 | 2984 | |
2982 | 2985 | cat >>confdefs.h <<_ACEOF |
3150 | 3153 | |
3151 | 3154 | |
3152 | 3155 | |
3153 | macro_version='2.2.6' | |
3154 | macro_revision='1.3012' | |
3156 | macro_version='2.2.6b' | |
3157 | macro_revision='1.3017' | |
3155 | 3158 | |
3156 | 3159 | |
3157 | 3160 | |
3551 | 3554 | ... rest of stderr output deleted ... |
3552 | 3555 | 10q' conftest.err >conftest.er1 |
3553 | 3556 | cat conftest.er1 >&5 |
3554 | rm -f conftest.er1 conftest.err | |
3555 | 3557 | fi |
3558 | rm -f conftest.er1 conftest.err | |
3556 | 3559 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 |
3557 | 3560 | test $ac_status = 0; } |
3558 | 3561 | done |
3559 | 3562 | |
3560 | 3563 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
3561 | 3564 | /* end confdefs.h. */ |
3562 | #include <stdio.h> | |
3565 | ||
3563 | 3566 | int |
3564 | 3567 | main () |
3565 | 3568 | { |
3566 | FILE *f = fopen ("conftest.out", "w"); | |
3567 | return ferror (f) || fclose (f) != 0; | |
3568 | 3569 | |
3569 | 3570 | ; |
3570 | 3571 | return 0; |
3571 | 3572 | } |
3572 | 3573 | _ACEOF |
3573 | 3574 | ac_clean_files_save=$ac_clean_files |
3574 | ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out conftest.out" | |
3575 | ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" | |
3575 | 3576 | # Try to create an executable without -o first, disregard a.out. |
3576 | 3577 | # It will help us diagnose broken compilers, and finding out an intuition |
3577 | 3578 | # of exeext. |
3578 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 | |
3579 | $as_echo_n "checking for C compiler default output file name... " >&6; } | |
3579 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 | |
3580 | $as_echo_n "checking whether the C compiler works... " >&6; } | |
3580 | 3581 | ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` |
3581 | 3582 | |
3582 | 3583 | # The possible output files: |
3638 | 3639 | else |
3639 | 3640 | ac_file='' |
3640 | 3641 | fi |
3641 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 | |
3642 | $as_echo "$ac_file" >&6; } | |
3643 | 3642 | if test -z "$ac_file"; then : |
3644 | $as_echo "$as_me: failed program was:" >&5 | |
3643 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
3644 | $as_echo "no" >&6; } | |
3645 | $as_echo "$as_me: failed program was:" >&5 | |
3645 | 3646 | sed 's/^/| /' conftest.$ac_ext >&5 |
3646 | 3647 | |
3647 | 3648 | { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 |
3649 | 3650 | { as_fn_set_status 77 |
3650 | 3651 | as_fn_error "C compiler cannot create executables |
3651 | 3652 | See \`config.log' for more details." "$LINENO" 5; }; } |
3652 | fi | |
3653 | else | |
3654 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 | |
3655 | $as_echo "yes" >&6; } | |
3656 | fi | |
3657 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 | |
3658 | $as_echo_n "checking for C compiler default output file name... " >&6; } | |
3659 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 | |
3660 | $as_echo "$ac_file" >&6; } | |
3653 | 3661 | ac_exeext=$ac_cv_exeext |
3654 | 3662 | |
3655 | # Check that the compiler produces executables we can run. If not, either | |
3656 | # the compiler is broken, or we cross compile. | |
3657 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 | |
3658 | $as_echo_n "checking whether the C compiler works... " >&6; } | |
3659 | # If not cross compiling, check that we can run a simple program. | |
3660 | if test "$cross_compiling" != yes; then | |
3661 | if { ac_try='./$ac_file' | |
3662 | { { case "(($ac_try" in | |
3663 | *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; | |
3664 | *) ac_try_echo=$ac_try;; | |
3665 | esac | |
3666 | eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" | |
3667 | $as_echo "$ac_try_echo"; } >&5 | |
3668 | (eval "$ac_try") 2>&5 | |
3669 | ac_status=$? | |
3670 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | |
3671 | test $ac_status = 0; }; }; then | |
3672 | cross_compiling=no | |
3673 | else | |
3674 | if test "$cross_compiling" = maybe; then | |
3675 | cross_compiling=yes | |
3676 | else | |
3677 | { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 | |
3678 | $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} | |
3679 | as_fn_error "cannot run C compiled programs. | |
3680 | If you meant to cross compile, use \`--host'. | |
3681 | See \`config.log' for more details." "$LINENO" 5; } | |
3682 | fi | |
3683 | fi | |
3684 | fi | |
3685 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 | |
3686 | $as_echo "yes" >&6; } | |
3687 | ||
3688 | rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out conftest.out | |
3663 | rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out | |
3689 | 3664 | ac_clean_files=$ac_clean_files_save |
3690 | # Check that the compiler produces executables we can run. If not, either | |
3691 | # the compiler is broken, or we cross compile. | |
3692 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 | |
3693 | $as_echo_n "checking whether we are cross compiling... " >&6; } | |
3694 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 | |
3695 | $as_echo "$cross_compiling" >&6; } | |
3696 | ||
3697 | 3665 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 |
3698 | 3666 | $as_echo_n "checking for suffix of executables... " >&6; } |
3699 | 3667 | if { { ac_try="$ac_link" |
3726 | 3694 | as_fn_error "cannot compute suffix of executables: cannot compile and link |
3727 | 3695 | See \`config.log' for more details." "$LINENO" 5; } |
3728 | 3696 | fi |
3729 | rm -f conftest$ac_cv_exeext | |
3697 | rm -f conftest conftest$ac_cv_exeext | |
3730 | 3698 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 |
3731 | 3699 | $as_echo "$ac_cv_exeext" >&6; } |
3732 | 3700 | |
3733 | 3701 | rm -f conftest.$ac_ext |
3734 | 3702 | EXEEXT=$ac_cv_exeext |
3735 | 3703 | ac_exeext=$EXEEXT |
3704 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
3705 | /* end confdefs.h. */ | |
3706 | #include <stdio.h> | |
3707 | int | |
3708 | main () | |
3709 | { | |
3710 | FILE *f = fopen ("conftest.out", "w"); | |
3711 | return ferror (f) || fclose (f) != 0; | |
3712 | ||
3713 | ; | |
3714 | return 0; | |
3715 | } | |
3716 | _ACEOF | |
3717 | ac_clean_files="$ac_clean_files conftest.out" | |
3718 | # Check that the compiler produces executables we can run. If not, either | |
3719 | # the compiler is broken, or we cross compile. | |
3720 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 | |
3721 | $as_echo_n "checking whether we are cross compiling... " >&6; } | |
3722 | if test "$cross_compiling" != yes; then | |
3723 | { { ac_try="$ac_link" | |
3724 | case "(($ac_try" in | |
3725 | *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; | |
3726 | *) ac_try_echo=$ac_try;; | |
3727 | esac | |
3728 | eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" | |
3729 | $as_echo "$ac_try_echo"; } >&5 | |
3730 | (eval "$ac_link") 2>&5 | |
3731 | ac_status=$? | |
3732 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | |
3733 | test $ac_status = 0; } | |
3734 | if { ac_try='./conftest$ac_cv_exeext' | |
3735 | { { case "(($ac_try" in | |
3736 | *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; | |
3737 | *) ac_try_echo=$ac_try;; | |
3738 | esac | |
3739 | eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" | |
3740 | $as_echo "$ac_try_echo"; } >&5 | |
3741 | (eval "$ac_try") 2>&5 | |
3742 | ac_status=$? | |
3743 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | |
3744 | test $ac_status = 0; }; }; then | |
3745 | cross_compiling=no | |
3746 | else | |
3747 | if test "$cross_compiling" = maybe; then | |
3748 | cross_compiling=yes | |
3749 | else | |
3750 | { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 | |
3751 | $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} | |
3752 | as_fn_error "cannot run C compiled programs. | |
3753 | If you meant to cross compile, use \`--host'. | |
3754 | See \`config.log' for more details." "$LINENO" 5; } | |
3755 | fi | |
3756 | fi | |
3757 | fi | |
3758 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 | |
3759 | $as_echo "$cross_compiling" >&6; } | |
3760 | ||
3761 | rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out | |
3762 | ac_clean_files=$ac_clean_files_save | |
3736 | 3763 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 |
3737 | 3764 | $as_echo_n "checking for suffix of object files... " >&6; } |
3738 | 3765 | if test "${ac_cv_objext+set}" = set; then : |
4707 | 4734 | else |
4708 | 4735 | lt_cv_nm_interface="BSD nm" |
4709 | 4736 | echo "int some_variable = 0;" > conftest.$ac_ext |
4710 | (eval echo "\"\$as_me:4711: $ac_compile\"" >&5) | |
4737 | (eval echo "\"\$as_me:4738: $ac_compile\"" >&5) | |
4711 | 4738 | (eval "$ac_compile" 2>conftest.err) |
4712 | 4739 | cat conftest.err >&5 |
4713 | (eval echo "\"\$as_me:4714: $NM \\\"conftest.$ac_objext\\\"\"" >&5) | |
4740 | (eval echo "\"\$as_me:4741: $NM \\\"conftest.$ac_objext\\\"\"" >&5) | |
4714 | 4741 | (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) |
4715 | 4742 | cat conftest.err >&5 |
4716 | (eval echo "\"\$as_me:4717: output\"" >&5) | |
4743 | (eval echo "\"\$as_me:4744: output\"" >&5) | |
4717 | 4744 | cat conftest.out >&5 |
4718 | 4745 | if $GREP 'External.*some_variable' conftest.out > /dev/null; then |
4719 | 4746 | lt_cv_nm_interface="MS dumpbin" |
5179 | 5206 | ;; |
5180 | 5207 | |
5181 | 5208 | # This must be Linux ELF. |
5182 | linux* | k*bsd*-gnu) | |
5209 | linux* | k*bsd*-gnu | kopensolaris*-gnu) | |
5183 | 5210 | lt_cv_deplibs_check_method=pass_all |
5184 | 5211 | ;; |
5185 | 5212 | |
5919 | 5946 | ;; |
5920 | 5947 | *-*-irix6*) |
5921 | 5948 | # Find out which ABI we are using. |
5922 | echo '#line 5923 "configure"' > conftest.$ac_ext | |
5949 | echo '#line 5950 "configure"' > conftest.$ac_ext | |
5923 | 5950 | if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 |
5924 | 5951 | (eval $ac_compile) 2>&5 |
5925 | 5952 | ac_status=$? |
7415 | 7442 | -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ |
7416 | 7443 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ |
7417 | 7444 | -e 's:$: $lt_compiler_flag:'` |
7418 | (eval echo "\"\$as_me:7419: $lt_compile\"" >&5) | |
7445 | (eval echo "\"\$as_me:7446: $lt_compile\"" >&5) | |
7419 | 7446 | (eval "$lt_compile" 2>conftest.err) |
7420 | 7447 | ac_status=$? |
7421 | 7448 | cat conftest.err >&5 |
7422 | echo "$as_me:7423: \$? = $ac_status" >&5 | |
7449 | echo "$as_me:7450: \$? = $ac_status" >&5 | |
7423 | 7450 | if (exit $ac_status) && test -s "$ac_outfile"; then |
7424 | 7451 | # The compiler can only warn and ignore the option if not recognized |
7425 | 7452 | # So say no if there are warnings other than the usual output. |
7584 | 7611 | lt_prog_compiler_static='-non_shared' |
7585 | 7612 | ;; |
7586 | 7613 | |
7587 | linux* | k*bsd*-gnu) | |
7614 | linux* | k*bsd*-gnu | kopensolaris*-gnu) | |
7588 | 7615 | case $cc_basename in |
7589 | 7616 | # old Intel for x86_64 which still supported -KPIC. |
7590 | 7617 | ecc*) |
7754 | 7781 | -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ |
7755 | 7782 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ |
7756 | 7783 | -e 's:$: $lt_compiler_flag:'` |
7757 | (eval echo "\"\$as_me:7758: $lt_compile\"" >&5) | |
7784 | (eval echo "\"\$as_me:7785: $lt_compile\"" >&5) | |
7758 | 7785 | (eval "$lt_compile" 2>conftest.err) |
7759 | 7786 | ac_status=$? |
7760 | 7787 | cat conftest.err >&5 |
7761 | echo "$as_me:7762: \$? = $ac_status" >&5 | |
7788 | echo "$as_me:7789: \$? = $ac_status" >&5 | |
7762 | 7789 | if (exit $ac_status) && test -s "$ac_outfile"; then |
7763 | 7790 | # The compiler can only warn and ignore the option if not recognized |
7764 | 7791 | # So say no if there are warnings other than the usual output. |
7859 | 7886 | -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ |
7860 | 7887 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ |
7861 | 7888 | -e 's:$: $lt_compiler_flag:'` |
7862 | (eval echo "\"\$as_me:7863: $lt_compile\"" >&5) | |
7889 | (eval echo "\"\$as_me:7890: $lt_compile\"" >&5) | |
7863 | 7890 | (eval "$lt_compile" 2>out/conftest.err) |
7864 | 7891 | ac_status=$? |
7865 | 7892 | cat out/conftest.err >&5 |
7866 | echo "$as_me:7867: \$? = $ac_status" >&5 | |
7893 | echo "$as_me:7894: \$? = $ac_status" >&5 | |
7867 | 7894 | if (exit $ac_status) && test -s out/conftest2.$ac_objext |
7868 | 7895 | then |
7869 | 7896 | # The compiler can only warn and ignore the option if not recognized |
7914 | 7941 | -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ |
7915 | 7942 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ |
7916 | 7943 | -e 's:$: $lt_compiler_flag:'` |
7917 | (eval echo "\"\$as_me:7918: $lt_compile\"" >&5) | |
7944 | (eval echo "\"\$as_me:7945: $lt_compile\"" >&5) | |
7918 | 7945 | (eval "$lt_compile" 2>out/conftest.err) |
7919 | 7946 | ac_status=$? |
7920 | 7947 | cat out/conftest.err >&5 |
7921 | echo "$as_me:7922: \$? = $ac_status" >&5 | |
7948 | echo "$as_me:7949: \$? = $ac_status" >&5 | |
7922 | 7949 | if (exit $ac_status) && test -s out/conftest2.$ac_objext |
7923 | 7950 | then |
7924 | 7951 | # The compiler can only warn and ignore the option if not recognized |
8057 | 8084 | fi |
8058 | 8085 | supports_anon_versioning=no |
8059 | 8086 | case `$LD -v 2>&1` in |
8087 | *GNU\ gold*) supports_anon_versioning=yes ;; | |
8060 | 8088 | *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 |
8061 | 8089 | *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... |
8062 | 8090 | *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... |
8148 | 8176 | 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' |
8149 | 8177 | ;; |
8150 | 8178 | |
8151 | gnu* | linux* | tpf* | k*bsd*-gnu) | |
8179 | gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) | |
8152 | 8180 | tmp_diet=no |
8153 | 8181 | if test "$host_os" = linux-dietlibc; then |
8154 | 8182 | case $cc_basename in |
9610 | 9638 | ;; |
9611 | 9639 | |
9612 | 9640 | # This must be Linux ELF. |
9613 | linux* | k*bsd*-gnu) | |
9641 | linux* | k*bsd*-gnu | kopensolaris*-gnu) | |
9614 | 9642 | version_type=linux |
9615 | 9643 | need_lib_prefix=no |
9616 | 9644 | need_version=no |
10297 | 10325 | lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 |
10298 | 10326 | lt_status=$lt_dlunknown |
10299 | 10327 | cat > conftest.$ac_ext <<_LT_EOF |
10300 | #line 10301 "configure" | |
10328 | #line 10329 "configure" | |
10301 | 10329 | #include "confdefs.h" |
10302 | 10330 | |
10303 | 10331 | #if HAVE_DLFCN_H |
10393 | 10421 | lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 |
10394 | 10422 | lt_status=$lt_dlunknown |
10395 | 10423 | cat > conftest.$ac_ext <<_LT_EOF |
10396 | #line 10397 "configure" | |
10424 | #line 10425 "configure" | |
10397 | 10425 | #include "confdefs.h" |
10398 | 10426 | |
10399 | 10427 | #if HAVE_DLFCN_H |
12993 | 13021 | # values after options handling. |
12994 | 13022 | ac_log=" |
12995 | 13023 | This file was extended by $as_me, which was |
12996 | generated by GNU Autoconf 2.64. Invocation command line was | |
13024 | generated by GNU Autoconf 2.65. Invocation command line was | |
12997 | 13025 | |
12998 | 13026 | CONFIG_FILES = $CONFIG_FILES |
12999 | 13027 | CONFIG_HEADERS = $CONFIG_HEADERS |
13033 | 13061 | |
13034 | 13062 | -h, --help print this help, then exit |
13035 | 13063 | -V, --version print version number and configuration settings, then exit |
13064 | --config print configuration, then exit | |
13036 | 13065 | -q, --quiet, --silent |
13037 | 13066 | do not print progress messages |
13038 | 13067 | -d, --debug don't remove temporary files |
13055 | 13084 | |
13056 | 13085 | _ACEOF |
13057 | 13086 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 |
13087 | ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" | |
13058 | 13088 | ac_cs_version="\\ |
13059 | 13089 | config.status |
13060 | configured by $0, generated by GNU Autoconf 2.64, | |
13061 | with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" | |
13090 | configured by $0, generated by GNU Autoconf 2.65, | |
13091 | with options \\"\$ac_cs_config\\" | |
13062 | 13092 | |
13063 | 13093 | Copyright (C) 2009 Free Software Foundation, Inc. |
13064 | 13094 | This config.status script is free software; the Free Software Foundation |
13096 | 13126 | ac_cs_recheck=: ;; |
13097 | 13127 | --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) |
13098 | 13128 | $as_echo "$ac_cs_version"; exit ;; |
13129 | --config | --confi | --conf | --con | --co | --c ) | |
13130 | $as_echo "$ac_cs_config"; exit ;; | |
13099 | 13131 | --debug | --debu | --deb | --de | --d | -d ) |
13100 | 13132 | debug=: ;; |
13101 | 13133 | --file | --fil | --fi | --f ) |
13560 | 13592 | t delim |
13561 | 13593 | :nl |
13562 | 13594 | h |
13563 | s/\(.\{148\}\).*/\1/ | |
13595 | s/\(.\{148\}\)..*/\1/ | |
13564 | 13596 | t more1 |
13565 | 13597 | s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ |
13566 | 13598 | p |
13574 | 13606 | t nl |
13575 | 13607 | :delim |
13576 | 13608 | h |
13577 | s/\(.\{148\}\).*/\1/ | |
13609 | s/\(.\{148\}\)..*/\1/ | |
13578 | 13610 | t more2 |
13579 | 13611 | s/["\\]/\\&/g; s/^/"/; s/$/"/ |
13580 | 13612 | p |
3 | 3 | |
4 | 4 | AM_CONFIG_HEADER(include/gavl/config.h) |
5 | 5 | |
6 | AM_INIT_AUTOMAKE(gavl, 1.1.2) | |
6 | AM_INIT_AUTOMAKE(gavl, 1.2.0) | |
7 | 7 | |
8 | 8 | GAVL_VERSION=$VERSION |
9 | 9 |
423 | 423 | # directories like "/usr/src/myproject". Separate the files or directories |
424 | 424 | # with spaces. |
425 | 425 | |
426 | INPUT = @TOP_SRCDIR@/doc/mainpage.incl @TOP_SRCDIR@/include/gavl/timecode.h @TOP_SRCDIR@/include/gavl/gavl.h @TOP_SRCDIR@/include/gavl/gavltime.h @TOP_SRCDIR@/include/gavl/gavldsp.h | |
426 | INPUT = @TOP_SRCDIR@/doc/mainpage.incl @TOP_SRCDIR@/include/gavl/timecode.h @TOP_SRCDIR@/include/gavl/gavl.h @TOP_SRCDIR@/include/gavl/gavltime.h @TOP_SRCDIR@/include/gavl/gavldsp.h @TOP_SRCDIR@/include/gavl/compression.h | |
427 | 427 | |
428 | 428 | # If the value of the INPUT tag contains directories, you can use the |
429 | 429 | # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp |
0 | # Makefile.in generated by automake 1.11 from Makefile.am. | |
0 | # Makefile.in generated by automake 1.11.1 from Makefile.am. | |
1 | 1 | # @configure_input@ |
2 | 2 | |
3 | 3 | # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, |
0 | # Makefile.in generated by automake 1.11 from Makefile.am. | |
0 | # Makefile.in generated by automake 1.11.1 from Makefile.am. | |
1 | 1 | # @configure_input@ |
2 | 2 | |
3 | 3 | # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
59 | 59 | blend.c \ |
60 | 60 | colorchannel.c \ |
61 | 61 | colorspace.c \ |
62 | compression.c \ | |
62 | 63 | cputest.c \ |
63 | 64 | deinterlace.c \ |
64 | 65 | deinterlace_blend.c \ |
0 | # Makefile.in generated by automake 1.11 from Makefile.am. | |
0 | # Makefile.in generated by automake 1.11.1 from Makefile.am. | |
1 | 1 | # @configure_input@ |
2 | 2 | |
3 | 3 | # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, |
83 | 83 | libgdither/libgdither.la libsamplerate/libsamplerate.la |
84 | 84 | am_libgavl_la_OBJECTS = absdiff.lo arith128.lo audioconverter.lo \ |
85 | 85 | audioformat.lo audioframe.lo audiooptions.lo blend.lo \ |
86 | colorchannel.lo colorspace.lo cputest.lo deinterlace.lo \ | |
87 | deinterlace_blend.lo deinterlace_copy.lo deinterlace_scale.lo \ | |
88 | dsp.lo dsputils.lo frametable.lo interleave.lo memcpy.lo \ | |
89 | mix.lo peakdetector.lo psnr.lo rectangle.lo sampleformat.lo \ | |
90 | samplerate.lo scale.lo scale_context.lo scale_kernels.lo \ | |
91 | scale_table.lo ssim.lo time.lo timecode.lo timer.lo \ | |
92 | transform.lo transform_context.lo transform_table.lo video.lo \ | |
93 | videoformat.lo videoframe.lo videooptions.lo volume.lo | |
86 | colorchannel.lo colorspace.lo compression.lo cputest.lo \ | |
87 | deinterlace.lo deinterlace_blend.lo deinterlace_copy.lo \ | |
88 | deinterlace_scale.lo dsp.lo dsputils.lo frametable.lo \ | |
89 | interleave.lo memcpy.lo mix.lo peakdetector.lo psnr.lo \ | |
90 | rectangle.lo sampleformat.lo samplerate.lo scale.lo \ | |
91 | scale_context.lo scale_kernels.lo scale_table.lo ssim.lo \ | |
92 | time.lo timecode.lo timer.lo transform.lo transform_context.lo \ | |
93 | transform_table.lo video.lo videoformat.lo videoframe.lo \ | |
94 | videooptions.lo volume.lo | |
94 | 95 | libgavl_la_OBJECTS = $(am_libgavl_la_OBJECTS) |
95 | 96 | DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include/gavl |
96 | 97 | depcomp = $(SHELL) $(top_srcdir)/depcomp |
318 | 319 | blend.c \ |
319 | 320 | colorchannel.c \ |
320 | 321 | colorspace.c \ |
322 | compression.c \ | |
321 | 323 | cputest.c \ |
322 | 324 | deinterlace.c \ |
323 | 325 | deinterlace_blend.c \ |
460 | 462 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/blend.Plo@am__quote@ |
461 | 463 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/colorchannel.Plo@am__quote@ |
462 | 464 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/colorspace.Plo@am__quote@ |
465 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/compression.Plo@am__quote@ | |
463 | 466 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cputest.Plo@am__quote@ |
464 | 467 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/deinterlace.Plo@am__quote@ |
465 | 468 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/deinterlace_blend.Plo@am__quote@ |
527 | 530 | # (which will cause the Makefiles to be regenerated when you run `make'); |
528 | 531 | # (2) otherwise, pass the desired values on the `make' command line. |
529 | 532 | $(RECURSIVE_TARGETS): |
530 | @failcom='exit 1'; \ | |
533 | @fail= failcom='exit 1'; \ | |
531 | 534 | for f in x $$MAKEFLAGS; do \ |
532 | 535 | case $$f in \ |
533 | 536 | *=* | --[!k]*);; \ |
552 | 555 | fi; test -z "$$fail" |
553 | 556 | |
554 | 557 | $(RECURSIVE_CLEAN_TARGETS): |
555 | @failcom='exit 1'; \ | |
558 | @fail= failcom='exit 1'; \ | |
556 | 559 | for f in x $$MAKEFLAGS; do \ |
557 | 560 | case $$f in \ |
558 | 561 | *=* | --[!k]*);; \ |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
86 | 86 | { |
87 | 87 | gavl_audio_convert_context_t * ret; |
88 | 88 | ret = calloc(1, sizeof(*ret)); |
89 | gavl_audio_format_copy(&(ret->input_format), input_format); | |
90 | gavl_audio_format_copy(&(ret->output_format), output_format); | |
89 | gavl_audio_format_copy(&ret->input_format, input_format); | |
90 | gavl_audio_format_copy(&ret->output_format, output_format); | |
91 | 91 | |
92 | 92 | return ret; |
93 | 93 | } |
116 | 116 | cnv->contexts = ctx; |
117 | 117 | } |
118 | 118 | ctx->output_format.samples_per_frame = 0; |
119 | cnv->current_format = &(ctx->output_format); | |
119 | cnv->current_format = &ctx->output_format; | |
120 | 120 | cnv->num_conversions++; |
121 | 121 | } |
122 | 122 | #if 0 |
124 | 124 | { |
125 | 125 | fprintf(stderr, "==== Conversion context ====\n"); |
126 | 126 | fprintf(stderr, "Input format:\n"); |
127 | gavl_audio_format_dump(&(ctx->input_format)); | |
127 | gavl_audio_format_dump(&ctx->input_format); | |
128 | 128 | fprintf(stderr, "Output format:\n"); |
129 | gavl_audio_format_dump(&(ctx->output_format)); | |
129 | gavl_audio_format_dump(&ctx->output_format); | |
130 | 130 | fprintf(stderr, "Func: %p\n", ctx->func); |
131 | 131 | |
132 | 132 | } |
142 | 142 | if(cnv->current_format->interleave_mode == GAVL_INTERLEAVE_2) |
143 | 143 | { |
144 | 144 | tmp_format->interleave_mode = GAVL_INTERLEAVE_NONE; |
145 | ctx = gavl_interleave_context_create(&(cnv->opt), | |
145 | ctx = gavl_interleave_context_create(&cnv->opt, | |
146 | 146 | cnv->current_format, |
147 | 147 | tmp_format); |
148 | 148 | add_context(cnv, ctx); |
151 | 151 | if(cnv->current_format->sample_format < GAVL_SAMPLE_FLOAT) |
152 | 152 | { |
153 | 153 | tmp_format->sample_format = GAVL_SAMPLE_FLOAT; |
154 | ctx = gavl_sampleformat_context_create(&(cnv->opt), | |
154 | ctx = gavl_sampleformat_context_create(&cnv->opt, | |
155 | 155 | cnv->current_format, |
156 | 156 | tmp_format); |
157 | 157 | add_context(cnv, ctx); |
158 | 158 | } |
159 | 159 | |
160 | 160 | tmp_format->samplerate = out_samplerate; |
161 | ctx = gavl_samplerate_context_create(&(cnv->opt), | |
161 | ctx = gavl_samplerate_context_create(&cnv->opt, | |
162 | 162 | cnv->current_format, |
163 | 163 | tmp_format); |
164 | 164 | add_context(cnv, ctx); |
190 | 190 | memset(&tmp_format, 0, sizeof(tmp_format)); |
191 | 191 | gavl_audio_format_copy(&tmp_format, &cnv->input_format); |
192 | 192 | |
193 | cnv->current_format = &(cnv->input_format); | |
193 | cnv->current_format = &cnv->input_format; | |
194 | 194 | |
195 | 195 | /* Check if we must mix */ |
196 | 196 | |
236 | 236 | if(cnv->current_format->interleave_mode != GAVL_INTERLEAVE_NONE) |
237 | 237 | { |
238 | 238 | tmp_format.interleave_mode = GAVL_INTERLEAVE_NONE; |
239 | ctx = gavl_interleave_context_create(&(cnv->opt), | |
239 | ctx = gavl_interleave_context_create(&cnv->opt, | |
240 | 240 | cnv->current_format, |
241 | 241 | &tmp_format); |
242 | 242 | add_context(cnv, ctx); |
247 | 247 | (cnv->output_format.sample_format == GAVL_SAMPLE_FLOAT))) |
248 | 248 | { |
249 | 249 | tmp_format.sample_format = GAVL_SAMPLE_FLOAT; |
250 | ctx = gavl_sampleformat_context_create(&(cnv->opt), | |
250 | ctx = gavl_sampleformat_context_create(&cnv->opt, | |
251 | 251 | cnv->current_format, |
252 | 252 | &tmp_format); |
253 | 253 | add_context(cnv, ctx); |
257 | 257 | (cnv->output_format.sample_format == GAVL_SAMPLE_DOUBLE))) |
258 | 258 | { |
259 | 259 | tmp_format.sample_format = GAVL_SAMPLE_DOUBLE; |
260 | ctx = gavl_sampleformat_context_create(&(cnv->opt), | |
260 | ctx = gavl_sampleformat_context_create(&cnv->opt, | |
261 | 261 | cnv->current_format, |
262 | 262 | &tmp_format); |
263 | 263 | add_context(cnv, ctx); |
267 | 267 | gavl_bytes_per_sample(cnv->output_format.sample_format)) |
268 | 268 | { |
269 | 269 | tmp_format.sample_format = cnv->output_format.sample_format; |
270 | ctx = gavl_sampleformat_context_create(&(cnv->opt), | |
270 | ctx = gavl_sampleformat_context_create(&cnv->opt, | |
271 | 271 | cnv->current_format, |
272 | 272 | &tmp_format); |
273 | 273 | add_context(cnv, ctx); |
277 | 277 | memcpy(tmp_format.channel_locations, cnv->output_format.channel_locations, |
278 | 278 | GAVL_MAX_CHANNELS * sizeof(tmp_format.channel_locations[0])); |
279 | 279 | |
280 | ctx = gavl_mix_context_create(&(cnv->opt), cnv->current_format, | |
280 | ctx = gavl_mix_context_create(&cnv->opt, cnv->current_format, | |
281 | 281 | &tmp_format); |
282 | 282 | add_context(cnv, ctx); |
283 | 283 | } |
294 | 294 | if(cnv->current_format->interleave_mode == GAVL_INTERLEAVE_2) |
295 | 295 | { |
296 | 296 | tmp_format.interleave_mode = GAVL_INTERLEAVE_NONE; |
297 | ctx = gavl_interleave_context_create(&(cnv->opt), | |
297 | ctx = gavl_interleave_context_create(&cnv->opt, | |
298 | 298 | cnv->current_format, |
299 | 299 | &tmp_format); |
300 | 300 | add_context(cnv, ctx); |
301 | 301 | } |
302 | 302 | |
303 | 303 | tmp_format.sample_format = cnv->output_format.sample_format; |
304 | ctx = gavl_sampleformat_context_create(&(cnv->opt), | |
304 | ctx = gavl_sampleformat_context_create(&cnv->opt, | |
305 | 305 | cnv->current_format, |
306 | 306 | &tmp_format); |
307 | 307 | add_context(cnv, ctx); |
313 | 313 | if(cnv->current_format->interleave_mode != cnv->output_format.interleave_mode) |
314 | 314 | { |
315 | 315 | tmp_format.interleave_mode = cnv->output_format.interleave_mode; |
316 | ctx = gavl_interleave_context_create(&(cnv->opt), | |
316 | ctx = gavl_interleave_context_create(&cnv->opt, | |
317 | 317 | cnv->current_format, |
318 | 318 | &tmp_format); |
319 | 319 | add_context(cnv, ctx); |
321 | 321 | |
322 | 322 | // fprintf(stderr, "Audio converter initialized, %d conversions\n", cnv->num_conversions); |
323 | 323 | |
324 | // gavl_audio_format_dump(&(cnv->input_format)); | |
325 | ||
326 | // gavl_audio_format_dump(&(cnv->output_format)); | |
324 | // gavl_audio_format_dump(&cnv->input_format); | |
325 | ||
326 | // gavl_audio_format_dump(&cnv->output_format); | |
327 | 327 | // gavl_audio_format_dump(cnv->current_format); |
328 | 328 | |
329 | 329 | /* Set samples_per_frame of the first context |
373 | 373 | ctx->output_format.samples_per_frame = out_samples_needed + 1024; |
374 | 374 | if(ctx->output_frame) |
375 | 375 | gavl_audio_frame_destroy(ctx->output_frame); |
376 | ctx->output_frame = gavl_audio_frame_create(&(ctx->output_format)); | |
376 | ctx->output_frame = gavl_audio_frame_create(&ctx->output_format); | |
377 | 377 | ctx->next->input_frame = ctx->output_frame; |
378 | 378 | } |
379 | 379 | ctx = ctx->next; |
384 | 384 | const gavl_audio_format_t * input_format, |
385 | 385 | const gavl_audio_format_t * output_format) |
386 | 386 | { |
387 | gavl_audio_format_copy(&(cnv->input_format), input_format); | |
388 | gavl_audio_format_copy(&(cnv->output_format), output_format); | |
389 | ||
390 | adjust_format(&(cnv->input_format)); | |
391 | adjust_format(&(cnv->output_format)); | |
387 | gavl_audio_format_copy(&cnv->input_format, input_format); | |
388 | gavl_audio_format_copy(&cnv->output_format, output_format); | |
389 | ||
390 | adjust_format(&cnv->input_format); | |
391 | adjust_format(&cnv->output_format); | |
392 | 392 | return gavl_audio_converter_reinit(cnv); |
393 | 393 | } |
394 | 394 | |
432 | 432 | gavl_audio_converter_t * gavl_audio_converter_create() |
433 | 433 | { |
434 | 434 | gavl_audio_converter_t * ret = calloc(1, sizeof(*ret)); |
435 | gavl_audio_options_set_defaults(&(ret->opt)); | |
435 | gavl_audio_options_set_defaults(&ret->opt); | |
436 | 436 | return ret; |
437 | 437 | } |
438 | 438 | |
439 | 439 | gavl_audio_options_t * |
440 | 440 | gavl_audio_converter_get_options(gavl_audio_converter_t * cnv) |
441 | 441 | { |
442 | return &(cnv->opt); | |
442 | return &cnv->opt; | |
443 | 443 | } |
444 | 444 | |
445 | 445 | |
449 | 449 | gavl_audio_format_t tmp_format; |
450 | 450 | gavl_audio_convert_context_t * ctx; |
451 | 451 | |
452 | gavl_audio_format_copy(&(cnv->input_format), format); | |
453 | gavl_audio_format_copy(&(cnv->output_format), format); | |
454 | gavl_audio_format_copy(&(tmp_format), format); | |
455 | ||
456 | adjust_format(&(cnv->input_format)); | |
457 | adjust_format(&(cnv->output_format)); | |
452 | gavl_audio_format_copy(&cnv->input_format, format); | |
453 | gavl_audio_format_copy(&cnv->output_format, format); | |
454 | gavl_audio_format_copy(&tmp_format, format); | |
455 | ||
456 | adjust_format(&cnv->input_format); | |
457 | adjust_format(&cnv->output_format); | |
458 | 458 | |
459 | 459 | // Delete previous conversions |
460 | 460 | audio_converter_cleanup(cnv); |
461 | 461 | |
462 | cnv->current_format = &(cnv->input_format); | |
462 | cnv->current_format = &cnv->input_format; | |
463 | 463 | |
464 | 464 | put_samplerate_context(cnv, &tmp_format, cnv->output_format.samplerate); |
465 | 465 | |
470 | 470 | if(cnv->current_format->interleave_mode == GAVL_INTERLEAVE_2) |
471 | 471 | { |
472 | 472 | tmp_format.interleave_mode = GAVL_INTERLEAVE_NONE; |
473 | ctx = gavl_interleave_context_create(&(cnv->opt), | |
473 | ctx = gavl_interleave_context_create(&cnv->opt, | |
474 | 474 | cnv->current_format, |
475 | 475 | &tmp_format); |
476 | 476 | add_context(cnv, ctx); |
477 | 477 | } |
478 | 478 | |
479 | 479 | tmp_format.sample_format = cnv->output_format.sample_format; |
480 | ctx = gavl_sampleformat_context_create(&(cnv->opt), | |
480 | ctx = gavl_sampleformat_context_create(&cnv->opt, | |
481 | 481 | cnv->current_format, |
482 | 482 | &tmp_format); |
483 | 483 | add_context(cnv, ctx); |
488 | 488 | if(cnv->current_format->interleave_mode != cnv->output_format.interleave_mode) |
489 | 489 | { |
490 | 490 | tmp_format.interleave_mode = cnv->output_format.interleave_mode; |
491 | ctx = gavl_interleave_context_create(&(cnv->opt), | |
491 | ctx = gavl_interleave_context_create(&cnv->opt, | |
492 | 492 | cnv->current_format, |
493 | 493 | &tmp_format); |
494 | 494 | add_context(cnv, ctx); |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
62 | 62 | memalign(ALIGNMENT_BYTES, num_samples * format->num_channels); |
63 | 63 | |
64 | 64 | for(i = 0; i < format->num_channels; i++) |
65 | ret->channels.u_8[i] = &(ret->samples.u_8[i*num_samples]); | |
65 | ret->channels.u_8[i] = &ret->samples.u_8[i*num_samples]; | |
66 | 66 | |
67 | 67 | break; |
68 | 68 | case GAVL_SAMPLE_S8: |
71 | 71 | memalign(ALIGNMENT_BYTES, num_samples * format->num_channels); |
72 | 72 | |
73 | 73 | for(i = 0; i < format->num_channels; i++) |
74 | ret->channels.s_8[i] = &(ret->samples.s_8[i*num_samples]); | |
74 | ret->channels.s_8[i] = &ret->samples.s_8[i*num_samples]; | |
75 | 75 | |
76 | 76 | break; |
77 | 77 | case GAVL_SAMPLE_U16: |
79 | 79 | ret->samples.u_16 = |
80 | 80 | memalign(ALIGNMENT_BYTES, 2 * num_samples * format->num_channels); |
81 | 81 | for(i = 0; i < format->num_channels; i++) |
82 | ret->channels.u_16[i] = &(ret->samples.u_16[i*num_samples]); | |
82 | ret->channels.u_16[i] = &ret->samples.u_16[i*num_samples]; | |
83 | 83 | |
84 | 84 | break; |
85 | 85 | case GAVL_SAMPLE_S16: |
87 | 87 | ret->samples.s_16 = |
88 | 88 | memalign(ALIGNMENT_BYTES, 2 * num_samples * format->num_channels); |
89 | 89 | for(i = 0; i < format->num_channels; i++) |
90 | ret->channels.s_16[i] = &(ret->samples.s_16[i*num_samples]); | |
90 | ret->channels.s_16[i] = &ret->samples.s_16[i*num_samples]; | |
91 | 91 | |
92 | 92 | break; |
93 | 93 | |
96 | 96 | ret->samples.s_32 = |
97 | 97 | memalign(ALIGNMENT_BYTES, 4 * num_samples * format->num_channels); |
98 | 98 | for(i = 0; i < format->num_channels; i++) |
99 | ret->channels.s_32[i] = &(ret->samples.s_32[i*num_samples]); | |
99 | ret->channels.s_32[i] = &ret->samples.s_32[i*num_samples]; | |
100 | 100 | |
101 | 101 | break; |
102 | 102 | |
106 | 106 | memalign(ALIGNMENT_BYTES, sizeof(float) * num_samples * format->num_channels); |
107 | 107 | |
108 | 108 | for(i = 0; i < format->num_channels; i++) |
109 | ret->channels.f[i] = &(ret->samples.f[i*num_samples]); | |
109 | ret->channels.f[i] = &ret->samples.f[i*num_samples]; | |
110 | 110 | |
111 | 111 | break; |
112 | 112 | case GAVL_SAMPLE_DOUBLE: |
115 | 115 | memalign(ALIGNMENT_BYTES, sizeof(double) * num_samples * format->num_channels); |
116 | 116 | |
117 | 117 | for(i = 0; i < format->num_channels; i++) |
118 | ret->channels.d[i] = &(ret->samples.d[i*num_samples]); | |
118 | ret->channels.d[i] = &ret->samples.d[i*num_samples]; | |
119 | 119 | |
120 | 120 | break; |
121 | 121 | case GAVL_SAMPLE_NONE: |
295 | 295 | case GAVL_INTERLEAVE_NONE: |
296 | 296 | for(i = 0; i < format->num_channels; i++) |
297 | 297 | { |
298 | gavl_memcpy(&(dst->channels.s_8[i][out_pos * bytes_per_sample]), | |
299 | &(src->channels.s_8[i][in_pos * bytes_per_sample]), | |
298 | gavl_memcpy(&dst->channels.s_8[i][out_pos * bytes_per_sample], | |
299 | &src->channels.s_8[i][in_pos * bytes_per_sample], | |
300 | 300 | samples_to_copy * bytes_per_sample); |
301 | 301 | } |
302 | 302 | break; |
303 | 303 | case GAVL_INTERLEAVE_2: |
304 | 304 | for(i = 0; i < format->num_channels/2; i++) |
305 | 305 | { |
306 | gavl_memcpy(&(dst->channels.s_8[i*2][2 * out_pos * bytes_per_sample]), | |
307 | &(src->channels.s_8[i*2][2 * in_pos * bytes_per_sample]), | |
306 | gavl_memcpy(&dst->channels.s_8[i*2][2 * out_pos * bytes_per_sample], | |
307 | &src->channels.s_8[i*2][2 * in_pos * bytes_per_sample], | |
308 | 308 | 2*samples_to_copy * bytes_per_sample); |
309 | 309 | } |
310 | 310 | /* Last channel is not interleaved */ |
311 | 311 | if(format->num_channels & 1) |
312 | 312 | { |
313 | gavl_memcpy(&(dst->channels.s_8[format->num_channels-1][2 * out_pos * bytes_per_sample]), | |
314 | &(src->channels.s_8[format->num_channels-1][2 * in_pos * bytes_per_sample]), | |
313 | gavl_memcpy(&dst->channels.s_8[format->num_channels-1][2 * out_pos * bytes_per_sample], | |
314 | &src->channels.s_8[format->num_channels-1][2 * in_pos * bytes_per_sample], | |
315 | 315 | 2*samples_to_copy * bytes_per_sample); |
316 | 316 | } |
317 | 317 | break; |
318 | 318 | case GAVL_INTERLEAVE_ALL: |
319 | gavl_memcpy(&(dst->samples.s_8[format->num_channels * out_pos * bytes_per_sample]), | |
320 | &(src->samples.s_8[format->num_channels * in_pos * bytes_per_sample]), | |
319 | gavl_memcpy(&dst->samples.s_8[format->num_channels * out_pos * bytes_per_sample], | |
320 | &src->samples.s_8[format->num_channels * in_pos * bytes_per_sample], | |
321 | 321 | format->num_channels * samples_to_copy * bytes_per_sample); |
322 | 322 | break; |
323 | 323 | } |
363 | 363 | } |
364 | 364 | dst->valid_samples = len; |
365 | 365 | } |
366 | ||
367 | int gavl_audio_frames_equal(const gavl_audio_format_t * format, | |
368 | const gavl_audio_frame_t * f1, | |
369 | const gavl_audio_frame_t * f2) | |
370 | { | |
371 | int i; | |
372 | int bytes; | |
373 | ||
374 | if(f1->valid_samples != f2->valid_samples) | |
375 | return 0; | |
376 | ||
377 | switch(format->interleave_mode) | |
378 | { | |
379 | case GAVL_INTERLEAVE_ALL: | |
380 | bytes = f1->valid_samples * format->num_channels * | |
381 | gavl_bytes_per_sample(format->sample_format); | |
382 | if(memcmp(f1->samples.s_8, f2->samples.s_8, bytes)) | |
383 | return 0; | |
384 | break; | |
385 | case GAVL_INTERLEAVE_2: | |
386 | bytes = f1->valid_samples * 2 * | |
387 | gavl_bytes_per_sample(format->sample_format); | |
388 | ||
389 | for(i = 0; i < format->num_channels/2; i++) | |
390 | { | |
391 | if(memcmp(f1->channels.s_8[i*2], f2->channels.s_8[i*2], bytes)) | |
392 | return 0; | |
393 | } | |
394 | if(format->num_channels % 2) | |
395 | { | |
396 | if(memcmp(f1->channels.s_8[format->num_channels-1], | |
397 | f2->channels.s_8[format->num_channels-1], bytes/2)) | |
398 | return 0; | |
399 | } | |
400 | break; | |
401 | case GAVL_INTERLEAVE_NONE: | |
402 | bytes = f1->valid_samples * | |
403 | gavl_bytes_per_sample(format->sample_format); | |
404 | for(i = 0; i < format->num_channels/2; i++) | |
405 | { | |
406 | if(memcmp(f1->channels.s_8[i], f2->channels.s_8[i], bytes)) | |
407 | return 0; | |
408 | } | |
409 | break; | |
410 | } | |
411 | return 1; | |
412 | } | |
413 | ||
414 | static void do_plot(const gavl_audio_format_t * format, | |
415 | const gavl_audio_frame_t * frame, | |
416 | FILE * out) | |
417 | { | |
418 | int i, j; | |
419 | for(j = 0; j < frame->valid_samples; j++) | |
420 | { | |
421 | fprintf(out, "%d", j); | |
422 | switch(format->sample_format) | |
423 | { | |
424 | case GAVL_SAMPLE_U8: | |
425 | for(i = 0; i < format->num_channels; i++) | |
426 | fprintf(out, " %d", frame->channels.u_8[i][j]); | |
427 | break; | |
428 | case GAVL_SAMPLE_S8: | |
429 | for(i = 0; i < format->num_channels; i++) | |
430 | fprintf(out, " %d", frame->channels.s_8[i][j]); | |
431 | ||
432 | break; | |
433 | case GAVL_SAMPLE_U16: | |
434 | for(i = 0; i < format->num_channels; i++) | |
435 | fprintf(out, " %d", frame->channels.u_16[i][j]); | |
436 | ||
437 | break; | |
438 | case GAVL_SAMPLE_S16: | |
439 | for(i = 0; i < format->num_channels; i++) | |
440 | fprintf(out, " %d", frame->channels.s_16[i][j]); | |
441 | ||
442 | break; | |
443 | ||
444 | case GAVL_SAMPLE_S32: | |
445 | for(i = 0; i < format->num_channels; i++) | |
446 | fprintf(out, " %d", frame->channels.s_32[i][j]); | |
447 | ||
448 | break; | |
449 | ||
450 | case GAVL_SAMPLE_FLOAT: | |
451 | for(i = 0; i < format->num_channels; i++) | |
452 | fprintf(out, " %f", frame->channels.f[i][j]); | |
453 | ||
454 | break; | |
455 | case GAVL_SAMPLE_DOUBLE: | |
456 | for(i = 0; i < format->num_channels; i++) | |
457 | fprintf(out, " %f", frame->channels.d[i][j]); | |
458 | ||
459 | break; | |
460 | case GAVL_SAMPLE_NONE: | |
461 | break; | |
462 | } | |
463 | fprintf(out, "\n"); | |
464 | } | |
465 | } | |
466 | ||
467 | ||
468 | int gavl_audio_frame_plot(const gavl_audio_format_t * format, | |
469 | const gavl_audio_frame_t * frame, | |
470 | const char * name_base) | |
471 | { | |
472 | int i; | |
473 | gavl_audio_converter_t * cnv; | |
474 | gavl_audio_format_t plot_format; | |
475 | int do_convert; | |
476 | FILE * out; | |
477 | char * filename = malloc(strlen(name_base) + 5); | |
478 | ||
479 | /* Write data file */ | |
480 | strcpy(filename, name_base); | |
481 | strcat(filename, ".dat"); | |
482 | out = fopen(filename, "w"); | |
483 | if(!out) | |
484 | return 0; | |
485 | ||
486 | cnv = gavl_audio_converter_create(); | |
487 | gavl_audio_format_copy(&plot_format, | |
488 | format); | |
489 | plot_format.interleave_mode = GAVL_INTERLEAVE_NONE; | |
490 | ||
491 | plot_format.samples_per_frame = frame->valid_samples; | |
492 | ||
493 | do_convert = | |
494 | gavl_audio_converter_init(cnv, format, &plot_format); | |
495 | ||
496 | if(do_convert) | |
497 | { | |
498 | gavl_audio_frame_t * plot_frame = gavl_audio_frame_create(&plot_format); | |
499 | gavl_audio_convert(cnv, frame, plot_frame); | |
500 | ||
501 | do_plot(&plot_format, plot_frame, out); | |
502 | gavl_audio_frame_destroy(plot_frame); | |
503 | } | |
504 | else | |
505 | do_plot(format, frame, out); | |
506 | ||
507 | fclose(out); | |
508 | ||
509 | /* Write gnuplot file */ | |
510 | strcpy(filename, name_base); | |
511 | strcat(filename, ".gnu"); | |
512 | out = fopen(filename, "w"); | |
513 | if(!out) | |
514 | return 0; | |
515 | ||
516 | fprintf(out, "plot "); | |
517 | ||
518 | for(i = 0; i < format->num_channels; i++) | |
519 | { | |
520 | if(i) | |
521 | fprintf(out, ", "); | |
522 | fprintf(out, "\"%s.dat\" using 1:%d title \"%s\"", | |
523 | name_base, i+2, | |
524 | gavl_channel_id_to_string(format->channel_locations[i])); | |
525 | } | |
526 | fprintf(out, "\n"); | |
527 | fclose(out); | |
528 | return 1; | |
529 | } |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
56 | 56 | gavl_video_options_t * |
57 | 57 | gavl_overlay_blend_context_get_options(gavl_overlay_blend_context_t * ctx) |
58 | 58 | { |
59 | return &(ctx->opt); | |
59 | return &ctx->opt; | |
60 | 60 | } |
61 | 61 | |
62 | 62 | int |
80 | 80 | return 0; |
81 | 81 | |
82 | 82 | /* Copy formats */ |
83 | gavl_video_format_copy(&(ctx->dst_format), dst_format); | |
84 | gavl_video_format_copy(&(ctx->ovl_format), ovl_format); | |
83 | gavl_video_format_copy(&ctx->dst_format, dst_format); | |
84 | gavl_video_format_copy(&ctx->ovl_format, ovl_format); | |
85 | 85 | |
86 | 86 | /* Get chroma subsampling of the destination */ |
87 | 87 | gavl_pixelformat_chroma_sub(dst_format->pixelformat, |
88 | &(ctx->dst_sub_h), &(ctx->dst_sub_v)); | |
88 | &ctx->dst_sub_h, &ctx->dst_sub_v); | |
89 | 89 | |
90 | 90 | /* Get blend function */ |
91 | 91 | |
92 | 92 | ctx->func = |
93 | 93 | gavl_find_blend_func_c(ctx, |
94 | 94 | dst_format->pixelformat, |
95 | &(ctx->ovl_format.pixelformat)); | |
95 | &ctx->ovl_format.pixelformat); | |
96 | 96 | |
97 | 97 | ctx->ovl_win = gavl_video_frame_create((gavl_video_format_t*)0); |
98 | gavl_video_format_copy(ovl_format, &(ctx->ovl_format)); | |
98 | gavl_video_format_copy(ovl_format, &ctx->ovl_format); | |
99 | 99 | return 1; |
100 | 100 | } |
101 | 101 | |
179 | 179 | gavl_video_frame_get_subframe(ctx->ovl_format.pixelformat, |
180 | 180 | ovl->frame, |
181 | 181 | ctx->ovl_win, |
182 | &(ctx->ovl.ovl_rect)); | |
182 | &ctx->ovl.ovl_rect); | |
183 | 183 | } |
184 | 184 | |
185 | 185 | void gavl_overlay_blend(gavl_overlay_blend_context_t * ctx, |
192 | 192 | gavl_video_frame_get_subframe(ctx->dst_format.pixelformat, |
193 | 193 | dst_frame, |
194 | 194 | ctx->dst_win, |
195 | &(ctx->dst_rect)); | |
195 | &ctx->dst_rect); | |
196 | 196 | /* Fire up blender */ |
197 | 197 | |
198 | 198 | ctx->func(ctx, ctx->dst_win, ctx->ovl_win); |
0 | # Makefile.in generated by automake 1.11 from Makefile.am. | |
0 | # Makefile.in generated by automake 1.11.1 from Makefile.am. | |
1 | 1 | # @configure_input@ |
2 | 2 | |
3 | 3 | # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
4408 | 4408 | int min_penalty; |
4409 | 4409 | int min_index; |
4410 | 4410 | int i, test; |
4411 | ||
4412 | if(!dst_supported || (dst_supported[0] == GAVL_PIXELFORMAT_NONE)) | |
4413 | return GAVL_PIXELFORMAT_NONE; | |
4411 | 4414 | |
4412 | 4415 | min_penalty = |
4413 | 4416 | gavl_pixelformat_conversion_penalty(src, |
0 | /***************************************************************** | |
1 | * gavl - a general purpose audio/video processing library | |
2 | * | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | * gmerlin-general@lists.sourceforge.net | |
5 | * http://gmerlin.sourceforge.net | |
6 | * | |
7 | * This program is free software: you can redistribute it and/or modify | |
8 | * it under the terms of the GNU General Public License as published by | |
9 | * the Free Software Foundation, either version 2 of the License, or | |
10 | * (at your option) any later version. | |
11 | * | |
12 | * This program is distributed in the hope that it will be useful, | |
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | * GNU General Public License for more details. | |
16 | * | |
17 | * You should have received a copy of the GNU General Public License | |
18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
19 | * *****************************************************************/ | |
20 | #include <stdlib.h> | |
21 | #include <stdio.h> | |
22 | ||
23 | #include <gavl/gavl.h> | |
24 | #include <gavl/compression.h> | |
25 | ||
26 | ||
27 | static void hexdump(const uint8_t * data, int len, int linebreak) | |
28 | { | |
29 | int i; | |
30 | int bytes_written = 0; | |
31 | int imax; | |
32 | ||
33 | while(bytes_written < len) | |
34 | { | |
35 | imax = (bytes_written + linebreak > len) ? len - bytes_written : linebreak; | |
36 | for(i = 0; i < imax; i++) | |
37 | fprintf(stderr, "%02x ", data[bytes_written + i]); | |
38 | for(i = imax; i < linebreak; i++) | |
39 | fprintf(stderr, " "); | |
40 | for(i = 0; i < imax; i++) | |
41 | { | |
42 | if((data[bytes_written + i] < 0x7f) && (data[bytes_written + i] >= 32)) | |
43 | fprintf(stderr, "%c", data[bytes_written + i]); | |
44 | else | |
45 | fprintf(stderr, "."); | |
46 | } | |
47 | bytes_written += imax; | |
48 | fprintf(stderr, "\n"); | |
49 | } | |
50 | } | |
51 | ||
52 | ||
53 | void gavl_compression_info_free(gavl_compression_info_t * info) | |
54 | { | |
55 | if(info->global_header) | |
56 | free(info->global_header); | |
57 | } | |
58 | ||
59 | #define FLAG_SEPARATE (1<<0) | |
60 | #define FLAG_NEEDS_PIXELFORMAT (1<<1) | |
61 | ||
62 | struct | |
63 | { | |
64 | gavl_codec_id_t id; | |
65 | const char * extension; | |
66 | const char * name; | |
67 | int flags; | |
68 | } | |
69 | compression_ids[] = | |
70 | { | |
71 | /* Audio */ | |
72 | { GAVL_CODEC_ID_ALAW, NULL, "alaw" }, | |
73 | { GAVL_CODEC_ID_ULAW, NULL, "ulaw" }, | |
74 | { GAVL_CODEC_ID_MP2, "mp2", "MPEG layer 2" }, | |
75 | { GAVL_CODEC_ID_MP3, "mp3", "MPEG layer 3" }, | |
76 | { GAVL_CODEC_ID_AC3, "ac3", "AC3" }, | |
77 | { GAVL_CODEC_ID_AAC, NULL, "AAC" }, | |
78 | { GAVL_CODEC_ID_VORBIS, NULL, "Vorbis" }, | |
79 | ||
80 | /* Video */ | |
81 | { GAVL_CODEC_ID_JPEG, "jpg", "JPEG image", FLAG_SEPARATE | FLAG_NEEDS_PIXELFORMAT }, | |
82 | { GAVL_CODEC_ID_PNG, "png", "PNG image", FLAG_SEPARATE | FLAG_NEEDS_PIXELFORMAT }, | |
83 | { GAVL_CODEC_ID_TIFF, "tif", "TIFF image", FLAG_SEPARATE | FLAG_NEEDS_PIXELFORMAT }, | |
84 | { GAVL_CODEC_ID_TGA, "tga", "TGA image", FLAG_SEPARATE | FLAG_NEEDS_PIXELFORMAT }, | |
85 | { GAVL_CODEC_ID_MPEG1, "mpv", "MPEG-1" }, | |
86 | { GAVL_CODEC_ID_MPEG2, "mpv", "MPEG-2", FLAG_NEEDS_PIXELFORMAT }, | |
87 | { GAVL_CODEC_ID_MPEG4_ASP, "m4v", "MPEG-4 ASP" }, | |
88 | { GAVL_CODEC_ID_H264, "h264", "H.264" }, | |
89 | { GAVL_CODEC_ID_THEORA, NULL, "Theora" }, | |
90 | { GAVL_CODEC_ID_DIRAC, NULL, "Dirac" }, | |
91 | { GAVL_CODEC_ID_DV, "dv", "DV", FLAG_NEEDS_PIXELFORMAT }, | |
92 | ||
93 | }; | |
94 | ||
95 | const char * gavl_compression_get_extension(gavl_codec_id_t id, int * separate) | |
96 | { | |
97 | int i; | |
98 | for(i = 0; i < sizeof(compression_ids)/sizeof(compression_ids[0]); i++) | |
99 | { | |
100 | if(compression_ids[i].id == id) | |
101 | { | |
102 | if(separate) | |
103 | *separate = !!(compression_ids[i].flags & FLAG_SEPARATE); | |
104 | return compression_ids[i].extension; | |
105 | } | |
106 | } | |
107 | return NULL; | |
108 | } | |
109 | ||
110 | int gavl_compression_need_pixelformat(gavl_codec_id_t id) | |
111 | { | |
112 | int i; | |
113 | for(i = 0; i < sizeof(compression_ids)/sizeof(compression_ids[0]); i++) | |
114 | { | |
115 | if(compression_ids[i].id == id) | |
116 | return !!(compression_ids[i].flags & FLAG_NEEDS_PIXELFORMAT); | |
117 | } | |
118 | return 0; | |
119 | } | |
120 | ||
121 | ||
122 | static const char * | |
123 | get_name(gavl_codec_id_t id) | |
124 | { | |
125 | int i; | |
126 | for(i = 0; i < sizeof(compression_ids)/sizeof(compression_ids[0]); i++) | |
127 | { | |
128 | if(compression_ids[i].id == id) | |
129 | { | |
130 | return compression_ids[i].name; | |
131 | } | |
132 | } | |
133 | return NULL; | |
134 | } | |
135 | ||
136 | void gavl_compression_info_dump(const gavl_compression_info_t * info) | |
137 | { | |
138 | fprintf(stderr, "Compression info\n"); | |
139 | fprintf(stderr, " Codec: %s\n", get_name(info->id)); | |
140 | fprintf(stderr, " Bitrate: %d bps\n", info->bitrate); | |
141 | ||
142 | if(info->id >= 0x10000) | |
143 | { | |
144 | fprintf(stderr, " Palette size: %d\n", info->palette_size); | |
145 | fprintf(stderr, " Frame types: I"); | |
146 | if(info->flags & GAVL_COMPRESSION_HAS_P_FRAMES) | |
147 | fprintf(stderr, ",P"); | |
148 | if(info->flags & GAVL_COMPRESSION_HAS_B_FRAMES) | |
149 | fprintf(stderr, ",B"); | |
150 | fprintf(stderr, "\n"); | |
151 | } | |
152 | else | |
153 | { | |
154 | fprintf(stderr, " SBR: %s\n", | |
155 | (info->flags & GAVL_COMPRESSION_SBR ? "Yes" : "No")); | |
156 | } | |
157 | ||
158 | fprintf(stderr, " Global header %d bytes", info->global_header_len); | |
159 | if(info->global_header_len) | |
160 | { | |
161 | fprintf(stderr, " (hexdump follows)\n"); | |
162 | hexdump(info->global_header, | |
163 | info->global_header_len, 16); | |
164 | } | |
165 | else | |
166 | fprintf(stderr, "\n"); | |
167 | } | |
168 | ||
169 | GAVL_PUBLIC | |
170 | void gavl_packet_alloc(gavl_packet_t * p, int len) | |
171 | { | |
172 | if(len > p->data_alloc) | |
173 | { | |
174 | p->data_alloc = len + 1024; | |
175 | p->data = realloc(p->data, p->data_alloc); | |
176 | } | |
177 | } | |
178 | ||
179 | GAVL_PUBLIC | |
180 | void gavl_packet_free(gavl_packet_t * p) | |
181 | { | |
182 | if(p->data) | |
183 | free(p->data); | |
184 | } | |
185 | ||
186 | void gavl_packet_dump(const gavl_packet_t * p) | |
187 | { | |
188 | fprintf(stderr, "Packet: sz: %d ", p->data_len); | |
189 | ||
190 | if(p->pts != GAVL_TIME_UNDEFINED) | |
191 | fprintf(stderr, "pts: %"PRId64" ", p->pts); | |
192 | else | |
193 | fprintf(stderr, "pts: None "); | |
194 | ||
195 | fprintf(stderr, "dur: %"PRId64, p->duration); | |
196 | ||
197 | fprintf(stderr, " head: %d, f2: %d\n", | |
198 | p->header_size, p->field2_offset); | |
199 | ||
200 | hexdump(p->data, p->data_len < 16 ? p->data_len : 16, 16); | |
201 | ||
202 | } |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
54 | 54 | gavl_video_options_t * |
55 | 55 | gavl_video_deinterlacer_get_options(gavl_video_deinterlacer_t * d) |
56 | 56 | { |
57 | return &(d->opt); | |
57 | return &d->opt; | |
58 | 58 | } |
59 | 59 | |
60 | 60 | |
62 | 62 | const gavl_video_format_t * src_format) |
63 | 63 | { |
64 | 64 | |
65 | gavl_video_format_copy(&(d->format), src_format); | |
66 | gavl_video_format_copy(&(d->half_height_format), src_format); | |
65 | gavl_video_format_copy(&d->format, src_format); | |
66 | gavl_video_format_copy(&d->half_height_format, src_format); | |
67 | 67 | |
68 | if((d->format.interlace_mode == GAVL_INTERLACE_MIXED) || | |
69 | (d->format.interlace_mode == GAVL_INTERLACE_MIXED_TOP) || | |
70 | (d->format.interlace_mode == GAVL_INTERLACE_MIXED_BOTTOM)) | |
71 | d->mixed = 1; | |
72 | else | |
73 | d->mixed = 0; | |
74 | ||
68 | 75 | d->half_height_format.image_height /= 2; |
69 | 76 | d->half_height_format.frame_height /= 2; |
70 | 77 | |
93 | 100 | const gavl_video_frame_t * input_frame, |
94 | 101 | gavl_video_frame_t * output_frame) |
95 | 102 | { |
96 | if(d->format.interlace_mode == GAVL_INTERLACE_MIXED) | |
103 | if(d->mixed) | |
97 | 104 | { |
98 | 105 | if((input_frame->interlace_mode != GAVL_INTERLACE_NONE) || |
99 | 106 | (d->opt.conversion_flags & GAVL_FORCE_DEINTERLACE)) |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | # Makefile.in generated by automake 1.11 from Makefile.am. | |
0 | # Makefile.in generated by automake 1.11.1 from Makefile.am. | |
1 | 1 | # @configure_input@ |
2 | 2 | |
3 | 3 | # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
234 | 234 | |
235 | 235 | table = gavl_create_interleave_table(opt); |
236 | 236 | ret->func = |
237 | gavl_find_interleave_converter(table, &(ret->input_format), | |
238 | &(ret->output_format)); | |
237 | gavl_find_interleave_converter(table, &ret->input_format, | |
238 | &ret->output_format); | |
239 | 239 | |
240 | 240 | gavl_destroy_interleave_table(table); |
241 | 241 | return ret; |
0 | # Makefile.in generated by automake 1.11 from Makefile.am. | |
0 | # Makefile.in generated by automake 1.11.1 from Makefile.am. | |
1 | 1 | # @configure_input@ |
2 | 2 | |
3 | 3 | # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, |
0 | # Makefile.in generated by automake 1.11 from Makefile.am. | |
0 | # Makefile.in generated by automake 1.11.1 from Makefile.am. | |
1 | 1 | # @configure_input@ |
2 | 2 | |
3 | 3 | # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
214 | 214 | { |
215 | 215 | register unsigned long int delta; |
216 | 216 | /* Align destinition to MMREG_SIZE -boundary */ |
217 | delta = ((unsigned long int)to)&(SSE_MMREG_SIZE-1); | |
217 | delta = ((unsigned long int)to) & (SSE_MMREG_SIZE-1); | |
218 | 218 | if(delta) |
219 | 219 | { |
220 | 220 | delta=SSE_MMREG_SIZE-delta; |
291 | 291 | { |
292 | 292 | register unsigned long int delta; |
293 | 293 | /* Align destinition to MMREG_SIZE -boundary */ |
294 | delta = ((unsigned long int)to)&(MMX_MMREG_SIZE-1); | |
294 | delta = ((unsigned long int)to) & (MMX_MMREG_SIZE-1); | |
295 | 295 | if(delta) |
296 | 296 | { |
297 | 297 | delta=MMX_MMREG_SIZE-delta; |
356 | 356 | { |
357 | 357 | register unsigned long int delta; |
358 | 358 | /* Align destinition to MMREG_SIZE -boundary */ |
359 | delta = ((unsigned long int)to)&(MMX_MMREG_SIZE-1); | |
359 | delta = ((unsigned long int)to) & (MMX_MMREG_SIZE-1); | |
360 | 360 | if(delta) |
361 | 361 | { |
362 | 362 | delta=MMX_MMREG_SIZE-delta; |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
65 | 65 | |
66 | 66 | for(i = 0; i < c->num_inputs; i++) |
67 | 67 | { |
68 | input_channel_dump(&(c->inputs[i])); | |
68 | input_channel_dump(&c->inputs[i]); | |
69 | 69 | } |
70 | 70 | } |
71 | 71 | #endif |
76 | 76 | for(i = 0; i < ctx->output_format.num_channels; i++) |
77 | 77 | { |
78 | 78 | if(ctx->mix_matrix->output_channels[i].func) |
79 | ctx->mix_matrix->output_channels[i].func(&(ctx->mix_matrix->output_channels[i]), | |
79 | ctx->mix_matrix->output_channels[i].func(&ctx->mix_matrix->output_channels[i], | |
80 | 80 | ctx->input_frame, |
81 | 81 | ctx->output_frame); |
82 | 82 | else |
83 | 83 | /* This happens, if channels in the output are muted */ |
84 | 84 | gavl_audio_frame_mute_channel(ctx->output_frame, |
85 | &(ctx->output_format), i); | |
85 | &ctx->output_format, i); | |
86 | 86 | } |
87 | 87 | } |
88 | 88 | |
777 | 777 | |
778 | 778 | if(matrix[i][j] != 0.0) |
779 | 779 | { |
780 | set_factor(&(ctx->output_channels[i].inputs[num_inputs]), | |
780 | set_factor(&ctx->output_channels[i].inputs[num_inputs], | |
781 | 781 | matrix[i][j], in_format->sample_format); |
782 | 782 | ctx->output_channels[i].inputs[num_inputs].index = j; |
783 | 783 | num_inputs++; |
831 | 831 | } |
832 | 832 | } |
833 | 833 | #ifdef DUMP_MATRIX |
834 | output_channel_dump(&(ctx->output_channels[i])); | |
834 | output_channel_dump(&ctx->output_channels[i]); | |
835 | 835 | #endif |
836 | 836 | } |
837 | 837 | |
888 | 888 | out_format->channel_locations, |
889 | 889 | GAVL_MAX_CHANNELS * sizeof(out_format->channel_locations[0])); |
890 | 890 | ret->mix_matrix = gavl_create_mix_matrix(opt, |
891 | &(ret->input_format), | |
892 | &(ret->output_format)); | |
891 | &ret->input_format, | |
892 | &ret->output_format); | |
893 | 893 | ret->func = gavl_mix_audio; |
894 | 894 | |
895 | 895 | return ret; |
0 | # Makefile.in generated by automake 1.11 from Makefile.am. | |
0 | # Makefile.in generated by automake 1.11.1 from Makefile.am. | |
1 | 1 | # @configure_input@ |
2 | 2 | |
3 | 3 | # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | # Makefile.in generated by automake 1.11 from Makefile.am. | |
0 | # Makefile.in generated by automake 1.11.1 from Makefile.am. | |
1 | 1 | # @configure_input@ |
2 | 2 | |
3 | 3 | # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
270 | 270 | int w, int h, int advance) |
271 | 271 | { |
272 | 272 | int i, j; |
273 | const uint16_t *s1; | |
274 | const uint16_t *s2; | |
273 | const float *s1; | |
274 | const float *s2; | |
275 | 275 | double ret = 0; |
276 | 276 | double diff; |
277 | 277 | for(i = 0; i < h; i++) |
278 | 278 | { |
279 | s1 = (const uint16_t *)(src1 + i * src1_stride); | |
280 | s2 = (const uint16_t *)(src2 + i * src2_stride); | |
281 | ||
282 | for(j = 0; j < w; j++) | |
283 | { | |
284 | diff = *s1 - *s2; | |
279 | s1 = (const float *)(src1 + i * src1_stride); | |
280 | s2 = (const float *)(src2 + i * src2_stride); | |
281 | ||
282 | for(j = 0; j < w; j++) | |
283 | { | |
284 | diff = (*s1) - (*s2); | |
285 | 285 | diff *= diff; |
286 | 286 | ret += diff; |
287 | 287 | s1+= advance; |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
147 | 147 | const gavl_video_format_t * src_format, |
148 | 148 | const gavl_video_format_t * dst_format) |
149 | 149 | { |
150 | crop_dimension_scale(&(src_rect->x), &(src_rect->w), src_format->image_width, | |
151 | &(dst_rect->x), &(dst_rect->w), dst_format->image_width); | |
152 | crop_dimension_scale(&(src_rect->y), &(src_rect->h), src_format->image_height, | |
153 | &(dst_rect->y), &(dst_rect->h), dst_format->image_height); | |
150 | crop_dimension_scale(&src_rect->x, &src_rect->w, src_format->image_width, | |
151 | &dst_rect->x, &dst_rect->w, dst_format->image_width); | |
152 | crop_dimension_scale(&src_rect->y, &src_rect->h, src_format->image_height, | |
153 | &dst_rect->y, &dst_rect->h, dst_format->image_height); | |
154 | 154 | } |
155 | 155 | |
156 | 156 |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
272 | 272 | |
273 | 273 | |
274 | 274 | ret->func = |
275 | gavl_find_sampleformat_converter(table, &(ret->input_format), | |
276 | &(ret->output_format)); | |
275 | gavl_find_sampleformat_converter(table, &ret->input_format, | |
276 | &ret->output_format); | |
277 | 277 | /* if(!ret->func) */ |
278 | 278 | /* fprintf(stderr, "No function found\n"); */ |
279 | 279 | gavl_destroy_sampleformat_table(table); |
363 | 363 | default: |
364 | 364 | fprintf(stderr, "BUG: Invalid dither initialization\n"); |
365 | 365 | fprintf(stderr, "Input format\n"); |
366 | gavl_audio_format_dump(&(ret->input_format)); | |
366 | gavl_audio_format_dump(&ret->input_format); | |
367 | 367 | fprintf(stderr, "Output format\n"); |
368 | gavl_audio_format_dump(&(ret->output_format)); | |
368 | gavl_audio_format_dump(&ret->output_format); | |
369 | 369 | return NULL; |
370 | 370 | } |
371 | 371 |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
88 | 88 | ctx->samplerate_converter->data.data_in_f = ctx->input_frame->channels.f[i]; |
89 | 89 | ctx->samplerate_converter->data.data_out_f = ctx->output_frame->channels.f[i]; |
90 | 90 | result = gavl_src_process(ctx->samplerate_converter->resamplers[i], |
91 | &(ctx->samplerate_converter->data)); | |
91 | &ctx->samplerate_converter->data); | |
92 | 92 | if(result) |
93 | 93 | { |
94 | 94 | fprintf(stderr, "gavl_src_process returned %s (%p)\n", gavl_src_strerror(result), ctx->output_frame->samples.f); |
115 | 115 | ctx->samplerate_converter->data.data_out_f = |
116 | 116 | ctx->output_frame->channels.f[2*i]; |
117 | 117 | gavl_src_process(ctx->samplerate_converter->resamplers[i], |
118 | &(ctx->samplerate_converter->data)); | |
118 | &ctx->samplerate_converter->data); | |
119 | 119 | } |
120 | 120 | ctx->output_frame->valid_samples = |
121 | 121 | ctx->samplerate_converter->data.output_frames_gen; |
132 | 132 | ctx->samplerate_converter->data.data_in_f = ctx->input_frame->samples.f; |
133 | 133 | ctx->samplerate_converter->data.data_out_f = ctx->output_frame->samples.f; |
134 | 134 | gavl_src_process(ctx->samplerate_converter->resamplers[0], |
135 | &(ctx->samplerate_converter->data)); | |
135 | &ctx->samplerate_converter->data); | |
136 | 136 | ctx->output_frame->valid_samples = |
137 | 137 | ctx->samplerate_converter->data.output_frames_gen; |
138 | 138 | } |
149 | 149 | ctx->samplerate_converter->data.data_in_d = ctx->input_frame->channels.d[i]; |
150 | 150 | ctx->samplerate_converter->data.data_out_d = ctx->output_frame->channels.d[i]; |
151 | 151 | result = gavl_src_process(ctx->samplerate_converter->resamplers[i], |
152 | &(ctx->samplerate_converter->data)); | |
152 | &ctx->samplerate_converter->data); | |
153 | 153 | if(result) |
154 | 154 | { |
155 | 155 | fprintf(stderr, "gavl_src_process returned %s (%p)\n", gavl_src_strerror(result), ctx->output_frame->samples.f); |
176 | 176 | ctx->samplerate_converter->data.data_out_d = |
177 | 177 | ctx->output_frame->channels.d[2*i]; |
178 | 178 | gavl_src_process(ctx->samplerate_converter->resamplers[i], |
179 | &(ctx->samplerate_converter->data)); | |
179 | &ctx->samplerate_converter->data); | |
180 | 180 | } |
181 | 181 | ctx->output_frame->valid_samples = |
182 | 182 | ctx->samplerate_converter->data.output_frames_gen; |
193 | 193 | ctx->samplerate_converter->data.data_in_d = ctx->input_frame->samples.d; |
194 | 194 | ctx->samplerate_converter->data.data_out_d = ctx->output_frame->samples.d; |
195 | 195 | gavl_src_process(ctx->samplerate_converter->resamplers[0], |
196 | &(ctx->samplerate_converter->data)); | |
196 | &ctx->samplerate_converter->data); | |
197 | 197 | ctx->output_frame->valid_samples = |
198 | 198 | ctx->samplerate_converter->data.output_frames_gen; |
199 | 199 | } |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
51 | 51 | { |
52 | 52 | for(j = 0; j < GAVL_MAX_PLANES; j++) |
53 | 53 | { |
54 | gavl_video_scale_context_cleanup(&(s->contexts[i][j])); | |
54 | gavl_video_scale_context_cleanup(&s->contexts[i][j]); | |
55 | 55 | } |
56 | 56 | } |
57 | 57 | free(s); |
312 | 312 | |
313 | 313 | /* Copy options because we want to change them */ |
314 | 314 | |
315 | gavl_video_options_copy(&opt, &(scaler->opt)); | |
315 | gavl_video_options_copy(&opt, &scaler->opt); | |
316 | 316 | |
317 | 317 | /* TODO: If the image is smaller than the number of filter taps, |
318 | 318 | reduce scaling algorithm */ |
319 | 319 | |
320 | 320 | /* Copy formats */ |
321 | 321 | |
322 | gavl_video_format_copy(&(scaler->src_format), src_format); | |
323 | gavl_video_format_copy(&(scaler->dst_format), dst_format); | |
322 | gavl_video_format_copy(&scaler->src_format, src_format); | |
323 | gavl_video_format_copy(&scaler->dst_format, dst_format); | |
324 | 324 | |
325 | 325 | /* Check if we have rectangles */ |
326 | 326 | |
327 | 327 | if(!opt.have_rectangles) |
328 | 328 | { |
329 | gavl_rectangle_f_set_all(&(src_rect), &(scaler->src_format)); | |
330 | gavl_rectangle_i_set_all(&(dst_rect), &(scaler->dst_format)); | |
331 | gavl_video_options_set_rectangles(&opt, &(src_rect), &(dst_rect)); | |
329 | gavl_rectangle_f_set_all(&src_rect, &scaler->src_format); | |
330 | gavl_rectangle_i_set_all(&dst_rect, &scaler->dst_format); | |
331 | gavl_video_options_set_rectangles(&opt, &src_rect, &dst_rect); | |
332 | 332 | } |
333 | 333 | |
334 | 334 | /* Check how many fields we must handle */ |
369 | 369 | /* Copy destination rectangle so we know, which subframe to take */ |
370 | 370 | gavl_rectangle_i_copy(&scaler->dst_rect, &opt.dst_rect); |
371 | 371 | |
372 | #if 0 | |
372 | #if 0 | |
373 | 373 | fprintf(stderr, "gavl_video_scaler_init:\n"); |
374 | gavl_rectangle_f_dump(&(scaler->src_rect)); | |
374 | gavl_rectangle_f_dump(&scaler->opt.src_rect); | |
375 | 375 | fprintf(stderr, "\n"); |
376 | gavl_rectangle_i_dump(&(scaler->dst_rect)); | |
376 | gavl_rectangle_i_dump(&scaler->dst_rect); | |
377 | 377 | fprintf(stderr, "\n"); |
378 | 378 | #endif |
379 | 379 | |
384 | 384 | /* Align the destination rectangle to the output formtat */ |
385 | 385 | |
386 | 386 | gavl_pixelformat_chroma_sub(scaler->dst_format.pixelformat, &sub_h_out, &sub_v_out); |
387 | gavl_rectangle_i_align(&(opt.dst_rect), sub_h_out, sub_v_out); | |
387 | gavl_rectangle_i_align(&opt.dst_rect, sub_h_out, sub_v_out); | |
388 | 388 | |
389 | 389 | #if 0 |
390 | 390 | fprintf(stderr, "Initializing scaler:\n"); |
391 | 391 | fprintf(stderr, "Src format:\n"); |
392 | gavl_video_format_dump(&(scaler->src_format)); | |
392 | gavl_video_format_dump(&scaler->src_format); | |
393 | 393 | fprintf(stderr, "Dst format:\n"); |
394 | gavl_video_format_dump(&(scaler->dst_format)); | |
394 | gavl_video_format_dump(&scaler->dst_format); | |
395 | 395 | |
396 | 396 | fprintf(stderr, "Src rectangle:\n"); |
397 | 397 | gavl_rectangle_f_dump(&opt.src_rect); |
441 | 441 | field = (scaler->opt.deinterlace_drop_mode == GAVL_DEINTERLACE_DROP_BOTTOM) ? 0 : 1; |
442 | 442 | for(plane = 0; plane < scaler->num_planes; plane++) |
443 | 443 | { |
444 | if(!gavl_video_scale_context_init(&(scaler->contexts[field][plane]), | |
444 | if(!gavl_video_scale_context_init(&scaler->contexts[field][plane], | |
445 | 445 | &opt, |
446 | plane, &(scaler->src_format), &(scaler->dst_format), field, 0, | |
446 | plane, &scaler->src_format, &scaler->dst_format, field, 0, | |
447 | 447 | scaler->src_fields, scaler->dst_fields)) |
448 | 448 | return 0; |
449 | 449 | } |
451 | 451 | { |
452 | 452 | for(plane = 0; plane < scaler->num_planes; plane++) |
453 | 453 | { |
454 | if(!gavl_video_scale_context_init(&(scaler->contexts[2][plane]), | |
454 | if(!gavl_video_scale_context_init(&scaler->contexts[2][plane], | |
455 | 455 | &opt, |
456 | plane, &(scaler->src_format), &(scaler->dst_format), 0, 0, 1, 1)) | |
456 | plane, &scaler->src_format, &scaler->dst_format, 0, 0, 1, 1)) | |
457 | 457 | return 0; |
458 | 458 | } |
459 | 459 | } |
465 | 465 | { |
466 | 466 | for(plane = 0; plane < scaler->num_planes; plane++) |
467 | 467 | { |
468 | if(!gavl_video_scale_context_init(&(scaler->contexts[field][plane]), | |
468 | if(!gavl_video_scale_context_init(&scaler->contexts[field][plane], | |
469 | 469 | &opt, |
470 | plane, &(scaler->src_format), &(scaler->dst_format), field, field, | |
470 | plane, &scaler->src_format, &scaler->dst_format, field, field, | |
471 | 471 | scaler->src_fields, scaler->dst_fields)) |
472 | 472 | return 0; |
473 | 473 | } |
477 | 477 | { |
478 | 478 | for(plane = 0; plane < scaler->num_planes; plane++) |
479 | 479 | { |
480 | if(!gavl_video_scale_context_init(&(scaler->contexts[2][plane]), | |
480 | if(!gavl_video_scale_context_init(&scaler->contexts[2][plane], | |
481 | 481 | &opt, |
482 | plane, &(scaler->src_format), &(scaler->dst_format), 0, 0, 1, 1)) | |
482 | plane, &scaler->src_format, &scaler->dst_format, 0, 0, 1, 1)) | |
483 | 483 | return 0; |
484 | 484 | } |
485 | 485 | } |
501 | 501 | |
502 | 502 | /* Copy options because we want to change them */ |
503 | 503 | |
504 | gavl_video_options_copy(&opt, &(scaler->opt)); | |
504 | gavl_video_options_copy(&opt, &scaler->opt); | |
505 | 505 | |
506 | 506 | /* Copy formats */ |
507 | 507 | |
508 | gavl_video_format_copy(&(scaler->src_format), format); | |
509 | gavl_video_format_copy(&(scaler->dst_format), format); | |
510 | ||
511 | gavl_rectangle_f_set_all(&(src_rect), &(scaler->src_format)); | |
512 | gavl_rectangle_i_set_all(&(dst_rect), &(scaler->dst_format)); | |
513 | gavl_video_options_set_rectangles(&opt, &(src_rect), &(dst_rect)); | |
508 | gavl_video_format_copy(&scaler->src_format, format); | |
509 | gavl_video_format_copy(&scaler->dst_format, format); | |
510 | ||
511 | gavl_rectangle_f_set_all(&src_rect, &scaler->src_format); | |
512 | gavl_rectangle_i_set_all(&dst_rect, &scaler->dst_format); | |
513 | gavl_video_options_set_rectangles(&opt, &src_rect, &dst_rect); | |
514 | 514 | |
515 | 515 | /* Check how many fields we must handle */ |
516 | 516 | |
549 | 549 | { |
550 | 550 | for(plane = 0; plane < scaler->num_planes; plane++) |
551 | 551 | { |
552 | gavl_video_scale_context_init_convolve(&(scaler->contexts[field][plane]), | |
552 | gavl_video_scale_context_init_convolve(&scaler->contexts[field][plane], | |
553 | 553 | &opt, |
554 | 554 | plane, format, |
555 | 555 | scaler->src_fields, |
561 | 561 | { |
562 | 562 | for(plane = 0; plane < scaler->num_planes; plane++) |
563 | 563 | { |
564 | gavl_video_scale_context_init_convolve(&(scaler->contexts[2][plane]), | |
564 | gavl_video_scale_context_init_convolve(&scaler->contexts[2][plane], | |
565 | 565 | &opt, |
566 | 566 | plane, format, |
567 | 567 | 1, |
577 | 577 | gavl_video_options_t * |
578 | 578 | gavl_video_scaler_get_options(gavl_video_scaler_t * s) |
579 | 579 | { |
580 | return &(s->opt); | |
580 | return &s->opt; | |
581 | 581 | } |
582 | 582 | |
583 | 583 | void gavl_video_scaler_scale(gavl_video_scaler_t * s, |
587 | 587 | int i, field; |
588 | 588 | /* Set the destination subframe */ |
589 | 589 | gavl_video_frame_get_subframe(s->dst_format.pixelformat, dst, s->dst, |
590 | &(s->dst_rect)); | |
590 | &s->dst_rect); | |
591 | 591 | #if 0 |
592 | 592 | fprintf(stderr, "Get subframe\n"); |
593 | gavl_rectangle_i_dump(&(s->dst_rect)); | |
593 | gavl_rectangle_i_dump(&s->dst_rect); | |
594 | 594 | fprintf(stderr, "\n"); |
595 | 595 | #endif |
596 | 596 | if(s->src_fields > s->dst_fields) |
601 | 601 | !(s->opt.conversion_flags & GAVL_FORCE_DEINTERLACE)) |
602 | 602 | { |
603 | 603 | for(i = 0; i < s->num_planes; i++) |
604 | gavl_video_scale_context_scale(&(s->contexts[2][i]), src, s->dst); | |
604 | gavl_video_scale_context_scale(&s->contexts[2][i], src, s->dst); | |
605 | 605 | } |
606 | 606 | else /* Deinterlace mode */ |
607 | 607 | { |
610 | 610 | s->src_field, field); |
611 | 611 | |
612 | 612 | for(i = 0; i < s->num_planes; i++) |
613 | gavl_video_scale_context_scale(&(s->contexts[field][i]), | |
613 | gavl_video_scale_context_scale(&s->contexts[field][i], | |
614 | 614 | s->src_field, s->dst); |
615 | 615 | } |
616 | 616 | } |
622 | 622 | !(s->opt.conversion_flags & GAVL_FORCE_DEINTERLACE)) |
623 | 623 | { |
624 | 624 | for(i = 0; i < s->num_planes; i++) |
625 | gavl_video_scale_context_scale(&(s->contexts[2][i]), src, s->dst); | |
625 | gavl_video_scale_context_scale(&s->contexts[2][i], src, s->dst); | |
626 | 626 | } |
627 | 627 | else |
628 | 628 | { |
632 | 632 | for(i = 0; i < s->num_planes; i++) |
633 | 633 | { |
634 | 634 | // fprintf(stderr, "Field: 0, plane: %d\n", i); |
635 | gavl_video_scale_context_scale(&(s->contexts[0][i]), s->src_field, s->dst_field); | |
635 | gavl_video_scale_context_scale(&s->contexts[0][i], s->src_field, s->dst_field); | |
636 | 636 | } |
637 | 637 | |
638 | 638 | /* Second field */ |
641 | 641 | for(i = 0; i < s->num_planes; i++) |
642 | 642 | { |
643 | 643 | // fprintf(stderr, "Field: 1, plane: %d\n", i); |
644 | gavl_video_scale_context_scale(&(s->contexts[1][i]), s->src_field, s->dst_field); | |
644 | gavl_video_scale_context_scale(&s->contexts[1][i], s->src_field, s->dst_field); | |
645 | 645 | } |
646 | 646 | } |
647 | 647 | } |
649 | 649 | { |
650 | 650 | for(i = 0; i < s->num_planes; i++) |
651 | 651 | { |
652 | // fprintf(stderr, "Scale %d, %p\n", i, &(s->contexts[0][i])); | |
652 | // fprintf(stderr, "Scale %d, %p\n", i, &s->contexts[0][i]); | |
653 | 653 | // fprintf(stderr, "Field: 0 (progressive), plane: %d\n", i); |
654 | gavl_video_scale_context_scale(&(s->contexts[0][i]), src, s->dst); | |
654 | gavl_video_scale_context_scale(&s->contexts[0][i], src, s->dst); | |
655 | 655 | } |
656 | 656 | } |
657 | 657 | } |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
458 | 458 | fprintf(stderr, "scale_context_init: src_field: %d, dst_field: %d plane: %d\n", |
459 | 459 | src_field, dst_field, plane); |
460 | 460 | #endif |
461 | gavl_rectangle_f_copy(&(ctx->src_rect), &(opt->src_rect)); | |
462 | gavl_rectangle_i_copy(&(ctx->dst_rect), &(opt->dst_rect)); | |
461 | gavl_rectangle_f_copy(&ctx->src_rect, &opt->src_rect); | |
462 | gavl_rectangle_i_copy(&ctx->dst_rect, &opt->dst_rect); | |
463 | 463 | |
464 | 464 | scale_factor_x = (float)ctx->dst_rect.w / ctx->src_rect.w; |
465 | 465 | scale_factor_y = (float)ctx->dst_rect.h / ctx->src_rect.h; |
510 | 510 | |
511 | 511 | #if 0 |
512 | 512 | fprintf(stderr, "gavl_video_scale_context_init\n"); |
513 | gavl_rectangle_f_dump(&(ctx->src_rect)); | |
513 | gavl_rectangle_f_dump(&ctx->src_rect); | |
514 | 514 | fprintf(stderr, "\n"); |
515 | gavl_rectangle_i_dump(&(ctx->dst_rect)); | |
515 | gavl_rectangle_i_dump(&ctx->dst_rect); | |
516 | 516 | fprintf(stderr, "\n"); |
517 | 517 | #endif |
518 | 518 | |
590 | 590 | |
591 | 591 | /* We set this once here */ |
592 | 592 | |
593 | ctx->offset = &(ctx->offset1); | |
593 | ctx->offset = &ctx->offset1; | |
594 | 594 | ctx->dst_size = ctx->dst_rect.w; |
595 | 595 | } |
596 | 596 | else if(ctx->num_directions == 2) |
629 | 629 | |
630 | 630 | /* We set this once here */ |
631 | 631 | |
632 | ctx->offset = &(ctx->offset1); | |
632 | ctx->offset = &ctx->offset1; | |
633 | 633 | ctx->dst_size = ctx->dst_rect.w; |
634 | 634 | |
635 | 635 | ctx->num_directions = 1; |
640 | 640 | { |
641 | 641 | // fprintf(stderr, "Initializing x table %f\n", ctx->src_rect.x + offset_x); |
642 | 642 | gavl_video_options_copy(&tmp_opt, opt); |
643 | gavl_video_scale_table_init(&(ctx->table_h), &tmp_opt, | |
643 | gavl_video_scale_table_init(&ctx->table_h, &tmp_opt, | |
644 | 644 | offset_x, |
645 | 645 | ctx->src_rect.w, ctx->dst_rect.w, src_width); |
646 | 646 | // fprintf(stderr, "Initializing x table done\n"); |
648 | 648 | // fprintf(stderr, "Initializing y table %f\n", |
649 | 649 | // ctx->src_rect.y + offset_y); |
650 | 650 | gavl_video_options_copy(&tmp_opt_y, opt); |
651 | gavl_video_scale_table_init(&(ctx->table_v), &tmp_opt_y, | |
651 | gavl_video_scale_table_init(&ctx->table_v, &tmp_opt_y, | |
652 | 652 | offset_y, |
653 | 653 | ctx->src_rect.h, ctx->dst_rect.h, src_height); |
654 | 654 | |
660 | 660 | (tmp_opt.scale_order == tmp_opt_y.scale_order)) |
661 | 661 | { |
662 | 662 | gavl_init_scale_funcs(&funcs, &tmp_opt, ctx->offset1.src_advance, |
663 | ctx->offset2.dst_advance, &(ctx->table_h), &(ctx->table_v)); | |
664 | ctx->func1 = get_func(&(funcs.funcs_xy), src_format->pixelformat, &bits_h); | |
663 | ctx->offset2.dst_advance, &ctx->table_h, | |
664 | &ctx->table_v); | |
665 | ctx->func1 = get_func(&funcs.funcs_xy, src_format->pixelformat, &bits_h); | |
665 | 666 | // fprintf(stderr, "X AND Y %d\n"); |
666 | 667 | } |
667 | 668 | |
670 | 671 | ctx->num_directions = 1; |
671 | 672 | if(bits_h) |
672 | 673 | { |
673 | gavl_video_scale_table_init_int(&(ctx->table_h), bits_h); | |
674 | gavl_video_scale_table_init_int(&ctx->table_h, bits_h); | |
674 | 675 | /* Must be bits_h since we have only one function (and thus one accuracy) */ |
675 | gavl_video_scale_table_init_int(&(ctx->table_v), bits_h); | |
676 | gavl_video_scale_table_init_int(&ctx->table_v, bits_h); | |
676 | 677 | } |
677 | ctx->offset = &(ctx->offset1); | |
678 | ctx->offset = &ctx->offset1; | |
678 | 679 | ctx->dst_size = ctx->dst_rect.w; |
679 | 680 | |
680 | 681 | /* Switch offsets back */ |
683 | 684 | } |
684 | 685 | else |
685 | 686 | { |
686 | gavl_video_scale_table_get_src_indices(&(ctx->table_h), | |
687 | gavl_video_scale_table_get_src_indices(&ctx->table_h, | |
687 | 688 | &src_rect_i.x, &src_rect_i.w); |
688 | gavl_video_scale_table_get_src_indices(&(ctx->table_v), | |
689 | gavl_video_scale_table_get_src_indices(&ctx->table_v, | |
689 | 690 | &src_rect_i.y, &src_rect_i.h); |
690 | 691 | |
691 | 692 | /* Decide the scale order depending on whats computationally less expensive */ |
706 | 707 | ctx->buffer_width = ctx->dst_rect.w; |
707 | 708 | ctx->buffer_height = src_rect_i.h; |
708 | 709 | |
709 | gavl_video_scale_table_shift_indices(&(ctx->table_v), -src_rect_i.y); | |
710 | gavl_video_scale_table_shift_indices(&ctx->table_v, -src_rect_i.y); | |
710 | 711 | ctx->first_scanline = src_rect_i.y; |
711 | 712 | |
712 | 713 | gavl_init_scale_funcs(&funcs, &tmp_opt, |
713 | 714 | ctx->offset1.src_advance, |
714 | 715 | ctx->offset1.dst_advance, |
715 | &(ctx->table_h), NULL); | |
716 | &ctx->table_h, NULL); | |
716 | 717 | ctx->func1 = get_func(&funcs.funcs_x, src_format->pixelformat, &bits_h); |
717 | 718 | if(bits_h) |
718 | gavl_video_scale_table_init_int(&(ctx->table_h), bits_h); | |
719 | gavl_video_scale_table_init_int(&ctx->table_h, bits_h); | |
719 | 720 | |
720 | 721 | gavl_init_scale_funcs(&funcs, &tmp_opt_y, |
721 | 722 | ctx->offset2.src_advance, |
722 | 723 | ctx->offset2.dst_advance, |
723 | NULL, &(ctx->table_v)); | |
724 | NULL, &ctx->table_v); | |
724 | 725 | ctx->func2 = get_func(&funcs.funcs_y, |
725 | 726 | src_format->pixelformat, &bits_v); |
726 | 727 | |
727 | 728 | if(bits_v) |
728 | gavl_video_scale_table_init_int(&(ctx->table_v), bits_v); | |
729 | gavl_video_scale_table_init_int(&ctx->table_v, bits_v); | |
729 | 730 | } |
730 | 731 | else |
731 | 732 | { |
737 | 738 | |
738 | 739 | ctx->offset1.src_offset += src_rect_i.x * ctx->offset1.src_advance; |
739 | 740 | |
740 | gavl_video_scale_table_shift_indices(&(ctx->table_h), -src_rect_i.x); | |
741 | gavl_video_scale_table_shift_indices(&ctx->table_h, -src_rect_i.x); | |
741 | 742 | |
742 | 743 | gavl_init_scale_funcs(&funcs, &tmp_opt_y, |
743 | 744 | ctx->offset1.src_advance, |
744 | 745 | ctx->offset1.dst_advance, |
745 | NULL, &(ctx->table_v)); | |
746 | NULL, &ctx->table_v); | |
746 | 747 | ctx->func1 = get_func(&funcs.funcs_y, src_format->pixelformat, &bits_v); |
747 | 748 | |
748 | 749 | if(bits_v) |
749 | gavl_video_scale_table_init_int(&(ctx->table_v), bits_v); | |
750 | gavl_video_scale_table_init_int(&ctx->table_v, bits_v); | |
750 | 751 | |
751 | 752 | gavl_init_scale_funcs(&funcs, &tmp_opt, |
752 | 753 | ctx->offset2.src_advance, |
753 | 754 | ctx->offset2.dst_advance, |
754 | &(ctx->table_h), NULL); | |
755 | ctx->func2 = get_func(&(funcs.funcs_x), | |
755 | &ctx->table_h, NULL); | |
756 | ctx->func2 = get_func(&funcs.funcs_x, | |
756 | 757 | src_format->pixelformat, &bits_h); |
757 | 758 | if(bits_h) |
758 | gavl_video_scale_table_init_int(&(ctx->table_h), bits_h); | |
759 | gavl_video_scale_table_init_int(&ctx->table_h, bits_h); | |
759 | 760 | } |
760 | 761 | |
761 | 762 | /* Allocate temporary buffer */ |
765 | 766 | else if(scale_x) |
766 | 767 | { |
767 | 768 | gavl_video_options_copy(&tmp_opt, opt); |
768 | gavl_video_scale_table_init(&(ctx->table_h), &tmp_opt, | |
769 | gavl_video_scale_table_init(&ctx->table_h, &tmp_opt, | |
769 | 770 | offset_x, |
770 | 771 | ctx->src_rect.w, ctx->dst_rect.w, src_width); |
771 | 772 | // fprintf(stderr, "Initializing x table done\n"); |
773 | 774 | gavl_init_scale_funcs(&funcs, &tmp_opt, |
774 | 775 | ctx->offset1.src_advance, |
775 | 776 | ctx->offset1.dst_advance, |
776 | &(ctx->table_h), NULL); | |
777 | ctx->func1 = get_func(&(funcs.funcs_x), src_format->pixelformat, &bits_h); | |
777 | &ctx->table_h, NULL); | |
778 | ctx->func1 = get_func(&funcs.funcs_x, src_format->pixelformat, &bits_h); | |
778 | 779 | |
779 | 780 | if(bits_h) |
780 | gavl_video_scale_table_init_int(&(ctx->table_h), bits_h); | |
781 | gavl_video_scale_table_init_int(&ctx->table_h, bits_h); | |
781 | 782 | } |
782 | 783 | else if(scale_y) |
783 | 784 | { |
784 | 785 | // fprintf(stderr, "Initializing y table\n"); |
785 | 786 | gavl_video_options_copy(&tmp_opt, opt); |
786 | 787 | |
787 | gavl_video_scale_table_init(&(ctx->table_v), &tmp_opt, offset_y, | |
788 | gavl_video_scale_table_init(&ctx->table_v, &tmp_opt, offset_y, | |
788 | 789 | ctx->src_rect.h, ctx->dst_rect.h, src_height); |
789 | 790 | // fprintf(stderr, "Initializing y table done\n"); |
790 | 791 | gavl_init_scale_funcs(&funcs, &tmp_opt, |
791 | 792 | ctx->offset1.src_advance, |
792 | 793 | ctx->offset1.dst_advance, |
793 | NULL, &(ctx->table_v)); | |
794 | ctx->func1 = get_func(&(funcs.funcs_y), src_format->pixelformat, &bits_v); | |
794 | NULL, &ctx->table_v); | |
795 | ctx->func1 = get_func(&funcs.funcs_y, src_format->pixelformat, &bits_v); | |
795 | 796 | |
796 | 797 | if(bits_v) |
797 | gavl_video_scale_table_init_int(&(ctx->table_v), bits_v); | |
798 | gavl_video_scale_table_init_int(&ctx->table_v, bits_v); | |
798 | 799 | } |
799 | 800 | |
800 | 801 | if(!ctx->func1 || ((ctx->num_directions == 2) && !ctx->func2)) |
807 | 808 | #if 0 |
808 | 809 | /* Dump final scale tables */ |
809 | 810 | fprintf(stderr, "Horizontal table:\n"); |
810 | gavl_video_scale_table_dump(&(ctx->table_h)); | |
811 | gavl_video_scale_table_dump(&ctx->table_h); | |
811 | 812 | fprintf(stderr, "Vertical table:\n"); |
812 | gavl_video_scale_table_dump(&(ctx->table_v)); | |
813 | gavl_video_scale_table_dump(&ctx->table_v); | |
813 | 814 | #endif |
814 | 815 | |
815 | 816 | get_minmax(src_format->pixelformat, ctx->min_values_h, |
937 | 938 | src_field, dst_field, plane); |
938 | 939 | #endif |
939 | 940 | |
940 | gavl_rectangle_f_set_all(&(ctx->src_rect), format); | |
941 | gavl_rectangle_i_set_all(&(ctx->dst_rect), format); | |
941 | gavl_rectangle_f_set_all(&ctx->src_rect, format); | |
942 | gavl_rectangle_i_set_all(&ctx->dst_rect, format); | |
942 | 943 | |
943 | 944 | ctx->first_scanline = 0; |
944 | 945 | |
976 | 977 | |
977 | 978 | #if 0 |
978 | 979 | fprintf(stderr, "gavl_video_scale_context_init\n"); |
979 | gavl_rectangle_f_dump(&(ctx->src_rect)); | |
980 | gavl_rectangle_f_dump(&ctx->src_rect); | |
980 | 981 | fprintf(stderr, "\n"); |
981 | gavl_rectangle_i_dump(&(ctx->dst_rect)); | |
982 | gavl_rectangle_i_dump(&ctx->dst_rect); | |
982 | 983 | fprintf(stderr, "\n"); |
983 | 984 | #endif |
984 | 985 | |
1068 | 1069 | |
1069 | 1070 | /* We set this once here */ |
1070 | 1071 | |
1071 | ctx->offset = &(ctx->offset1); | |
1072 | ctx->offset = &ctx->offset1; | |
1072 | 1073 | ctx->dst_size = ctx->dst_rect.w; |
1073 | 1074 | } |
1074 | 1075 | else if(ctx->num_directions == 2) |
1110 | 1111 | |
1111 | 1112 | /* We set this once here */ |
1112 | 1113 | |
1113 | ctx->offset = &(ctx->offset1); | |
1114 | ctx->offset = &ctx->offset1; | |
1114 | 1115 | ctx->dst_size = ctx->dst_rect.w; |
1115 | 1116 | |
1116 | 1117 | ctx->num_directions = 1; |
1122 | 1123 | // fprintf(stderr, "Initializing x table\n"); |
1123 | 1124 | gavl_video_options_copy(&tmp_opt, opt); |
1124 | 1125 | tmp_opt.scale_mode = GAVL_SCALE_NONE; |
1125 | gavl_video_scale_table_init_convolve(&(ctx->table_h), | |
1126 | gavl_video_scale_table_init_convolve(&ctx->table_h, | |
1126 | 1127 | &tmp_opt, |
1127 | 1128 | h_radius, h_coeffs, |
1128 | 1129 | src_width); |
1131 | 1132 | // fprintf(stderr, "Initializing y table\n"); |
1132 | 1133 | gavl_video_options_copy(&tmp_opt_y, opt); |
1133 | 1134 | tmp_opt_y.scale_mode = GAVL_SCALE_NONE; |
1134 | gavl_video_scale_table_init_convolve(&(ctx->table_v), | |
1135 | gavl_video_scale_table_init_convolve(&ctx->table_v, | |
1135 | 1136 | &tmp_opt_y, |
1136 | 1137 | v_radius, v_coeffs, |
1137 | 1138 | src_height); |
1146 | 1147 | gavl_init_scale_funcs(&funcs, &tmp_opt, |
1147 | 1148 | ctx->offset1.src_advance, |
1148 | 1149 | ctx->offset2.dst_advance, |
1149 | &(ctx->table_h), &(ctx->table_v)); | |
1150 | ctx->func1 = get_func(&(funcs.funcs_xy), format->pixelformat, &bits_h); | |
1150 | &ctx->table_h, &ctx->table_v); | |
1151 | ctx->func1 = get_func(&funcs.funcs_xy, format->pixelformat, &bits_h); | |
1151 | 1152 | // fprintf(stderr, "X AND Y\n"); |
1152 | 1153 | } |
1153 | 1154 | |
1155 | 1156 | { |
1156 | 1157 | ctx->num_directions = 1; |
1157 | 1158 | |
1158 | gavl_video_scale_table_init_int(&(ctx->table_h), bits_h); | |
1159 | gavl_video_scale_table_init_int(&(ctx->table_v), bits_h); | |
1159 | gavl_video_scale_table_init_int(&ctx->table_h, bits_h); | |
1160 | gavl_video_scale_table_init_int(&ctx->table_v, bits_h); | |
1160 | 1161 | } |
1161 | 1162 | else |
1162 | 1163 | { |
1163 | gavl_video_scale_table_get_src_indices(&(ctx->table_h), | |
1164 | gavl_video_scale_table_get_src_indices(&ctx->table_h, | |
1164 | 1165 | &src_rect_i.x, |
1165 | 1166 | &src_rect_i.w); |
1166 | 1167 | |
1167 | gavl_video_scale_table_get_src_indices(&(ctx->table_v), | |
1168 | gavl_video_scale_table_get_src_indices(&ctx->table_v, | |
1168 | 1169 | &src_rect_i.y, |
1169 | 1170 | &src_rect_i.h); |
1170 | 1171 | |
1174 | 1175 | ctx->buffer_width = ctx->dst_rect.w; |
1175 | 1176 | ctx->buffer_height = src_rect_i.h; |
1176 | 1177 | |
1177 | gavl_video_scale_table_shift_indices(&(ctx->table_v), | |
1178 | gavl_video_scale_table_shift_indices(&ctx->table_v, | |
1178 | 1179 | -src_rect_i.y); |
1179 | 1180 | gavl_init_scale_funcs(&funcs, &tmp_opt, |
1180 | 1181 | ctx->offset1.src_advance, |
1181 | 1182 | ctx->offset1.dst_advance, |
1182 | &(ctx->table_h), NULL); | |
1183 | &ctx->table_h, NULL); | |
1183 | 1184 | ctx->func1 = get_func(&funcs.funcs_x, format->pixelformat, &bits_h); |
1184 | 1185 | |
1185 | gavl_video_scale_table_init_int(&(ctx->table_h), bits_h); | |
1186 | gavl_video_scale_table_init_int(&ctx->table_h, bits_h); | |
1186 | 1187 | |
1187 | 1188 | gavl_init_scale_funcs(&funcs, &tmp_opt_y, |
1188 | 1189 | ctx->offset2.src_advance, |
1189 | 1190 | ctx->offset2.dst_advance, |
1190 | NULL, &(ctx->table_v)); | |
1191 | NULL, &ctx->table_v); | |
1191 | 1192 | ctx->func2 = get_func(&funcs.funcs_y, format->pixelformat, &bits_v); |
1192 | 1193 | |
1193 | 1194 | |
1194 | gavl_video_scale_table_init_int(&(ctx->table_v), bits_v); | |
1195 | gavl_video_scale_table_init_int(&ctx->table_v, bits_v); | |
1195 | 1196 | |
1196 | 1197 | /* Allocate temporary buffer */ |
1197 | 1198 | alloc_temp(ctx, format->pixelformat); |
1203 | 1204 | gavl_video_options_copy(&tmp_opt, opt); |
1204 | 1205 | tmp_opt.scale_mode = GAVL_SCALE_NONE; |
1205 | 1206 | |
1206 | gavl_video_scale_table_init_convolve(&(ctx->table_h), | |
1207 | gavl_video_scale_table_init_convolve(&ctx->table_h, | |
1207 | 1208 | &tmp_opt, |
1208 | 1209 | h_radius, h_coeffs, |
1209 | 1210 | src_width); |
1211 | 1212 | gavl_init_scale_funcs(&funcs, &tmp_opt, |
1212 | 1213 | ctx->offset1.src_advance, |
1213 | 1214 | ctx->offset1.dst_advance, |
1214 | &(ctx->table_h), NULL); | |
1215 | ctx->func1 = get_func(&(funcs.funcs_x), format->pixelformat, &bits_h); | |
1216 | ||
1217 | gavl_video_scale_table_init_int(&(ctx->table_h), bits_h); | |
1215 | &ctx->table_h, NULL); | |
1216 | ctx->func1 = get_func(&funcs.funcs_x, format->pixelformat, &bits_h); | |
1217 | ||
1218 | gavl_video_scale_table_init_int(&ctx->table_h, bits_h); | |
1218 | 1219 | } |
1219 | 1220 | else if(scale_y) |
1220 | 1221 | { |
1221 | 1222 | // fprintf(stderr, "Initializing y table\n"); |
1222 | 1223 | gavl_video_options_copy(&tmp_opt, opt); |
1223 | 1224 | tmp_opt.scale_mode = GAVL_SCALE_NONE; |
1224 | gavl_video_scale_table_init_convolve(&(ctx->table_v), | |
1225 | gavl_video_scale_table_init_convolve(&ctx->table_v, | |
1225 | 1226 | &tmp_opt, |
1226 | 1227 | v_radius, v_coeffs, |
1227 | 1228 | src_height); |
1230 | 1231 | gavl_init_scale_funcs(&funcs, &tmp_opt, |
1231 | 1232 | ctx->offset1.src_advance, |
1232 | 1233 | ctx->offset1.dst_advance, |
1233 | NULL, &(ctx->table_v)); | |
1234 | ctx->func1 = get_func(&(funcs.funcs_y), format->pixelformat, &bits_v); | |
1235 | ||
1236 | gavl_video_scale_table_init_int(&(ctx->table_v), bits_v); | |
1234 | NULL, &ctx->table_v); | |
1235 | ctx->func1 = get_func(&funcs.funcs_y, format->pixelformat, &bits_v); | |
1236 | ||
1237 | gavl_video_scale_table_init_int(&ctx->table_v, bits_v); | |
1237 | 1238 | } |
1238 | 1239 | |
1239 | 1240 | #if 0 |
1240 | 1241 | /* Dump final scale tables */ |
1241 | 1242 | fprintf(stderr, "Horizontal table:\n"); |
1242 | gavl_video_scale_table_dump(&(ctx->table_h)); | |
1243 | gavl_video_scale_table_dump(&ctx->table_h); | |
1243 | 1244 | fprintf(stderr, "Vertical table:\n"); |
1244 | gavl_video_scale_table_dump(&(ctx->table_v)); | |
1245 | gavl_video_scale_table_dump(&ctx->table_v); | |
1245 | 1246 | #endif |
1246 | 1247 | |
1247 | 1248 | |
1256 | 1257 | |
1257 | 1258 | void gavl_video_scale_context_cleanup(gavl_video_scale_context_t * ctx) |
1258 | 1259 | { |
1259 | gavl_video_scale_table_cleanup(&(ctx->table_h)); | |
1260 | gavl_video_scale_table_cleanup(&(ctx->table_v)); | |
1260 | gavl_video_scale_table_cleanup(&ctx->table_h); | |
1261 | gavl_video_scale_table_cleanup(&ctx->table_v); | |
1261 | 1262 | if(ctx->buffer) |
1262 | 1263 | free(ctx->buffer); |
1263 | 1264 | } |
1357 | 1358 | break; |
1358 | 1359 | case 2: |
1359 | 1360 | /* First step */ |
1360 | ctx->offset = &(ctx->offset1); | |
1361 | ctx->offset = &ctx->offset1; | |
1361 | 1362 | |
1362 | 1363 | ctx->src = src->planes[ctx->src_frame_plane] + |
1363 | 1364 | ctx->offset->src_offset + |
1393 | 1394 | // fprintf(stderr, "done\n"); |
1394 | 1395 | |
1395 | 1396 | /* Second step */ |
1396 | ctx->offset = &(ctx->offset2); | |
1397 | ctx->offset = &ctx->offset2; | |
1397 | 1398 | #if 0 |
1398 | 1399 | fprintf(stderr, "Second direction\n"); |
1399 | 1400 | dump_offset(ctx->offset); |
1460 | 1461 | break; |
1461 | 1462 | case 2: |
1462 | 1463 | /* First step */ |
1463 | ctx->offset = &(ctx->offset1); | |
1464 | ctx->offset = &ctx->offset1; | |
1464 | 1465 | |
1465 | 1466 | ctx->src = src->planes[ctx->src_frame_plane] + |
1466 | 1467 | ctx->offset->src_offset + |
1483 | 1484 | // fprintf(stderr, "done\n"); |
1484 | 1485 | |
1485 | 1486 | /* Second step */ |
1486 | ctx->offset = &(ctx->offset2); | |
1487 | ctx->offset = &ctx->offset2; | |
1487 | 1488 | #if 0 |
1488 | 1489 | fprintf(stderr, "Second direction\n"); |
1489 | 1490 | dump_offset(ctx->offset); |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
112 | 112 | |
113 | 113 | widen = 0; |
114 | 114 | |
115 | if(!dst_size) | |
116 | return; | |
117 | ||
115 | 118 | if(scale_factor < 1.0) |
116 | 119 | { |
117 | 120 | switch(opt->downscale_filter) |
147 | 150 | /* Get the kernel generator */ |
148 | 151 | |
149 | 152 | weight_func = |
150 | gavl_video_scale_get_weight_func(opt, &(tab->factors_per_pixel)); | |
153 | gavl_video_scale_get_weight_func(opt, &tab->factors_per_pixel); | |
151 | 154 | |
152 | 155 | num_tmp_factors = tab->factors_per_pixel; |
153 | 156 | |
190 | 193 | break; |
191 | 194 | } |
192 | 195 | weight_func = |
193 | gavl_video_scale_get_weight_func(opt, &(tab->factors_per_pixel)); | |
196 | gavl_video_scale_get_weight_func(opt, &tab->factors_per_pixel); | |
194 | 197 | } |
195 | 198 | |
196 | 199 | // fprintf(stderr, "gavl_video_scale_table_init: %f %f %d %d\n", |
589 | 592 | void gavl_video_scale_table_get_src_indices(gavl_video_scale_table_t * tab, |
590 | 593 | int * start, int * size) |
591 | 594 | { |
592 | *start = tab->pixels[0].index; | |
593 | *size = tab->pixels[tab->num_pixels-1].index + tab->factors_per_pixel - *start; | |
595 | if(!tab->pixels) | |
596 | { | |
597 | *start = 0; | |
598 | *size = 0; | |
599 | } | |
600 | else | |
601 | { | |
602 | *start = tab->pixels[0].index; | |
603 | *size = tab->pixels[tab->num_pixels-1].index + tab->factors_per_pixel - | |
604 | *start; | |
605 | } | |
594 | 606 | } |
595 | 607 | |
596 | 608 | void gavl_video_scale_table_shift_indices(gavl_video_scale_table_t * tab, |
0 | # Makefile.in generated by automake 1.11 from Makefile.am. | |
0 | # Makefile.in generated by automake 1.11.1 from Makefile.am. | |
1 | 1 | # @configure_input@ |
2 | 2 | |
3 | 3 | # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | # Makefile.in generated by automake 1.11 from Makefile.am. | |
0 | # Makefile.in generated by automake 1.11.1 from Makefile.am. | |
1 | 1 | # @configure_input@ |
2 | 2 | |
3 | 3 | # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | # Makefile.in generated by automake 1.11 from Makefile.am. | |
0 | # Makefile.in generated by automake 1.11.1 from Makefile.am. | |
1 | 1 | # @configure_input@ |
2 | 2 | |
3 | 3 | # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
29 | 29 | #endif |
30 | 30 | #include <sys/time.h> |
31 | 31 | |
32 | #include <gavltime.h> | |
32 | #include <gavl.h> | |
33 | 33 | |
34 | 34 | #ifdef HAVE_CLOCK_MONOTONIC |
35 | 35 | |
70 | 70 | |
71 | 71 | void gavl_timer_start(gavl_timer_t * t) |
72 | 72 | { |
73 | get_time(&(t->start_time_real)); | |
73 | get_time(&t->start_time_real); | |
74 | 74 | t->is_running = 1; |
75 | 75 | } |
76 | 76 | |
140 | 140 | #endif |
141 | 141 | } |
142 | 142 | |
143 | const char * gavl_benchmark_get_desc(int flags) | |
143 | const char * gavl_benchmark_get_desc(int config_flags) | |
144 | 144 | { |
145 | 145 | #ifdef ARCH_X86 |
146 | uint64_t x; | |
147 | 146 | /* that should prevent us from trying cpuid with old cpus */ |
148 | 147 | if( config_flags & GAVL_ACCEL_MMX ) |
149 | 148 | { |
152 | 151 | else |
153 | 152 | { |
154 | 153 | #endif |
155 | return "microseconds returned by gettimeofday" | |
154 | return "microseconds returned by gettimeofday"; | |
156 | 155 | #ifdef ARCH_X86 |
157 | 156 | } |
158 | 157 | #endif |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
92 | 92 | switch(format->interlace_mode) |
93 | 93 | { |
94 | 94 | case GAVL_INTERLACE_NONE: |
95 | case GAVL_INTERLACE_UNKNOWN: | |
95 | 96 | t->num_fields = 1; |
96 | 97 | break; |
97 | 98 | case GAVL_INTERLACE_TOP_FIRST: |
99 | 100 | t->num_fields = 2; |
100 | 101 | break; |
101 | 102 | case GAVL_INTERLACE_MIXED: |
103 | case GAVL_INTERLACE_MIXED_TOP: | |
104 | case GAVL_INTERLACE_MIXED_BOTTOM: | |
102 | 105 | t->num_fields = 3; |
103 | 106 | break; |
104 | 107 | } |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
190 | 190 | float scale_x, scale_y; |
191 | 191 | int sub_h, sub_v; |
192 | 192 | gavl_transform_context_t * ctx; |
193 | ctx = &(t->contexts[field_index][plane_index]); | |
193 | ctx = &t->contexts[field_index][plane_index]; | |
194 | 194 | |
195 | 195 | if(field_index == 1) |
196 | 196 | { |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
311 | 311 | |
312 | 312 | /* Get factors per pixel and filter_func */ |
313 | 313 | sd.weight_func = |
314 | gavl_video_scale_get_weight_func(opt, &(tab->factors_per_pixel)); | |
314 | gavl_video_scale_get_weight_func(opt, &tab->factors_per_pixel); | |
315 | 315 | |
316 | 316 | if(tab->factors_per_pixel > MAX_TRANSFORM_FILTER) |
317 | 317 | { |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
76 | 76 | { |
77 | 77 | gavl_video_convert_context_t * ctx; |
78 | 78 | ctx = calloc(1, sizeof(*ctx)); |
79 | ctx->options = &(cnv->options); | |
80 | gavl_video_format_copy(&(ctx->input_format), | |
79 | ctx->options = &cnv->options; | |
80 | gavl_video_format_copy(&ctx->input_format, | |
81 | 81 | input_format); |
82 | 82 | |
83 | gavl_video_format_copy(&(ctx->output_format), | |
83 | gavl_video_format_copy(&ctx->output_format, | |
84 | 84 | output_format); |
85 | 85 | |
86 | 86 | if(cnv->last_context) |
104 | 104 | gavl_video_convert_context_t * ctx; |
105 | 105 | ctx = add_context(cnv, input_format, output_format); |
106 | 106 | |
107 | ctx->func = gavl_find_pixelformat_converter(&(cnv->options), | |
107 | ctx->func = gavl_find_pixelformat_converter(&cnv->options, | |
108 | 108 | input_format->pixelformat, |
109 | 109 | output_format->pixelformat, |
110 | 110 | input_format->frame_width, |
148 | 148 | |
149 | 149 | scaler_options = gavl_video_scaler_get_options(ctx->scaler); |
150 | 150 | |
151 | gavl_video_options_copy(scaler_options, &(cnv->options)); | |
151 | gavl_video_options_copy(scaler_options, &cnv->options); | |
152 | 152 | #if 0 |
153 | 153 | fprintf(stderr, "gavl_video_scaler_init:\n"); |
154 | 154 | fprintf(stderr, "src_format:\n"); |
157 | 157 | gavl_video_format_dump(output_format); |
158 | 158 | |
159 | 159 | fprintf(stderr, "src_rectangle: "); |
160 | gavl_rectangle_f_dump(&(cnv->options.src_rect)); | |
160 | gavl_rectangle_f_dump(&cnv->options.src_rect); | |
161 | 161 | fprintf(stderr, "\n"); |
162 | 162 | |
163 | 163 | fprintf(stderr, "dst_rectangle: "); |
164 | gavl_rectangle_i_dump(&(cnv->options.dst_rect)); | |
164 | gavl_rectangle_i_dump(&cnv->options.dst_rect); | |
165 | 165 | fprintf(stderr, "\n"); |
166 | 166 | #endif |
167 | 167 | |
193 | 193 | |
194 | 194 | ctx->deinterlacer = gavl_video_deinterlacer_create(); |
195 | 195 | deinterlacer_options = gavl_video_deinterlacer_get_options(ctx->deinterlacer); |
196 | gavl_video_options_copy(deinterlacer_options, &(cnv->options)); | |
196 | gavl_video_options_copy(deinterlacer_options, &cnv->options); | |
197 | 197 | |
198 | 198 | if(!gavl_video_deinterlacer_init(ctx->deinterlacer, |
199 | 199 | in_format)) |
464 | 464 | while(tmp_ctx && tmp_ctx->next) |
465 | 465 | { |
466 | 466 | tmp_ctx->output_frame = |
467 | gavl_video_frame_create(&(tmp_ctx->output_format)); | |
468 | gavl_video_frame_clear(tmp_ctx->output_frame, &(tmp_ctx->output_format)); | |
467 | gavl_video_frame_create(&tmp_ctx->output_format); | |
468 | gavl_video_frame_clear(tmp_ctx->output_frame, &tmp_ctx->output_format); | |
469 | 469 | |
470 | 470 | |
471 | 471 | tmp_ctx->next->input_frame = tmp_ctx->output_frame; |
487 | 487 | gavl_video_options_t * |
488 | 488 | gavl_video_converter_get_options(gavl_video_converter_t * cnv) |
489 | 489 | { |
490 | return &(cnv->options); | |
490 | return &cnv->options; | |
491 | 491 | } |
492 | 492 | |
493 | 493 | /*************************************************** |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
117 | 117 | |
118 | 118 | interlace_mode_tab_t interlace_mode_tab[] = |
119 | 119 | { |
120 | { GAVL_INTERLACE_UNKNOWN, "Unknown" }, | |
120 | 121 | { GAVL_INTERLACE_NONE, "None (Progressive)" }, |
121 | 122 | { GAVL_INTERLACE_TOP_FIRST, "Top field first" }, |
122 | 123 | { GAVL_INTERLACE_BOTTOM_FIRST, "Bottom field first" }, |
123 | { GAVL_INTERLACE_MIXED, "Mixed" } | |
124 | { GAVL_INTERLACE_MIXED, "Mixed" }, | |
125 | { GAVL_INTERLACE_MIXED_TOP, "Top first + progressive" }, | |
126 | { GAVL_INTERLACE_MIXED_BOTTOM, "Bottom first + progressive" } | |
124 | 127 | }; |
125 | 128 | |
126 | 129 | static const int num_interlace_modes = sizeof(interlace_mode_tab)/sizeof(interlace_mode_tab[0]); |
135 | 138 | } |
136 | 139 | return (const char*)0; |
137 | 140 | } |
141 | ||
142 | typedef const struct | |
143 | { | |
144 | gavl_framerate_mode_t mode; | |
145 | char * name; | |
146 | } framerate_mode_tab_t; | |
147 | ||
148 | framerate_mode_tab_t framerate_mode_tab[] = | |
149 | { | |
150 | { GAVL_FRAMERATE_UNKNOWN, "Unknown" }, | |
151 | { GAVL_FRAMERATE_CONSTANT, "Constant" }, | |
152 | { GAVL_FRAMERATE_VARIABLE, "Variable" }, | |
153 | { GAVL_FRAMERATE_STILL, "Still" }, | |
154 | }; | |
155 | ||
156 | static const int num_framerate_modes = sizeof(framerate_mode_tab)/sizeof(framerate_mode_tab[0]); | |
157 | ||
158 | ||
159 | const char * gavl_framerate_mode_to_string(gavl_framerate_mode_t mode) | |
160 | { | |
161 | int i; | |
162 | for(i = 0; i < num_framerate_modes; i++) | |
163 | { | |
164 | if(framerate_mode_tab[i].mode == mode) | |
165 | return framerate_mode_tab[i].name; | |
166 | } | |
167 | return (const char*)0; | |
168 | ||
169 | } | |
170 | ||
138 | 171 | |
139 | 172 | |
140 | 173 | typedef struct |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
1759 | 1759 | } |
1760 | 1760 | |
1761 | 1761 | } |
1762 | ||
1763 | int gavl_video_frames_equal(const gavl_video_format_t * format, | |
1764 | const gavl_video_frame_t * f1, | |
1765 | const gavl_video_frame_t * f2) | |
1766 | { | |
1767 | int i, j; | |
1768 | int height; | |
1769 | int bytes_per_line; | |
1770 | int sub_h, sub_v; | |
1771 | int planes; | |
1772 | ||
1773 | planes = gavl_pixelformat_num_planes(format->pixelformat); | |
1774 | height = format->image_height; | |
1775 | ||
1776 | bytes_per_line = gavl_pixelformat_is_planar(format->pixelformat) ? | |
1777 | format->image_width * gavl_pixelformat_bytes_per_component(format->pixelformat) : | |
1778 | format->image_width * gavl_pixelformat_bytes_per_pixel(format->pixelformat); | |
1779 | ||
1780 | for(i = 0; i < planes; i++) | |
1781 | { | |
1782 | if(i == 1) | |
1783 | { | |
1784 | gavl_pixelformat_chroma_sub(format->pixelformat, &sub_h, &sub_v); | |
1785 | bytes_per_line /= sub_h; | |
1786 | height /= sub_v; | |
1787 | } | |
1788 | ||
1789 | for(j = 0; j < height; j++) | |
1790 | { | |
1791 | if(memcmp(f1->planes[i] + j * f1->strides[i], | |
1792 | f2->planes[i] + j * f2->strides[i], bytes_per_line)) | |
1793 | return 0; | |
1794 | } | |
1795 | } | |
1796 | return 1; | |
1797 | } |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
115 | 115 | opt->have_rectangles = 0; |
116 | 116 | return; |
117 | 117 | } |
118 | gavl_rectangle_f_copy(&(opt->src_rect), src_rect); | |
119 | gavl_rectangle_i_copy(&(opt->dst_rect), dst_rect); | |
118 | gavl_rectangle_f_copy(&opt->src_rect, src_rect); | |
119 | gavl_rectangle_i_copy(&opt->dst_rect, dst_rect); | |
120 | 120 | opt->have_rectangles = 1; |
121 | 121 | } |
122 | 122 | |
124 | 124 | gavl_rectangle_f_t * src_rect, |
125 | 125 | gavl_rectangle_i_t * dst_rect) |
126 | 126 | { |
127 | gavl_rectangle_f_copy(src_rect, &(opt->src_rect)); | |
128 | gavl_rectangle_i_copy(dst_rect, &(opt->dst_rect)); | |
127 | gavl_rectangle_f_copy(src_rect, &opt->src_rect); | |
128 | gavl_rectangle_i_copy(dst_rect, &opt->dst_rect); | |
129 | 129 | } |
130 | 130 | |
131 | 131 | #define SET_INT(p) opt->p = p |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
110 | 110 | { |
111 | 111 | gavl_volume_funcs_t * funcs; |
112 | 112 | |
113 | gavl_audio_format_copy(&(v->format), format); | |
113 | gavl_audio_format_copy(&v->format, format); | |
114 | 114 | |
115 | 115 | funcs = gavl_volume_funcs_create(); |
116 | 116 |
0 | # Makefile.in generated by automake 1.11 from Makefile.am. | |
0 | # Makefile.in generated by automake 1.11.1 from Makefile.am. | |
1 | 1 | # @configure_input@ |
2 | 2 | |
3 | 3 | # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, |
290 | 290 | # (which will cause the Makefiles to be regenerated when you run `make'); |
291 | 291 | # (2) otherwise, pass the desired values on the `make' command line. |
292 | 292 | $(RECURSIVE_TARGETS): |
293 | @failcom='exit 1'; \ | |
293 | @fail= failcom='exit 1'; \ | |
294 | 294 | for f in x $$MAKEFLAGS; do \ |
295 | 295 | case $$f in \ |
296 | 296 | *=* | --[!k]*);; \ |
315 | 315 | fi; test -z "$$fail" |
316 | 316 | |
317 | 317 | $(RECURSIVE_CLEAN_TARGETS): |
318 | @failcom='exit 1'; \ | |
318 | @fail= failcom='exit 1'; \ | |
319 | 319 | for f in x $$MAKEFLAGS; do \ |
320 | 320 | case $$f in \ |
321 | 321 | *=* | --[!k]*);; \ |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
68 | 68 | int sub_h; |
69 | 69 | int sub_v; |
70 | 70 | |
71 | ||
71 | int mixed; | |
72 | 72 | }; |
73 | 73 | |
74 | 74 | /* Find conversion function */ |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | pkginclude_HEADERS = gavl.h gavltime.h gavl_version.h gavldsp.h timecode.h gavldefs.h | |
0 | pkginclude_HEADERS = compression.h gavl.h gavltime.h gavl_version.h gavldsp.h timecode.h gavldefs.h | |
1 | 1 | |
2 | 2 | EXTRA_DIST = gavl_version.h.in |
0 | # Makefile.in generated by automake 1.11 from Makefile.am. | |
0 | # Makefile.in generated by automake 1.11.1 from Makefile.am. | |
1 | 1 | # @configure_input@ |
2 | 2 | |
3 | 3 | # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, |
205 | 205 | top_build_prefix = @top_build_prefix@ |
206 | 206 | top_builddir = @top_builddir@ |
207 | 207 | top_srcdir = @top_srcdir@ |
208 | pkginclude_HEADERS = gavl.h gavltime.h gavl_version.h gavldsp.h timecode.h gavldefs.h | |
208 | pkginclude_HEADERS = compression.h gavl.h gavltime.h gavl_version.h gavldsp.h timecode.h gavldefs.h | |
209 | 209 | EXTRA_DIST = gavl_version.h.in |
210 | 210 | all: config.h |
211 | 211 | $(MAKE) $(AM_MAKEFLAGS) all-am |
0 | /***************************************************************** | |
1 | * gavl - a general purpose audio/video processing library | |
2 | * | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | * gmerlin-general@lists.sourceforge.net | |
5 | * http://gmerlin.sourceforge.net | |
6 | * | |
7 | * This program is free software: you can redistribute it and/or modify | |
8 | * it under the terms of the GNU General Public License as published by | |
9 | * the Free Software Foundation, either version 2 of the License, or | |
10 | * (at your option) any later version. | |
11 | * | |
12 | * This program is distributed in the hope that it will be useful, | |
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | * GNU General Public License for more details. | |
16 | * | |
17 | * You should have received a copy of the GNU General Public License | |
18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
19 | * *****************************************************************/ | |
20 | ||
21 | #ifndef GAVL_COMPRESSION_H_INCLUDED | |
22 | #define GAVL_COMPRESSION_H_INCLUDED | |
23 | ||
24 | #include <gavl/gavldefs.h> | |
25 | ||
26 | #ifdef __cplusplus | |
27 | extern "C" { | |
28 | #endif | |
29 | ||
30 | /** \defgroup compression Compressed stream support | |
31 | * \brief Compressed stream support | |
32 | * | |
33 | * gavl provides some structures and functions for handling | |
34 | * compressed data packets. It is a completely independent API | |
35 | * layer and has nothing to do with the uncompressed video and audio | |
36 | * API. In particular the conversion between compressed and uncompressed | |
37 | * data (i.e. codecs) are outside the scope of gavl. These are implemented | |
38 | * in gmerlin-avdecoder and gmerlin encoding plugins. | |
39 | * | |
40 | * @{ | |
41 | */ | |
42 | ||
43 | ||
44 | #define GAVL_COMPRESSION_HAS_P_FRAMES (1<<0) //!< Not all frames are keyframes | |
45 | #define GAVL_COMPRESSION_HAS_B_FRAMES (1<<1) //!< Frames don't appear in presentation order | |
46 | #define GAVL_COMPRESSION_HAS_FIELD_PICTURES (1<<2) //!< Packets can consist of 2 consecutive fields | |
47 | #define GAVL_COMPRESSION_SBR (1<<3) //!< Samplerate got doubled by decoder, format and sample counts are for the upsampled rate | |
48 | ||
49 | typedef enum | |
50 | { | |
51 | GAVL_CODEC_ID_NONE = 0, //!< Unknown/unsupported compression format | |
52 | /* Audio */ | |
53 | GAVL_CODEC_ID_ALAW = 1, //!< alaw 2:1 | |
54 | GAVL_CODEC_ID_ULAW, //!< mu-law 2:1 | |
55 | GAVL_CODEC_ID_MP2, //!< MPEG-1 audio layer II | |
56 | GAVL_CODEC_ID_MP3, //!< MPEG-1/2 audio layer 3 CBR/VBR | |
57 | GAVL_CODEC_ID_AC3, //!< AC3 | |
58 | GAVL_CODEC_ID_AAC, //!< AAC as stored in quicktime/mp4 | |
59 | GAVL_CODEC_ID_VORBIS, //!< Vorbis (segmented extradata and packets) | |
60 | ||
61 | /* Video */ | |
62 | GAVL_CODEC_ID_JPEG = 0x10000, //!< JPEG image | |
63 | GAVL_CODEC_ID_PNG, //!< PNG image | |
64 | GAVL_CODEC_ID_TIFF, //!< TIFF image | |
65 | GAVL_CODEC_ID_TGA, //!< TGA image | |
66 | GAVL_CODEC_ID_MPEG1, //!< MPEG-1 video | |
67 | GAVL_CODEC_ID_MPEG2, //!< MPEG-2 video | |
68 | GAVL_CODEC_ID_MPEG4_ASP, //!< MPEG-4 ASP (a.k.a. Divx4) | |
69 | GAVL_CODEC_ID_H264, //!< H.264 (Annex B) | |
70 | GAVL_CODEC_ID_THEORA, //!< Theora (segmented extradata | |
71 | GAVL_CODEC_ID_DIRAC, //!< Complete DIRAC frames, sequence end code appended to last packet | |
72 | GAVL_CODEC_ID_DV, //!< DV (several variants) | |
73 | } gavl_codec_id_t; | |
74 | ||
75 | /** \brief Compression format | |
76 | * | |
77 | * This defines parameters of the compression. The most important | |
78 | * value is the \ref gavl_codec_id_t. Formats, which support a global | |
79 | * header, store it here as well. | |
80 | * | |
81 | * Usually there must be an associated audio or video format, because | |
82 | * some containers need this as well. | |
83 | */ | |
84 | ||
85 | typedef struct | |
86 | { | |
87 | int flags; //!< ORed combination of GAVL_COMPRESSION_* flags | |
88 | gavl_codec_id_t id; //!< Codec ID | |
89 | ||
90 | uint8_t * global_header; //!< Global header | |
91 | int global_header_len; //!< Length of global header | |
92 | ||
93 | int bitrate; //!< Needed by some codecs, negative values mean VBR | |
94 | int palette_size; //!< Size of the embedded palette for image codecs | |
95 | } gavl_compression_info_t; | |
96 | ||
97 | /** \brief Free all dynamically allocated memory of a compression info | |
98 | * \param info A compression info | |
99 | */ | |
100 | ||
101 | GAVL_PUBLIC | |
102 | void gavl_compression_info_free(gavl_compression_info_t* info); | |
103 | ||
104 | /** \brief Dump a compression info to stderr | |
105 | * \param info A compression info | |
106 | * | |
107 | * Use this for debugging | |
108 | */ | |
109 | ||
110 | GAVL_PUBLIC | |
111 | void gavl_compression_info_dump(const gavl_compression_info_t * info); | |
112 | ||
113 | /** \brief Get the file extension of the corresponding raw format | |
114 | * \param id A codec ID | |
115 | * \param separate If non-null returns 1 if each packet should be in a separate file | |
116 | * \returns The file extension of the raw file or NULL | |
117 | * | |
118 | * This function can be used for writing elementary streams to files. | |
119 | * It returns a suitable file extension. If separate is 1, each packet should be | |
120 | * written to a separate file. This basically means, that the codec corresponds to an | |
121 | * image format. | |
122 | * | |
123 | * Not all compression formats have a suitable elementary stream format, in this | |
124 | * case NULL is returned for the extension. Most prominent examples are Vorbis and | |
125 | * Theora, which can hardly exist outside an OGG container. | |
126 | */ | |
127 | ||
128 | GAVL_PUBLIC | |
129 | const char * gavl_compression_get_extension(gavl_codec_id_t id, int * separate); | |
130 | ||
131 | /** \brief Check if the compression supports multiple pixelformats | |
132 | * \param id A codec ID | |
133 | * \returns 1 if the compression ID must be associated with a pixelformat, 0 else | |
134 | * | |
135 | * This function can be used by decoding libraries to check if the compresison ID | |
136 | * is sufficient or if the pixelformat must be valid in the associated video format. | |
137 | * | |
138 | */ | |
139 | ||
140 | GAVL_PUBLIC | |
141 | int gavl_compression_need_pixelformat(gavl_codec_id_t id); | |
142 | ||
143 | ||
144 | #define GAVL_PACKET_TYPE_I 'I' //!< Packet is an I-frame | |
145 | #define GAVL_PACKET_TYPE_P 'P' //!< Packet is a P-frame | |
146 | #define GAVL_PACKET_TYPE_B 'B' //!< Packet is a B-frame | |
147 | #define GAVL_PACKET_TYPE_MASK 0xff //!< Mask for frame type | |
148 | ||
149 | #define GAVL_PACKET_KEYFRAME (1<<8) //!< Packet is a keyframe | |
150 | #define GAVL_PACKET_LAST (1<<9) //!< Packet is the last in the stream (only Xiph codecs need this flag) | |
151 | ||
152 | /** \brief Packet structure | |
153 | * | |
154 | * This specifies one packet of compressed data. | |
155 | * For video streams, each packet must correspond to a video frame. | |
156 | * For audio streams, each packet must be the smallest unit, which | |
157 | * can be decoded indepentently and for which a duration is known. | |
158 | * | |
159 | * The typical usage of a packet is to memset() oit to zero in the | |
160 | * beginning. Then for each packet call \ref gavl_packet_alloc | |
161 | * to ensure that enough data is allocated. At the very end call | |
162 | * \ref gavl_packet_free to free all memory. | |
163 | */ | |
164 | ||
165 | typedef struct | |
166 | { | |
167 | uint8_t * data; //!< Data | |
168 | int data_len; //!< Length of data | |
169 | int data_alloc; //!< How many bytes got allocated | |
170 | ||
171 | int flags; //!< ORed combination of GAVL_PACKET_* flags | |
172 | ||
173 | int64_t pts; //!< Presentation time | |
174 | int64_t duration; //!< Duration of the contained frame | |
175 | ||
176 | int field2_offset; //!< Offset of field 2 for field pictures | |
177 | int header_size; //!< Size of a repeated global header (or 0) | |
178 | int sequence_end_pos; //!< Position of sequence end code if any | |
179 | ||
180 | } gavl_packet_t; | |
181 | ||
182 | /** \brief Allocate memory for a packet | |
183 | * \param p A packet | |
184 | * \param len Number of bytes you want to store in the packet | |
185 | * | |
186 | * This function uses realloc(), which means that it preserves | |
187 | * the data already contained in the packet. | |
188 | */ | |
189 | ||
190 | GAVL_PUBLIC | |
191 | void gavl_packet_alloc(gavl_packet_t * p, int len); | |
192 | ||
193 | /** \brief Free memory of a packet | |
194 | * \param p A packet | |
195 | */ | |
196 | ||
197 | GAVL_PUBLIC | |
198 | void gavl_packet_free(gavl_packet_t * p); | |
199 | ||
200 | /** \brief Dump a packet to stderr | |
201 | * \param p A packet | |
202 | * | |
203 | * Use this for debugging | |
204 | */ | |
205 | ||
206 | GAVL_PUBLIC | |
207 | void gavl_packet_dump(const gavl_packet_t * p); | |
208 | ||
209 | ||
210 | #ifdef __cplusplus | |
211 | } | |
212 | #endif | |
213 | ||
214 | ||
215 | #endif // GAVL_COMPRESSION_H_INCLUDED |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
672 | 672 | gavl_audio_frame_t * src, |
673 | 673 | gavl_audio_frame_t * dst, |
674 | 674 | int start, int len); |
675 | ||
676 | /*! | |
677 | \ingroup audio_frame | |
678 | \brief Check if 2 audio frames are bit-identical | |
679 | \param format Format | |
680 | \param f1 First frame | |
681 | \param f2 Second frame | |
682 | \returns 1 if the frames are equal, 0 else | |
683 | ||
684 | Since 1.2.0 | |
685 | */ | |
686 | ||
687 | ||
688 | GAVL_PUBLIC | |
689 | int gavl_audio_frames_equal(const gavl_audio_format_t * format, | |
690 | const gavl_audio_frame_t * f1, | |
691 | const gavl_audio_frame_t * f2); | |
692 | ||
693 | /*! | |
694 | \ingroup audio_frame | |
695 | \brief Plot an audio frame to an ASCII file | |
696 | \param format Format | |
697 | \param frame An audio frame | |
698 | \param name_base Filename base | |
699 | \returns 1 in success, 0 in failure | |
700 | ||
701 | Plots an audio frame into an ascii file with one line per | |
702 | sample in the format: | |
703 | <sample_number> <channel1> <channel2> ... | |
704 | ||
705 | In addition, a file for making a plot with gnuplot is generated. | |
706 | name_base is used for generating the filenames. For the data file, | |
707 | the extension ".dat" is appended. For the gnuplot file it's ".gnu" | |
708 | ||
709 | Since 1.2.0 | |
710 | */ | |
711 | ||
712 | GAVL_PUBLIC | |
713 | int gavl_audio_frame_plot(const gavl_audio_format_t * format, | |
714 | const gavl_audio_frame_t * frame, | |
715 | const char * name_base); | |
716 | ||
675 | 717 | |
676 | 718 | /** \defgroup audio_options Audio conversion options |
677 | 719 | \ingroup audio |
2020 | 2062 | /*! \ingroup video_format |
2021 | 2063 | * \brief Framerate mode |
2022 | 2064 | */ |
2023 | ||
2065 | ||
2066 | /* Changing the values alters the gmerlin-avdecoder index format */ | |
2067 | ||
2024 | 2068 | typedef enum |
2025 | 2069 | { |
2026 | GAVL_FRAMERATE_CONSTANT = 0, /*!< Constant framerate */ | |
2027 | GAVL_FRAMERATE_VARIABLE = 1, /*!< Variable framerate */ | |
2028 | GAVL_FRAMERATE_STILL = 2, /*!< Still image */ | |
2070 | GAVL_FRAMERATE_UNKNOWN = -1, /*!< Unknown (never use in public APIs) */ | |
2071 | GAVL_FRAMERATE_CONSTANT = 0, /*!< Constant framerate */ | |
2072 | GAVL_FRAMERATE_VARIABLE = 1, /*!< Variable framerate */ | |
2073 | GAVL_FRAMERATE_STILL = 2, /*!< Still image */ | |
2029 | 2074 | } gavl_framerate_mode_t; |
2030 | 2075 | |
2076 | /*! \ingroup video_format | |
2077 | * \brief Translate a framerate mode into a human readable string | |
2078 | * \param mode A framerate mode | |
2079 | * \returns A string describing the framerate mode | |
2080 | */ | |
2081 | ||
2082 | GAVL_PUBLIC | |
2083 | const char * gavl_framerate_mode_to_string(gavl_framerate_mode_t mode); | |
2084 | ||
2031 | 2085 | /*! \ingroup video_format |
2032 | 2086 | * \brief Interlace mode |
2033 | 2087 | */ |
2034 | 2088 | |
2089 | /* Changing the values alters the gmerlin-avdecoder index format */ | |
2090 | ||
2035 | 2091 | typedef enum |
2036 | 2092 | { |
2037 | GAVL_INTERLACE_NONE = 0, /*!< Progressive */ | |
2038 | GAVL_INTERLACE_TOP_FIRST, /*!< Top field first */ | |
2039 | GAVL_INTERLACE_BOTTOM_FIRST,/*!< Bottom field first */ | |
2040 | GAVL_INTERLACE_MIXED /*!< Use interlace_mode of the frames */ | |
2093 | GAVL_INTERLACE_UNKNOWN = -1,/*!< Unknown interlacing (never use in public APIs) */ | |
2094 | GAVL_INTERLACE_NONE = 0, /*!< Progressive */ | |
2095 | GAVL_INTERLACE_TOP_FIRST = 1, /*!< Top field first */ | |
2096 | GAVL_INTERLACE_BOTTOM_FIRST = 2, /*!< Bottom field first */ | |
2097 | GAVL_INTERLACE_MIXED = 3, /*!< Use interlace_mode of the frames */ | |
2098 | GAVL_INTERLACE_MIXED_TOP = 4, /*!< Progressive + top */ | |
2099 | GAVL_INTERLACE_MIXED_BOTTOM = 5, /*!< Progressive + bottom */ | |
2041 | 2100 | } gavl_interlace_mode_t; |
2042 | 2101 | |
2043 | 2102 | /*! \ingroup video_format |
2600 | 2659 | gavl_video_frame_t * dst); |
2601 | 2660 | |
2602 | 2661 | |
2662 | /*! | |
2663 | \ingroup video_frame | |
2664 | \brief Check if 2 video frames are bit-identical | |
2665 | \param format Format | |
2666 | \param f1 First frame | |
2667 | \param f2 Second frame | |
2668 | \returns 1 if the frames are equal, 0 else | |
2669 | ||
2670 | Since 1.2.0 | |
2671 | */ | |
2672 | ||
2673 | GAVL_PUBLIC | |
2674 | int gavl_video_frames_equal(const gavl_video_format_t * format, | |
2675 | const gavl_video_frame_t * f1, | |
2676 | const gavl_video_frame_t * f2); | |
2603 | 2677 | |
2604 | 2678 | |
2605 | 2679 | /***************************** |
0 | 0 | #ifndef __GAVL_VERSION_H_ |
1 | 1 | #define __GAVL_VERSION_H_ |
2 | 2 | |
3 | #define GAVL_VERSION "1.1.2" | |
3 | #define GAVL_VERSION "1.2.0" | |
4 | 4 | |
5 | 5 | #define GAVL_VERSION_MAJOR 1 |
6 | #define GAVL_VERSION_MINOR 1 | |
7 | #define GAVL_VERSION_MICRO 2 | |
6 | #define GAVL_VERSION_MINOR 2 | |
7 | #define GAVL_VERSION_MICRO 0 | |
8 | 8 | |
9 | 9 | #define GAVL_MAKE_BUILD(a,b,c) ((a << 16) + (b << 8) + c) |
10 | 10 |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | # Generated from ltmain.m4sh. |
1 | 1 | |
2 | # ltmain.sh (GNU libtool) 2.2.6 | |
2 | # ltmain.sh (GNU libtool) 2.2.6b | |
3 | 3 | # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 |
4 | 4 | |
5 | 5 | # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc. |
64 | 64 | # compiler: $LTCC |
65 | 65 | # compiler flags: $LTCFLAGS |
66 | 66 | # linker: $LD (gnu? $with_gnu_ld) |
67 | # $progname: (GNU libtool) 2.2.6 Debian-2.2.6a-4 | |
67 | # $progname: (GNU libtool) 2.2.6b Debian-2.2.6b-2ubuntu1 | |
68 | 68 | # automake: $automake_version |
69 | 69 | # autoconf: $autoconf_version |
70 | 70 | # |
72 | 72 | |
73 | 73 | PROGRAM=ltmain.sh |
74 | 74 | PACKAGE=libtool |
75 | VERSION="2.2.6 Debian-2.2.6a-4" | |
75 | VERSION="2.2.6b Debian-2.2.6b-2ubuntu1" | |
76 | 76 | TIMESTAMP="" |
77 | package_revision=1.3012 | |
77 | package_revision=1.3017 | |
78 | 78 | |
79 | 79 | # Be Bourne compatible |
80 | 80 | if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then |
0 | # Makefile.in generated by automake 1.11 from Makefile.am. | |
0 | # Makefile.in generated by automake 1.11.1 from Makefile.am. | |
1 | 1 | # @configure_input@ |
2 | 2 | |
3 | 3 | # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, |
963 | 963 | AC_MSG_RESULT(no) |
964 | 964 | ) |
965 | 965 | |
966 | if test "x$have_dvdread" = "xtrue"; then | |
967 | AC_CHECK_FUNCS(DVDInit DVDFinish) | |
968 | fi | |
969 | ||
966 | 970 | CFLAGS=$OLD_CFLAGS |
967 | 971 | LIBS=$OLD_LIBS |
968 | 972 | |
1767 | 1771 | sem_t s; |
1768 | 1772 | result = sem_init(&s, 0, 0); |
1769 | 1773 | if(result) |
1770 | return -1; | |
1771 | return 0; | |
1774 | return 0; | |
1775 | return -1; | |
1772 | 1776 | } |
1773 | 1777 | ], |
1774 | 1778 | [ |
0 | # Makefile.in generated by automake 1.11 from Makefile.am. | |
0 | # Makefile.in generated by automake 1.11.1 from Makefile.am. | |
1 | 1 | # @configure_input@ |
2 | 2 | |
3 | 3 | # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
19 | 19 | * *****************************************************************/ |
20 | 20 | #include <stdlib.h> |
21 | 21 | #include <gavl.h> |
22 | #include <gavl_version.h> | |
22 | 23 | //#include "colorspace.h" // Common routines |
23 | 24 | #include <stdio.h> |
24 | 25 | #include <png.h> |
178 | 179 | { |
179 | 180 | case PNG_COLOR_TYPE_GRAY: /* (bit depths 1, 2, 4, 8, 16) */ |
180 | 181 | if(bit_depth < 8) |
182 | #if GAVL_MAKE_BUILD(PNG_LIBPNG_VER_MAJOR, PNG_LIBPNG_VER_MINOR, PNG_LIBPNG_VER_RELEASE) < GAVL_MAKE_BUILD(1,2,9) | |
181 | 183 | png_set_gray_1_2_4_to_8(png_ptr); |
184 | #else | |
185 | png_set_expand_gray_1_2_4_to_8(png_ptr); | |
186 | #endif | |
182 | 187 | if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) |
183 | 188 | { |
184 | 189 | png_set_tRNS_to_alpha(png_ptr); |
227 | 232 | png_read_image(png_ptr, rows); |
228 | 233 | png_read_end(png_ptr, end_info); |
229 | 234 | |
230 | png_destroy_read_struct(&(png_ptr), &(info_ptr), | |
231 | &(end_info)); | |
235 | png_destroy_read_struct(&png_ptr, &info_ptr, | |
236 | &end_info); | |
232 | 237 | fclose(file); |
233 | 238 | free(rows); |
234 | 239 |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
20 | 20 | #include <png.h> |
21 | 21 | #include <stdio.h> |
22 | 22 | #include <gavl.h> |
23 | #include <gavl_version.h> | |
23 | 24 | #include <pngutil.h> |
24 | 25 | #include <stdlib.h> |
25 | 26 | |
172 | 173 | { |
173 | 174 | case PNG_COLOR_TYPE_GRAY: /* (bit depths 1, 2, 4, 8, 16) */ |
174 | 175 | if(bit_depth < 8) |
176 | #if GAVL_MAKE_BUILD(PNG_LIBPNG_VER_MAJOR, PNG_LIBPNG_VER_MINOR, PNG_LIBPNG_VER_RELEASE) < GAVL_MAKE_BUILD(1,2,9) | |
175 | 177 | png_set_gray_1_2_4_to_8(png_ptr); |
178 | #else | |
179 | png_set_expand_gray_1_2_4_to_8(png_ptr); | |
180 | #endif | |
176 | 181 | if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) |
177 | 182 | { |
178 | 183 | png_set_tRNS_to_alpha(png_ptr); |
221 | 226 | png_read_image(png_ptr, rows); |
222 | 227 | png_read_end(png_ptr, end_info); |
223 | 228 | |
224 | png_destroy_read_struct(&(png_ptr), &(info_ptr), | |
225 | &(end_info)); | |
229 | png_destroy_read_struct(&png_ptr, &info_ptr, | |
230 | &end_info); | |
226 | 231 | fclose(file); |
227 | 232 | free(rows); |
228 | 233 |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
19 | 19 | * *****************************************************************/ |
20 | 20 | #include <stdlib.h> |
21 | 21 | #include <gavl.h> |
22 | #include <gavl_version.h> | |
22 | 23 | //#include "colorspace.h" // Common routines |
23 | 24 | #include <stdio.h> |
24 | 25 | #include <png.h> |
209 | 210 | { |
210 | 211 | case PNG_COLOR_TYPE_GRAY: /* (bit depths 1, 2, 4, 8, 16) */ |
211 | 212 | if(bit_depth < 8) |
213 | #if GAVL_MAKE_BUILD(PNG_LIBPNG_VER_MAJOR, PNG_LIBPNG_VER_MINOR, PNG_LIBPNG_VER_RELEASE) < GAVL_MAKE_BUILD(1,2,9) | |
212 | 214 | png_set_gray_1_2_4_to_8(png_ptr); |
215 | #else | |
216 | png_set_expand_gray_1_2_4_to_8(png_ptr); | |
217 | #endif | |
213 | 218 | if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) |
214 | 219 | { |
215 | 220 | png_set_tRNS_to_alpha(png_ptr); |
258 | 263 | png_read_image(png_ptr, rows); |
259 | 264 | png_read_end(png_ptr, end_info); |
260 | 265 | |
261 | png_destroy_read_struct(&(png_ptr), &(info_ptr), | |
262 | &(end_info)); | |
266 | png_destroy_read_struct(&png_ptr, &info_ptr, | |
267 | &end_info); | |
263 | 268 | fclose(file); |
264 | 269 | free(rows); |
265 | 270 |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |
0 | 0 | /***************************************************************** |
1 | 1 | * gavl - a general purpose audio/video processing library |
2 | 2 | * |
3 | * Copyright (c) 2001 - 2010 Members of the Gmerlin project | |
3 | * Copyright (c) 2001 - 2011 Members of the Gmerlin project | |
4 | 4 | * gmerlin-general@lists.sourceforge.net |
5 | 5 | * http://gmerlin.sourceforge.net |
6 | 6 | * |