Codebase list gavl / 451cc07
Imported Upstream version 1.2.0 Alessio Treglia 13 years ago
198 changed file(s) with 1418 addition(s) and 631 deletion(s). Raw diff Collapse all Expand all
0 # Makefile.in generated by automake 1.11 from Makefile.am.
0 # Makefile.in generated by automake 1.11.1 from Makefile.am.
11 # @configure_input@
22
33 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
349349 # (which will cause the Makefiles to be regenerated when you run `make');
350350 # (2) otherwise, pass the desired values on the `make' command line.
351351 $(RECURSIVE_TARGETS):
352 @failcom='exit 1'; \
352 @fail= failcom='exit 1'; \
353353 for f in x $$MAKEFLAGS; do \
354354 case $$f in \
355355 *=* | --[!k]*);; \
374374 fi; test -z "$$fail"
375375
376376 $(RECURSIVE_CLEAN_TARGETS):
377 @failcom='exit 1'; \
377 @fail= failcom='exit 1'; \
378378 for f in x $$MAKEFLAGS; do \
379379 case $$f in \
380380 *=* | --[!k]*);; \
538538 fi; \
539539 done
540540 -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 \
542543 ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
543544 ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
544545 ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
582583 distcheck: dist
583584 case '$(DIST_ARCHIVES)' in \
584585 *.tar.gz*) \
585 GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
586 GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
586587 *.tar.bz2*) \
587 bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
588 bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
588589 *.tar.lzma*) \
589 unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
590 lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
590591 *.tar.xz*) \
591592 xz -dc $(distdir).tar.xz | $(am__untar) ;;\
592593 *.tar.Z*) \
593594 uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
594595 *.shar.gz*) \
595 GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
596 GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
596597 *.zip*) \
597598 unzip $(distdir).zip ;;\
598599 esac
0 # generated automatically by aclocal 1.11 -*- Autoconf -*-
0 # generated automatically by aclocal 1.11.1 -*- Autoconf -*-
11
22 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
33 # 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
1212
1313 m4_ifndef([AC_AUTOCONF_VERSION],
1414 [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.
1717 You have another version of autoconf. It may work, but is not guaranteed to.
1818 If you have problems, you may need to regenerate the build system entirely.
1919 To do so, use the procedure documented by the package, typically `autoreconf'.])])
24592459 ;;
24602460
24612461 # This must be Linux ELF.
2462 linux* | k*bsd*-gnu)
2462 linux* | k*bsd*-gnu | kopensolaris*-gnu)
24632463 version_type=linux
24642464 need_lib_prefix=no
24652465 need_version=no
30983098 ;;
30993099
31003100 # This must be Linux ELF.
3101 linux* | k*bsd*-gnu)
3101 linux* | k*bsd*-gnu | kopensolaris*-gnu)
31023102 lt_cv_deplibs_check_method=pass_all
31033103 ;;
31043104
37193719 ;;
37203720 esac
37213721 ;;
3722 linux* | k*bsd*-gnu)
3722 linux* | k*bsd*-gnu | kopensolaris*-gnu)
37233723 case $cc_basename in
37243724 KCC*)
37253725 # KAI C++ Compiler
40034003 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
40044004 ;;
40054005
4006 linux* | k*bsd*-gnu)
4006 linux* | k*bsd*-gnu | kopensolaris*-gnu)
40074007 case $cc_basename in
40084008 # old Intel for x86_64 which still supported -KPIC.
40094009 ecc*)
42994299 fi
43004300 supports_anon_versioning=no
43014301 case `$LD -v 2>&1` in
4302 *GNU\ gold*) supports_anon_versioning=yes ;;
43024303 *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
43034304 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
43044305 *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
43904391 _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'
43914392 ;;
43924393
4393 gnu* | linux* | tpf* | k*bsd*-gnu)
4394 gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
43944395 tmp_diet=no
43954396 if test "$host_os" = linux-dietlibc; then
43964397 case $cc_basename in
58705871 _LT_TAGVAR(inherit_rpath, $1)=yes
58715872 ;;
58725873
5873 linux* | k*bsd*-gnu)
5874 linux* | k*bsd*-gnu | kopensolaris*-gnu)
58745875 case $cc_basename in
58755876 KCC*)
58765877 # Kuck and Associates, Inc. (KAI) C++ Compiler
78777878
78787879 # Generated from ltversion.in.
78797880
7880 # serial 3012 ltversion.m4
7881 # serial 3017 ltversion.m4
78817882 # This file is part of GNU Libtool
78827883
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])
78857886
78867887 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'
78897890 _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
78907891 _LT_DECL(, macro_revision, 0)
78917892 ])
79987999 [am__api_version='1.11'
79998000 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
80008001 dnl require some minimum version. Point them to the right macro.
8001 m4_if([$1], [1.11], [],
8002 m4_if([$1], [1.11.1], [],
80028003 [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
80038004 ])
80048005
80148015 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
80158016 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
80168017 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
8017 [AM_AUTOMAKE_VERSION([1.11])dnl
8018 [AM_AUTOMAKE_VERSION([1.11.1])dnl
80188019 m4_ifndef([AC_AUTOCONF_VERSION],
80198020 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
80208021 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
00 #! /bin/sh
11 # Attempt to guess a canonical system name.
22 # 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
44 # Free Software Foundation, Inc.
55
6 timestamp='2009-04-27'
6 timestamp='2009-06-10'
77
88 # This file is free software; you can redistribute it and/or modify it
99 # under the terms of the GNU General Public License as published by
169169 arm*|i386|m68k|ns32k|sh3*|sparc|vax)
170170 eval $set_cc_for_build
171171 if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
172 | grep __ELF__ >/dev/null
172 | grep -q __ELF__
173173 then
174174 # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
175175 # Return netbsd for either. FIX?
655655 # => hppa64-hp-hpux11.23
656656
657657 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
658 grep __LP64__ >/dev/null
658 grep -q __LP64__
659659 then
660660 HP_ARCH="hppa2.0w"
661661 else
821821 [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
822822 echo i${UNAME_MACHINE}-pc-mks
823823 exit ;;
824 8664:Windows_NT:*)
825 echo x86_64-pc-mks
826 exit ;;
824827 i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
825828 # How do we know it's Interix rather than the generic POSIX subsystem?
826829 # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
881884 m68*:Linux:*:*)
882885 echo ${UNAME_MACHINE}-unknown-linux-gnu
883886 exit ;;
884 mips:Linux:*:*)
887 mips:Linux:*:* | mips64:Linux:*:*)
885888 eval $set_cc_for_build
886889 sed 's/^ //' << EOF >$dummy.c
887890 #undef CPU
888 #undef mips
889 #undef mipsel
891 #undef ${UNAME_MACHINE}
892 #undef ${UNAME_MACHINE}el
890893 #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
891 CPU=mipsel
894 CPU=${UNAME_MACHINE}el
892895 #else
893896 #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}
918898 #else
919899 CPU=
920900 #endif
946926 EV67) UNAME_MACHINE=alphaev67 ;;
947927 EV68*) UNAME_MACHINE=alphaev68 ;;
948928 esac
949 objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
929 objdump --private-headers /bin/sh | grep -q ld.so.1
950930 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
951931 echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
952932 exit ;;
1000980 elf32-i386)
1001981 TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
1002982 ;;
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 ;;
1011983 esac
1012984 # Determine whether the default compiler is a.out or elf
1013985 eval $set_cc_for_build
10731045 i*86:syllable:*:*)
10741046 echo ${UNAME_MACHINE}-pc-syllable
10751047 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]*:*)
10771049 echo i386-unknown-lynxos${UNAME_RELEASE}
10781050 exit ;;
10791051 i*86:*DOS:*:*)
11811153 rs6000:LynxOS:2.*:*)
11821154 echo rs6000-unknown-lynxos${UNAME_RELEASE}
11831155 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]*:*)
11851157 echo powerpc-unknown-lynxos${UNAME_RELEASE}
11861158 exit ;;
11871159 SM[BE]S:UNIX_SV:*:*)
00 #! /bin/sh
11 # Configuration validation subroutine script.
22 # 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
44 # Free Software Foundation, Inc.
55
6 timestamp='2009-04-17'
6 timestamp='2009-06-11'
77
88 # This file is (in principle) common to ALL GNU software.
99 # The presence of a machine in this file suggests that SOME GNU software
151151 -apple | -axis | -knuth | -cray)
152152 os=
153153 basic_machine=$1
154 ;;
155 -bluegene*)
156 os=-cnk
154157 ;;
155158 -sim | -cisco | -oki | -wec | -winbond)
156159 os=
466469 basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
467470 os=-linux
468471 ;;
472 bluegene*)
473 basic_machine=powerpc-ibm
474 os=-cnk
475 ;;
469476 c90)
470477 basic_machine=c90-cray
471478 os=-unicos
12591266 # Each alternative MUST END IN A *, to match a version number.
12601267 # -sysv* is not here because it comes later, after sysvr4.
12611268 -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]*\
12631270 | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
12641271 | -kopensolaris* \
12651272 | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
16121619 -sunos*)
16131620 vendor=sun
16141621 ;;
1615 -aix*)
1622 -cnk*|-aix*)
16161623 vendor=ibm
16171624 ;;
16181625 -beos*)
00 #! /bin/sh
11 # Guess values for system-dependent variables and create Makefiles.
2 # Generated by GNU Autoconf 2.64.
2 # Generated by GNU Autoconf 2.65.
3 #
34 #
45 # 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 #
79 #
810 # This configure script is free software; the Free Software Foundation
911 # gives unlimited permission to copy, distribute and modify it.
672674
673675
674676
675 exec 7<&0 </dev/null 6>&1
677 test -n "$DJDIR" || exec 7<&0 </dev/null
678 exec 6>&1
676679
677680 # Name of the host.
678681 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
15511554 LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
15521555 nonstandard directory <lib dir>
15531556 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
15551558 you have headers in a nonstandard directory <include dir>
15561559 CPP C preprocessor
15571560
16221625 if $ac_init_version; then
16231626 cat <<\_ACEOF
16241627 configure
1625 generated by GNU Autoconf 2.64
1628 generated by GNU Autoconf 2.65
16261629
16271630 Copyright (C) 2009 Free Software Foundation, Inc.
16281631 This configure script is free software; the Free Software Foundation
16691672 ac_retval=1
16701673 fi
16711674 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
16731676
16741677 } # ac_fn_c_try_compile
16751678
17151718 # left behind by Apple's compiler. We do this before executing the actions.
17161719 rm -rf conftest.dSYM conftest_ipa8_conftest.oo
17171720 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
17191722
17201723 } # ac_fn_c_try_link
17211724
17831786 ac_retval=1
17841787 fi
17851788 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
17871790
17881791 } # ac_fn_c_try_cpp
17891792
18251828 fi
18261829 rm -rf conftest.dSYM conftest_ipa8_conftest.oo
18271830 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
18291832
18301833 } # ac_fn_c_try_run
18311834
21572160
21582161 fi
21592162 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
21612164
21622165 } # ac_fn_c_compute_int
21632166 cat >config.log <<_ACEOF
21652168 running configure, to aid debugging if configure makes a mistake.
21662169
21672170 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
21692172
21702173 $ $0 $@
21712174
24182421 for ac_site_file in "$ac_site_file1" "$ac_site_file2"
24192422 do
24202423 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
24222425 { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
24232426 $as_echo "$as_me: loading site script $ac_site_file" >&6;}
24242427 sed 's/^/| /' "$ac_site_file" >&5
24272430 done
24282431
24292432 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
24332436 { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
24342437 $as_echo "$as_me: loading cache $cache_file" >&6;}
24352438 case $cache_file in
28522855
28532856 fi
28542857
2858 test -d ./--version && rmdir ./--version
28552859 if test "${ac_cv_path_mkdir+set}" = set; then
28562860 MKDIR_P="$ac_cv_path_mkdir -p"
28572861 else
28592863 # value for MKDIR_P within a source directory, because that will
28602864 # break other packages using the cache if that directory is
28612865 # removed, or if the value is a relative name.
2862 test -d ./--version && rmdir ./--version
28632866 MKDIR_P="$ac_install_sh -d"
28642867 fi
28652868 fi
29762979
29772980 # Define the identity of the package.
29782981 PACKAGE=gavl
2979 VERSION=1.1.2
2982 VERSION=1.2.0
29802983
29812984
29822985 cat >>confdefs.h <<_ACEOF
31503153
31513154
31523155
3153 macro_version='2.2.6'
3154 macro_revision='1.3012'
3156 macro_version='2.2.6b'
3157 macro_revision='1.3017'
31553158
31563159
31573160
35513554 ... rest of stderr output deleted ...
35523555 10q' conftest.err >conftest.er1
35533556 cat conftest.er1 >&5
3554 rm -f conftest.er1 conftest.err
35553557 fi
3558 rm -f conftest.er1 conftest.err
35563559 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
35573560 test $ac_status = 0; }
35583561 done
35593562
35603563 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
35613564 /* end confdefs.h. */
3562 #include <stdio.h>
3565
35633566 int
35643567 main ()
35653568 {
3566 FILE *f = fopen ("conftest.out", "w");
3567 return ferror (f) || fclose (f) != 0;
35683569
35693570 ;
35703571 return 0;
35713572 }
35723573 _ACEOF
35733574 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"
35753576 # Try to create an executable without -o first, disregard a.out.
35763577 # It will help us diagnose broken compilers, and finding out an intuition
35773578 # 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; }
35803581 ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
35813582
35823583 # The possible output files:
36383639 else
36393640 ac_file=''
36403641 fi
3641 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
3642 $as_echo "$ac_file" >&6; }
36433642 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
36453646 sed 's/^/| /' conftest.$ac_ext >&5
36463647
36473648 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
36493650 { as_fn_set_status 77
36503651 as_fn_error "C compiler cannot create executables
36513652 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; }
36533661 ac_exeext=$ac_cv_exeext
36543662
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
36893664 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
36973665 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
36983666 $as_echo_n "checking for suffix of executables... " >&6; }
36993667 if { { ac_try="$ac_link"
37263694 as_fn_error "cannot compute suffix of executables: cannot compile and link
37273695 See \`config.log' for more details." "$LINENO" 5; }
37283696 fi
3729 rm -f conftest$ac_cv_exeext
3697 rm -f conftest conftest$ac_cv_exeext
37303698 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
37313699 $as_echo "$ac_cv_exeext" >&6; }
37323700
37333701 rm -f conftest.$ac_ext
37343702 EXEEXT=$ac_cv_exeext
37353703 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
37363763 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
37373764 $as_echo_n "checking for suffix of object files... " >&6; }
37383765 if test "${ac_cv_objext+set}" = set; then :
47074734 else
47084735 lt_cv_nm_interface="BSD nm"
47094736 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)
47114738 (eval "$ac_compile" 2>conftest.err)
47124739 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)
47144741 (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
47154742 cat conftest.err >&5
4716 (eval echo "\"\$as_me:4717: output\"" >&5)
4743 (eval echo "\"\$as_me:4744: output\"" >&5)
47174744 cat conftest.out >&5
47184745 if $GREP 'External.*some_variable' conftest.out > /dev/null; then
47194746 lt_cv_nm_interface="MS dumpbin"
51795206 ;;
51805207
51815208 # This must be Linux ELF.
5182 linux* | k*bsd*-gnu)
5209 linux* | k*bsd*-gnu | kopensolaris*-gnu)
51835210 lt_cv_deplibs_check_method=pass_all
51845211 ;;
51855212
59195946 ;;
59205947 *-*-irix6*)
59215948 # Find out which ABI we are using.
5922 echo '#line 5923 "configure"' > conftest.$ac_ext
5949 echo '#line 5950 "configure"' > conftest.$ac_ext
59235950 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
59245951 (eval $ac_compile) 2>&5
59255952 ac_status=$?
74157442 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
74167443 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
74177444 -e 's:$: $lt_compiler_flag:'`
7418 (eval echo "\"\$as_me:7419: $lt_compile\"" >&5)
7445 (eval echo "\"\$as_me:7446: $lt_compile\"" >&5)
74197446 (eval "$lt_compile" 2>conftest.err)
74207447 ac_status=$?
74217448 cat conftest.err >&5
7422 echo "$as_me:7423: \$? = $ac_status" >&5
7449 echo "$as_me:7450: \$? = $ac_status" >&5
74237450 if (exit $ac_status) && test -s "$ac_outfile"; then
74247451 # The compiler can only warn and ignore the option if not recognized
74257452 # So say no if there are warnings other than the usual output.
75847611 lt_prog_compiler_static='-non_shared'
75857612 ;;
75867613
7587 linux* | k*bsd*-gnu)
7614 linux* | k*bsd*-gnu | kopensolaris*-gnu)
75887615 case $cc_basename in
75897616 # old Intel for x86_64 which still supported -KPIC.
75907617 ecc*)
77547781 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
77557782 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
77567783 -e 's:$: $lt_compiler_flag:'`
7757 (eval echo "\"\$as_me:7758: $lt_compile\"" >&5)
7784 (eval echo "\"\$as_me:7785: $lt_compile\"" >&5)
77587785 (eval "$lt_compile" 2>conftest.err)
77597786 ac_status=$?
77607787 cat conftest.err >&5
7761 echo "$as_me:7762: \$? = $ac_status" >&5
7788 echo "$as_me:7789: \$? = $ac_status" >&5
77627789 if (exit $ac_status) && test -s "$ac_outfile"; then
77637790 # The compiler can only warn and ignore the option if not recognized
77647791 # So say no if there are warnings other than the usual output.
78597886 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
78607887 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
78617888 -e 's:$: $lt_compiler_flag:'`
7862 (eval echo "\"\$as_me:7863: $lt_compile\"" >&5)
7889 (eval echo "\"\$as_me:7890: $lt_compile\"" >&5)
78637890 (eval "$lt_compile" 2>out/conftest.err)
78647891 ac_status=$?
78657892 cat out/conftest.err >&5
7866 echo "$as_me:7867: \$? = $ac_status" >&5
7893 echo "$as_me:7894: \$? = $ac_status" >&5
78677894 if (exit $ac_status) && test -s out/conftest2.$ac_objext
78687895 then
78697896 # The compiler can only warn and ignore the option if not recognized
79147941 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
79157942 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
79167943 -e 's:$: $lt_compiler_flag:'`
7917 (eval echo "\"\$as_me:7918: $lt_compile\"" >&5)
7944 (eval echo "\"\$as_me:7945: $lt_compile\"" >&5)
79187945 (eval "$lt_compile" 2>out/conftest.err)
79197946 ac_status=$?
79207947 cat out/conftest.err >&5
7921 echo "$as_me:7922: \$? = $ac_status" >&5
7948 echo "$as_me:7949: \$? = $ac_status" >&5
79227949 if (exit $ac_status) && test -s out/conftest2.$ac_objext
79237950 then
79247951 # The compiler can only warn and ignore the option if not recognized
80578084 fi
80588085 supports_anon_versioning=no
80598086 case `$LD -v 2>&1` in
8087 *GNU\ gold*) supports_anon_versioning=yes ;;
80608088 *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
80618089 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
80628090 *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
81488176 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'
81498177 ;;
81508178
8151 gnu* | linux* | tpf* | k*bsd*-gnu)
8179 gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
81528180 tmp_diet=no
81538181 if test "$host_os" = linux-dietlibc; then
81548182 case $cc_basename in
96109638 ;;
96119639
96129640 # This must be Linux ELF.
9613 linux* | k*bsd*-gnu)
9641 linux* | k*bsd*-gnu | kopensolaris*-gnu)
96149642 version_type=linux
96159643 need_lib_prefix=no
96169644 need_version=no
1029710325 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1029810326 lt_status=$lt_dlunknown
1029910327 cat > conftest.$ac_ext <<_LT_EOF
10300 #line 10301 "configure"
10328 #line 10329 "configure"
1030110329 #include "confdefs.h"
1030210330
1030310331 #if HAVE_DLFCN_H
1039310421 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1039410422 lt_status=$lt_dlunknown
1039510423 cat > conftest.$ac_ext <<_LT_EOF
10396 #line 10397 "configure"
10424 #line 10425 "configure"
1039710425 #include "confdefs.h"
1039810426
1039910427 #if HAVE_DLFCN_H
1299313021 # values after options handling.
1299413022 ac_log="
1299513023 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
1299713025
1299813026 CONFIG_FILES = $CONFIG_FILES
1299913027 CONFIG_HEADERS = $CONFIG_HEADERS
1303313061
1303413062 -h, --help print this help, then exit
1303513063 -V, --version print version number and configuration settings, then exit
13064 --config print configuration, then exit
1303613065 -q, --quiet, --silent
1303713066 do not print progress messages
1303813067 -d, --debug don't remove temporary files
1305513084
1305613085 _ACEOF
1305713086 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
13087 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
1305813088 ac_cs_version="\\
1305913089 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\\"
1306213092
1306313093 Copyright (C) 2009 Free Software Foundation, Inc.
1306413094 This config.status script is free software; the Free Software Foundation
1309613126 ac_cs_recheck=: ;;
1309713127 --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
1309813128 $as_echo "$ac_cs_version"; exit ;;
13129 --config | --confi | --conf | --con | --co | --c )
13130 $as_echo "$ac_cs_config"; exit ;;
1309913131 --debug | --debu | --deb | --de | --d | -d )
1310013132 debug=: ;;
1310113133 --file | --fil | --fi | --f )
1356013592 t delim
1356113593 :nl
1356213594 h
13563 s/\(.\{148\}\).*/\1/
13595 s/\(.\{148\}\)..*/\1/
1356413596 t more1
1356513597 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
1356613598 p
1357413606 t nl
1357513607 :delim
1357613608 h
13577 s/\(.\{148\}\).*/\1/
13609 s/\(.\{148\}\)..*/\1/
1357813610 t more2
1357913611 s/["\\]/\\&/g; s/^/"/; s/$/"/
1358013612 p
33
44 AM_CONFIG_HEADER(include/gavl/config.h)
55
6 AM_INIT_AUTOMAKE(gavl, 1.1.2)
6 AM_INIT_AUTOMAKE(gavl, 1.2.0)
77
88 GAVL_VERSION=$VERSION
99
423423 # directories like "/usr/src/myproject". Separate the files or directories
424424 # with spaces.
425425
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
427427
428428 # If the value of the INPUT tag contains directories, you can use the
429429 # 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.
11 # @configure_input@
22
33 # 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.
11 # @configure_input@
22
33 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
5959 blend.c \
6060 colorchannel.c \
6161 colorspace.c \
62 compression.c \
6263 cputest.c \
6364 deinterlace.c \
6465 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.
11 # @configure_input@
22
33 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
8383 libgdither/libgdither.la libsamplerate/libsamplerate.la
8484 am_libgavl_la_OBJECTS = absdiff.lo arith128.lo audioconverter.lo \
8585 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
9495 libgavl_la_OBJECTS = $(am_libgavl_la_OBJECTS)
9596 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include/gavl
9697 depcomp = $(SHELL) $(top_srcdir)/depcomp
318319 blend.c \
319320 colorchannel.c \
320321 colorspace.c \
322 compression.c \
321323 cputest.c \
322324 deinterlace.c \
323325 deinterlace_blend.c \
460462 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/blend.Plo@am__quote@
461463 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/colorchannel.Plo@am__quote@
462464 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/colorspace.Plo@am__quote@
465 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/compression.Plo@am__quote@
463466 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cputest.Plo@am__quote@
464467 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/deinterlace.Plo@am__quote@
465468 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/deinterlace_blend.Plo@am__quote@
527530 # (which will cause the Makefiles to be regenerated when you run `make');
528531 # (2) otherwise, pass the desired values on the `make' command line.
529532 $(RECURSIVE_TARGETS):
530 @failcom='exit 1'; \
533 @fail= failcom='exit 1'; \
531534 for f in x $$MAKEFLAGS; do \
532535 case $$f in \
533536 *=* | --[!k]*);; \
552555 fi; test -z "$$fail"
553556
554557 $(RECURSIVE_CLEAN_TARGETS):
555 @failcom='exit 1'; \
558 @fail= failcom='exit 1'; \
556559 for f in x $$MAKEFLAGS; do \
557560 case $$f in \
558561 *=* | --[!k]*);; \
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
8686 {
8787 gavl_audio_convert_context_t * ret;
8888 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);
9191
9292 return ret;
9393 }
116116 cnv->contexts = ctx;
117117 }
118118 ctx->output_format.samples_per_frame = 0;
119 cnv->current_format = &(ctx->output_format);
119 cnv->current_format = &ctx->output_format;
120120 cnv->num_conversions++;
121121 }
122122 #if 0
124124 {
125125 fprintf(stderr, "==== Conversion context ====\n");
126126 fprintf(stderr, "Input format:\n");
127 gavl_audio_format_dump(&(ctx->input_format));
127 gavl_audio_format_dump(&ctx->input_format);
128128 fprintf(stderr, "Output format:\n");
129 gavl_audio_format_dump(&(ctx->output_format));
129 gavl_audio_format_dump(&ctx->output_format);
130130 fprintf(stderr, "Func: %p\n", ctx->func);
131131
132132 }
142142 if(cnv->current_format->interleave_mode == GAVL_INTERLEAVE_2)
143143 {
144144 tmp_format->interleave_mode = GAVL_INTERLEAVE_NONE;
145 ctx = gavl_interleave_context_create(&(cnv->opt),
145 ctx = gavl_interleave_context_create(&cnv->opt,
146146 cnv->current_format,
147147 tmp_format);
148148 add_context(cnv, ctx);
151151 if(cnv->current_format->sample_format < GAVL_SAMPLE_FLOAT)
152152 {
153153 tmp_format->sample_format = GAVL_SAMPLE_FLOAT;
154 ctx = gavl_sampleformat_context_create(&(cnv->opt),
154 ctx = gavl_sampleformat_context_create(&cnv->opt,
155155 cnv->current_format,
156156 tmp_format);
157157 add_context(cnv, ctx);
158158 }
159159
160160 tmp_format->samplerate = out_samplerate;
161 ctx = gavl_samplerate_context_create(&(cnv->opt),
161 ctx = gavl_samplerate_context_create(&cnv->opt,
162162 cnv->current_format,
163163 tmp_format);
164164 add_context(cnv, ctx);
190190 memset(&tmp_format, 0, sizeof(tmp_format));
191191 gavl_audio_format_copy(&tmp_format, &cnv->input_format);
192192
193 cnv->current_format = &(cnv->input_format);
193 cnv->current_format = &cnv->input_format;
194194
195195 /* Check if we must mix */
196196
236236 if(cnv->current_format->interleave_mode != GAVL_INTERLEAVE_NONE)
237237 {
238238 tmp_format.interleave_mode = GAVL_INTERLEAVE_NONE;
239 ctx = gavl_interleave_context_create(&(cnv->opt),
239 ctx = gavl_interleave_context_create(&cnv->opt,
240240 cnv->current_format,
241241 &tmp_format);
242242 add_context(cnv, ctx);
247247 (cnv->output_format.sample_format == GAVL_SAMPLE_FLOAT)))
248248 {
249249 tmp_format.sample_format = GAVL_SAMPLE_FLOAT;
250 ctx = gavl_sampleformat_context_create(&(cnv->opt),
250 ctx = gavl_sampleformat_context_create(&cnv->opt,
251251 cnv->current_format,
252252 &tmp_format);
253253 add_context(cnv, ctx);
257257 (cnv->output_format.sample_format == GAVL_SAMPLE_DOUBLE)))
258258 {
259259 tmp_format.sample_format = GAVL_SAMPLE_DOUBLE;
260 ctx = gavl_sampleformat_context_create(&(cnv->opt),
260 ctx = gavl_sampleformat_context_create(&cnv->opt,
261261 cnv->current_format,
262262 &tmp_format);
263263 add_context(cnv, ctx);
267267 gavl_bytes_per_sample(cnv->output_format.sample_format))
268268 {
269269 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,
271271 cnv->current_format,
272272 &tmp_format);
273273 add_context(cnv, ctx);
277277 memcpy(tmp_format.channel_locations, cnv->output_format.channel_locations,
278278 GAVL_MAX_CHANNELS * sizeof(tmp_format.channel_locations[0]));
279279
280 ctx = gavl_mix_context_create(&(cnv->opt), cnv->current_format,
280 ctx = gavl_mix_context_create(&cnv->opt, cnv->current_format,
281281 &tmp_format);
282282 add_context(cnv, ctx);
283283 }
294294 if(cnv->current_format->interleave_mode == GAVL_INTERLEAVE_2)
295295 {
296296 tmp_format.interleave_mode = GAVL_INTERLEAVE_NONE;
297 ctx = gavl_interleave_context_create(&(cnv->opt),
297 ctx = gavl_interleave_context_create(&cnv->opt,
298298 cnv->current_format,
299299 &tmp_format);
300300 add_context(cnv, ctx);
301301 }
302302
303303 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,
305305 cnv->current_format,
306306 &tmp_format);
307307 add_context(cnv, ctx);
313313 if(cnv->current_format->interleave_mode != cnv->output_format.interleave_mode)
314314 {
315315 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,
317317 cnv->current_format,
318318 &tmp_format);
319319 add_context(cnv, ctx);
321321
322322 // fprintf(stderr, "Audio converter initialized, %d conversions\n", cnv->num_conversions);
323323
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);
327327 // gavl_audio_format_dump(cnv->current_format);
328328
329329 /* Set samples_per_frame of the first context
373373 ctx->output_format.samples_per_frame = out_samples_needed + 1024;
374374 if(ctx->output_frame)
375375 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);
377377 ctx->next->input_frame = ctx->output_frame;
378378 }
379379 ctx = ctx->next;
384384 const gavl_audio_format_t * input_format,
385385 const gavl_audio_format_t * output_format)
386386 {
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);
392392 return gavl_audio_converter_reinit(cnv);
393393 }
394394
432432 gavl_audio_converter_t * gavl_audio_converter_create()
433433 {
434434 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);
436436 return ret;
437437 }
438438
439439 gavl_audio_options_t *
440440 gavl_audio_converter_get_options(gavl_audio_converter_t * cnv)
441441 {
442 return &(cnv->opt);
442 return &cnv->opt;
443443 }
444444
445445
449449 gavl_audio_format_t tmp_format;
450450 gavl_audio_convert_context_t * ctx;
451451
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);
458458
459459 // Delete previous conversions
460460 audio_converter_cleanup(cnv);
461461
462 cnv->current_format = &(cnv->input_format);
462 cnv->current_format = &cnv->input_format;
463463
464464 put_samplerate_context(cnv, &tmp_format, cnv->output_format.samplerate);
465465
470470 if(cnv->current_format->interleave_mode == GAVL_INTERLEAVE_2)
471471 {
472472 tmp_format.interleave_mode = GAVL_INTERLEAVE_NONE;
473 ctx = gavl_interleave_context_create(&(cnv->opt),
473 ctx = gavl_interleave_context_create(&cnv->opt,
474474 cnv->current_format,
475475 &tmp_format);
476476 add_context(cnv, ctx);
477477 }
478478
479479 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,
481481 cnv->current_format,
482482 &tmp_format);
483483 add_context(cnv, ctx);
488488 if(cnv->current_format->interleave_mode != cnv->output_format.interleave_mode)
489489 {
490490 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,
492492 cnv->current_format,
493493 &tmp_format);
494494 add_context(cnv, ctx);
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
6262 memalign(ALIGNMENT_BYTES, num_samples * format->num_channels);
6363
6464 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];
6666
6767 break;
6868 case GAVL_SAMPLE_S8:
7171 memalign(ALIGNMENT_BYTES, num_samples * format->num_channels);
7272
7373 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];
7575
7676 break;
7777 case GAVL_SAMPLE_U16:
7979 ret->samples.u_16 =
8080 memalign(ALIGNMENT_BYTES, 2 * num_samples * format->num_channels);
8181 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];
8383
8484 break;
8585 case GAVL_SAMPLE_S16:
8787 ret->samples.s_16 =
8888 memalign(ALIGNMENT_BYTES, 2 * num_samples * format->num_channels);
8989 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];
9191
9292 break;
9393
9696 ret->samples.s_32 =
9797 memalign(ALIGNMENT_BYTES, 4 * num_samples * format->num_channels);
9898 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];
100100
101101 break;
102102
106106 memalign(ALIGNMENT_BYTES, sizeof(float) * num_samples * format->num_channels);
107107
108108 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];
110110
111111 break;
112112 case GAVL_SAMPLE_DOUBLE:
115115 memalign(ALIGNMENT_BYTES, sizeof(double) * num_samples * format->num_channels);
116116
117117 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];
119119
120120 break;
121121 case GAVL_SAMPLE_NONE:
295295 case GAVL_INTERLEAVE_NONE:
296296 for(i = 0; i < format->num_channels; i++)
297297 {
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],
300300 samples_to_copy * bytes_per_sample);
301301 }
302302 break;
303303 case GAVL_INTERLEAVE_2:
304304 for(i = 0; i < format->num_channels/2; i++)
305305 {
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],
308308 2*samples_to_copy * bytes_per_sample);
309309 }
310310 /* Last channel is not interleaved */
311311 if(format->num_channels & 1)
312312 {
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],
315315 2*samples_to_copy * bytes_per_sample);
316316 }
317317 break;
318318 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],
321321 format->num_channels * samples_to_copy * bytes_per_sample);
322322 break;
323323 }
363363 }
364364 dst->valid_samples = len;
365365 }
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 }
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
5656 gavl_video_options_t *
5757 gavl_overlay_blend_context_get_options(gavl_overlay_blend_context_t * ctx)
5858 {
59 return &(ctx->opt);
59 return &ctx->opt;
6060 }
6161
6262 int
8080 return 0;
8181
8282 /* 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);
8585
8686 /* Get chroma subsampling of the destination */
8787 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);
8989
9090 /* Get blend function */
9191
9292 ctx->func =
9393 gavl_find_blend_func_c(ctx,
9494 dst_format->pixelformat,
95 &(ctx->ovl_format.pixelformat));
95 &ctx->ovl_format.pixelformat);
9696
9797 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);
9999 return 1;
100100 }
101101
179179 gavl_video_frame_get_subframe(ctx->ovl_format.pixelformat,
180180 ovl->frame,
181181 ctx->ovl_win,
182 &(ctx->ovl.ovl_rect));
182 &ctx->ovl.ovl_rect);
183183 }
184184
185185 void gavl_overlay_blend(gavl_overlay_blend_context_t * ctx,
192192 gavl_video_frame_get_subframe(ctx->dst_format.pixelformat,
193193 dst_frame,
194194 ctx->dst_win,
195 &(ctx->dst_rect));
195 &ctx->dst_rect);
196196 /* Fire up blender */
197197
198198 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.
11 # @configure_input@
22
33 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
44084408 int min_penalty;
44094409 int min_index;
44104410 int i, test;
4411
4412 if(!dst_supported || (dst_supported[0] == GAVL_PIXELFORMAT_NONE))
4413 return GAVL_PIXELFORMAT_NONE;
44114414
44124415 min_penalty =
44134416 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 }
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
5454 gavl_video_options_t *
5555 gavl_video_deinterlacer_get_options(gavl_video_deinterlacer_t * d)
5656 {
57 return &(d->opt);
57 return &d->opt;
5858 }
5959
6060
6262 const gavl_video_format_t * src_format)
6363 {
6464
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);
6767
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
6875 d->half_height_format.image_height /= 2;
6976 d->half_height_format.frame_height /= 2;
7077
93100 const gavl_video_frame_t * input_frame,
94101 gavl_video_frame_t * output_frame)
95102 {
96 if(d->format.interlace_mode == GAVL_INTERLACE_MIXED)
103 if(d->mixed)
97104 {
98105 if((input_frame->interlace_mode != GAVL_INTERLACE_NONE) ||
99106 (d->opt.conversion_flags & GAVL_FORCE_DEINTERLACE))
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
0 # Makefile.in generated by automake 1.11 from Makefile.am.
0 # Makefile.in generated by automake 1.11.1 from Makefile.am.
11 # @configure_input@
22
33 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
234234
235235 table = gavl_create_interleave_table(opt);
236236 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);
239239
240240 gavl_destroy_interleave_table(table);
241241 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.
11 # @configure_input@
22
33 # 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.
11 # @configure_input@
22
33 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
214214 {
215215 register unsigned long int delta;
216216 /* 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);
218218 if(delta)
219219 {
220220 delta=SSE_MMREG_SIZE-delta;
291291 {
292292 register unsigned long int delta;
293293 /* 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);
295295 if(delta)
296296 {
297297 delta=MMX_MMREG_SIZE-delta;
356356 {
357357 register unsigned long int delta;
358358 /* 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);
360360 if(delta)
361361 {
362362 delta=MMX_MMREG_SIZE-delta;
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
6565
6666 for(i = 0; i < c->num_inputs; i++)
6767 {
68 input_channel_dump(&(c->inputs[i]));
68 input_channel_dump(&c->inputs[i]);
6969 }
7070 }
7171 #endif
7676 for(i = 0; i < ctx->output_format.num_channels; i++)
7777 {
7878 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],
8080 ctx->input_frame,
8181 ctx->output_frame);
8282 else
8383 /* This happens, if channels in the output are muted */
8484 gavl_audio_frame_mute_channel(ctx->output_frame,
85 &(ctx->output_format), i);
85 &ctx->output_format, i);
8686 }
8787 }
8888
777777
778778 if(matrix[i][j] != 0.0)
779779 {
780 set_factor(&(ctx->output_channels[i].inputs[num_inputs]),
780 set_factor(&ctx->output_channels[i].inputs[num_inputs],
781781 matrix[i][j], in_format->sample_format);
782782 ctx->output_channels[i].inputs[num_inputs].index = j;
783783 num_inputs++;
831831 }
832832 }
833833 #ifdef DUMP_MATRIX
834 output_channel_dump(&(ctx->output_channels[i]));
834 output_channel_dump(&ctx->output_channels[i]);
835835 #endif
836836 }
837837
888888 out_format->channel_locations,
889889 GAVL_MAX_CHANNELS * sizeof(out_format->channel_locations[0]));
890890 ret->mix_matrix = gavl_create_mix_matrix(opt,
891 &(ret->input_format),
892 &(ret->output_format));
891 &ret->input_format,
892 &ret->output_format);
893893 ret->func = gavl_mix_audio;
894894
895895 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.
11 # @configure_input@
22
33 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
0 # Makefile.in generated by automake 1.11 from Makefile.am.
0 # Makefile.in generated by automake 1.11.1 from Makefile.am.
11 # @configure_input@
22
33 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
270270 int w, int h, int advance)
271271 {
272272 int i, j;
273 const uint16_t *s1;
274 const uint16_t *s2;
273 const float *s1;
274 const float *s2;
275275 double ret = 0;
276276 double diff;
277277 for(i = 0; i < h; i++)
278278 {
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);
285285 diff *= diff;
286286 ret += diff;
287287 s1+= advance;
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
147147 const gavl_video_format_t * src_format,
148148 const gavl_video_format_t * dst_format)
149149 {
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);
154154 }
155155
156156
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
272272
273273
274274 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);
277277 /* if(!ret->func) */
278278 /* fprintf(stderr, "No function found\n"); */
279279 gavl_destroy_sampleformat_table(table);
363363 default:
364364 fprintf(stderr, "BUG: Invalid dither initialization\n");
365365 fprintf(stderr, "Input format\n");
366 gavl_audio_format_dump(&(ret->input_format));
366 gavl_audio_format_dump(&ret->input_format);
367367 fprintf(stderr, "Output format\n");
368 gavl_audio_format_dump(&(ret->output_format));
368 gavl_audio_format_dump(&ret->output_format);
369369 return NULL;
370370 }
371371
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
8888 ctx->samplerate_converter->data.data_in_f = ctx->input_frame->channels.f[i];
8989 ctx->samplerate_converter->data.data_out_f = ctx->output_frame->channels.f[i];
9090 result = gavl_src_process(ctx->samplerate_converter->resamplers[i],
91 &(ctx->samplerate_converter->data));
91 &ctx->samplerate_converter->data);
9292 if(result)
9393 {
9494 fprintf(stderr, "gavl_src_process returned %s (%p)\n", gavl_src_strerror(result), ctx->output_frame->samples.f);
115115 ctx->samplerate_converter->data.data_out_f =
116116 ctx->output_frame->channels.f[2*i];
117117 gavl_src_process(ctx->samplerate_converter->resamplers[i],
118 &(ctx->samplerate_converter->data));
118 &ctx->samplerate_converter->data);
119119 }
120120 ctx->output_frame->valid_samples =
121121 ctx->samplerate_converter->data.output_frames_gen;
132132 ctx->samplerate_converter->data.data_in_f = ctx->input_frame->samples.f;
133133 ctx->samplerate_converter->data.data_out_f = ctx->output_frame->samples.f;
134134 gavl_src_process(ctx->samplerate_converter->resamplers[0],
135 &(ctx->samplerate_converter->data));
135 &ctx->samplerate_converter->data);
136136 ctx->output_frame->valid_samples =
137137 ctx->samplerate_converter->data.output_frames_gen;
138138 }
149149 ctx->samplerate_converter->data.data_in_d = ctx->input_frame->channels.d[i];
150150 ctx->samplerate_converter->data.data_out_d = ctx->output_frame->channels.d[i];
151151 result = gavl_src_process(ctx->samplerate_converter->resamplers[i],
152 &(ctx->samplerate_converter->data));
152 &ctx->samplerate_converter->data);
153153 if(result)
154154 {
155155 fprintf(stderr, "gavl_src_process returned %s (%p)\n", gavl_src_strerror(result), ctx->output_frame->samples.f);
176176 ctx->samplerate_converter->data.data_out_d =
177177 ctx->output_frame->channels.d[2*i];
178178 gavl_src_process(ctx->samplerate_converter->resamplers[i],
179 &(ctx->samplerate_converter->data));
179 &ctx->samplerate_converter->data);
180180 }
181181 ctx->output_frame->valid_samples =
182182 ctx->samplerate_converter->data.output_frames_gen;
193193 ctx->samplerate_converter->data.data_in_d = ctx->input_frame->samples.d;
194194 ctx->samplerate_converter->data.data_out_d = ctx->output_frame->samples.d;
195195 gavl_src_process(ctx->samplerate_converter->resamplers[0],
196 &(ctx->samplerate_converter->data));
196 &ctx->samplerate_converter->data);
197197 ctx->output_frame->valid_samples =
198198 ctx->samplerate_converter->data.output_frames_gen;
199199 }
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
5151 {
5252 for(j = 0; j < GAVL_MAX_PLANES; j++)
5353 {
54 gavl_video_scale_context_cleanup(&(s->contexts[i][j]));
54 gavl_video_scale_context_cleanup(&s->contexts[i][j]);
5555 }
5656 }
5757 free(s);
312312
313313 /* Copy options because we want to change them */
314314
315 gavl_video_options_copy(&opt, &(scaler->opt));
315 gavl_video_options_copy(&opt, &scaler->opt);
316316
317317 /* TODO: If the image is smaller than the number of filter taps,
318318 reduce scaling algorithm */
319319
320320 /* Copy formats */
321321
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);
324324
325325 /* Check if we have rectangles */
326326
327327 if(!opt.have_rectangles)
328328 {
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);
332332 }
333333
334334 /* Check how many fields we must handle */
369369 /* Copy destination rectangle so we know, which subframe to take */
370370 gavl_rectangle_i_copy(&scaler->dst_rect, &opt.dst_rect);
371371
372 #if 0
372 #if 0
373373 fprintf(stderr, "gavl_video_scaler_init:\n");
374 gavl_rectangle_f_dump(&(scaler->src_rect));
374 gavl_rectangle_f_dump(&scaler->opt.src_rect);
375375 fprintf(stderr, "\n");
376 gavl_rectangle_i_dump(&(scaler->dst_rect));
376 gavl_rectangle_i_dump(&scaler->dst_rect);
377377 fprintf(stderr, "\n");
378378 #endif
379379
384384 /* Align the destination rectangle to the output formtat */
385385
386386 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);
388388
389389 #if 0
390390 fprintf(stderr, "Initializing scaler:\n");
391391 fprintf(stderr, "Src format:\n");
392 gavl_video_format_dump(&(scaler->src_format));
392 gavl_video_format_dump(&scaler->src_format);
393393 fprintf(stderr, "Dst format:\n");
394 gavl_video_format_dump(&(scaler->dst_format));
394 gavl_video_format_dump(&scaler->dst_format);
395395
396396 fprintf(stderr, "Src rectangle:\n");
397397 gavl_rectangle_f_dump(&opt.src_rect);
441441 field = (scaler->opt.deinterlace_drop_mode == GAVL_DEINTERLACE_DROP_BOTTOM) ? 0 : 1;
442442 for(plane = 0; plane < scaler->num_planes; plane++)
443443 {
444 if(!gavl_video_scale_context_init(&(scaler->contexts[field][plane]),
444 if(!gavl_video_scale_context_init(&scaler->contexts[field][plane],
445445 &opt,
446 plane, &(scaler->src_format), &(scaler->dst_format), field, 0,
446 plane, &scaler->src_format, &scaler->dst_format, field, 0,
447447 scaler->src_fields, scaler->dst_fields))
448448 return 0;
449449 }
451451 {
452452 for(plane = 0; plane < scaler->num_planes; plane++)
453453 {
454 if(!gavl_video_scale_context_init(&(scaler->contexts[2][plane]),
454 if(!gavl_video_scale_context_init(&scaler->contexts[2][plane],
455455 &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))
457457 return 0;
458458 }
459459 }
465465 {
466466 for(plane = 0; plane < scaler->num_planes; plane++)
467467 {
468 if(!gavl_video_scale_context_init(&(scaler->contexts[field][plane]),
468 if(!gavl_video_scale_context_init(&scaler->contexts[field][plane],
469469 &opt,
470 plane, &(scaler->src_format), &(scaler->dst_format), field, field,
470 plane, &scaler->src_format, &scaler->dst_format, field, field,
471471 scaler->src_fields, scaler->dst_fields))
472472 return 0;
473473 }
477477 {
478478 for(plane = 0; plane < scaler->num_planes; plane++)
479479 {
480 if(!gavl_video_scale_context_init(&(scaler->contexts[2][plane]),
480 if(!gavl_video_scale_context_init(&scaler->contexts[2][plane],
481481 &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))
483483 return 0;
484484 }
485485 }
501501
502502 /* Copy options because we want to change them */
503503
504 gavl_video_options_copy(&opt, &(scaler->opt));
504 gavl_video_options_copy(&opt, &scaler->opt);
505505
506506 /* Copy formats */
507507
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);
514514
515515 /* Check how many fields we must handle */
516516
549549 {
550550 for(plane = 0; plane < scaler->num_planes; plane++)
551551 {
552 gavl_video_scale_context_init_convolve(&(scaler->contexts[field][plane]),
552 gavl_video_scale_context_init_convolve(&scaler->contexts[field][plane],
553553 &opt,
554554 plane, format,
555555 scaler->src_fields,
561561 {
562562 for(plane = 0; plane < scaler->num_planes; plane++)
563563 {
564 gavl_video_scale_context_init_convolve(&(scaler->contexts[2][plane]),
564 gavl_video_scale_context_init_convolve(&scaler->contexts[2][plane],
565565 &opt,
566566 plane, format,
567567 1,
577577 gavl_video_options_t *
578578 gavl_video_scaler_get_options(gavl_video_scaler_t * s)
579579 {
580 return &(s->opt);
580 return &s->opt;
581581 }
582582
583583 void gavl_video_scaler_scale(gavl_video_scaler_t * s,
587587 int i, field;
588588 /* Set the destination subframe */
589589 gavl_video_frame_get_subframe(s->dst_format.pixelformat, dst, s->dst,
590 &(s->dst_rect));
590 &s->dst_rect);
591591 #if 0
592592 fprintf(stderr, "Get subframe\n");
593 gavl_rectangle_i_dump(&(s->dst_rect));
593 gavl_rectangle_i_dump(&s->dst_rect);
594594 fprintf(stderr, "\n");
595595 #endif
596596 if(s->src_fields > s->dst_fields)
601601 !(s->opt.conversion_flags & GAVL_FORCE_DEINTERLACE))
602602 {
603603 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);
605605 }
606606 else /* Deinterlace mode */
607607 {
610610 s->src_field, field);
611611
612612 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],
614614 s->src_field, s->dst);
615615 }
616616 }
622622 !(s->opt.conversion_flags & GAVL_FORCE_DEINTERLACE))
623623 {
624624 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);
626626 }
627627 else
628628 {
632632 for(i = 0; i < s->num_planes; i++)
633633 {
634634 // 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);
636636 }
637637
638638 /* Second field */
641641 for(i = 0; i < s->num_planes; i++)
642642 {
643643 // 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);
645645 }
646646 }
647647 }
649649 {
650650 for(i = 0; i < s->num_planes; i++)
651651 {
652 // fprintf(stderr, "Scale %d, %p\n", i, &(s->contexts[0][i]));
652 // fprintf(stderr, "Scale %d, %p\n", i, &s->contexts[0][i]);
653653 // 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);
655655 }
656656 }
657657 }
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
458458 fprintf(stderr, "scale_context_init: src_field: %d, dst_field: %d plane: %d\n",
459459 src_field, dst_field, plane);
460460 #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);
463463
464464 scale_factor_x = (float)ctx->dst_rect.w / ctx->src_rect.w;
465465 scale_factor_y = (float)ctx->dst_rect.h / ctx->src_rect.h;
510510
511511 #if 0
512512 fprintf(stderr, "gavl_video_scale_context_init\n");
513 gavl_rectangle_f_dump(&(ctx->src_rect));
513 gavl_rectangle_f_dump(&ctx->src_rect);
514514 fprintf(stderr, "\n");
515 gavl_rectangle_i_dump(&(ctx->dst_rect));
515 gavl_rectangle_i_dump(&ctx->dst_rect);
516516 fprintf(stderr, "\n");
517517 #endif
518518
590590
591591 /* We set this once here */
592592
593 ctx->offset = &(ctx->offset1);
593 ctx->offset = &ctx->offset1;
594594 ctx->dst_size = ctx->dst_rect.w;
595595 }
596596 else if(ctx->num_directions == 2)
629629
630630 /* We set this once here */
631631
632 ctx->offset = &(ctx->offset1);
632 ctx->offset = &ctx->offset1;
633633 ctx->dst_size = ctx->dst_rect.w;
634634
635635 ctx->num_directions = 1;
640640 {
641641 // fprintf(stderr, "Initializing x table %f\n", ctx->src_rect.x + offset_x);
642642 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,
644644 offset_x,
645645 ctx->src_rect.w, ctx->dst_rect.w, src_width);
646646 // fprintf(stderr, "Initializing x table done\n");
648648 // fprintf(stderr, "Initializing y table %f\n",
649649 // ctx->src_rect.y + offset_y);
650650 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,
652652 offset_y,
653653 ctx->src_rect.h, ctx->dst_rect.h, src_height);
654654
660660 (tmp_opt.scale_order == tmp_opt_y.scale_order))
661661 {
662662 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);
665666 // fprintf(stderr, "X AND Y %d\n");
666667 }
667668
670671 ctx->num_directions = 1;
671672 if(bits_h)
672673 {
673 gavl_video_scale_table_init_int(&(ctx->table_h), bits_h);
674 gavl_video_scale_table_init_int(&ctx->table_h, bits_h);
674675 /* 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);
676677 }
677 ctx->offset = &(ctx->offset1);
678 ctx->offset = &ctx->offset1;
678679 ctx->dst_size = ctx->dst_rect.w;
679680
680681 /* Switch offsets back */
683684 }
684685 else
685686 {
686 gavl_video_scale_table_get_src_indices(&(ctx->table_h),
687 gavl_video_scale_table_get_src_indices(&ctx->table_h,
687688 &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,
689690 &src_rect_i.y, &src_rect_i.h);
690691
691692 /* Decide the scale order depending on whats computationally less expensive */
706707 ctx->buffer_width = ctx->dst_rect.w;
707708 ctx->buffer_height = src_rect_i.h;
708709
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);
710711 ctx->first_scanline = src_rect_i.y;
711712
712713 gavl_init_scale_funcs(&funcs, &tmp_opt,
713714 ctx->offset1.src_advance,
714715 ctx->offset1.dst_advance,
715 &(ctx->table_h), NULL);
716 &ctx->table_h, NULL);
716717 ctx->func1 = get_func(&funcs.funcs_x, src_format->pixelformat, &bits_h);
717718 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);
719720
720721 gavl_init_scale_funcs(&funcs, &tmp_opt_y,
721722 ctx->offset2.src_advance,
722723 ctx->offset2.dst_advance,
723 NULL, &(ctx->table_v));
724 NULL, &ctx->table_v);
724725 ctx->func2 = get_func(&funcs.funcs_y,
725726 src_format->pixelformat, &bits_v);
726727
727728 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);
729730 }
730731 else
731732 {
737738
738739 ctx->offset1.src_offset += src_rect_i.x * ctx->offset1.src_advance;
739740
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);
741742
742743 gavl_init_scale_funcs(&funcs, &tmp_opt_y,
743744 ctx->offset1.src_advance,
744745 ctx->offset1.dst_advance,
745 NULL, &(ctx->table_v));
746 NULL, &ctx->table_v);
746747 ctx->func1 = get_func(&funcs.funcs_y, src_format->pixelformat, &bits_v);
747748
748749 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);
750751
751752 gavl_init_scale_funcs(&funcs, &tmp_opt,
752753 ctx->offset2.src_advance,
753754 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,
756757 src_format->pixelformat, &bits_h);
757758 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);
759760 }
760761
761762 /* Allocate temporary buffer */
765766 else if(scale_x)
766767 {
767768 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,
769770 offset_x,
770771 ctx->src_rect.w, ctx->dst_rect.w, src_width);
771772 // fprintf(stderr, "Initializing x table done\n");
773774 gavl_init_scale_funcs(&funcs, &tmp_opt,
774775 ctx->offset1.src_advance,
775776 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);
778779
779780 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);
781782 }
782783 else if(scale_y)
783784 {
784785 // fprintf(stderr, "Initializing y table\n");
785786 gavl_video_options_copy(&tmp_opt, opt);
786787
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,
788789 ctx->src_rect.h, ctx->dst_rect.h, src_height);
789790 // fprintf(stderr, "Initializing y table done\n");
790791 gavl_init_scale_funcs(&funcs, &tmp_opt,
791792 ctx->offset1.src_advance,
792793 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);
795796
796797 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);
798799 }
799800
800801 if(!ctx->func1 || ((ctx->num_directions == 2) && !ctx->func2))
807808 #if 0
808809 /* Dump final scale tables */
809810 fprintf(stderr, "Horizontal table:\n");
810 gavl_video_scale_table_dump(&(ctx->table_h));
811 gavl_video_scale_table_dump(&ctx->table_h);
811812 fprintf(stderr, "Vertical table:\n");
812 gavl_video_scale_table_dump(&(ctx->table_v));
813 gavl_video_scale_table_dump(&ctx->table_v);
813814 #endif
814815
815816 get_minmax(src_format->pixelformat, ctx->min_values_h,
937938 src_field, dst_field, plane);
938939 #endif
939940
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);
942943
943944 ctx->first_scanline = 0;
944945
976977
977978 #if 0
978979 fprintf(stderr, "gavl_video_scale_context_init\n");
979 gavl_rectangle_f_dump(&(ctx->src_rect));
980 gavl_rectangle_f_dump(&ctx->src_rect);
980981 fprintf(stderr, "\n");
981 gavl_rectangle_i_dump(&(ctx->dst_rect));
982 gavl_rectangle_i_dump(&ctx->dst_rect);
982983 fprintf(stderr, "\n");
983984 #endif
984985
10681069
10691070 /* We set this once here */
10701071
1071 ctx->offset = &(ctx->offset1);
1072 ctx->offset = &ctx->offset1;
10721073 ctx->dst_size = ctx->dst_rect.w;
10731074 }
10741075 else if(ctx->num_directions == 2)
11101111
11111112 /* We set this once here */
11121113
1113 ctx->offset = &(ctx->offset1);
1114 ctx->offset = &ctx->offset1;
11141115 ctx->dst_size = ctx->dst_rect.w;
11151116
11161117 ctx->num_directions = 1;
11221123 // fprintf(stderr, "Initializing x table\n");
11231124 gavl_video_options_copy(&tmp_opt, opt);
11241125 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,
11261127 &tmp_opt,
11271128 h_radius, h_coeffs,
11281129 src_width);
11311132 // fprintf(stderr, "Initializing y table\n");
11321133 gavl_video_options_copy(&tmp_opt_y, opt);
11331134 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,
11351136 &tmp_opt_y,
11361137 v_radius, v_coeffs,
11371138 src_height);
11461147 gavl_init_scale_funcs(&funcs, &tmp_opt,
11471148 ctx->offset1.src_advance,
11481149 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);
11511152 // fprintf(stderr, "X AND Y\n");
11521153 }
11531154
11551156 {
11561157 ctx->num_directions = 1;
11571158
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);
11601161 }
11611162 else
11621163 {
1163 gavl_video_scale_table_get_src_indices(&(ctx->table_h),
1164 gavl_video_scale_table_get_src_indices(&ctx->table_h,
11641165 &src_rect_i.x,
11651166 &src_rect_i.w);
11661167
1167 gavl_video_scale_table_get_src_indices(&(ctx->table_v),
1168 gavl_video_scale_table_get_src_indices(&ctx->table_v,
11681169 &src_rect_i.y,
11691170 &src_rect_i.h);
11701171
11741175 ctx->buffer_width = ctx->dst_rect.w;
11751176 ctx->buffer_height = src_rect_i.h;
11761177
1177 gavl_video_scale_table_shift_indices(&(ctx->table_v),
1178 gavl_video_scale_table_shift_indices(&ctx->table_v,
11781179 -src_rect_i.y);
11791180 gavl_init_scale_funcs(&funcs, &tmp_opt,
11801181 ctx->offset1.src_advance,
11811182 ctx->offset1.dst_advance,
1182 &(ctx->table_h), NULL);
1183 &ctx->table_h, NULL);
11831184 ctx->func1 = get_func(&funcs.funcs_x, format->pixelformat, &bits_h);
11841185
1185 gavl_video_scale_table_init_int(&(ctx->table_h), bits_h);
1186 gavl_video_scale_table_init_int(&ctx->table_h, bits_h);
11861187
11871188 gavl_init_scale_funcs(&funcs, &tmp_opt_y,
11881189 ctx->offset2.src_advance,
11891190 ctx->offset2.dst_advance,
1190 NULL, &(ctx->table_v));
1191 NULL, &ctx->table_v);
11911192 ctx->func2 = get_func(&funcs.funcs_y, format->pixelformat, &bits_v);
11921193
11931194
1194 gavl_video_scale_table_init_int(&(ctx->table_v), bits_v);
1195 gavl_video_scale_table_init_int(&ctx->table_v, bits_v);
11951196
11961197 /* Allocate temporary buffer */
11971198 alloc_temp(ctx, format->pixelformat);
12031204 gavl_video_options_copy(&tmp_opt, opt);
12041205 tmp_opt.scale_mode = GAVL_SCALE_NONE;
12051206
1206 gavl_video_scale_table_init_convolve(&(ctx->table_h),
1207 gavl_video_scale_table_init_convolve(&ctx->table_h,
12071208 &tmp_opt,
12081209 h_radius, h_coeffs,
12091210 src_width);
12111212 gavl_init_scale_funcs(&funcs, &tmp_opt,
12121213 ctx->offset1.src_advance,
12131214 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);
12181219 }
12191220 else if(scale_y)
12201221 {
12211222 // fprintf(stderr, "Initializing y table\n");
12221223 gavl_video_options_copy(&tmp_opt, opt);
12231224 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,
12251226 &tmp_opt,
12261227 v_radius, v_coeffs,
12271228 src_height);
12301231 gavl_init_scale_funcs(&funcs, &tmp_opt,
12311232 ctx->offset1.src_advance,
12321233 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);
12371238 }
12381239
12391240 #if 0
12401241 /* Dump final scale tables */
12411242 fprintf(stderr, "Horizontal table:\n");
1242 gavl_video_scale_table_dump(&(ctx->table_h));
1243 gavl_video_scale_table_dump(&ctx->table_h);
12431244 fprintf(stderr, "Vertical table:\n");
1244 gavl_video_scale_table_dump(&(ctx->table_v));
1245 gavl_video_scale_table_dump(&ctx->table_v);
12451246 #endif
12461247
12471248
12561257
12571258 void gavl_video_scale_context_cleanup(gavl_video_scale_context_t * ctx)
12581259 {
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);
12611262 if(ctx->buffer)
12621263 free(ctx->buffer);
12631264 }
13571358 break;
13581359 case 2:
13591360 /* First step */
1360 ctx->offset = &(ctx->offset1);
1361 ctx->offset = &ctx->offset1;
13611362
13621363 ctx->src = src->planes[ctx->src_frame_plane] +
13631364 ctx->offset->src_offset +
13931394 // fprintf(stderr, "done\n");
13941395
13951396 /* Second step */
1396 ctx->offset = &(ctx->offset2);
1397 ctx->offset = &ctx->offset2;
13971398 #if 0
13981399 fprintf(stderr, "Second direction\n");
13991400 dump_offset(ctx->offset);
14601461 break;
14611462 case 2:
14621463 /* First step */
1463 ctx->offset = &(ctx->offset1);
1464 ctx->offset = &ctx->offset1;
14641465
14651466 ctx->src = src->planes[ctx->src_frame_plane] +
14661467 ctx->offset->src_offset +
14831484 // fprintf(stderr, "done\n");
14841485
14851486 /* Second step */
1486 ctx->offset = &(ctx->offset2);
1487 ctx->offset = &ctx->offset2;
14871488 #if 0
14881489 fprintf(stderr, "Second direction\n");
14891490 dump_offset(ctx->offset);
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
112112
113113 widen = 0;
114114
115 if(!dst_size)
116 return;
117
115118 if(scale_factor < 1.0)
116119 {
117120 switch(opt->downscale_filter)
147150 /* Get the kernel generator */
148151
149152 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);
151154
152155 num_tmp_factors = tab->factors_per_pixel;
153156
190193 break;
191194 }
192195 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);
194197 }
195198
196199 // fprintf(stderr, "gavl_video_scale_table_init: %f %f %d %d\n",
589592 void gavl_video_scale_table_get_src_indices(gavl_video_scale_table_t * tab,
590593 int * start, int * size)
591594 {
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 }
594606 }
595607
596608 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.
11 # @configure_input@
22
33 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
0 # Makefile.in generated by automake 1.11 from Makefile.am.
0 # Makefile.in generated by automake 1.11.1 from Makefile.am.
11 # @configure_input@
22
33 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
0 # Makefile.in generated by automake 1.11 from Makefile.am.
0 # Makefile.in generated by automake 1.11.1 from Makefile.am.
11 # @configure_input@
22
33 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
2929 #endif
3030 #include <sys/time.h>
3131
32 #include <gavltime.h>
32 #include <gavl.h>
3333
3434 #ifdef HAVE_CLOCK_MONOTONIC
3535
7070
7171 void gavl_timer_start(gavl_timer_t * t)
7272 {
73 get_time(&(t->start_time_real));
73 get_time(&t->start_time_real);
7474 t->is_running = 1;
7575 }
7676
140140 #endif
141141 }
142142
143 const char * gavl_benchmark_get_desc(int flags)
143 const char * gavl_benchmark_get_desc(int config_flags)
144144 {
145145 #ifdef ARCH_X86
146 uint64_t x;
147146 /* that should prevent us from trying cpuid with old cpus */
148147 if( config_flags & GAVL_ACCEL_MMX )
149148 {
152151 else
153152 {
154153 #endif
155 return "microseconds returned by gettimeofday"
154 return "microseconds returned by gettimeofday";
156155 #ifdef ARCH_X86
157156 }
158157 #endif
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
9292 switch(format->interlace_mode)
9393 {
9494 case GAVL_INTERLACE_NONE:
95 case GAVL_INTERLACE_UNKNOWN:
9596 t->num_fields = 1;
9697 break;
9798 case GAVL_INTERLACE_TOP_FIRST:
99100 t->num_fields = 2;
100101 break;
101102 case GAVL_INTERLACE_MIXED:
103 case GAVL_INTERLACE_MIXED_TOP:
104 case GAVL_INTERLACE_MIXED_BOTTOM:
102105 t->num_fields = 3;
103106 break;
104107 }
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
190190 float scale_x, scale_y;
191191 int sub_h, sub_v;
192192 gavl_transform_context_t * ctx;
193 ctx = &(t->contexts[field_index][plane_index]);
193 ctx = &t->contexts[field_index][plane_index];
194194
195195 if(field_index == 1)
196196 {
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
311311
312312 /* Get factors per pixel and filter_func */
313313 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);
315315
316316 if(tab->factors_per_pixel > MAX_TRANSFORM_FILTER)
317317 {
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
7676 {
7777 gavl_video_convert_context_t * ctx;
7878 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,
8181 input_format);
8282
83 gavl_video_format_copy(&(ctx->output_format),
83 gavl_video_format_copy(&ctx->output_format,
8484 output_format);
8585
8686 if(cnv->last_context)
104104 gavl_video_convert_context_t * ctx;
105105 ctx = add_context(cnv, input_format, output_format);
106106
107 ctx->func = gavl_find_pixelformat_converter(&(cnv->options),
107 ctx->func = gavl_find_pixelformat_converter(&cnv->options,
108108 input_format->pixelformat,
109109 output_format->pixelformat,
110110 input_format->frame_width,
148148
149149 scaler_options = gavl_video_scaler_get_options(ctx->scaler);
150150
151 gavl_video_options_copy(scaler_options, &(cnv->options));
151 gavl_video_options_copy(scaler_options, &cnv->options);
152152 #if 0
153153 fprintf(stderr, "gavl_video_scaler_init:\n");
154154 fprintf(stderr, "src_format:\n");
157157 gavl_video_format_dump(output_format);
158158
159159 fprintf(stderr, "src_rectangle: ");
160 gavl_rectangle_f_dump(&(cnv->options.src_rect));
160 gavl_rectangle_f_dump(&cnv->options.src_rect);
161161 fprintf(stderr, "\n");
162162
163163 fprintf(stderr, "dst_rectangle: ");
164 gavl_rectangle_i_dump(&(cnv->options.dst_rect));
164 gavl_rectangle_i_dump(&cnv->options.dst_rect);
165165 fprintf(stderr, "\n");
166166 #endif
167167
193193
194194 ctx->deinterlacer = gavl_video_deinterlacer_create();
195195 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);
197197
198198 if(!gavl_video_deinterlacer_init(ctx->deinterlacer,
199199 in_format))
464464 while(tmp_ctx && tmp_ctx->next)
465465 {
466466 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);
469469
470470
471471 tmp_ctx->next->input_frame = tmp_ctx->output_frame;
487487 gavl_video_options_t *
488488 gavl_video_converter_get_options(gavl_video_converter_t * cnv)
489489 {
490 return &(cnv->options);
490 return &cnv->options;
491491 }
492492
493493 /***************************************************
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
117117
118118 interlace_mode_tab_t interlace_mode_tab[] =
119119 {
120 { GAVL_INTERLACE_UNKNOWN, "Unknown" },
120121 { GAVL_INTERLACE_NONE, "None (Progressive)" },
121122 { GAVL_INTERLACE_TOP_FIRST, "Top field first" },
122123 { 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" }
124127 };
125128
126129 static const int num_interlace_modes = sizeof(interlace_mode_tab)/sizeof(interlace_mode_tab[0]);
135138 }
136139 return (const char*)0;
137140 }
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
138171
139172
140173 typedef struct
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
17591759 }
17601760
17611761 }
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 }
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
115115 opt->have_rectangles = 0;
116116 return;
117117 }
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);
120120 opt->have_rectangles = 1;
121121 }
122122
124124 gavl_rectangle_f_t * src_rect,
125125 gavl_rectangle_i_t * dst_rect)
126126 {
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);
129129 }
130130
131131 #define SET_INT(p) opt->p = p
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
110110 {
111111 gavl_volume_funcs_t * funcs;
112112
113 gavl_audio_format_copy(&(v->format), format);
113 gavl_audio_format_copy(&v->format, format);
114114
115115 funcs = gavl_volume_funcs_create();
116116
0 # Makefile.in generated by automake 1.11 from Makefile.am.
0 # Makefile.in generated by automake 1.11.1 from Makefile.am.
11 # @configure_input@
22
33 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
290290 # (which will cause the Makefiles to be regenerated when you run `make');
291291 # (2) otherwise, pass the desired values on the `make' command line.
292292 $(RECURSIVE_TARGETS):
293 @failcom='exit 1'; \
293 @fail= failcom='exit 1'; \
294294 for f in x $$MAKEFLAGS; do \
295295 case $$f in \
296296 *=* | --[!k]*);; \
315315 fi; test -z "$$fail"
316316
317317 $(RECURSIVE_CLEAN_TARGETS):
318 @failcom='exit 1'; \
318 @fail= failcom='exit 1'; \
319319 for f in x $$MAKEFLAGS; do \
320320 case $$f in \
321321 *=* | --[!k]*);; \
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
6868 int sub_h;
6969 int sub_v;
7070
71
71 int mixed;
7272 };
7373
7474 /* Find conversion function */
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
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
11
22 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.
11 # @configure_input@
22
33 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
205205 top_build_prefix = @top_build_prefix@
206206 top_builddir = @top_builddir@
207207 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
209209 EXTRA_DIST = gavl_version.h.in
210210 all: config.h
211211 $(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
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
672672 gavl_audio_frame_t * src,
673673 gavl_audio_frame_t * dst,
674674 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
675717
676718 /** \defgroup audio_options Audio conversion options
677719 \ingroup audio
20202062 /*! \ingroup video_format
20212063 * \brief Framerate mode
20222064 */
2023
2065
2066 /* Changing the values alters the gmerlin-avdecoder index format */
2067
20242068 typedef enum
20252069 {
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 */
20292074 } gavl_framerate_mode_t;
20302075
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
20312085 /*! \ingroup video_format
20322086 * \brief Interlace mode
20332087 */
20342088
2089 /* Changing the values alters the gmerlin-avdecoder index format */
2090
20352091 typedef enum
20362092 {
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 */
20412100 } gavl_interlace_mode_t;
20422101
20432102 /*! \ingroup video_format
26002659 gavl_video_frame_t * dst);
26012660
26022661
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);
26032677
26042678
26052679 /*****************************
00 #ifndef __GAVL_VERSION_H_
11 #define __GAVL_VERSION_H_
22
3 #define GAVL_VERSION "1.1.2"
3 #define GAVL_VERSION "1.2.0"
44
55 #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
88
99 #define GAVL_MAKE_BUILD(a,b,c) ((a << 16) + (b << 8) + c)
1010
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 # Generated from ltmain.m4sh.
11
2 # ltmain.sh (GNU libtool) 2.2.6
2 # ltmain.sh (GNU libtool) 2.2.6b
33 # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
44
55 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc.
6464 # compiler: $LTCC
6565 # compiler flags: $LTCFLAGS
6666 # 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
6868 # automake: $automake_version
6969 # autoconf: $autoconf_version
7070 #
7272
7373 PROGRAM=ltmain.sh
7474 PACKAGE=libtool
75 VERSION="2.2.6 Debian-2.2.6a-4"
75 VERSION="2.2.6b Debian-2.2.6b-2ubuntu1"
7676 TIMESTAMP=""
77 package_revision=1.3012
77 package_revision=1.3017
7878
7979 # Be Bourne compatible
8080 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.
11 # @configure_input@
22
33 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
963963 AC_MSG_RESULT(no)
964964 )
965965
966 if test "x$have_dvdread" = "xtrue"; then
967 AC_CHECK_FUNCS(DVDInit DVDFinish)
968 fi
969
966970 CFLAGS=$OLD_CFLAGS
967971 LIBS=$OLD_LIBS
968972
17671771 sem_t s;
17681772 result = sem_init(&s, 0, 0);
17691773 if(result)
1770 return -1;
1771 return 0;
1774 return 0;
1775 return -1;
17721776 }
17731777 ],
17741778 [
0 # Makefile.in generated by automake 1.11 from Makefile.am.
0 # Makefile.in generated by automake 1.11.1 from Makefile.am.
11 # @configure_input@
22
33 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
1919 * *****************************************************************/
2020 #include <stdlib.h>
2121 #include <gavl.h>
22 #include <gavl_version.h>
2223 //#include "colorspace.h" // Common routines
2324 #include <stdio.h>
2425 #include <png.h>
178179 {
179180 case PNG_COLOR_TYPE_GRAY: /* (bit depths 1, 2, 4, 8, 16) */
180181 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)
181183 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
182187 if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS))
183188 {
184189 png_set_tRNS_to_alpha(png_ptr);
227232 png_read_image(png_ptr, rows);
228233 png_read_end(png_ptr, end_info);
229234
230 png_destroy_read_struct(&(png_ptr), &(info_ptr),
231 &(end_info));
235 png_destroy_read_struct(&png_ptr, &info_ptr,
236 &end_info);
232237 fclose(file);
233238 free(rows);
234239
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
2020 #include <png.h>
2121 #include <stdio.h>
2222 #include <gavl.h>
23 #include <gavl_version.h>
2324 #include <pngutil.h>
2425 #include <stdlib.h>
2526
172173 {
173174 case PNG_COLOR_TYPE_GRAY: /* (bit depths 1, 2, 4, 8, 16) */
174175 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)
175177 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
176181 if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS))
177182 {
178183 png_set_tRNS_to_alpha(png_ptr);
221226 png_read_image(png_ptr, rows);
222227 png_read_end(png_ptr, end_info);
223228
224 png_destroy_read_struct(&(png_ptr), &(info_ptr),
225 &(end_info));
229 png_destroy_read_struct(&png_ptr, &info_ptr,
230 &end_info);
226231 fclose(file);
227232 free(rows);
228233
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
1919 * *****************************************************************/
2020 #include <stdlib.h>
2121 #include <gavl.h>
22 #include <gavl_version.h>
2223 //#include "colorspace.h" // Common routines
2324 #include <stdio.h>
2425 #include <png.h>
209210 {
210211 case PNG_COLOR_TYPE_GRAY: /* (bit depths 1, 2, 4, 8, 16) */
211212 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)
212214 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
213218 if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS))
214219 {
215220 png_set_tRNS_to_alpha(png_ptr);
258263 png_read_image(png_ptr, rows);
259264 png_read_end(png_ptr, end_info);
260265
261 png_destroy_read_struct(&(png_ptr), &(info_ptr),
262 &(end_info));
266 png_destroy_read_struct(&png_ptr, &info_ptr,
267 &end_info);
263268 fclose(file);
264269 free(rows);
265270
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
00 /*****************************************************************
11 * gavl - a general purpose audio/video processing library
22 *
3 * Copyright (c) 2001 - 2010 Members of the Gmerlin project
3 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
44 * gmerlin-general@lists.sourceforge.net
55 * http://gmerlin.sourceforge.net
66 *
0 # Makefile.in generated by automake 1.11 from Makefile.am.
0 # Makefile.in generated by automake 1.11.1 from Makefile.am.
11 # @configure_input@
22
33 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,